/* Bedienhilfen — Bedienelemente und die Wirkung der Schalter.
   Die Wirkungsregeln stehen bewusst am Ende: Sie müssen fremde Theme-Regeln
   überschreiben, und dafür gibt es außer !important kein verlässliches Mittel
   in einer Umgebung, deren CSS wir nicht kennen. */

/* --- Bedienelemente ----------------------------------------------------- */

.cis-barriere-bedienhilfen {
	position: fixed;
	z-index: 99999;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 1rem;
	line-height: 1.4;
}

.cis-barriere-pos-unten-rechts {
	right: 1rem;
	bottom: 1rem;
}

.cis-barriere-pos-unten-links {
	left: 1rem;
	bottom: 1rem;
}

/* Im Fluss: das Widget steht dort, wo der Gestalter es setzt. */
.cis-barriere-pos-im-fluss {
	position: static;
}

.cis-barriere-bedienhilfen button {
	font: inherit;
	cursor: pointer;
	border-radius: 3px;
	/* Zielgröße nach WCAG 2.2 (2.5.8) mit Abstand über dem Mindestmaß. */
	min-height: 2.75rem;
	padding: 0.6rem 1rem;
	background: #1d2327;
	color: #fff;
	border: 2px solid #1d2327;
}

.cis-barriere-bedienhilfen button:hover {
	background: #000;
}

.cis-barriere-bedienhilfen button:focus-visible {
	outline: 3px solid #135e96;
	outline-offset: 2px;
}

/* Gedrückter Zustand: nicht nur Farbe, sondern auch Rahmen und Häkchen —
   sonst ist der Zustand ohne Farbsehen nicht erkennbar. */
.cis-barriere-bedienhilfen button[aria-pressed="true"] {
	background: #fff;
	color: #1d2327;
	border-color: #1d2327;
	font-weight: 700;
}

.cis-barriere-bedienhilfen button[aria-pressed="true"]::after {
	content: " \2713";
}

.cis-barriere-symbol {
	font-size: 1.1em;
}

.cis-barriere-panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.5rem);
	width: min(22rem, calc(100vw - 2rem));
	max-height: min(32rem, calc(100vh - 4rem));
	overflow-y: auto;
	padding: 1rem;
	background: #fff;
	color: #1d2327;
	border: 2px solid #1d2327;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.cis-barriere-pos-unten-links .cis-barriere-panel {
	right: auto;
	left: 0;
}

.cis-barriere-pos-im-fluss .cis-barriere-panel {
	position: static;
	width: auto;
	box-shadow: none;
}

.cis-barriere-panel[hidden] {
	display: none;
}

.cis-barriere-panel .cis-barriere-gruppe {
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	margin: 0 0 0.75rem;
	padding: 0.5rem 0.75rem 0.75rem;
}

.cis-barriere-panel legend {
	font-weight: 600;
	padding: 0 0.25rem;
}

.cis-barriere-panel .cis-barriere-stufe {
	margin: 0.25rem 0.25rem 0 0;
}

.cis-barriere-schalterzeile {
	margin: 0 0 0.5rem;
}

.cis-barriere-schalterzeile .cis-barriere-schalter,
.cis-barriere-panel-fuss button {
	width: 100%;
	text-align: left;
}

.cis-barriere-panel-hinweis {
	margin: 0.75rem 0 0;
	font-size: 0.85rem;
}

/* --- Wirkung der Schalter ---------------------------------------------- */

/* Schriftgröße über die Wurzel: rem-basierte Elementor-Layouts wachsen mit,
   px-Angaben nicht — deshalb zusätzlich eine Skalierung für Fließtext. */
html.cisb-schrift {
	font-size: calc(100% * var(--cisb-schrift, 1));
}

html.cisb-zeilen body {
	line-height: 1.9 !important;
	letter-spacing: 0.02em !important;
	word-spacing: 0.1em !important;
}

html.cisb-links a {
	text-decoration: underline !important;
	text-underline-offset: 0.15em;
	font-weight: 700 !important;
}

html.cisb-kontrast body,
html.cisb-kontrast :is(p, li, td, th, dd, dt, span, div, h1, h2, h3, h4, h5, h6) {
	color: #000 !important;
	background-color: #fff !important;
	text-shadow: none !important;
}

html.cisb-kontrast a {
	color: #00348b !important;
	text-decoration: underline !important;
}

html.cisb-kontrast :is(button, .elementor-button) {
	color: #fff !important;
	background-color: #00348b !important;
	border-color: #00348b !important;
}

/* Die Toolbar selbst behält ihr Aussehen — sonst verschwindet der gedrückte
   Zustand hinter den Kontrastregeln. */
html.cisb-kontrast .cis-barriere-bedienhilfen :is(button, p, div, legend) {
	color: inherit !important;
	background-color: inherit !important;
}

html.cisb-bewegung *,
html.cisb-bewegung *::before,
html.cisb-bewegung *::after {
	animation-play-state: paused !important;
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}

/* Wer Bewegungsreduktion im System eingestellt hat, bekommt sie auch ohne
   Schalter — die Systemeinstellung ist die verbindlichere Aussage. */
@media (prefers-reduced-motion: reduce) {
	.cis-barriere-bedienhilfen * {
		transition: none !important;
		animation: none !important;
	}
}
