/* ============================================================
   COOKIE CONSENT — v17t (2026-05-13)
   ============================================================
   GDPR cookie banner + 4-category preferences modal.
   Pattern matches new.ossip.ee/et with adaptations for the
   eterniit static-HTML site visual identity.

   Loaded sitewide via scripts/generate-content-pages.ts.
   Banner shows on first visit only; preferences persist in
   localStorage key "bestor.cookies.v1".
   ============================================================ */

/* -------------------------------------------------------------
   BANNER (bottom-fixed, full-width)
   ------------------------------------------------------------- */
.cc-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9000;
	background: #201614;
	color: #fdfbf7;
	box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.2);
	padding: 20px 0;
	animation: cc-banner-in 0.32s ease-out;
}
@keyframes cc-banner-in {
	from {
		transform: translateY(100%);
	}
	to {
		transform: translateY(0);
	}
}

.cc-banner__inner {
	display: flex;
	flex-direction: column;
	gap: 18px;
	align-items: flex-start;
}
@media (min-width: 900px) {
	.cc-banner__inner {
		flex-direction: row;
		align-items: center;
		gap: 32px;
	}
}

.cc-banner__copy {
	flex: 1;
}
.cc-banner__title {
	margin: 0 0 6px;
	font-family: "Fraunces", serif;
	font-style: italic;
	font-weight: 500;
	font-size: 20px;
	line-height: 1.2;
	letter-spacing: -0.015em;
}
.cc-banner__text {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: rgba(253, 251, 247, 0.82);
	max-width: 78ch;
}
.cc-banner__text a {
	color: #fdfbf7;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.cc-banner__text a:hover {
	color: #fff;
}

.cc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex-shrink: 0;
}

/* -------------------------------------------------------------
   BUTTONS (used in banner + modal)
   ------------------------------------------------------------- */
.cc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 22px;
	font-family: "JetBrains Mono", monospace;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	border-radius: 999px;
	border: 1px solid transparent;
	cursor: pointer;
	transition:
		background 0.15s,
		color 0.15s,
		border-color 0.15s;
	white-space: nowrap;
}
.cc-btn--solid {
	background: #fdfbf7;
	color: #201614;
}
.cc-btn--solid:hover {
	background: #fff;
}
.cc-btn--ghost {
	background: transparent;
	color: #fdfbf7;
}
.cc-btn--ghost:hover {
	background: rgba(253, 251, 247, 0.08);
}
.cc-btn--outline {
	background: transparent;
	color: #fdfbf7;
	border-color: rgba(253, 251, 247, 0.4);
}
.cc-btn--outline:hover {
	border-color: #fdfbf7;
	background: rgba(253, 251, 247, 0.06);
}

/* -------------------------------------------------------------
   MODAL (preferences dialog)
   ------------------------------------------------------------- */
.cc-modal {
	position: fixed;
	inset: 0;
	z-index: 9100;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.cc-modal[hidden] {
	display: none;
}

.cc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
}

.cc-modal__panel {
	position: relative;
	background: #201614;
	color: #fdfbf7;
	width: 100%;
	max-width: 580px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 24px 24px;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
	animation: cc-modal-in 0.28s ease-out;
}
@media (min-width: 768px) {
	.cc-modal {
		align-items: center;
	}
	.cc-modal__panel {
		max-width: 560px;
		margin-left: auto;
		margin-right: 0;
		max-height: 100vh;
		min-height: 100vh;
		padding: 36px 36px 28px;
	}
}
@keyframes cc-modal-in {
	from {
		transform: translateY(20px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.cc-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 12px;
}
.cc-modal__header h2 {
	margin: 0;
	font-family: "Fraunces", serif;
	font-style: italic;
	font-weight: 500;
	font-size: 24px;
	letter-spacing: -0.02em;
}
.cc-modal__close {
	background: transparent;
	border: 0;
	color: #fdfbf7;
	font-size: 28px;
	line-height: 1;
	padding: 4px 8px;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.15s;
}
.cc-modal__close:hover {
	opacity: 1;
}

.cc-modal__lede {
	margin: 0 0 22px;
	font-size: 13.5px;
	line-height: 1.55;
	color: rgba(253, 251, 247, 0.78);
}

/* -------------------------------------------------------------
   CATEGORY ROWS
   ------------------------------------------------------------- */
.cc-cat {
	padding: 18px 0;
	border-top: 1px solid rgba(253, 251, 247, 0.12);
}
.cc-cat:last-of-type {
	border-bottom: 1px solid rgba(253, 251, 247, 0.12);
	margin-bottom: 22px;
}

.cc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}
.cc-cat__head h3 {
	margin: 0;
	font-family: "JetBrains Mono", monospace;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.cc-cat p {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(253, 251, 247, 0.7);
}

/* -------------------------------------------------------------
   TOGGLE SWITCH
   ------------------------------------------------------------- */
.cc-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}
.cc-toggle input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.cc-toggle__slider {
	display: inline-block;
	width: 44px;
	height: 24px;
	background: rgba(253, 251, 247, 0.15);
	border-radius: 999px;
	position: relative;
	cursor: pointer;
	transition: background 0.18s;
}
.cc-toggle__slider::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fdfbf7;
	border-radius: 50%;
	transition: transform 0.18s;
}
.cc-toggle input:checked + .cc-toggle__slider {
	background: var(--red-accent, #c0392b);
}
.cc-toggle input:checked + .cc-toggle__slider::after {
	transform: translateX(20px);
}
.cc-toggle--locked {
	font-family: "JetBrains Mono", monospace;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(253, 251, 247, 0.5);
	padding: 6px 10px;
	border: 1px solid rgba(253, 251, 247, 0.15);
	border-radius: 999px;
}

.cc-modal__footer {
	display: flex;
	justify-content: flex-end;
}

/* -------------------------------------------------------------
   FOOTER LINK ("Halda küpsiseid" in site footer)
   ------------------------------------------------------------- */
.cc-footer-link {
	background: transparent;
	border: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: 0.7;
	transition: opacity 0.15s;
}
.cc-footer-link:hover {
	opacity: 1;
}
