/* Cookie banner, settings panel, footer button, policy cookie table, embed placeholders and the video background.
   The site's colours arrive as --ctwb-c-* from ctwb_consent_site() (inline, after this file). The banner takes
   the look of the sites' dark top bar and footer: Montserrat uppercase buttons, square corners and the short
   accent line the footer headings carry. Rules are scoped under the component with two classes, because the
   theme styles bare elements; its button rule forces colour, padding, min-width and centring with !important,
   so the button rules here answer with !important too. */

:root {
	--ctwb-dark: #1d1d20;
	--ctwb-ink: #212121;
	--ctwb-text: #616161;
	--ctwb-on-dark: #bdbdbd;
	--ctwb-line: #e0e0e0;
	--ctwb-soft: #f7f7f7;
	--ctwb-head: Montserrat, Arial, sans-serif;
	--ctwb-body: Roboto, Arial, sans-serif;
	--ctwb-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
}

html {
	scroll-padding-bottom: var(--ctwb-consent-height, 0px);
}

.ctwb-consent [hidden],
.ctwb-embed [hidden],
.ctwb-hp {
	display: none !important;
}

.ctwb-consent:focus,
.ctwb-consent button:focus:not(:focus-visible),
.ctwb-embed button:focus:not(:focus-visible),
.ctwb-legal-links button:focus:not(:focus-visible),
.ctwb-cookie-table button:focus:not(:focus-visible) {
	outline: none;
}

/* The theme's reboot shows every dialog; only an open panel should be. */
.ctwb-consent .ctwb-consent-panel:not([open]) {
	display: none;
}

/* Buttons: one style everywhere, Accept and Reject identical. */
.ctwb-consent .ctwb-consent-btn,
.ctwb-embed .ctwb-consent-btn,
.ctwb-cookie-table .ctwb-consent-btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 46px;
	margin: 0;
	padding: 10px 20px !important;
	border: 2px solid var(--ctwb-c-action);
	border-radius: 0;
	background: var(--ctwb-c-action);
	box-shadow: none;
	color: var(--ctwb-c-on-action) !important;
	font: 700 12px/1.3 var(--ctwb-head);
	letter-spacing: 1px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ctwb-consent .ctwb-consent-btn:hover,
.ctwb-embed .ctwb-consent-btn:hover,
.ctwb-cookie-table .ctwb-consent-btn:hover {
	border-color: var(--ctwb-c-action-hover);
	background: var(--ctwb-c-action-hover);
	color: var(--ctwb-c-on-action) !important;
}

.ctwb-consent .ctwb-consent-btn-quiet {
	border-color: var(--ctwb-ink);
	background: #fff;
	color: var(--ctwb-ink) !important;
}

.ctwb-consent .ctwb-consent-btn-quiet:hover {
	border-color: var(--ctwb-ink);
	background: var(--ctwb-ink);
	color: #fff !important;
}

.ctwb-consent .ctwb-consent-btn:focus,
.ctwb-embed .ctwb-consent-btn:focus,
.ctwb-cookie-table .ctwb-consent-btn:focus {
	outline: none;
}

/* Focus rings: the site's ink accent on white, white on the dark banner. */
.ctwb-consent button:focus-visible,
.ctwb-consent a:focus-visible,
.ctwb-consent summary:focus-visible,
.ctwb-consent .ctwb-consent-switch:focus-visible,
.ctwb-embed .ctwb-consent-btn:focus-visible,
.ctwb-embed a:focus-visible,
.ctwb-cookie-table .ctwb-consent-btn:focus-visible,
.ctwb-legal-links button:focus-visible {
	outline: 2px solid var(--ctwb-c-ink-accent);
	outline-offset: 3px;
}

.ctwb-consent .ctwb-consent-banner button:focus-visible,
.ctwb-consent .ctwb-consent-banner a:focus-visible,
.ctwb-consent .ctwb-consent-panel-head button:focus-visible {
	outline-color: #fff;
}

/* Text links in the banner (on dark) and the panel (on white). */
.ctwb-consent .ctwb-consent-link,
.ctwb-consent a {
	display: inline;
	position: static;
	min-width: 0;
	margin: 0;
	padding: 0 !important;
	overflow: visible;
	border: 0;
	background: none;
	color: var(--ctwb-c-ink-accent) !important;
	vertical-align: baseline;
	text-align: left !important;
	font: inherit;
	font-weight: 500;
	letter-spacing: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-transform: none;
	cursor: pointer;
}

.ctwb-consent .ctwb-consent-banner .ctwb-consent-link,
.ctwb-consent .ctwb-consent-banner a {
	color: #fff !important;
}

.ctwb-consent .ctwb-consent-link:hover,
.ctwb-consent a:hover {
	text-decoration-thickness: 2px;
}

/* First layer: a dark strip along the bottom on phones. */
.ctwb-consent .ctwb-consent-banner {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990;
	box-sizing: border-box;
	max-height: 100vh;
	max-height: 100dvh;
	overflow-y: auto;
	padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
	border-top: 3px solid var(--ctwb-c-accent);
	background: var(--ctwb-dark);
	box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
	color: var(--ctwb-on-dark);
	font: 400 14px/1.5 var(--ctwb-body);
	letter-spacing: 0.3px;
	text-align: left;
}

.ctwb-consent .ctwb-consent-title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 4px !important;
	padding: 0;
	color: #fff !important;
	font-family: var(--ctwb-head) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 22px !important;
	letter-spacing: 0;
	text-transform: none;
}

/* The short line the footer headings carry. */
.ctwb-consent .ctwb-consent-title::after,
.ctwb-consent .ctwb-consent-panel-title::after {
	content: "";
	flex: none;
	width: 24px;
	height: 2px;
	background: var(--ctwb-c-accent);
}

.ctwb-consent .ctwb-consent-text {
	margin: 0 0 12px;
	color: var(--ctwb-on-dark);
	font-size: 14px;
	line-height: 1.5;
}

.ctwb-consent .ctwb-consent-links > * {
	margin-right: 12px;
	white-space: nowrap;
}

.ctwb-consent .ctwb-consent-more {
	display: none;
}

.ctwb-consent .ctwb-consent-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

@media (prefers-reduced-motion: no-preference) {
	.ctwb-consent .ctwb-consent-banner:not([hidden]) {
		animation: ctwb-consent-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
	}
}

@keyframes ctwb-consent-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* Keeps the end of the page reachable above the strip. */
@media (max-width: 639px) {
	html body {
		padding-bottom: var(--ctwb-consent-height, 0px);
	}
}

/* From 640px: a card in the bottom left. */
@media (min-width: 640px) {
	.ctwb-consent .ctwb-consent-banner {
		right: auto;
		bottom: 24px;
		left: 24px;
		width: 392px;
		max-height: calc(100vh - 48px);
		max-height: calc(100dvh - 48px);
		padding: 24px 26px 26px;
		box-shadow: var(--ctwb-shadow);
	}

	.ctwb-consent .ctwb-consent-title {
		font-size: 18px !important;
		line-height: 26px !important;
	}

	.ctwb-consent .ctwb-consent-text {
		margin: 10px 0 20px;
		line-height: 1.6;
	}

	.ctwb-consent .ctwb-consent-more {
		display: inline;
	}

	.ctwb-consent .ctwb-consent-links {
		display: flex;
		gap: 0 20px;
		margin: 10px 0 0;
	}

	.ctwb-consent .ctwb-consent-links > * {
		margin-right: 0;
	}
}

/* Settings panel: a dark head like the banner over a white body. */
.ctwb-consent .ctwb-consent-panel {
	box-sizing: border-box;
	width: min(560px, calc(100% - 24px));
	max-width: none;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
	box-shadow: var(--ctwb-shadow);
	color: var(--ctwb-text);
	font: 400 14px/1.6 var(--ctwb-body);
	letter-spacing: 0.3px;
	text-align: left;
}

.ctwb-consent .ctwb-consent-panel[open] {
	display: flex;
	flex-direction: column;
}

.ctwb-consent .ctwb-consent-panel::backdrop {
	background: rgba(15, 15, 17, 0.6);
}

.ctwb-consent .ctwb-consent-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 12px 14px 24px;
	border-top: 3px solid var(--ctwb-c-accent);
	background: var(--ctwb-dark);
}

.ctwb-consent .ctwb-consent-panel-title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 !important;
	color: #fff !important;
	font-family: var(--ctwb-head) !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	line-height: 26px !important;
	letter-spacing: 0;
	text-transform: none;
}

.ctwb-consent .ctwb-consent-panel-title:focus {
	outline: none;
}

.ctwb-consent .ctwb-consent-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 !important;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff !important;
	font: 400 30px/1 var(--ctwb-body);
	cursor: pointer;
}

.ctwb-consent .ctwb-consent-close:hover {
	background: rgba(255, 255, 255, 0.1);
}

.ctwb-consent .ctwb-consent-panel-body {
	overflow-y: auto;
	padding: 6px 24px 8px;
	overscroll-behavior: contain;
}

.ctwb-consent .ctwb-consent-intro {
	margin: 14px 0 4px;
	color: var(--ctwb-text);
}

.ctwb-consent .ctwb-consent-category {
	padding: 16px 0;
	border-top: 1px solid var(--ctwb-line);
}

.ctwb-consent .ctwb-consent-intro + .ctwb-consent-category {
	margin-top: 12px;
}

.ctwb-consent .ctwb-consent-category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.ctwb-consent .ctwb-consent-category-title {
	margin: 0 !important;
	color: var(--ctwb-ink) !important;
	font-family: var(--ctwb-head) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 24px !important;
	letter-spacing: 0;
	text-transform: none;
}

.ctwb-consent .ctwb-consent-category-title label {
	margin: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.ctwb-consent .ctwb-consent-always {
	color: var(--ctwb-ink);
	font: 700 11px/1 var(--ctwb-head);
	letter-spacing: 1px;
	text-transform: uppercase;
	white-space: nowrap;
}

.ctwb-consent .ctwb-consent-category-text {
	margin: 6px 0 8px;
	color: var(--ctwb-text);
	font-size: 14px;
	line-height: 1.6;
}

/* Switch: a checkbox with role="switch". Off is a grey that passes 3:1 on white. */
.ctwb-consent .ctwb-consent-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: none;
	width: 46px;
	height: 26px;
	margin: 0;
	border: 0;
	border-radius: 13px;
	background: #757575;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.ctwb-consent .ctwb-consent-switch::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}

.ctwb-consent .ctwb-consent-switch:checked {
	background: var(--ctwb-c-ink-accent);
}

.ctwb-consent .ctwb-consent-switch:checked::before {
	transform: translateX(20px);
}

.ctwb-consent .ctwb-consent-cookies summary {
	display: inline-block;
	color: var(--ctwb-c-ink-accent);
	font-size: 13px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.ctwb-consent .ctwb-consent-cookie-list {
	margin: 10px 0 0;
	padding: 0;
}

.ctwb-consent .ctwb-consent-cookie-list > div {
	margin: 0 0 6px;
	padding: 8px 12px;
	border-left: 3px solid var(--ctwb-c-accent);
	background: var(--ctwb-soft);
}

.ctwb-consent .ctwb-consent-cookie-list dt {
	color: var(--ctwb-ink);
	font-size: 13px;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.ctwb-consent .ctwb-consent-cookie-list dd {
	margin: 2px 0 0;
	color: var(--ctwb-text);
	font-size: 13px;
	line-height: 1.5;
}

.ctwb-consent .ctwb-consent-cookie-meta {
	color: #595959;
}

.ctwb-consent .ctwb-consent-panel-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px 24px;
	border-top: 1px solid var(--ctwb-line);
	background: var(--ctwb-soft);
}

.ctwb-consent .ctwb-consent-panel-foot .ctwb-consent-btn {
	flex: 1 1 auto;
}

/* Phones: the panel is a sheet from the bottom. */
@media (max-width: 639px) {
	.ctwb-consent .ctwb-consent-panel {
		width: 100%;
		max-height: calc(100dvh - 32px);
		margin: auto 0 0;
	}

	.ctwb-consent .ctwb-consent-panel-head,
	.ctwb-consent .ctwb-consent-panel-body,
	.ctwb-consent .ctwb-consent-panel-foot {
		padding-right: 16px;
		padding-left: 16px;
	}

	.ctwb-consent .ctwb-consent-panel-head {
		padding-right: 6px;
	}

	.ctwb-consent .ctwb-consent-panel-foot {
		display: grid;
		grid-template-columns: 1fr 1fr;
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}

	.ctwb-consent .ctwb-consent-panel-foot .ctwb-consent-btn-quiet {
		grid-column: 1 / -1;
	}
}

/* Footer: Cookie settings under the copyright line, in its colour and alignment. */
.ctwb-legal-links {
	margin: 4px 0 0;
	color: #bdbdbd;
	text-align: center;
}

.ctwb-legal-links .ctwb-legal-link {
	position: static;
	min-width: 0;
	margin: 0;
	padding: 0 !important;
	overflow: visible;
	border: 0;
	background: none;
	color: inherit !important;
	vertical-align: baseline;
	text-align: inherit !important;
	font: inherit;
	letter-spacing: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-transform: none;
	cursor: pointer;
}

/* Privacy policy cookie table. */
.ctwb-cookie-table .ctwb-cookie-table-scroll {
	margin: 0 0 24px;
	overflow-x: auto;
}

.ctwb-cookie-table table {
	width: 100%;
	min-width: 560px;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 1.5;
}

.ctwb-cookie-table th,
.ctwb-cookie-table td {
	padding: 10px 12px;
	border: 1px solid var(--ctwb-line);
	text-align: left;
	vertical-align: top;
}

.ctwb-cookie-table th {
	background: var(--ctwb-soft);
	color: var(--ctwb-ink);
	font-family: var(--ctwb-head);
	font-weight: 700;
}

.ctwb-cookie-table td:first-child {
	overflow-wrap: anywhere;
}

@media (max-width: 600px) {
	.ctwb-cookie-table table { min-width: 0; }
	.ctwb-cookie-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.ctwb-cookie-table tr { display: block; margin: 0 0 12px; border: 1px solid var(--ctwb-line); }
	.ctwb-cookie-table td { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; border: 0; border-bottom: 1px solid var(--ctwb-line); }
	.ctwb-cookie-table td:last-child { border-bottom: 0; }
	.ctwb-cookie-table td::before { content: attr(data-label); color: var(--ctwb-ink); font-weight: 700; }
}

/* Embed placeholder: the same box as the iframe, its height set per page. */
.ctwb-embed {
	position: relative;
}

.ctwb-embed .ctwb-embed-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 100%;
	overflow: auto;
	padding: 16px;
	background: var(--ctwb-soft);
}

.ctwb-embed .ctwb-embed-card {
	box-sizing: border-box;
	max-width: 400px;
	padding: 24px 24px 22px;
	border-top: 3px solid var(--ctwb-c-accent);
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	text-align: center;
}

.ctwb-embed .ctwb-embed-text {
	margin: 0 0 16px;
	color: var(--ctwb-ink);
	font: 400 15px/1.6 var(--ctwb-body);
}

.ctwb-embed .ctwb-embed-link {
	margin: 14px 0 0;
	font: 500 14px/1.5 var(--ctwb-body);
}

.ctwb-embed .ctwb-embed-link a {
	color: var(--ctwb-c-ink-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ctwb-embed .ctwb-embed-note {
	margin: 12px 0 0;
	color: var(--ctwb-text);
	font: 400 13px/1.5 var(--ctwb-body);
}

/* Visitors who allowed embeds see an empty box for the moment before the iframe is added. */
.ctwb-allow-embeds .ctwb-embed .ctwb-embed-card {
	visibility: hidden;
}

.ctwb-embed .ctwb-embed-frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ctwb-embed[data-ctwb-embed-hold]:not(.is-active) .ctwb-embed-frame {
	pointer-events: none;
}

/* Background video: fills its positioned parent and covers it like a background image. */
.ctwb-video-bg {
	position: absolute;
	inset: 0;
	overflow: hidden;
	container-type: size;
}

/* The theme sets img height to auto and caps iframes at 100% width, both with priority. */
.ctwb-video-bg .ctwb-video-bg-still {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100% !important;
	object-fit: cover;
}

.ctwb-video-bg .ctwb-video-bg-frame {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	width: max(100cqw, 177.78cqh);
	max-width: none;
	height: 100%;
	height: max(100cqh, 56.25cqw);
	border: 0;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%);
	transition: opacity 0.6s ease;
}

.ctwb-video-bg.is-playing .ctwb-video-bg-frame {
	opacity: 1;
}
