/*
 * The tracking notice (includes/consent.php, assets/consent.js): a bar along the bottom of the
 * page, on the site's ink under a gold rule, with Accept and Decline the same size and the same
 * weight; and "Tracking choices" in the footer's base line, dressed as that line's links.
 * Tokens from the theme (critical.css), with the palette's values as fallbacks.
 */

.cs-consent {
	background: var(--cst-ink, #0d0d0d);
	border-top: 2px solid var(--cst-gold, #d8a83e);
	bottom: 0;
	box-shadow: 0 -12px 32px rgb(0 0 0 / 35%);
	color: var(--cst-paper, #fff);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	left: 0;
	line-height: 1.5;
	position: fixed;
	right: 0;
	z-index: 200;
}

.cs-consent[hidden] {
	display: none;
}

/* Reopened, the bar itself takes focus (neither answer comes pre-selected); it needs no ring. */
.cs-consent:focus {
	outline: none;
}

.cs-consent__inner {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	margin-inline: auto;
	max-width: var(--wp--style--global--wide-size, 1440px);
	padding: 1rem var(--wp--preset--spacing--40, 1.25rem);
	padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.cs-consent__copy {
	flex: 1 1 26rem;
	min-width: 0;
}

.cs-consent__copy > p {
	margin: 0;
	max-width: 68ch;
}

.cs-consent__state {
	color: color-mix(in srgb, var(--cst-paper, #fff) 70%, transparent);
	margin-top: 0.25rem !important;
}

.cs-consent a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--cst-gold, #d8a83e);
	text-underline-offset: 0.2em;
}

.cs-consent__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 0.75rem;
}

/* One look for both answers: neither is bigger, brighter or first in weight. */
.cs-consent__button {
	appearance: none;
	background: transparent;
	border: 2px solid var(--cst-gold, #d8a83e);
	border-radius: var(--cst-radius, 2px);
	color: var(--cst-paper, #fff);
	cursor: pointer;
	font-family: var(--cst-heading, "Roboto Condensed", "Arial Narrow", Arial, sans-serif);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	min-height: 2.75rem;
	min-width: 8.5rem;
	padding: 0.65em 1.25em;
	text-transform: uppercase;
}

.cs-consent__button:hover,
.cs-consent__button:focus-visible {
	background: var(--cst-gold, #d8a83e);
	color: var(--cst-ink, #0d0d0d);
}

.cs-consent__button:focus-visible,
.cs-consent a:focus-visible {
	outline: 2px solid var(--cst-paper, #fff);
	outline-offset: 3px;
}

/* Choose: the two boxes, under the words. */
.cs-consent__choose {
	border: 0;
	display: grid;
	gap: 0.4rem;
	margin: 0.75rem 0 0;
	padding: 0;
}

.cs-consent__choose[hidden],
.cs-consent__button[hidden] {
	display: none;
}

.cs-consent__legend {
	font-weight: 700;
	margin-bottom: 0.25rem;
	padding: 0;
}

.cs-consent__option {
	align-items: flex-start;
	display: flex;
	gap: 0.6rem;
}

.cs-consent__option input {
	accent-color: var(--cst-gold, #d8a83e);
	flex: 0 0 auto;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	width: 1.15rem;
}

@media (max-width: 599px) {
	.cs-consent__actions {
		flex-wrap: wrap;
		width: 100%;
	}

	.cs-consent__button {
		flex: 1 1 0;
		min-width: 0;
	}
}

/* While the bar shows, the page's last line and a focused link scroll clear of it. */
html.cs-consent-open {
	scroll-padding-bottom: var(--cs-consent-h, 0px);
}

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

/* A floating control at the foot of the page (the look switch) rides above the bar, not under it. */
html.cs-consent-open .cs-look-float {
	transform: translateY(calc(-1 * var(--cs-consent-h, 0px)));
}

@media (prefers-reduced-motion: no-preference) {
	.cs-consent:not([hidden]) {
		animation: cs-consent-rise 0.35s var(--cst-ease, ease-out) both;
	}

	@keyframes cs-consent-rise {
		from {
			opacity: 0;
			transform: translateY(100%);
		}

		to {
			opacity: 1;
			transform: none;
		}
	}
}

@media print {
	.cs-consent {
		display: none;
	}
}

/* "Tracking choices" in the footer's base line: a button that reads as the line's links. */
.cs-consent-choices,
.cs-consent-policy {
	margin: 0;
}

.cs-consent-choices__button {
	appearance: none;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	letter-spacing: inherit;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

html:not(.cs-js) .cs-consent-choices {
	display: none;
}

@media (max-width: 781px) {
	.cs-site-footer__base > .cs-consent-choices,
	.cs-site-footer__base > .cs-consent-policy {
		order: 2;
	}

	.cs-consent-choices__button {
		padding-block: 0.3rem;
	}
}
