/**
 * Groundcraft consent — the banner shell.
 *
 * Colour is never a literal: every value chains a per-module knob to the design
 * token to a last-resort fallback, so Global Styles retints the banner with the
 * rest of the site and a Core-only install (no Groundcraft theme, no presets)
 * still renders something legible rather than black-on-black.
 *
 * The two answer buttons are styled by ONE rule on purpose. The moment refuse
 * is quieter, smaller or further away than accept, the consent this banner
 * collects stops meaning anything — so there is deliberately no selector here
 * that could make them differ.
 */

.gc-consent {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99998; /* Below a popup (99999): a modal must still be reachable. */
	padding: 1rem;
	box-sizing: border-box;
}

/* The `hidden` attribute has the same specificity as this file's own display
   rule, so the author rule wins and a "hidden" banner sits across the page
   eating clicks. Ship the guard, always. */
.gc-consent[hidden] {
	display: none;
}

.gc-consent--bottom {
	bottom: 0;
}

.gc-consent--top {
	top: 0;
}

.gc-consent__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
	box-sizing: border-box;
	max-width: var(--wp--style--global--content-size, 1200px);
	margin-inline: auto;
	padding: clamp(0.9rem, 3vw, 1.25rem);
	background: var(--gc-consent-surface, var(--wp--preset--color--surface, #fff));
	color: var(--gc-consent-ink, var(--wp--preset--color--ink-2, #46514a));
	border: 1px solid var(--gc-consent-border, var(--wp--preset--color--border, #e3e6dc));
	border-radius: var(--gc-consent-radius, 14px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
	animation: gc-consent-in 0.24s ease both;
}

.gc-consent__text {
	flex: 1 1 20rem;
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.5;
}

.gc-consent__policy {
	color: var(--gc-consent-link, var(--wp--preset--color--brand-strong, #4f7a1f));
}

.gc-consent__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gc-consent__choice {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	cursor: pointer;
}

.gc-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* One rule, both answers. See the note at the top of this file. */
.gc-consent__btn {
	appearance: none;
	cursor: pointer;
	padding: 0.6rem 1.25rem;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--gc-consent-btn-ink, var(--wp--preset--color--brand-ink, #1e3209));
	background: var(--gc-consent-btn-bg, var(--wp--preset--color--brand-soft, #eef7df));
	border: 1px solid var(--gc-consent-btn-border, var(--wp--preset--color--border-strong, #cfd4c6));
	border-radius: 999px;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.gc-consent__btn:hover,
.gc-consent__btn:focus-visible {
	background: var(--gc-consent-btn-bg-hover, var(--wp--preset--color--brand, #9bd45f));
}

/* Never remove the ring without replacing it — this banner is often the first
   thing a keyboard user meets on the page. */
.gc-consent__btn:focus-visible,
.gc-consent__choice input:focus-visible {
	outline: 2px solid var(--gc-consent-focus, var(--wp--preset--color--brand-strong, #4f7a1f));
	outline-offset: 2px;
}

/* "Save my choices" is the secondary path, not a quieter refusal — refuse is a
   full-weight button above. This one only recedes against the two answers. */
.gc-consent__btn--quiet {
	background: transparent;
}

@keyframes gc-consent-in {
	from {
		opacity: 0;
		transform: translateY(0.75rem);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* A banner that slides in unbidden is exactly the motion that triggers people
   who asked the OS not to do this. Honour it: appear, do not travel. */
@media (prefers-reduced-motion: reduce) {
	.gc-consent__inner {
		animation: none;
	}

	.gc-consent__btn {
		transition: none;
	}
}
