/* ═════════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER
   Markup: inc/consent.php → loquat_consent_banner()
   Behaviour: /assets/js/consent.js

   Design notes:
   • Bottom sheet on mobile, bottom-anchored card on desktop — never a
     full-screen overlay, so it cannot block the page for a visitor who
     ignores it (and so it does not count as a dark pattern).
   • "Reject non-essential" carries the same visual weight as "Accept
     all" — an equal-prominence reject is what GDPR enforcement and the
     EDPB cookie-banner taskforce actually look for.
   • Uses the shared brand tokens from layout/variables.css.
   ═════════════════════════════════════════════════════════════════ */

.loquat-consent {
	position: fixed;
	z-index: 10000;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0 var(--container-x) max(16px, env(safe-area-inset-bottom));
	pointer-events: none;
}

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

.loquat-consent-inner {
	pointer-events: auto;
	max-width: 720px;
	margin: 0 0 16px auto;
	background: var(--cream);
	color: var(--ink);
	border: 1px solid var(--rule);
	border-radius: 14px;
	box-shadow: 0 18px 48px rgba(26, 26, 26, 0.18);
	padding: 22px 24px;
	font-family: var(--f-sans);
	/* Slide-in is opt-out under reduced motion (see the media query
	   at the foot of this file). */
	transform: translateY(12px);
	opacity: 0;
	transition: transform .32s ease, opacity .32s ease;
}

.loquat-consent.is-visible .loquat-consent-inner {
	transform: translateY(0);
	opacity: 1;
}

.loquat-consent-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 8px;
	letter-spacing: -0.01em;
}

.loquat-consent-body {
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink-soft);
	margin: 0;
}

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

.loquat-consent-body a:hover { color: var(--orange); }

/* ── Preferences ── */
.loquat-consent-prefs {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--rule);
	display: grid;
	gap: 14px;
}

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

.loquat-consent-row {
	display: grid;
	grid-template-columns: 18px 1fr;
	gap: 12px;
	align-items: start;
	font-size: 13px;
	line-height: 1.45;
	color: var(--ink-soft);
	cursor: pointer;
}

.loquat-consent-row input[disabled] { cursor: not-allowed; }

.loquat-consent-row input {
	margin: 2px 0 0;
	width: 18px;
	height: 18px;
	accent-color: var(--green);
}

.loquat-consent-row strong {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
	margin-bottom: 2px;
}

/* ── Actions ── */
.loquat-consent-actions {
	margin-top: 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.loquat-consent-btn {
	font-family: var(--f-sans);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	padding: 12px 18px;
	border-radius: 999px;
	border: 1px solid var(--ink);
	cursor: pointer;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

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

.loquat-consent-btn--ghost {
	background: transparent;
	color: var(--ink);
}

.loquat-consent-btn--ghost:hover {
	background: var(--ink);
	color: var(--cream);
}

.loquat-consent-btn--solid {
	background: var(--ink);
	color: var(--cream);
}

.loquat-consent-btn--solid:hover {
	background: var(--orange);
	border-color: var(--orange);
	color: var(--white);
}

.loquat-consent-btn:focus-visible {
	outline: 3px solid var(--orange);
	outline-offset: 2px;
}

/* Footer re-open link, rendered by consent.js next to the privacy link. */
.loquat-consent-reopen {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.loquat-consent-reopen:hover { color: var(--orange); }

@media (max-width: 767px) {
	.loquat-consent { padding-inline: 12px; }

	.loquat-consent-inner {
		margin-inline: 0;
		padding: 18px 18px 20px;
		border-radius: 12px;
	}

	/* Stacked full-width buttons keep accept and reject visually equal
	   on narrow screens, where a row would shrink one of them. */
	.loquat-consent-actions { justify-content: stretch; }
	.loquat-consent-btn { flex: 1 1 100%; padding: 13px 16px; }
}

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