/* USCS — cookie consent: compact popup (bottom-left) + preferences modal.
   Uses the tokens defined in main.css. */

/* ---------------------------------------------------------
   Small popup / tab
   --------------------------------------------------------- */
.cc-popup {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 300;
	width: 340px;
	max-width: calc(100vw - (24px * 2));
	background: var(--cloud);
	border: 1px solid var(--line);
	padding: 24px 24px 16px;
	box-shadow: 0 20px 48px rgba(11, 27, 51, .16);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .3s ease, transform .3s ease;
	pointer-events: none;
}
.cc-popup.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.cc-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	color: var(--slate);
	cursor: pointer;
	padding: 0;
}
.cc-popup__close:hover { color: var(--graphite); }
.cc-popup__close svg { width: 14px; height: 14px; display: block; }

.cc-popup__text {
	font-size: .875rem;
	color: var(--graphite);
	margin: 0 24px 16px 0;
	line-height: 1.5;
}
.cc-popup__text a { color: var(--ink); }

.cc-popup__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.cc-popup .btn {
	font-size: .875rem;
	padding: 10px 16px;
	flex: 1 1 auto;
	text-align: center;
}

/* ---------------------------------------------------------
   Preferences modal
   --------------------------------------------------------- */
.cc-overlay {
	position: fixed;
	inset: 0;
	z-index: 400;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
	background: rgba(11, 27, 51, .6);
	background: color-mix(in srgb, var(--navy-900) 82%, transparent);
}
.cc-overlay.is-open { display: flex; }

.cc-modal {
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: var(--white);
	border: 1px solid var(--line);
	padding: 24px;
	margin: auto;
}
@media (min-width: 560px) {
	.cc-modal { padding: 40px; }
}

.cc-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}
.cc-modal__head h2 {
	font-family: var(--font-display);
	font-size: 1.5rem;
	margin: 0;
}
.cc-modal__close {
	width: 28px;
	height: 28px;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	color: var(--slate);
	cursor: pointer;
	padding: 0;
}
.cc-modal__close:hover { color: var(--graphite); }
.cc-modal__close svg { width: 16px; height: 16px; display: block; }

.cc-modal__intro {
	font-size: .875rem;
	color: var(--slate);
	margin-bottom: 24px;
}
.cc-modal__intro a { color: var(--ink); }

.cc-modal__acceptall { width: 100%; margin-bottom: 24px; text-align: center; }

.cc-cats {
	border-top: 1px solid var(--line);
	margin-bottom: 24px;
}
.cc-cat {
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
}
.cc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 8px;
}
.cc-cat__name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1rem;
	color: var(--graphite);
}
.cc-cat__desc {
	font-size: .875rem;
	color: var(--slate);
	margin: 0;
}
.cc-cat__badge { flex: 0 0 auto; }

/* Toggle switch — square track and thumb, no radius, matches the rest
   of the site's hard-edged controls. */
.cc-toggle {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	cursor: pointer;
}
.cc-toggle input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}
.cc-toggle__track {
	width: 44px;
	height: 24px;
	background: var(--line);
	border: 1px solid var(--line);
	display: block;
	transition: background-color .18s ease, border-color .18s ease;
}
.cc-toggle__thumb {
	display: block;
	width: 16px;
	height: 16px;
	margin: 3px;
	background: var(--slate);
	transition: transform .18s ease, background-color .18s ease;
}
.cc-toggle input:checked ~ .cc-toggle__track { background: var(--blue); border-color: var(--ink); }
.cc-toggle input:checked ~ .cc-toggle__track .cc-toggle__thumb { transform: translateX(20px); background: var(--graphite); }
.cc-toggle input:focus-visible ~ .cc-toggle__track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Locked "always active" toggle: visually on, not interactive. */
.cc-toggle--locked { cursor: default; opacity: .85; }
.cc-toggle--locked .cc-toggle__track { background: var(--blue-300); border-color: var(--blue-300); }
.cc-toggle--locked .cc-toggle__thumb { transform: translateX(20px); background: var(--graphite); }

.cc-modal__foot {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}
.cc-modal__foot .btn { flex: 1 1 200px; text-align: center; }

/* Footer "Cookie settings" link — plain text button matching the
   .legal row's links. */
.cc-footer-link {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--ink);
	cursor: pointer;
}
.cc-footer-link:hover { text-decoration: underline; }

@media (max-width: 420px) {
	.cc-popup { left: 16px; bottom: 16px; }
	.cc-popup__actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.cc-popup { transition: none; }
}

/* Rounded corners to match the site's components */
.cc-popup, .cc-modal { border-radius: 12px; }
.cc-toggle__track { border-radius: 999px; }
.cc-toggle__thumb { border-radius: 50%; }
.cc-popup__close, .cc-modal__close { border-radius: 8px; }
.cc-modal__head h2 { color: var(--navy-900); }