/**
 * Consentum – Dialog und Platzhalter.
 * Farben kommen als CSS-Variablen aus der Style-Variation des Themes.
 *
 * Copyright (c) 2026 Smart Artist / Benjamin Hartwich
 * License: GPL-2.0-or-later
 */

.cst {
	--cst-abstand: clamp(1rem, 3vw, 1.75rem);
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgb(0 0 0 / 0.45);
	font: inherit;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.cst[hidden] {
	display: none;
}

.cst--box-unten {
	align-items: flex-end;
	background: none;
	pointer-events: none;
}

.cst--leiste {
	inset: auto 0 0;
	padding: 0;
	background: none;
}

.sac__box {
	box-sizing: border-box;
	width: min(100%, 36rem);
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	overflow: auto;
	padding: var(--cst-abstand);
	background: var(--cst-bg);
	color: var(--cst-text);
	border-radius: 0.5rem;
	box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 0.2);
	pointer-events: auto;
	outline: none;
}

.cst--leiste .sac__box {
	width: 100%;
	max-height: 70vh;
	border-radius: 0;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0 var(--cst-abstand);
	align-items: center;
}

.cst--leiste .sac__logo,
.cst--leiste .sac__titel {
	grid-column: 1 / -1;
}

.cst--leiste.cst--details .sac__box {
	display: block;
}

.sac__logo {
	display: block;
	width: auto;
	max-width: 10rem;
	height: 2.5rem;
	object-fit: contain;
	margin-bottom: 1rem;
}

.sac__titel {
	margin: 0 0 0.5rem;
	font-size: 1.15em;
	font-weight: 600;
}

.sac__text p {
	margin: 0 0 0.75rem;
}

.cst a {
	color: inherit;
	text-decoration-color: var(--cst-akzent);
	text-underline-offset: 0.15em;
}

.sac__knoepfe {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* Alle Knöpfe gleich gewichtet: keine Wahl wird optisch bevorzugt. */
.sac__knopf {
	flex: 1 1 10rem;
	min-height: 2.75rem;
	padding: 0.6rem 1rem;
	border: 2px solid var(--cst-akzent);
	border-radius: 0.375rem;
	background: var(--cst-akzent);
	color: var(--cst-akzent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sac__knopf:hover,
.sac__knopf:focus-visible {
	filter: brightness(0.92);
}

.sac__knopf:focus-visible,
.cst input:focus-visible,
.cst summary:focus-visible {
	outline: 3px solid var(--cst-akzent);
	outline-offset: 2px;
}

.sac__knopf[hidden] {
	display: none;
}

.sac__links {
	margin: 0.75rem 0 0;
	font-size: 0.85em;
}

.sac__details {
	margin-top: 1rem;
}

.sac__gruppe {
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem;
	border: 1px solid color-mix(in srgb, var(--cst-text) 20%, transparent);
	border-radius: 0.375rem;
}

.sac__gruppe legend {
	padding: 0 0.25rem;
	font-weight: 600;
}

.sac__gruppe p,
.sac__gruppe dl {
	margin: 0.25rem 0;
	font-size: 0.9em;
}

.sac__gruppe ul {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.sac__gruppe li {
	padding: 0.5rem 0;
	border-top: 1px solid color-mix(in srgb, var(--cst-text) 12%, transparent);
}

.sac__gruppe dt {
	float: left;
	clear: left;
	width: 6.5rem;
	opacity: 0.75;
}

.sac__gruppe dd {
	margin-left: 6.5rem;
}

.cst input[type="checkbox"] {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--cst-akzent);
	vertical-align: -0.15em;
}

.cst summary {
	cursor: pointer;
	font-size: 0.9em;
}

/* Platzhalter für gesperrte Inhalte */
.cst-cb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 12rem;
	padding: 1.5rem;
	background: color-mix(in srgb, currentColor 6%, transparent);
	border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	border-radius: 0.375rem;
	text-align: center;
}

.cst-cb__ph {
	max-width: 32rem;
	font-size: 0.9375rem;
}

.cst-cb__ph p {
	margin: 0 0 0.75rem;
}

.cst-cb__titel {
	font-weight: 600;
}

.cst-cb__knoepfe {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.cst-cb .sac__knopf {
	flex: 0 1 auto;
	--cst-akzent: var(--wp--preset--color--primary, #1f1f1f);
	--cst-akzent-text: var(--wp--preset--color--base, #fff);
}

.sac__knopf--leise {
	background: transparent;
	color: inherit;
}

.cst-oeffnen {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
	.sac__box {
		animation: cst-ein 0.2s ease-out;
	}

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