/* Simple Cookie Consent
 * Override any of these variables in your theme to restyle the banner. */
.scc-banner,
.scc-reopen {
	--scc-accent: #2f4bd8;
	--scc-on-accent: #ffffff;
	--scc-surface: #ffffff;
	--scc-text: #1f2328;
	--scc-muted: #57606a;
	--scc-line: #d8dee4;
	--scc-radius: 10px;
	--scc-z: 2147483000;
}

.scc-banner[hidden],
.scc-overlay[hidden],
.scc-reopen[hidden],
.scc-banner [hidden] {
	display: none !important;
}

/* ---------- Panel ---------- */
.scc-banner {
	position: fixed;
	z-index: var(--scc-z);
	box-sizing: border-box;
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--scc-surface);
	color: var(--scc-text);
	border: 1px solid var(--scc-line);
	border-radius: var(--scc-radius);
	box-shadow: 0 1px 2px rgba(31, 35, 40, 0.08), 0 12px 32px rgba(31, 35, 40, 0.16);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}

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

.scc-banner:focus {
	outline: none;
}

.scc-banner--bar {
	left: 1rem;
	bottom: 1rem;
	width: min(27.5rem, calc(100vw - 2rem));
}

.scc-banner--bar.scc-banner--expanded {
	width: min(34rem, calc(100vw - 2rem));
}

.scc-banner--modal {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(36rem, calc(100vw - 2rem));
}

.scc-overlay {
	position: fixed;
	inset: 0;
	z-index: calc(var(--scc-z) - 1);
	background: rgba(15, 18, 22, 0.45);
}

.scc-panel {
	padding: 1.25rem 1.25rem 1rem;
}

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

.scc-banner .scc-text {
	margin: 0 0 1rem;
	color: var(--scc-muted);
}

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

/* ---------- Categories ---------- */
.scc-prefs {
	margin: 0 0 1rem;
	border-top: 1px solid var(--scc-line);
}

.scc-cat {
	padding: 0.875rem 0;
	border-bottom: 1px solid var(--scc-line);
}

.scc-cat__head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.scc-banner .scc-cat__label {
	flex: 1;
	margin: 0;
	font-weight: 600;
	color: var(--scc-text);
	cursor: pointer;
}

.scc-cat__always {
	font-size: 0.8125rem;
	color: var(--scc-muted);
}

.scc-banner .scc-cat__desc {
	margin: 0.25rem 0 0;
	font-size: 0.875rem;
	color: var(--scc-muted);
}

.scc-cat__cookies {
	margin-top: 0.375rem;
	font-size: 0.8125rem;
	color: var(--scc-muted);
}

.scc-cat__cookies summary {
	cursor: pointer;
	color: var(--scc-accent);
	width: max-content;
}

.scc-cat__cookies ul {
	margin: 0.375rem 0 0;
	padding-left: 1.1rem;
}

.scc-cat__cookies li {
	margin: 0.125rem 0;
}

.scc-banner code {
	font-size: 0.9em;
	background: none;
	padding: 0;
	color: var(--scc-text);
}

.scc-banner .scc-consent-id {
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	color: var(--scc-muted);
	word-break: break-all;
}

/* Toggle switch */
.scc-banner .scc-toggle {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: none;
	width: 2.5rem;
	height: 1.5rem;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: #8c959f;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.scc-banner .scc-toggle::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 1.125rem;
	height: 1.125rem;
	border-radius: 50%;
	background: #ffffff;
	transition: transform 0.15s ease;
}

.scc-banner .scc-toggle:checked {
	background: var(--scc-accent);
}

.scc-banner .scc-toggle:checked::after {
	transform: translateX(1rem);
}

.scc-banner .scc-toggle:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------- Buttons ---------- */
.scc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.scc-banner .scc-btn {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	border-radius: calc(var(--scc-radius) - 4px);
	cursor: pointer;
	box-shadow: none;
}

/* Accept and Reject are deliberately identical: equal prominence. */
.scc-banner .scc-btn--choice {
	flex: 1 1 0;
	min-width: 8rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--scc-accent);
	background: var(--scc-accent);
	color: var(--scc-on-accent);
}

.scc-banner .scc-btn--choice:hover {
	filter: brightness(1.08);
}

.scc-banner .scc-btn--quiet {
	flex: 1 0 100%;
	padding: 0.5rem;
	border: 0;
	background: transparent;
	color: var(--scc-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.scc-banner .scc-btn--quiet[data-scc-action="save"] {
	order: -1;
	padding: 0.75rem 1rem;
	border: 1px solid var(--scc-text);
	text-decoration: none;
}

.scc-banner .scc-btn:focus-visible,
.scc-banner .scc-toggle:focus-visible,
.scc-banner a:focus-visible,
.scc-banner summary:focus-visible,
.scc-reopen:focus-visible,
.scc-open-settings:focus-visible {
	outline: 2px solid var(--scc-accent);
	outline-offset: 2px;
}

/* ---------- Reopen button ---------- */
.scc-reopen {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: calc(var(--scc-z) - 2);
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 1px solid var(--scc-line);
	border-radius: 50%;
	background: var(--scc-surface);
	color: var(--scc-accent);
	box-shadow: 0 2px 8px rgba(31, 35, 40, 0.15);
	cursor: pointer;
}

.scc-open-settings {
	-webkit-appearance: none;
	appearance: none;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
	.scc-banner--bar:not([hidden]) {
		animation: scc-rise 0.2s ease-out;
	}
}

@keyframes scc-rise {
	from {
		opacity: 0;
		transform: translateY(0.5rem);
	}
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
	.scc-banner--bar,
	.scc-banner--bar.scc-banner--expanded {
		left: 0.5rem;
		right: 0.5rem;
		bottom: 0.5rem;
		width: auto;
	}

	.scc-banner .scc-btn--choice {
		flex-basis: 100%;
	}
}

/* ---------- Cookie declaration shortcode ---------- */
.scc-declaration__scroll {
	overflow-x: auto;
	margin-bottom: 1.5em;
}

.scc-declaration__table {
	width: 100%;
	border-collapse: collapse;
}

.scc-declaration__table th,
.scc-declaration__table td {
	padding: 0.5em 0.75em;
	border-bottom: 1px solid rgba(127, 127, 127, 0.3);
	text-align: left;
	vertical-align: top;
}
