/* Cookie-consent banner + Manage Preferences modal. Reuses the
   frontend.css design tokens so it reads as part of the same system,
   not a bolted-on third-party widget. */

.le-cookie-banner {
	position: fixed;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 9999;
	max-width: 640px;
	margin: 0 auto;
	background: var(--le-surface);
	border: 1px solid var(--le-border);
	box-shadow: var(--le-shadow-md);
	padding: 1.1rem 1.25rem;
	font-family: var(--le-font-sans);
	color: var(--le-ink);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.25rem;
	animation: le-cookie-slide-up .35s ease both;
}
.le-cookie-banner-text { margin: 0; font-size: .88rem; line-height: 1.5; flex: 1 1 320px; }
.le-cookie-banner-actions { display: flex; gap: .6rem; flex-wrap: wrap; flex: 0 0 auto; }
.le-cookie-banner-actions .le-btn { padding: .55rem 1rem; font-size: .82rem; white-space: nowrap; }

@keyframes le-cookie-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: translateY(0); }
}

.le-cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.le-cookie-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(36, 29, 18, .55);
}
.le-cookie-modal-dialog {
	position: relative;
	background: var(--le-surface);
	border: 1px solid var(--le-border);
	box-shadow: var(--le-shadow-md);
	max-width: 460px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	font-family: var(--le-font-sans);
	color: var(--le-ink);
	animation: le-cookie-modal-in .25s ease both;
}

@keyframes le-cookie-modal-in {
	from { opacity: 0; transform: scale(.97); }
	to { opacity: 1; transform: scale(1); }
}

.le-cookie-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid var(--le-border);
}
.le-cookie-modal-header h2 { margin: 0; font-family: var(--le-font-serif); font-size: 1.2rem; font-weight: 700; }
.le-cookie-modal-close {
	background: none;
	border: none;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--le-muted);
	cursor: pointer;
	padding: .25rem .5rem;
}
.le-cookie-modal-close:hover { color: var(--le-ink); }

.le-cookie-modal-body { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 1.1rem; }
.le-cookie-toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.le-cookie-toggle-copy strong { display: block; font-size: .92rem; margin-bottom: .2rem; }
.le-cookie-toggle-copy p { margin: 0; font-size: .82rem; color: var(--le-muted); line-height: 1.5; }

.le-cookie-switch { position: relative; display: inline-block; width: 2.6rem; height: 1.5rem; flex: 0 0 auto; }
.le-cookie-switch input { opacity: 0; width: 0; height: 0; }
.le-cookie-switch span {
	position: absolute;
	inset: 0;
	background: var(--le-border);
	cursor: pointer;
	transition: background .15s ease;
}
.le-cookie-switch span::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 3px;
	width: 1.05rem;
	height: 1.05rem;
	background: #fff;
	transition: transform .15s ease;
}
.le-cookie-switch input:checked + span { background: var(--le-accent); }
.le-cookie-switch input:checked + span::before { transform: translateX(1.1rem); }
.le-cookie-switch-disabled { opacity: .6; }
.le-cookie-switch-disabled span { cursor: not-allowed; }

.le-cookie-modal-footer { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid var(--le-border); }
.le-cookie-modal-footer .le-btn { width: 100%; text-align: center; }

@media (prefers-reduced-motion: reduce) {
	.le-cookie-banner, .le-cookie-modal-dialog { animation: none !important; }
}

@media (max-width: 600px) {
	.le-cookie-banner { flex-direction: column; align-items: stretch; }
	.le-cookie-banner-actions { justify-content: stretch; }
	.le-cookie-banner-actions .le-btn { flex: 1 1 0; text-align: center; }
}

/* Both elements set their own `display` above (flex, for layout), which
   would otherwise silently override the browser's default
   `[hidden] { display: none }` UA rule — these two win on specificity
   so the `hidden` attribute (toggled by JS) actually hides them. */
.le-cookie-banner[hidden], .le-cookie-modal[hidden] { display: none; }
