/**
 * Bricks Consent — nur essenzielle Styles.
 *
 * Das eigentliche Banner-/Popup-Design wird vollständig im Bricks Builder
 * gebaut. Diese Datei liefert nur minimale, optionale Hilfen:
 *   - einen Floating-Button-Style (Opt-in über die Klasse .bconsent-floating)
 *   - eine Sichtbarkeits-Hilfsklasse am <html>, an die der Admin sein
 *     Banner per CSS koppeln kann, falls die Bricks-Popup-API nicht greift.
 *
 * @package BricksConsent
 */

/* Optionaler Floating-Widerrufs-Button.
   Auf ein Bricks-Element mit data-bconsent-open-banner anwendbar,
   indem dort zusätzlich die Klasse .bconsent-floating gesetzt wird. */
.bconsent-floating {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #1e1e1e;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bconsent-floating:hover,
.bconsent-floating:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	outline: none;
}

/* Fallback-Sichtbarkeitssteuerung:
   Wenn die Bricks-Popup-API nicht verfügbar ist, kann ein im Markup
   vorhandenes Banner über diese Klasse ein-/ausgeblendet werden. */
.bconsent-banner-fallback {
	display: none;
}

html.bconsent-banner-visible .bconsent-banner-fallback {
	display: block;
}

/* Hinweis: Gemäß EDPB 3/2022 dürfen „Ablehnen" und „Akzeptieren"
   visuell NICHT unterschiedlich gewichtet werden. Etwaige Button-Styles
   bitte im Bricks Builder bewusst gleichwertig gestalten. */

/* ---------------------------------------------------------------------------
   Kategorie-Toggles als Checkbox darstellen.
   Wirkt auf JEDES Element mit data-bconsent-toggle (nativer Bricks-Button,
   Div, Text …). Den Zustand setzt bconsent.js über aria-checked /
   .bconsent-toggle-on. Alles über currentColor → passt sich der Textfarbe an
   und ist in Bricks frei überschreibbar.
   --------------------------------------------------------------------------- */
[data-bconsent-toggle] {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	cursor: pointer;
	user-select: none;
}

[data-bconsent-toggle]::before {
	content: "";
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 1.15em;
	height: 1.15em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid currentColor;
	border-radius: var(--radius-s);
	font-size: 0.85em;
	font-weight: 700;
	line-height: 1;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

/* Aktiv: Häkchen anzeigen (✓ in currentColor, Box bleibt umrandet). */
[data-bconsent-toggle][aria-checked="true"]::before,
[data-bconsent-toggle].bconsent-toggle-on::before {
	content: "\2713";
}

[data-bconsent-toggle]:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Essenziell ist immer an und nicht abwählbar. */
[data-bconsent-toggle="essential"] {
	cursor: default;
	opacity: 0.45;
}

/* ---------------------------------------------------------------------------
   Toggle-Chrome-Reset (saubere Checkbox-Zeilen).
   Ist der Toggle ein nativer Bricks-Button, so entkleiden wir ihn vom
   Button-CHROME — Hintergrund, Rahmen, Schatten, Radius, Hover-Farbe — sodass
   nur noch die Checkbox-Zeile bleibt: ::before-Kästchen + Label. Damit muss der
   Admin die Bricks-Buttons nicht mehr manuell entkleiden.

   Bewusst NUR Chrome: Padding, Breite, Font und Ausrichtung bleiben bei Bricks
   bzw. beim Admin (das native Button-Padding sorgt für die saubere Einrückung
   der Kästchen unter dem Fließtext — würden wir es entfernen, ragten die Boxen
   links aus dem Textblock heraus).

   Selektor deckt alle Bricks-Button-Renderings ab: Bricks gibt das Button-
   Element je nach Kontext als <span>/<a>/<button> mit .bricks-button aus (live
   auf seite1: <span class="brxe-button bricks-button">). Spezifität 0,2,0
   (.bricks-button + Attribut) schlägt Bricks' Default-Theme (.bricks-button,
   0,1,0), bleibt aber von element-spezifischen Regeln (#brxe-…, 1,0,0) frei
   übersteuerbar → Bricks-First bleibt gewahrt.
   --------------------------------------------------------------------------- */
button[data-bconsent-toggle],
a[data-bconsent-toggle],
.bricks-button[data-bconsent-toggle] {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	text-decoration: none;
}

/* Kein Button-typischer Hover-/Fokus-Hintergrund auf der Checkbox-Zeile
   (überschreibt .bricks-button:hover, 0,2,0 — hier 0,3,0). Der sichtbare
   Fokus-Ring kommt weiterhin aus der :focus-visible-Regel oben. */
button[data-bconsent-toggle]:hover,
button[data-bconsent-toggle]:focus,
a[data-bconsent-toggle]:hover,
a[data-bconsent-toggle]:focus,
.bricks-button[data-bconsent-toggle]:hover,
.bricks-button[data-bconsent-toggle]:focus {
	background: transparent;
	box-shadow: none;
	color: inherit;
}

/* ===========================================================================
   Zweistufiges Banner (RCB-Stil): Kompaktansicht ⇄ Detailansicht.

   Sichtbarkeit steuert bconsent.js über .bconsent-hidden. Die data-bconsent-el-
   Marker liefern die Default-Optik (gleichwertige Vollbreiten-Buttons, Karten,
   Links) und sind — wie der Toggle-Reset — per #brxe-… bzw. eigenen Bricks-
   Styles frei übersteuerbar (Bricks-First). Buttons rendern in Bricks als
   .bricks-button (span/a/button) → Selektoren decken alle drei ab.
   =========================================================================== */

/* Ansicht-Umschaltung: display:none !important schlägt Bricks' per-ID/-Klasse
   gesetztes display zuverlässig. */
.bconsent-hidden {
	display: none !important;
}

/* Gleichwertige Vollbreiten-Buttons — „Akzeptieren" und „Ablehnen/Weiter ohne
   Einwilligung" identisch gewichtet (EDPB 3/2022, keine Dark Patterns). */
button[data-bconsent-el="btn-primary"],
a[data-bconsent-el="btn-primary"],
.bricks-button[data-bconsent-el="btn-primary"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0.85em 1.25em;
	background: var(--action);
	border: 0;
	border-radius:var(--radius-s);
	color: #fff;
	font-size: calc(var(--text-s) * 1.1);
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.12s ease;
}
button[data-bconsent-el="btn-primary"]:hover,
a[data-bconsent-el="btn-primary"]:hover,
.bricks-button[data-bconsent-el="btn-primary"]:hover,
button[data-bconsent-el="btn-primary"]:focus-visible,
a[data-bconsent-el="btn-primary"]:focus-visible,
.bricks-button[data-bconsent-el="btn-primary"]:focus-visible {
	background: var(--secondary);
	color: #fff;
}

/* Textlink „Privatsphäre-Einstellungen individuell festlegen" / „Zurück". */
button[data-bconsent-el="link"],
a[data-bconsent-el="link"],
.bricks-button[data-bconsent-el="link"] {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0.4em 0;
	background: transparent;
	border: 0;
	color: var(--action);
	font-size: var(--text-s);
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
button[data-bconsent-el="link"]:hover,
a[data-bconsent-el="link"]:hover,
.bricks-button[data-bconsent-el="link"]:hover {
	color: var(--secondary);
}

/* Fußzeile mit Rechtstext-Links (Datenschutz • Impressum). */
[data-bconsent-el="footer"] {
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
}
button[data-bconsent-el="footlink"],
a[data-bconsent-el="footlink"],
.bricks-button[data-bconsent-el="footlink"] {
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--action);
	text-decoration: none;
	cursor: pointer;
}

/* Detailansicht: zweispaltiger Kopf (Text | Aktionen), auf schmalen Viewports
   einspaltig. */
[data-bconsent-el="cols"] {
	align-items: start;
}
@media (max-width: 640px) {
	[data-bconsent-el="cols"] {
		grid-template-columns: 1fr !important;
	}
}

/* Kategorie-Karten (Umriss wie im RCB-Stil). */
[data-bconsent-el="card"] {
	border: var(--border-size) solid var(--border-color-dark);
	border-radius: var(--radius-m);
	padding: var(--space-xs);
}
[data-bconsent-el="card"] [data-bconsent-toggle] {
	font-weight: 600;
}

/* ===========================================================================
   Content-Blocker-Platzhalter ("Klick zum Laden") für blockierte Einbettungen
   (Bricks-Karten, YouTube/Vimeo-iframes). Erzeugt/entfernt von bconsent.js.
   =========================================================================== */

/* Host (z. B. .brxe-map), über dem ein Overlay-Platzhalter liegt. */
.bconsent-host {
	position: relative;
}

.bconsent-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
	background: #e8eaed;
	color: #202124;
}

/* Overlay über einem Host (Karte) — füllt dessen Fläche. */
.bconsent-placeholder.bconsent-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
}

/* Standard-Hintergrund für Karten-Overlays: selbstgehostetes, stilisiertes
   Karten-SVG (kein externer Request). Per data-bconsent-poster überschreibbar. */
.bconsent-placeholder.bconsent-overlay::before {
	background-image: var(--bconsent-poster, url("../img/map-placeholder.svg"));
}

/* Eigenständige Ersatzbox (iframe-Ersatz). */
.bconsent-placeholder.bconsent-standalone {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	min-height: 220px;
}

/* Optionaler (unscharfer) Hintergrund aus --bconsent-poster. */
.bconsent-placeholder::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: var(--bconsent-poster, none);
	background-size: cover;
	background-position: center;
	filter: blur(6px);
	transform: scale(1.08);
	opacity: 0.9;
}

.bconsent-ph-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75em;
	max-width: 90%;
	padding: 1em;
	text-align: center;
}

.bconsent-ph-title {
	display: inline-block;
	padding: 0.3em 0.7em;
	background: rgba(60, 64, 67, 0.85);
	color: #fff;
	border-radius: var(--radius-s);
	font-size: calc(var(--text-s) * 1.3);
	line-height: 1.2;
}

.bconsent-ph-btn {
	appearance: none;
	-webkit-appearance: none;
	padding: 0.6em 1.15em;
	background: var(--action);
	border: 0;
	border-radius: var(--radius-s);
	color: #fff;
	font-size: calc(var(--text-s) * 1.3);
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.12s ease;
}
.bconsent-ph-btn:hover,
.bconsent-ph-btn:focus-visible {
	background: var(--secondary);
	color: #fff;
}

.bconsent-ph-note {
	margin: 0;
	max-width: 34ch;
	font-size: 1.1rem;
	line-height: 1.35;
	color: #3c4043;
}
