/**
 * Einwilligungs-Banner für die Besucherstatistik.
 *
 * Was:   Weißes Fenster unten in der Mitte: Text, darunter der Knopf
 *        „Einverstanden“ über die ganze Breite, darunter mittig die
 *        Textknöpfe „Nur notwendige“ · „Mehr erfahren ˅“. „Mehr erfahren“
 *        klappt Häkchen und „Einstellungen speichern“ auf.
 * Warum: Passt zu den Knöpfen und Overlays der Website (Grün #7B8562,
 *        runde Ecken 15 px, Schrift Krub). „Nur notwendige“ ist gut lesbar
 *        (dunkle Schrift, 16 px, unterstrichen) und gleich auf der ersten
 *        Ansicht da – Ablehnen bleibt so einfach wie Zustimmen.
 * Wie:   Farben und Schrift über die Variablen aus theme.json; ohne das
 *        Kunterbunt-Theme greifen die Ersatzwerte.
 */

.kb-consent {
	--kb-consent-green: var(--wp--preset--color--gruen, #7b8562);
	--kb-consent-text: var(--wp--preset--color--text, #1d1d1b);
	--kb-consent-white: var(--wp--preset--color--weiss, #fff);

	position: fixed;
	right: 16px;
	bottom: 16px;
	left: 16px;
	z-index: 99999;
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	padding: 24px 28px;
	border: 2px solid var(--kb-consent-green);
	border-radius: 15px;
	background-color: var(--kb-consent-white);
	color: var(--kb-consent-text);
	font-family: var(--wp--preset--font-family--krub, Krub, sans-serif);
	font-size: 16px;
	line-height: 1.5;
	box-shadow: 0 10px 40px rgba(29, 29, 27, 0.35);
}

.kb-consent[hidden] {
	display: none;
}

.kb-consent__title {
	margin: 0 0 8px;
	color: var(--kb-consent-green);
	font-size: 20px;
	line-height: 1.3;
}

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

.kb-consent__text {
	margin: 0 0 18px;
}

.kb-consent__text a {
	color: var(--kb-consent-text);
	text-decoration: underline;
}

/* Auswahl „Mehr erfahren“: Häkchen mit Erklärung. */
.kb-consent {
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

.kb-consent__panel {
	margin: 16px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--kb-consent-green);
}

.kb-consent__panel[hidden] {
	display: none;
}

.kb-consent__option {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 10px;
	margin: 0 0 12px;
}

.kb-consent__option input {
	width: 22px;
	height: 22px;
	margin: 2px 0 0;
	accent-color: var(--kb-consent-green);
}

.kb-consent__option label {
	font-weight: 700;
}

.kb-consent__hint {
	grid-column: 2;
	margin: 2px 0 0;
	font-size: 15px;
}

.kb-consent__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

/* Knöpfe über die ganze Breite des Fensters (bündig mit dem Text). */
.kb-consent__button {
	box-sizing: border-box;
	flex: 1 1 100%;
	min-width: 0;
	min-height: 48px;
	padding: 10px 15px;
	border: 1px solid var(--kb-consent-green);
	border-radius: 15px;
	background-color: var(--kb-consent-green);
	color: var(--kb-consent-white);
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.5;
	cursor: pointer;
	transition: background-color 0.45s, color 0.35s;
}

.kb-consent__button:hover,
.kb-consent__button:focus-visible {
	background-color: var(--kb-consent-white);
	color: var(--kb-consent-green);
}

.kb-consent__button:focus-visible {
	outline: 3px solid var(--kb-consent-text, #1d1d1b);
	outline-offset: 2px;
}

/* Zeile „Nur notwendige · Mehr erfahren ˅“ unter dem großen Knopf. */
.kb-consent__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 0;
	margin: 10px 0 0;
}

.kb-consent__link {
	min-height: 44px;
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--kb-consent-text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.kb-consent__link:hover {
	color: var(--kb-consent-green);
}

.kb-consent__link:focus-visible {
	outline: 3px solid var(--kb-consent-text, #1d1d1b);
	outline-offset: 0;
}

/* Trennpunkt zwischen den beiden Textknöpfen. */
.kb-consent__separator {
	padding: 0 4px;
	font-weight: 700;
}

/* Pfeil bei „Mehr erfahren“; zeigt nach oben, wenn aufgeklappt. */
.kb-consent__link--more::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin: 0 0 4px 10px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s;
}

.kb-consent__link--more[aria-expanded="true"]::after {
	margin-bottom: 0;
	transform: rotate(-135deg);
}

@media (max-width: 600px) {
	.kb-consent {
		right: 8px;
		bottom: 8px;
		left: 8px;
		padding: 18px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kb-consent__button,
	.kb-consent__link--more::after {
		transition: none;
	}
}
