/**
 * CookieYes banner, "Customise" panel and embed placeholders, matched to the site.
 *
 * Enqueued by inc/consent.php only while CookieYes is active.
 *
 * - Colours live in CookieYes's banner settings (set by scripts/cookieyes-setup.php) so
 *   they stay editable in the plugin. This file adds what those settings can't: the site's
 *   fonts, corners, focus rings, phone layout and embed placeholders.
 * - CookieYes writes its colours as inline styles and injects its own CSS at the end of
 *   <head> after this file, so layout rules need one class more than CookieYes's own.
 * - Fonts are the site's own, served locally (main.css @font-face). No font CDNs.
 * - Class names: only CookieYes's own (cky-*, video-placeholder-*). Content blockers hide
 *   elements with "banner", "popup", "social", "ad" etc. in invented class names.
 */

:root {
	--consent-font-body: var(--sans, 'Open Sans', sans-serif);
	--consent-font-heading: var(--serif, 'EB Garamond', Georgia, serif);
	--consent-radius: 6px;
	--consent-button-radius: var(--radius, 4px); /* Same corners as the site's buttons. */
	--consent-shadow: var(--shadow, 0 18px 50px -24px rgba(36, 31, 26, 0.45));
	--consent-focus: var(--gold-deep, #7a5b22);

	/* Embed placeholders: a calm dark box in the brand colours. */
	--consent-placeholder-bg: var(--dark, #17130f);
	--consent-placeholder-button: var(--gold-deep, #7a5b22);
	--consent-placeholder-button-text: #fff;

	/* Floating revisit-button tooltip. */
	--consent-tooltip-bg: var(--ink, #241f1a);
}

/* ---------------------------------------------------------------- Shapes and type */

.cky-consent-container .cky-consent-bar,
.cky-modal .cky-preference-center {
	border-radius: var(--consent-radius);
	border-style: solid;
	border-width: 1px;
	box-shadow: var(--consent-shadow);
	font-family: var(--consent-font-body);
}

.cky-consent-container .cky-consent-bar {
	padding: 1.5rem;
}

.cky-modal.cky-modal {
	border-radius: var(--consent-radius);
}

.cky-consent-container .cky-notice .cky-title,
.cky-modal .cky-preference-header .cky-preference-title {
	font-family: var(--consent-font-heading);
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.2;
	margin-bottom: 0.5rem;
}

.cky-consent-container .cky-notice-des,
.cky-consent-container .cky-notice-des *,
.cky-modal .cky-preference-content-wrapper,
.cky-modal .cky-preference-content-wrapper *,
.cky-modal .cky-accordion-header-des,
.cky-modal .cky-accordion-header-des *,
.cky-modal .cky-audit-table * {
	font-family: var(--consent-font-body);
	line-height: 1.55;
}

.cky-consent-container .cky-notice-des,
.cky-consent-container .cky-notice-des p,
.cky-modal .cky-preference-content-wrapper p {
	font-size: 0.9375rem;
}

.cky-consent-container .cky-notice-des p + p {
	margin-top: 0.5rem;
}

.cky-consent-container .cky-notice-des a,
.cky-consent-container .cky-policy {
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.cky-modal .cky-accordion-header .cky-accordion-btn,
.cky-modal .cky-accordion-header .cky-always-active {
	font-family: var(--consent-font-body);
	font-weight: 600;
}

/* ---------------------------------------------------------------- Buttons */

.cky-consent-container .cky-btn,
.cky-modal .cky-btn {
	border-radius: var(--consent-button-radius);
	border-style: solid;
	border-width: 1.5px;
	font-family: var(--consent-font-body);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 0.7em 1.3em;
}

.cky-consent-container .cky-btn:hover,
.cky-modal .cky-btn:hover {
	opacity: 0.9;
}

/* First layer: Accept all then Customise (no Reject; Sarah's choice), equal widths, one row.
   CookieYes injects its own order rules later, so these are one class more specific. */
.cky-consent-container .cky-notice-btn-wrapper.cky-notice-btn-wrapper {
	display: flex;
	flex-direction: row;
	gap: 0.5rem;
}

.cky-consent-container .cky-notice-btn-wrapper .cky-btn {
	flex: 1 1 0;
	margin: 0;
	min-width: 0;
}

.cky-consent-container .cky-notice-btn-wrapper .cky-btn-accept {
	order: 1;
}

.cky-consent-container .cky-notice-btn-wrapper .cky-btn-customize {
	order: 2;
}

.cky-consent-container .cky-btn:focus-visible,
.cky-modal .cky-btn:focus-visible,
.cky-modal .cky-accordion-btn:focus-visible,
.cky-modal .cky-btn-close:focus-visible,
.cky-consent-container .cky-banner-btn-close:focus-visible,
.cky-btn-revisit-wrapper .cky-btn-revisit:focus-visible,
.cky-modal .cky-switch input:focus-visible {
	outline: 3px solid var(--consent-focus);
	outline-offset: 3px;
}

/* CookieYes focuses the panel's close button on open and rings it in its own blue. */
.cky-modal .cky-btn-close:focus {
	outline-color: var(--consent-focus);
}

/* ---------------------------------------------------------------- Floating revisit button */

.cky-btn-revisit-wrapper.cky-btn-revisit-wrapper {
	box-shadow: var(--consent-shadow);
}

.cky-btn-revisit-wrapper.cky-revisit-bottom-left:hover::before,
.cky-btn-revisit-wrapper.cky-revisit-bottom-right:hover::before {
	background: var(--consent-tooltip-bg);
	font-family: var(--consent-font-body);
}

.cky-btn-revisit-wrapper.cky-revisit-bottom-left:hover::after {
	border-right-color: var(--consent-tooltip-bg);
}

.cky-btn-revisit-wrapper.cky-revisit-bottom-right:hover::after {
	border-left-color: var(--consent-tooltip-bg);
}

/* ---------------------------------------------------------------- Embeds waiting for consent */

/* CookieYes sizes placeholders from the iframe's width/height; never wider than the column. */
.video-placeholder-normal,
.video-placeholder-youtube,
.wp-block-embed iframe,
.entry-content iframe {
	max-width: 100%;
}

.video-placeholder-normal,
.video-placeholder-youtube {
	border-radius: var(--consent-radius);
	font-family: var(--consent-font-body);
}

/* No YouTube thumbnail: fetching it from img.youtube.com would contact Google before consent. */
.video-placeholder-youtube {
	background-color: var(--consent-placeholder-bg) !important;
	background-image: none !important;
}

.video-placeholder-normal {
	background-color: var(--consent-placeholder-bg) !important;
}

.video-placeholder-normal .video-placeholder-text-normal,
.video-placeholder-youtube .video-placeholder-text-youtube {
	background-color: var(--consent-placeholder-button) !important;
	border-radius: var(--consent-button-radius);
	color: var(--consent-placeholder-button-text) !important;
	cursor: pointer;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	max-width: calc(100% - 2rem);
	padding: 0.6em 1.2em;
	text-align: center;
}

/* ---------------------------------------------------------------- Phones */

@media (max-width: 576px) {
	.cky-consent-container .cky-consent-bar {
		padding: 1.25rem 1rem;
	}

	.cky-consent-container .cky-notice .cky-title {
		font-size: 1.25rem;
	}

	.cky-consent-container .cky-notice-btn-wrapper {
		margin-top: 1rem;
	}

	/* Customise panel: stack its buttons full width. */
	.cky-modal .cky-prefrence-btn-wrapper {
		display: flex;
		flex-direction: column;
		gap: 0.5rem;
	}

	.cky-modal .cky-prefrence-btn-wrapper .cky-btn {
		margin: 0;
		width: 100%;
	}

	.cky-modal .cky-prefrence-btn-wrapper .cky-btn-accept {
		order: 1;
	}

	.cky-modal .cky-prefrence-btn-wrapper .cky-btn-reject {
		order: 2;
	}

	.cky-modal .cky-prefrence-btn-wrapper .cky-btn-preferences {
		order: 3;
	}
}
