/**
 * Lake Foundry cookie consent.
 *
 * Uses the theme's design tokens, with fallbacks so the banner still reads
 * correctly if it ever runs under a different theme — it's a must-use plugin,
 * so it outlives the theme it was designed against.
 */

.lf-consent {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 80;
	box-sizing: border-box;
	background: var(--surface-raised, #1a1817);
	border-block-start: 1px solid var(--line-strong, #6e665e);
	box-shadow: var(--shadow-menu, 0 8px 24px rgba(0, 0, 0, 0.6));
	color: var(--ink, #f4f0ea);
	font-family: var(--font-sans, system-ui, sans-serif);
	padding: var(--space-5, 24px);
	padding-bottom: calc( var(--space-5, 24px) + env( safe-area-inset-bottom, 0px ) );
}

.lf-consent[hidden] { display: none; }
.lf-consent:focus { outline: none; }

.lf-consent__inner {
	box-sizing: border-box;
	max-width: 1200px;
	margin-inline: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-5, 24px);
}

.lf-consent__copy { flex: 1 1 32ch; min-width: 0; }

.lf-consent__title {
	font-family: var(--font-display, inherit);
	font-size: 12px;
	line-height: 16px;
	font-weight: 500;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--ink-muted, #a8a099);
	margin: 0 0 var(--space-3, 12px);
}

.lf-consent__body {
	font-size: 15px;
	line-height: 24px;
	color: var(--ink, #f4f0ea);
	margin: 0;
	max-width: 70ch;
}

.lf-consent__body a { color: var(--molten, #d46f18); }

/* ---- Preferences -------------------------------------------------------- */

.lf-consent__prefs {
	margin-block-start: var(--space-5, 24px);
	padding-block-start: var(--space-4, 16px);
	border-block-start: 1px solid var(--line-hairline, #2f2b27);
	display: grid;
	gap: var(--space-3, 12px);
}

.lf-consent__prefs[hidden] { display: none; }

.lf-consent__choice {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3, 12px);
	font-size: 15px;
	line-height: 24px;
	color: var(--ink-muted, #a8a099);
	cursor: pointer;
}

.lf-consent__choice strong { color: var(--ink, #f4f0ea); font-weight: 600; }

.lf-consent__choice input {
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: var(--molten, #d46f18);
	flex: none;
	cursor: pointer;
}

.lf-consent__choice input:disabled { cursor: not-allowed; opacity: 0.6; }

/* ---- Actions ------------------------------------------------------------ */

.lf-consent__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3, 12px);
	flex: 0 0 auto;
}

/* !important: `.lf-consent .lf-btn` below sets display with equal specificity
   and comes later, which otherwise showed "Save choices" before Manage. */
.lf-consent__actions [hidden] { display: none !important; }

/* The theme supplies .lf-btn; these are the fallbacks for anything that does
   not, so the controls are never unstyled text. */
.lf-consent .lf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: var(--space-3, 12px) var(--space-5, 24px);
	border: 2px solid transparent;
	border-radius: var(--radius-sm, 2px);
	font-family: inherit;
	font-size: 15px;
	line-height: 20px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	min-height: 44px;
	transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

.lf-consent .lf-btn--primary {
	background: var(--molten, #d46f18);
	border-color: var(--molten, #d46f18);
	color: var(--on-molten, #180a03);
}
.lf-consent .lf-btn--primary:hover {
	background: var(--molten-soft, #f1931b);
	border-color: var(--molten-soft, #f1931b);
}

.lf-consent .lf-btn--secondary {
	background: transparent;
	border-color: var(--line-strong, #6e665e);
	color: var(--ink, #f4f0ea);
}
.lf-consent .lf-btn--secondary:hover {
	border-color: var(--molten, #d46f18);
	color: var(--molten, #d46f18);
}

.lf-consent .lf-btn--ghost {
	background: transparent;
	border-color: transparent;
	color: var(--molten, #d46f18);
	padding-inline: var(--space-2, 8px);
}
.lf-consent .lf-btn--ghost:hover { color: var(--molten-soft, #f1931b); }

.lf-consent .lf-btn:focus-visible {
	outline: 2px solid var(--focus-ring, #ffb37a);
	outline-offset: 2px;
}

@media (max-width: 820px) {
	.lf-consent__inner { flex-direction: column; align-items: stretch; }
	/* Stacked, the 32ch basis would become a height and leave a gap above the
	   buttons. */
	.lf-consent__copy { flex: 0 0 auto; }
	.lf-consent__actions > .lf-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
	.lf-consent .lf-btn { transition-duration: 0ms; }
}
