/* =========================================================================
   CONSENT-01 — consent banner + the footer "Cookie Settings" control.

   Every value here is an existing --veil-* token from tokens.css. No new
   colours, no new radii, no imagery of any kind (owner rule 2026-08-16).

   Loaded on every front-end page but the banner element only EXISTS in the DOM
   when veil-consent.js decides to build it, so on the ~95% of page views that
   never see it this file costs one small stylesheet and nothing else.
   ========================================================================= */

.veil-consent {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 9999;
	background: var(--veil-cream);
	color: var(--veil-ink);
	border-top: 1px solid var(--veil-hairline);
	box-shadow: var(--veil-shadow-feature);
	font-family: var(--veil-font-body);
	font-size: var(--veil-body);
	line-height: var(--veil-body-lh);

	/* Opens from 0 → 1 opacity with a short lift. Opacity + transform only
	   (Design System §9), 200ms, and neutralised entirely below for anyone who
	   asked for reduced motion. */
	opacity: 0;
	transform: translateY(8px);
	transition: opacity var(--veil-ease), transform var(--veil-ease);
}

.veil-consent.is-open {
	opacity: 1;
	transform: none;
}

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

/* The dialog takes focus on open; it is a container, not a control, so the
   default UA outline on a tabindex="-1" element is suppressed in favour of the
   system focus ring on the buttons the visitor actually operates. */
.veil-consent:focus {
	outline: none;
}

.veil-consent__inner {
	max-width: var(--veil-max);
	margin: 0 auto;
	padding: 20px var(--veil-gutter);
	display: flex;
	flex-wrap: wrap;
	gap: 20px 32px;
	align-items: center;
	justify-content: space-between;
}

.veil-consent__copy {
	flex: 1 1 460px;
	min-width: 0;
}

.veil-consent__title {
	font-family: var(--veil-font-display);
	font-size: var(--veil-h3);
	color: var(--veil-ink);
	margin: 0 0 6px;
}

.veil-consent__body,
.veil-consent__gpc {
	margin: 0 0 6px;
	color: var(--veil-muted);
	font-size: var(--veil-small);
}

.veil-consent__gpc {
	color: var(--veil-accent-deep);
}

.veil-consent__link {
	margin: 0;
	font-size: var(--veil-small);
}

.veil-consent__link a {
	color: var(--veil-link);
	text-decoration: underline;
}

.veil-consent__actions {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* EQUAL PROMINENCE — this is a legal requirement, not a style preference
   (Veil_Privacy_Policy_Legal_Changes.md §4: "make rejecting as straightforward
   as accepting"). Accept and Reject share ONE rule: same size, same border,
   same colours, same weight, both one click. Do not add a `--primary` variant
   or a filled accent treatment to either of them. */
.veil-consent__btn {
	appearance: none;
	cursor: pointer;
	font-family: var(--veil-font-body);
	font-size: var(--veil-small);
	font-weight: 700;
	letter-spacing: .2px;
	line-height: 1.2;
	padding: 12px 20px;
	min-width: 156px;
	border: 1px solid var(--veil-ink);
	border-radius: var(--veil-radius-btn);
	background: var(--veil-white);
	color: var(--veil-ink);
	transition: background var(--veil-ease), color var(--veil-ease);
}

.veil-consent__btn:hover {
	background: var(--veil-sage);
}

.veil-consent__btn:focus-visible {
	outline: 2px solid var(--veil-focus-ring);
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--veil-focus-ring-inner);
}

/* Visually hidden live region for the "choice saved" announcement. */
.veil-consent__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 600px) {
	.veil-consent__inner {
		padding: 18px 20px;
		gap: 16px;
	}

	.veil-consent__actions {
		width: 100%;
	}

	/* Both buttons full width and equal — stacking must not make one of them
	   look like the recommended answer. */
	.veil-consent__btn {
		flex: 1 1 100%;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.veil-consent {
		transition: none;
		transform: none;
	}
}

/* -------------------------------------------------------------------------
   The footer legal-bar control. Matches the sibling legal links exactly — the
   same white, the same wipe-in underline — because it is one item in that row
   and must not read as a stray button. Doubled class per THEME-41: footer.css
   may load after this file and its `.veil-footer__legal-item a` rules are of
   equal specificity to a single-class rule here.
   ---------------------------------------------------------------------- */
.veil-footer__legal-item .veil-consent-reopen.veil-consent-reopen {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font: inherit;
	color: var(--wp--preset--color--palette-color-4, var(--theme-palette-color-4, #fff));
	background-repeat: no-repeat;
	background-image: linear-gradient(transparent calc(100% - 1px), currentColor 1px);
	background-size: 0 95%;
	transition: .7s ease;
}

.veil-footer__legal-item .veil-consent-reopen.veil-consent-reopen:hover {
	background-size: 100% 95%;
}

.veil-footer__legal-item .veil-consent-reopen.veil-consent-reopen:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
   A11Y-02 — Cookie Settings target size (WCAG 2.5.8 Target Size (Minimum), AA)

   MEASURED at 375x812: the button rendered 97.7 x 19 px with no pseudo-element
   enlargement, so it failed the 24x24 minimum. The 24px-spacing exception did
   not rescue it either — it sits inside the Sitemap link's 4018-4063 band, so
   its neighbours are closer than the exception allows.

   Fixed with an invisible ::after hit band rather than padding, the same
   pattern THEME-41 used for `a.go`: padding would reflow the footer legal row,
   the band does not move a single pixel of rendered text.

   Height is 24px, not 44px, DELIBERATELY. The criterion asks for 24; growing to
   44 would extend ~12px above and below into the adjacent legal links' rows and
   start stealing their clicks, which trades one target-size problem for a
   worse pointer-accuracy one. Doubled class to match the specificity of the
   base rule above (see the note there).
   ---------------------------------------------------------------------- */
.veil-footer__legal-item .veil-consent-reopen.veil-consent-reopen {
	position: relative;
}

.veil-footer__legal-item .veil-consent-reopen.veil-consent-reopen::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	min-height: 24px;
	height: 100%;
	/* Purely a hit area: no paint, and never a focus/hover visual. */
	background: none;
	pointer-events: auto;
}
