/*
 * Pinekit cookie banner. Themes restyle it with these variables:
 *   --pk-consent-bg, --pk-consent-fg, --pk-consent-muted, --pk-consent-line,
 *   --pk-consent-accent, --pk-consent-on-accent, --pk-consent-radius, --pk-consent-font
 * The accent comes from theme.json's "accent" colour when there is one.
 */

.pk-consent {
	--_bg: var(--pk-consent-bg, #fff);
	--_fg: var(--pk-consent-fg, #1d2025);
	--_muted: var(--pk-consent-muted, #5a606b);
	--_line: var(--pk-consent-line, #dfe2e7);
	--_accent: var(--pk-consent-accent, #2346d6);
	--_on-accent: var(--pk-consent-on-accent, #fff);
	--_radius: var(--pk-consent-radius, 12px);

	position: fixed;
	z-index: 2147483000;
	inset: auto 16px 16px 16px;
	color: var(--_fg);
	font-family: var(--pk-consent-font, inherit);
	font-size: 15px;
	line-height: 1.5;
}

.pk-consent[hidden],
.pk-consent [hidden],
.pk-consent-reopen[hidden] {
	display: none !important;
}

.pk-consent--box {
	right: auto;
	width: min(440px, calc(100vw - 32px));
}

.pk-consent__inner {
	display: grid;
	gap: 14px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 22px 22px 20px;
	border: 1px solid var(--_line);
	border-radius: var(--_radius);
	background: var(--_bg);
	box-shadow: 0 18px 50px rgba(15, 20, 30, 0.18), 0 2px 6px rgba(15, 20, 30, 0.08);
}

.pk-consent--bar .pk-consent__inner {
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 14px 28px;
	max-width: 1180px;
	margin: 0 auto;
}

.pk-consent--bar .pk-consent__title,
.pk-consent--bar .pk-consent__text,
.pk-consent--bar .pk-consent__prefs {
	grid-column: 1;
}

.pk-consent--bar .pk-consent__actions {
	grid-column: 2;
	grid-row: 1 / span 3;
	align-self: end;
	max-width: 320px;
}

.pk-consent--bar.is-choosing .pk-consent__inner {
	grid-template-columns: 1fr;
}

.pk-consent--bar.is-choosing .pk-consent__actions {
	grid-column: 1;
	grid-row: auto;
	max-width: none;
}

.pk-consent__title {
	margin: 0;
	color: inherit;
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.pk-consent__text {
	margin: 0;
	color: var(--_muted);
}

.pk-consent a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.pk-consent__prefs {
	display: grid;
	gap: 2px;
	border-top: 1px solid var(--_line);
}

.pk-consent__cat {
	padding: 12px 0;
	border-bottom: 1px solid var(--_line);
}

.pk-consent__switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-direction: row-reverse;
}

.pk-consent__switch label {
	margin: 0;
	color: var(--_fg);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.pk-consent__switch input {
	appearance: none;
	position: relative;
	flex: none;
	width: 42px;
	height: 24px;
	margin: 0;
	border: 0;
	border-radius: 99px;
	background: #858b96; /* 3.4:1 on white: the switch must stay visible (WCAG 1.4.11). */
	cursor: pointer;
	transition: background-color 0.15s;
}

.pk-consent__switch input::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s;
}

.pk-consent__switch input:checked {
	background: var(--_accent);
}

.pk-consent__switch input:checked::after {
	transform: translateX(18px);
}

.pk-consent__switch input:disabled {
	opacity: 0.55;
	cursor: default;
}

.pk-consent__switch input:focus-visible,
.pk-consent__btn:focus-visible,
.pk-consent-reopen:focus-visible {
	outline: 2px solid var(--_accent);
	outline-offset: 2px;
}

.pk-consent__cattext {
	margin: 4px 0 0;
	color: var(--_muted);
	font-size: 13.5px;
}

.pk-consent__services {
	display: block;
	margin-top: 2px;
}

.pk-consent__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

/* Accept and reject look exactly the same: neither is pushed. */
.pk-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	border: 1px solid var(--_accent);
	border-radius: calc(var(--_radius) * 0.6);
	background: var(--_accent);
	box-shadow: none;
	color: var(--_on-accent);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	cursor: pointer;
}

.pk-consent__btn:hover {
	filter: brightness(0.92);
}

.pk-consent__btn--quiet {
	grid-column: 1 / -1;
	min-height: 36px;
	padding: 6px;
	border-color: transparent;
	background: transparent;
	color: var(--_fg);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pk-consent__btn--quiet:hover {
	filter: none;
	text-decoration-thickness: 2px;
}

.pk-consent.is-choosing [data-pk-action="save"] {
	order: -1;
	min-height: 44px;
	border-color: var(--_fg);
	background: transparent;
	text-decoration: none;
}

.pk-consent-reopen {
	position: fixed;
	z-index: 2147482999;
	bottom: 16px;
	left: 16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--pk-consent-line, #dfe2e7);
	border-radius: 50%;
	background: var(--pk-consent-bg, #fff);
	box-shadow: 0 4px 14px rgba(15, 20, 30, 0.16);
	color: var(--pk-consent-fg, #1d2025);
	cursor: pointer;
}

.pk-consent .screen-reader-text,
.pk-consent-reopen .screen-reader-text,
.pk-embed .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (max-width: 640px) {
	.pk-consent,
	.pk-consent--box {
		inset: auto 8px 8px 8px;
		width: auto;
	}

	.pk-consent--bar .pk-consent__inner {
		grid-template-columns: 1fr;
	}

	.pk-consent--bar .pk-consent__actions {
		grid-column: 1;
		grid-row: auto;
		max-width: none;
	}

	.pk-consent__inner {
		padding: 18px 16px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pk-consent__switch input,
	.pk-consent__switch input::after {
		transition: none;
	}
}

/* Embedded videos and maps waiting for consent */

.pk-embed {
	--_accent: var(--pk-consent-accent, #2346d6);
	--_on-accent: var(--pk-consent-on-accent, #fff);

	position: relative;
	width: 100%;
	aspect-ratio: var(--pk-embed-ratio, 16 / 9);
	overflow: hidden;
	border-radius: var(--pk-consent-radius, 12px);
	background: #14171c;
	font-family: var(--pk-consent-font, inherit);
}

/* Inside core's responsive embed wrapper, fill it like the iframe would. */
.wp-has-aspect-ratio .pk-embed {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
	border-radius: 0;
}

.pk-embed > iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

.pk-embed:not(.is-loaded) > iframe {
	visibility: hidden;
}

.pk-embed.is-loaded {
	background: none;
}

.pk-embed__notice {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 16px;
	background:
		linear-gradient(rgba(10, 12, 16, 0.55), rgba(10, 12, 16, 0.72)),
		var(--pk-embed-thumb, none) center / cover no-repeat,
		#20242b;
	color: #fff;
	text-align: center;
}

.pk-embed--map .pk-embed__notice {
	background:
		repeating-linear-gradient(0deg, transparent 0 38px, rgba(255, 255, 255, 0.07) 38px 40px),
		repeating-linear-gradient(90deg, transparent 0 38px, rgba(255, 255, 255, 0.07) 38px 40px),
		linear-gradient(135deg, #2d4a3e, #23344a);
}

.pk-embed__box {
	display: grid;
	gap: 10px;
	max-width: 30rem;
}

.pk-embed--map .pk-embed__box::before {
	content: "";
	justify-self: center;
	width: 28px;
	height: 36px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath fill='%23fff' d='M12 0C5.4 0 0 5.3 0 11.9 0 20.8 12 32 12 32s12-11.2 12-20.1C24 5.3 18.6 0 12 0Zm0 16.5a4.6 4.6 0 1 1 0-9.2 4.6 4.6 0 0 1 0 9.2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.pk-embed__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.pk-embed__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.92;
}

.pk-embed__text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.pk-embed__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 14px;
}

.pk-embed__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 10px 18px;
	border: 0;
	border-radius: 99px;
	background: var(--_accent);
	color: var(--_on-accent);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.pk-embed--video [data-pk-embed-load]::before {
	content: "";
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 10px solid currentColor;
}

.pk-embed__btn--quiet {
	min-height: 36px;
	padding: 6px 4px;
	background: none;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pk-embed__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.pk-embed__text {
		font-size: 13px;
	}

	.pk-embed--video .pk-embed__text a,
	.pk-embed__title {
		display: none;
	}
}

@media print {
	.pk-embed__notice,
	.pk-consent,
	.pk-consent-reopen {
		display: none !important;
	}
}

/* Room for the open banner at the bottom of the page; set by consent.js. */
html.pk-consent-open {
	scroll-padding-bottom: var(--pk-consent-space, 0px);
}

html.pk-consent-open body {
	padding-bottom: var(--pk-consent-space, 0px);
}

/* After a choice, focus rests on the page itself; no ring around everything. */
body[tabindex="-1"]:focus {
	outline: 0;
}

/* Windows high contrast: backgrounds are dropped, so draw the switch. */
@media (forced-colors: active) {
	.pk-consent__switch input {
		border: 1px solid CanvasText;
	}

	.pk-consent__switch input::after {
		top: 2px;
		left: 2px;
		background: CanvasText;
	}

	.pk-consent__switch input:checked {
		background: Highlight;
	}

	.pk-consent__switch input:checked::after {
		background: HighlightText;
	}
}
