/**
 * BALSA Zäune Consent: banner, settings panel, settings link, YouTube placeholder.
 *
 * scripts/generuj.py replaces the block between the markers with the colors of the site.
 */

.bz-consent,
.bz-consent-open,
.bz-embed {
	--bzc-base: #242222;
	--bzc-surface: #2e2b2a;
	--bzc-line: #4a4542;
	--bzc-ink: #f7f3ec;
	--bzc-text: #f7f3ec;
	--bzc-muted: #cfc8bc;
	--bzc-accent: #ce9d81;
	--bzc-on-accent: #1b1a1a;
	--bzc-accent-text: #ce9d81;
	--bzc-radius: 0px;
}

.bz-consent-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Banner ------------------------------------------------------------------------------ */

.bz-consent {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999;
	max-height: 85vh;
	max-height: 85dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	box-sizing: border-box;
	border-top: 1px solid var(--bzc-line);
	background: var(--bzc-surface);
	box-shadow: 0 -6px 24px rgb(0 0 0 / 0.14);
	color: var(--bzc-text);
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

.bz-consent[hidden],
.bz-consent [hidden] {
	display: none !important;
}

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

.bz-consent__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px 16px max(16px, env(safe-area-inset-bottom));
}

.bz-consent__layer {
	display: grid;
	gap: 4px 32px;
	grid-template-columns: minmax(0, 1fr);
}

.bz-consent__title {
	margin: 0 0 4px;
	color: var(--bzc-ink);
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.bz-consent__title:focus {
	outline: none;
}

.bz-consent__title:focus-visible {
	outline: 3px solid var(--bzc-ink);
	outline-offset: 2px;
}

.bz-consent__text {
	margin: 0;
	max-width: 75ch;
}

.bz-consent__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 16px;
	margin: 0;
}

.bz-consent a {
	color: var(--bzc-accent-text);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.bz-consent__links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

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

.bz-consent a:focus-visible,
.bz-consent button:focus-visible,
.bz-consent summary:focus-visible,
.bz-consent input:focus-visible,
.bz-consent-open:focus-visible,
.bz-embed a:focus-visible,
.bz-embed button:focus-visible,
.bz-embed__frame:focus-visible {
	outline: 3px solid var(--bzc-ink);
	outline-offset: 2px;
}

/* The three decision buttons share one look and size (no "nudging"). */
.bz-consent__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-top: 8px;
}

.bz-consent__button,
.bz-embed__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 44px;
	margin: 0;
	padding: 10px 16px;
	border: 2px solid var(--bzc-accent);
	border-radius: var(--bzc-radius);
	background: var(--bzc-accent);
	color: var(--bzc-on-accent);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
}

.bz-consent__button:hover,
.bz-embed__button:hover {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

@media (min-width: 960px) {
	.bz-consent__layer {
		grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
	}

	.bz-consent__layer > .bz-consent__actions {
		grid-column: 2;
		grid-row: 1 / span 3;
		align-self: center;
		margin-top: 0;
	}
}

@media (max-width: 559px) {
	.bz-consent__actions {
		grid-template-columns: minmax(0, 1fr);
	}

	.bz-consent__inner {
		padding-top: 12px;
	}

	.bz-consent__text {
		font-size: 15px;
	}
}

/* Settings panel ---------------------------------------------------------------------- */

.bz-consent.is-prefs .bz-consent__inner {
	max-width: 760px;
}

.bz-consent__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.bz-consent__close {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--bzc-line);
	border-radius: var(--bzc-radius);
	background: transparent;
	color: var(--bzc-ink);
	cursor: pointer;
}

.bz-consent__cats {
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.bz-consent__cat {
	margin: 0 0 8px;
	padding: 4px 12px;
	border: 1px solid var(--bzc-line);
	border-radius: var(--bzc-radius);
	background: var(--bzc-base);
}

.bz-consent__cat-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	min-height: 44px;
}

.bz-consent__cat-head label {
	flex: 1 1 auto;
	padding: 10px 0;
	color: var(--bzc-ink);
	font-weight: 700;
	cursor: pointer;
}

.bz-consent__badge {
	color: var(--bzc-muted);
	font-size: 14px;
}

/* Switch: a styled checkbox (role="switch"), knob drawn with gradients so no pseudo-elements are needed. */
.bz-consent__switch {
	flex: none;
	width: 44px;
	height: 26px;
	margin: 9px 0;
	border: 2px solid var(--bzc-muted);
	border-radius: 13px;
	background: radial-gradient(circle at 11px 50%, var(--bzc-muted) 7px, transparent 8px) var(--bzc-base);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.bz-consent__switch:checked {
	border-color: var(--bzc-accent);
	background: radial-gradient(circle at calc(100% - 11px) 50%, var(--bzc-on-accent) 7px, transparent 8px) var(--bzc-accent);
}

.bz-consent__switch:disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.bz-consent__details summary {
	display: flex;
	align-items: center;
	min-height: 44px;
	color: var(--bzc-accent-text);
	cursor: pointer;
}

.bz-consent__facts {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 4px 16px;
	margin: 0 0 12px;
	font-size: 15px;
}

.bz-consent__facts dt {
	color: var(--bzc-ink);
	font-weight: 700;
}

.bz-consent__facts dd {
	margin: 0;
}

@media (max-width: 559px) {
	.bz-consent__facts {
		grid-template-columns: minmax(0, 1fr);
	}

	.bz-consent__facts dd {
		margin-bottom: 6px;
	}
}

/* Settings link (footer block, shortcode) ---------------------------------------------- */

.bz-consent-open {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	cursor: pointer;
}

/* YouTube placeholder ----------------------------------------------------------------- */

.bz-embed {
	position: relative;
	display: grid;
	aspect-ratio: 16 / 9;
	border-radius: var(--bzc-radius);
	background: #1d232a;
	color: #f1f3f5;
	font-size: 16px;
	line-height: 1.45;
}

.bz-embed__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: cover;
}

.bz-embed__thumb--none {
	background: linear-gradient(135deg, #2e363f, #14181c);
}

.bz-embed__overlay {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	border-radius: inherit;
	background: rgb(20 24 28 / 0.8);
	text-align: center;
}

.bz-embed__title {
	margin: 0;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
}

.bz-embed__notice {
	max-width: 60ch;
	margin: 0;
	font-size: 14px;
}

.bz-embed__notice a,
.bz-embed__link a {
	color: #fff;
	text-decoration: underline;
}

.bz-embed__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.bz-embed__actions[hidden] {
	display: none;
}

.bz-embed__link {
	margin: 0;
	font-size: 14px;
}

.bz-embed__link a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

/* The placeholder is always dark, so its focus ring is always light. */
.bz-embed a:focus-visible,
.bz-embed button:focus-visible {
	outline-color: #fff;
}

.bz-embed.is-loaded {
	background: #000;
}

.bz-embed__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: inherit;
}

@media (prefers-reduced-motion: no-preference) {
	.bz-consent__switch {
		transition: background-position 0.15s ease;
	}
}

@media (forced-colors: active) {
	.bz-consent__switch {
		border-color: CanvasText;
	}

	.bz-consent__switch:checked {
		background: Highlight;
	}
}
