/* Samtykke – Cookie Consent banner */

/* Viktig: skjul alltid når hidden er satt. Uten !important kan
   posisjonsklassene (display:flex) overstyre [hidden] og la banneret
   bli synlig selv etter samtykke. */
#samtykke-cc[hidden] { display: none !important; }

/* Tidlig head-skript setter denne klassen når gyldig samtykke finnes:
   skjul banneret umiddelbart, uten å vente på JS. */
html.scc-consented #samtykke-cc { display: none !important; }

.scc, .scc * { box-sizing: border-box; }
.scc {
	--scc-accent: #1a6acb;
	--scc-bg: #ffffff;
	--scc-fg: #1d2327;
	--scc-muted: #4a525b;
	--scc-border: #e2e4e7;
	position: fixed;
	z-index: 2147483600; /* over de fleste temaer/sticky-headere */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--scc-fg);
}
.scc--dark {
	--scc-bg: #1e2227;
	--scc-fg: #f0f0f1;
	--scc-muted: #c3cad2;
	--scc-border: #3a3f46;
}

.scc__box {
	background: var(--scc-bg);
	padding: 22px 24px;
	/* tydelig kant + topp-aksent gir bedre synlighet mot enhver bakgrunn */
	border: 1px solid var(--scc-border);
	border-top: 4px solid var(--scc-accent);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
}
.scc__title { margin: 0 0 8px; font-size: 19px; font-weight: 700; }
.scc__intro { margin: 0 0 14px; color: var(--scc-muted); }
.scc__link { color: var(--scc-accent); text-decoration: underline; }

/* ---------- Posisjon: lite hjørnevindu nederst til høyre ---------- */
.scc--corner { right: 20px; bottom: 20px; left: auto; max-width: 380px; }
.scc--corner .scc__overlay { display: none; }
.scc--corner .scc__box { padding: 20px; }
.scc--corner .scc__title { font-size: 17px; }
.scc--corner .scc__intro { font-size: 14px; }
.scc--corner .scc__actions { flex-direction: column; align-items: stretch; }
.scc--corner .scc__btn { width: 100%; }

/* ---------- Posisjon: bredt banner nederst ---------- */
.scc--bottom { left: 0; right: 0; bottom: 0; }
.scc--bottom .scc__overlay { display: none; }
.scc--bottom .scc__box {
	max-width: 920px;
	margin: 0 auto 16px;
}

/* ---------- Posisjon: modal i midten ---------- */
.scc--center { inset: 0; display: flex; align-items: center; justify-content: center; }
.scc--center .scc__overlay {
	position: absolute; inset: 0;
	background: rgba(0, 0, 0, .55);
	backdrop-filter: blur(2px);
}
.scc--center .scc__box {
	position: relative;
	max-width: 540px;
	width: calc(100% - 32px);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
}

/* ---------- Kategorier ---------- */
.scc__prefs { margin: 4px 0 16px; border-top: 1px solid var(--scc-border); }
.scc__prefs[hidden] { display: none; }
.scc__row {
	display: flex; align-items: center; gap: 16px;
	padding: 12px 2px;
	border-bottom: 1px solid var(--scc-border);
	cursor: pointer;
}
.scc__row-text { flex: 1; }
.scc__row-title { display: block; font-weight: 600; }
.scc__row-desc { display: block; font-size: 13px; color: var(--scc-muted); margin-top: 2px; }
.scc__always { font-size: 12px; color: var(--scc-muted); margin-right: 6px; }
.scc__toggle, .scc__row input[type="checkbox"] {
	width: 20px; height: 20px; accent-color: var(--scc-accent); cursor: pointer; flex: 0 0 auto;
}

/* ---------- Knapper ---------- */
.scc__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.scc__btn {
	appearance: none; border: 1px solid transparent;
	padding: 11px 18px; border-radius: 8px;
	font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2;
	transition: background .15s, border-color .15s, opacity .15s;
}
.scc__btn[hidden] { display: none; }
.scc__btn--primary, .scc__btn--save { background: var(--scc-accent); color: #fff; }
.scc__btn--primary:hover, .scc__btn--save:hover { opacity: .9; }
.scc__btn--ghost {
	background: transparent; color: var(--scc-fg);
	border-color: var(--scc-border);
}
.scc__btn--ghost:hover { background: rgba(0, 0, 0, .05); }
.scc--dark .scc__btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.scc__btn:focus-visible { outline: 3px solid var(--scc-accent); outline-offset: 2px; }

/* ---------- Responsivt ---------- */
@media (max-width: 600px) {
	.scc--corner { left: 12px; right: 12px; bottom: 12px; max-width: none; }
	.scc--bottom .scc__box { margin: 0 8px 8px; }
	.scc--bottom .scc__actions { justify-content: stretch; }
	.scc--bottom .scc__btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: no-preference) {
	#samtykke-cc:not([hidden]) .scc__box { animation: scc-in .25s ease; }
	@keyframes scc-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
