/*!
 * Simple Cookie Consent – styles.
 * Sizes are in em relative to a fixed 16px base so theme root font-size hacks don't shrink the UI.
 */

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

.scc,
.scc-floating {
	--scc-bg: #ffffff;
	--scc-text: #1f2328;
	--scc-muted: #57606a;
	--scc-border: #e1e4e8;
	--scc-section-bg: #f6f8fa;
	--scc-accent: #1f2328;
	--scc-accent-text: #ffffff;
	--scc-secondary-bg: #eaeef2;
	--scc-secondary-text: #1f2328;
	--scc-toggle-off: #a0a8b0;
	--scc-overlay: rgba(10, 12, 16, .55);
	--scc-shadow: 0 10px 40px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
	--scc-radius: 14px;
	--scc-btn-radius: 8px;
	--scc-z: 2147483600;
}

.scc-theme-dark .scc,
.scc-theme-dark .scc-floating {
	--scc-bg: #16191d;
	--scc-text: #e6e8eb;
	--scc-muted: #a3abb3;
	--scc-border: #2c3238;
	--scc-section-bg: #1e2227;
	--scc-accent: #e6e8eb;
	--scc-accent-text: #16191d;
	--scc-secondary-bg: #2c3238;
	--scc-secondary-text: #e6e8eb;
	--scc-toggle-off: #4b535b;
	--scc-overlay: rgba(0, 0, 0, .7);
	--scc-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
	.scc-theme-auto .scc,
	.scc-theme-auto .scc-floating {
		--scc-bg: #16191d;
		--scc-text: #e6e8eb;
		--scc-muted: #a3abb3;
		--scc-border: #2c3238;
		--scc-section-bg: #1e2227;
		--scc-accent: #e6e8eb;
		--scc-accent-text: #16191d;
		--scc-secondary-bg: #2c3238;
		--scc-secondary-text: #e6e8eb;
		--scc-toggle-off: #4b535b;
		--scc-overlay: rgba(0, 0, 0, .7);
		--scc-shadow: 0 10px 40px rgba(0, 0, 0, .6);
	}
}

/* ------------------------------------------------------------------ */
/* Base / defensive reset against theme styles                         */
/* ------------------------------------------------------------------ */

html.scc--locked {
	overflow: hidden;
}

.scc {
	font-size: 16px;
	line-height: 1.5;
	color: var(--scc-text);
	-webkit-font-smoothing: antialiased;
}

.scc *,
.scc *::before,
.scc *::after {
	box-sizing: border-box;
}

.scc [hidden] {
	display: none !important;
}

.scc .scc-title {
	margin: 0 0 .5em;
	padding: 0;
	font-family: inherit;
	font-size: 1.125em;
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	color: var(--scc-text);
}

.scc .scc-desc {
	font-size: .9375em;
	color: var(--scc-muted);
}

.scc .scc-desc p {
	margin: 0 0 .6em;
}

.scc .scc-desc p:last-child {
	margin-bottom: 0;
}

.scc a {
	color: var(--scc-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.scc a:hover {
	text-decoration-thickness: 2px;
}

/* Buttons */
.scc .scc-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 2.75em;
	margin: 0;
	padding: .65em 1.1em;
	border: 1px solid transparent;
	border-radius: var(--scc-btn-radius);
	font-family: inherit;
	font-size: .875em;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: none;
	cursor: pointer;
	transition: filter .15s ease, background-color .15s ease;
}

.scc .scc-btn--primary {
	background: var(--scc-accent);
	color: var(--scc-accent-text);
}

.scc .scc-btn--secondary {
	background: var(--scc-secondary-bg);
	color: var(--scc-secondary-text);
}

.scc .scc-btn:hover {
	filter: brightness(.92);
}

.scc-theme-dark .scc .scc-btn:hover {
	filter: brightness(1.15);
}

.scc .scc-btn:focus-visible,
.scc .scc-close:focus-visible,
.scc .scc-section__toggle:focus-visible {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

.scc .scc-btn-group {
	display: flex;
	gap: .5em;
}

.scc .scc-flip .scc-btn-group {
	flex-direction: row-reverse;
}

/* ------------------------------------------------------------------ */
/* Overlay                                                             */
/* ------------------------------------------------------------------ */

.scc-overlay {
	position: fixed;
	inset: 0;
	z-index: var(--scc-z);
	background: var(--scc-overlay);
	opacity: 0;
	transition: opacity .25s ease;
}

.scc-overlay.is-open {
	opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Consent banner                                                      */
/* ------------------------------------------------------------------ */

.scc-banner {
	position: fixed;
	z-index: calc(var(--scc-z) + 1);
	width: min(24em, calc(100vw - 2em));
	height: fit-content;
	max-height: calc(100vh - 2em);
	overflow: auto;
	background: var(--scc-bg);
	border: 1px solid var(--scc-border);
	border-radius: var(--scc-radius);
	box-shadow: var(--scc-shadow);
	opacity: 0;
	transform: translateY(.75em);
	transition: opacity .25s ease, transform .25s ease;
}

.scc-banner.is-open {
	opacity: 1;
	transform: none;
}

.scc-banner__inner {
	padding: 1.25em 1.25em 1em;
}

.scc-banner__actions {
	display: flex;
	flex-direction: column;
	gap: .5em;
	margin-top: 1.1em;
}

.scc-banner__footer {
	padding: .75em 1.25em;
	border-top: 1px solid var(--scc-border);
	font-size: .8125em;
	color: var(--scc-muted);
}

/* Positions (box / cloud) */
.scc-banner.scc-pos--bottom { bottom: 1em; }
.scc-banner.scc-pos--top { top: 1em; }
.scc-banner.scc-pos--middle { top: 0; bottom: 0; margin-top: auto; margin-bottom: auto; }
.scc-banner.scc-pos--left { left: 1em; }
.scc-banner.scc-pos--right { right: 1em; }
.scc-banner.scc-pos--center { left: 0; right: 0; margin-left: auto; margin-right: auto; }
.scc-banner.scc-pos--top { transform: translateY(-.75em); }
.scc-banner.scc-pos--top.is-open { transform: none; }

/* Wide box */
.scc-banner--wide {
	width: min(36em, calc(100vw - 2em));
}

/* Inline buttons */
.scc-banner--inline .scc-banner__actions {
	flex-direction: row;
	flex-wrap: wrap;
}

.scc-banner--inline .scc-btn-group {
	flex: 1 1 auto;
}

/* Cloud: wide card, text left / buttons right */
.scc-banner--cloud {
	width: min(56em, calc(100vw - 2em));
}

@media (min-width: 720px) {
	.scc-banner--cloud .scc-banner__inner {
		display: flex;
		align-items: center;
		gap: 2em;
	}

	.scc-banner--cloud .scc-banner__text {
		flex: 1 1 auto;
	}

	.scc-banner--cloud .scc-banner__actions {
		flex: 0 0 auto;
		min-width: 16em;
		margin-top: 0;
	}
}

/* Bar: full width, edge to edge */
.scc-banner--bar {
	left: 0;
	right: 0;
	width: auto;
	margin: 0;
	border-width: 1px 0;
	border-radius: 0;
}

.scc-banner--bar.scc-pos--bottom { bottom: 0; }
.scc-banner--bar.scc-pos--top { top: 0; }

.scc-banner--bar .scc-banner__inner,
.scc-banner--bar .scc-banner__footer {
	max-width: 72em;
	margin: 0 auto;
}

@media (min-width: 720px) {
	.scc-banner--bar .scc-banner__inner {
		display: flex;
		align-items: center;
		gap: 2em;
	}

	.scc-banner--bar .scc-banner__text {
		flex: 1 1 auto;
	}

	.scc-banner--bar .scc-banner__actions {
		flex: 0 0 auto;
		margin-top: 0;
	}
}

/* Phones: everything becomes a bottom sheet */
@media (max-width: 640px) {
	/* `.scc` prefix so these beat the `.scc-banner.scc-pos--*` rules above. */
	.scc .scc-banner {
		top: auto;
		bottom: .5em;
		left: .5em;
		right: .5em;
		width: auto;
		margin: 0;
		transform: translateY(.75em);
	}

	.scc .scc-banner.is-open {
		transform: none;
	}

	.scc .scc-banner--bar {
		bottom: 0;
		left: 0;
		right: 0;
	}

	.scc-banner .scc-btn-group {
		flex-direction: column;
	}

	.scc-banner.scc-flip .scc-btn-group {
		flex-direction: column-reverse;
	}

	.scc-banner--inline .scc-banner__actions {
		flex-direction: column;
	}
}

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

.scc-prefs {
	position: fixed;
	z-index: calc(var(--scc-z) + 2);
	display: flex;
	flex-direction: column;
	background: var(--scc-bg);
	box-shadow: var(--scc-shadow);
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
}

.scc-prefs.is-open {
	opacity: 1;
	transform: none;
}

/* Centered box */
.scc-prefs--box {
	inset: 0;
	margin: auto;
	width: min(42em, calc(100vw - 2em));
	height: fit-content;
	max-height: min(44em, calc(100vh - 2em));
	border: 1px solid var(--scc-border);
	border-radius: var(--scc-radius);
	transform: scale(.97);
}

/* Side panel */
.scc-prefs--bar {
	top: 0;
	bottom: 0;
	width: min(28em, 100vw);
	transform: translateX(100%);
}

.scc-prefs--bar.scc-pos--right { right: 0; border-left: 1px solid var(--scc-border); }
.scc-prefs--bar.scc-pos--left { left: 0; border-right: 1px solid var(--scc-border); transform: translateX(-100%); }
.scc-prefs--bar.is-open { transform: none; }

.scc-prefs__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: 1em 1.25em;
	border-bottom: 1px solid var(--scc-border);
}

.scc-prefs__header .scc-title {
	margin: 0;
}

.scc .scc-close {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25em;
	height: 2.25em;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--scc-secondary-bg);
	color: var(--scc-text);
	box-shadow: none;
	cursor: pointer;
}

.scc-prefs__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 1.25em;
	overscroll-behavior: contain;
}

.scc-prefs__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .5em;
	padding: 1em 1.25em;
	border-top: 1px solid var(--scc-border);
}

.scc-prefs__footer .scc-btn-group {
	flex: 1 1 auto;
}

.scc-prefs--bar .scc-prefs__footer,
.scc-prefs--bar .scc-prefs__footer .scc-btn-group {
	flex-direction: column;
}

@media (max-width: 640px) {
	.scc-prefs--box {
		width: calc(100vw - 1em);
		max-height: calc(100vh - 1em);
	}

	.scc-prefs__footer,
	.scc-prefs__footer .scc-btn-group {
		flex-direction: column;
	}
}

/* Sections */
.scc-section + .scc-section {
	margin-top: .75em;
}

.scc-section__title {
	margin: 0 0 .35em;
	font-size: 1em;
	font-weight: 650;
	color: var(--scc-text);
}

.scc-section--category {
	background: var(--scc-section-bg);
	border: 1px solid var(--scc-border);
	border-radius: 10px;
}

.scc-section__head {
	display: flex;
	align-items: center;
	gap: .75em;
	padding: .35em .9em .35em .35em;
}

.scc .scc-section__toggle {
	appearance: none;
	display: flex;
	align-items: center;
	gap: .65em;
	flex: 1 1 auto;
	min-height: 2.75em;
	margin: 0;
	padding: .4em .55em;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--scc-text);
	font-family: inherit;
	font-size: .9375em;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	box-shadow: none;
	cursor: pointer;
}

.scc-chevron {
	flex: 0 0 auto;
	width: .5em;
	height: .5em;
	margin: 0 .15em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform .2s ease;
}

.scc-section__toggle[aria-expanded="true"] .scc-chevron {
	transform: rotate(45deg);
}

.scc-section__desc {
	padding: 0 1.25em 1em 2.6em;
}

/* Switch */
.scc-switch {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	cursor: pointer;
}

.scc .scc-switch input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: inherit;
}

.scc-switch__track {
	position: relative;
	display: block;
	width: 2.75em;
	height: 1.5em;
	border-radius: 999px;
	background: var(--scc-toggle-off);
	transition: background-color .2s ease;
}

.scc-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: calc(1.5em - 6px);
	height: calc(1.5em - 6px);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .2s ease;
}

.scc-switch input:checked + .scc-switch__track {
	background: var(--scc-accent);
}

.scc-theme-dark .scc-switch input:checked + .scc-switch__track::after {
	background: var(--scc-bg);
}

.scc-switch input:checked + .scc-switch__track::after {
	transform: translateX(1.25em);
}

.scc-switch input:focus-visible + .scc-switch__track {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

.scc-switch--locked {
	cursor: not-allowed;
	opacity: .55;
}

/* ------------------------------------------------------------------ */
/* Floating "cookie settings" button                                   */
/* ------------------------------------------------------------------ */

.scc-floating {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: calc(var(--scc-z) - 1);
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--scc-border);
	border-radius: 50%;
	background: var(--scc-bg);
	color: var(--scc-text);
	box-shadow: var(--scc-shadow);
	cursor: pointer;
	transition: transform .15s ease;
}

.scc-floating:hover,
.scc-floating:focus-visible {
	transform: scale(1.08);
}

.scc-floating:focus-visible {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

.scc-floating[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.scc *,
	.scc-floating {
		transition: none !important;
	}
}

@media print {
	.scc,
	.scc-floating {
		display: none !important;
	}
}
