/* zeTZsche Barrierefreiheit – Styles
 * Farben/Schrift kommen als CSS-Variablen aus den Backend-Einstellungen (:root). */

:root {
	--zb-bg: #1a1a1a;
	--zb-bg-text: #fff;
	--zb-accent: #39ff14;
	--zb-accent-text: #000;
	--zb-dark-bg: #000;
	--zb-dark-text: #fff;
	--zb-dark-link: #ff0;
	--zb-light-bg: #fff;
	--zb-light-text: #000;
	--zb-light-link: #00c;
	--zb-link-bg: #ffef00;
	--zb-link-text: #000;
	--zb-head-bg: #fff3a0;
	--zb-head-text: #000;
	--zb-head-border: #000;
	--zb-focus: #ffd500;
	--zb-font: Verdana, Arial, sans-serif;
}

/* ---------- Eigene Oberfläche (von Seiteneffekten ausgenommen) ---------- */
.zb-a11y-ui,
.zb-a11y-ui * {
	box-sizing: border-box;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	text-shadow: none !important;
}
.zb-a11y-ui button,
.zb-a11y-ui select,
.zb-a11y-ui a {
	font-size: 16px !important;
	line-height: 1.3 !important;
	text-transform: none !important;
}
.zb-a11y-ui button:focus-visible,
.zb-a11y-ui select:focus-visible,
.zb-a11y-ui a:focus-visible {
	outline: 3px solid var(--zb-focus) !important;
	outline-offset: 2px !important;
}

/* ---------- Auslöser ---------- */
.zb-a11y-trigger {
	display: inline-flex !important;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 10px 18px !important;
	margin: 0;
	background: var(--zb-bg) !important;
	color: var(--zb-bg-text) !important;
	border: 2px solid var(--zb-accent) !important;
	border-radius: 4px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.zb-a11y-trigger:hover { background: var(--zb-accent) !important; color: var(--zb-accent-text) !important; }
.zb-a11y-ico { display: inline-flex; }
.zb-a11y-ico svg { fill: currentColor; }

.zb-a11y-float { position: fixed; bottom: 20px; z-index: 999990; }
.zb-a11y-float.zb-a11y-pos-right { right: 20px; }
.zb-a11y-float.zb-a11y-pos-left { left: 20px; }

@media (max-width: 600px) {
	.zb-a11y-float .zb-a11y-label {
		position: absolute !important;
		width: 1px; height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
	.zb-a11y-float .zb-a11y-trigger { padding: 12px !important; }
}

/* ---------- Bedienfeld ---------- */
.zb-a11y-backdrop {
	position: fixed; inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 999991;
}
.zb-a11y-panel {
	position: fixed; top: 0; right: 0; bottom: 0;
	width: 400px; max-width: 100%;
	overflow-y: auto;
	background: var(--zb-bg);
	color: var(--zb-bg-text);
	z-index: 999992;
	box-shadow: -4px 0 24px rgba(0, 0, 0, .5);
	font-size: 16px;
	line-height: 1.4;
}
.zb-a11y-panel[hidden], .zb-a11y-backdrop[hidden], .zb-reader-bar[hidden] { display: none !important; }
.zb-a11y-head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 2px solid var(--zb-accent);
}
.zb-a11y-title { font-size: 20px !important; font-weight: 700; color: var(--zb-bg-text) !important; }
.zb-a11y-close {
	width: 44px; height: 44px;
	background: transparent !important; color: var(--zb-bg-text) !important;
	border: 2px solid var(--zb-bg-text) !important; border-radius: 4px;
	font-size: 26px !important; line-height: 1 !important; cursor: pointer;
}
.zb-a11y-body { padding: 16px 20px 24px; }

.zb-a11y-fs {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	margin-bottom: 16px;
}
.zb-a11y-fs output { font-weight: 700; font-size: 18px; min-width: 64px; text-align: center; }
.zb-a11y-fs button,
.zb-a11y-reset,
.zb-a11y-readbtn,
.zb-reader-bar button {
	min-height: 48px;
	padding: 8px 16px !important;
	background: transparent !important;
	color: var(--zb-bg-text) !important;
	border: 2px solid var(--zb-bg-text) !important;
	border-radius: 4px !important;
	font-weight: 600 !important;
	cursor: pointer;
}
.zb-a11y-fs button { flex: 1; font-size: 20px !important; }
.zb-a11y-fs button:disabled { opacity: .4; cursor: not-allowed; }
.zb-a11y-readbtn {
	display: block; width: 100%; margin-bottom: 16px;
	background: var(--zb-accent) !important;
	color: var(--zb-accent-text) !important;
	border-color: var(--zb-accent) !important;
}

.zb-a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zb-a11y-opt {
	display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
	min-height: 68px; padding: 10px 12px !important;
	text-align: left !important;
	background: transparent !important;
	color: var(--zb-bg-text) !important;
	border: 2px solid var(--zb-bg-text) !important;
	border-radius: 4px !important;
	cursor: pointer;
}
.zb-a11y-opt-t { font-weight: 700; font-size: 15px; }
.zb-a11y-opt-s { font-size: 13px; opacity: .85; }
.zb-a11y-opt[aria-pressed="true"] {
	background: var(--zb-accent) !important;
	color: var(--zb-accent-text) !important;
	border-color: var(--zb-accent) !important;
}
.zb-a11y-opt[aria-pressed="true"] .zb-a11y-opt-t::after { content: " ✓"; }

.zb-a11y-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 18px; }
.zb-a11y-stmt { color: var(--zb-bg-text) !important; text-decoration: underline !important; }
.zb-a11y-hint { margin: 16px 0 0; font-size: 13px; opacity: .8; }

@media (max-width: 420px) {
	.zb-a11y-grid { grid-template-columns: 1fr; }
}

/* ---------- Vorlese-Leiste ---------- */
.zb-reader-bar {
	position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
	width: max-content; max-width: calc(100% - 24px);
	padding: 10px 14px;
	background: var(--zb-bg); color: var(--zb-bg-text);
	border: 2px solid var(--zb-accent); border-radius: 6px;
	z-index: 999993;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
}
.zb-reader-status { font-weight: 700; margin-right: 6px; min-width: 120px; color: var(--zb-bg-text) !important; }
.zb-reader-lbl { display: inline-flex; align-items: center; gap: 6px; color: var(--zb-bg-text) !important; }
.zb-reader-bar select {
	min-height: 48px; padding: 6px 8px !important;
	background: #fff !important; color: #000 !important;
	border: 2px solid var(--zb-bg-text) !important; border-radius: 4px !important;
	max-width: 180px;
}
.zb-reader-bar [data-r="pause"] { background: var(--zb-accent) !important; color: var(--zb-accent-text) !important; border-color: var(--zb-accent) !important; }
.zb-reader-bar button:hover { outline: 2px solid var(--zb-focus); }
html body .zb-reading-now {
	outline: 4px solid var(--zb-focus) !important;
	outline-offset: 4px !important;
	scroll-margin: 120px;
}

/* ---------- Sprunglink ---------- */
.zb-a11y-skip {
	position: absolute !important; left: -9999px; top: 8px;
	background: var(--zb-bg) !important; color: var(--zb-bg-text) !important;
	padding: 12px 18px !important; z-index: 1000000;
	border: 2px solid var(--zb-accent) !important;
}
.zb-a11y-skip:focus { left: 8px; }

/* ---------- Lese-Lineal ---------- */
/* Ein einzelnes Band, das die Seite nicht abdunkelt (optional im Backend). Erst nach der ersten Bewegung sichtbar. */
.zb-ruler-band {
	display: none;
	position: fixed; left: 0; right: 0;
	top: calc(50vh - 28px); height: 56px;
	border-top: 3px solid var(--zb-focus);
	border-bottom: 3px solid var(--zb-focus);
	pointer-events: none;
	z-index: 999980;
}
.zb-ruler-band::before { content: ""; position: absolute; inset: 0; background: var(--zb-focus); opacity: .18; }
.zb-ruler-band.is-dim { box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .4); }
html.zb-ruler .zb-ruler-band.zb-ruler-live { display: block; }

/* =====================================================================
 * Modi (wirken auf die Seite, nie auf die eigene Oberfläche)
 * ===================================================================== */

/* Kontrast dunkel */
html.zb-contrast body,
html.zb-contrast body *:not(.zb-a11y-ui):not(.zb-a11y-ui *):not(.zb-reading-now) {
	background-color: var(--zb-dark-bg) !important;
	background-image: none !important;
	color: var(--zb-dark-text) !important;
	border-color: var(--zb-dark-text) !important;
	box-shadow: none !important;
	text-shadow: none !important;
}
html.zb-contrast body a:not(.zb-a11y-ui),
html.zb-contrast body a:not(.zb-a11y-ui) * {
	color: var(--zb-dark-link) !important;
	text-decoration: underline !important;
}
html.zb-contrast body input:not(.zb-a11y-ui *),
html.zb-contrast body textarea:not(.zb-a11y-ui *),
html.zb-contrast body select:not(.zb-a11y-ui *),
html.zb-contrast body button:not(.zb-a11y-ui):not(.zb-a11y-ui *) {
	border: 2px solid var(--zb-dark-text) !important;
}

/* Kontrast hell */
html.zb-light body,
html.zb-light body *:not(.zb-a11y-ui):not(.zb-a11y-ui *):not(.zb-reading-now) {
	background-color: var(--zb-light-bg) !important;
	background-image: none !important;
	color: var(--zb-light-text) !important;
	border-color: var(--zb-light-text) !important;
	box-shadow: none !important;
	text-shadow: none !important;
}
html.zb-light body a:not(.zb-a11y-ui),
html.zb-light body a:not(.zb-a11y-ui) * {
	color: var(--zb-light-link) !important;
	text-decoration: underline !important;
}
html.zb-light body input:not(.zb-a11y-ui *),
html.zb-light body textarea:not(.zb-a11y-ui *),
html.zb-light body select:not(.zb-a11y-ui *),
html.zb-light body button:not(.zb-a11y-ui):not(.zb-a11y-ui *) {
	border: 2px solid var(--zb-light-text) !important;
}

/* Links hervorheben */
html.zb-links body a:not(.zb-a11y-ui):not(.zb-a11y-ui *) {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	text-underline-offset: 3px !important;
	background-color: var(--zb-link-bg) !important;
	color: var(--zb-link-text) !important;
	outline: 2px solid var(--zb-link-text) !important;
	padding: 0 .15em !important;
}
html.zb-links body a:not(.zb-a11y-ui) * { color: var(--zb-link-text) !important; background: transparent !important; }

/* Überschriften hervorheben */
html.zb-headings body :is(h1, h2, h3, h4, h5, h6):not(.zb-a11y-ui):not(.zb-a11y-ui *),
html.zb-headings body [role="heading"]:not(.zb-a11y-ui):not(.zb-a11y-ui *) {
	background-color: var(--zb-head-bg) !important;
	color: var(--zb-head-text) !important;
	border-left: 8px solid var(--zb-head-border) !important;
	padding: .2em .5em !important;
}
html.zb-headings body :is(h1, h2, h3, h4, h5, h6) * { color: var(--zb-head-text) !important; background: transparent !important; }

/* Gut lesbare Schrift (Symbol-Schriften bleiben unberührt) */
html.zb-font body *:not(.zb-a11y-ui):not(.zb-a11y-ui *):not(i):not([class*="icon"]):not([class*="fa-"]):not([class^="fa"]):not([class*="awb-"]):not(svg):not(svg *) {
	font-family: var(--zb-font) !important;
}

/* Mehr Textabstand (WCAG 1.4.12) */
html.zb-spacing body *:not(.zb-a11y-ui):not(.zb-a11y-ui *) {
	line-height: 1.6 !important;
	letter-spacing: .12em !important;
	word-spacing: .16em !important;
}
html.zb-spacing body p:not(.zb-a11y-ui *) { margin-bottom: 2em !important; }

/* Linksbündig */
html.zb-align body :is(p, li, h1, h2, h3, h4, h5, h6, blockquote, figcaption, dt, dd, th, td, .fusion-text, .fusion-title, .title):not(.zb-a11y-ui):not(.zb-a11y-ui *) {
	text-align: left !important;
}

/* Animationen stoppen */
html.zb-noanim *,
html.zb-noanim *::before,
html.zb-noanim *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}
html.zb-noanim .fusion-animated,
html.zb-noanim [data-animationtype] {
	visibility: visible !important;
	opacity: 1 !important;
}

/* Großer Mauszeiger */
html.zb-cursor,
html.zb-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 32 32'%3E%3Cpath d='M5 2v22l6-6 4 9 4-2-4-9h9z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* Tastatur-Fokus betonen */
html.zb-focus body *:focus,
html.zb-focus body *:focus-visible {
	outline: 4px solid var(--zb-focus) !important;
	outline-offset: 3px !important;
	box-shadow: 0 0 0 7px #000 !important;
}

/* Bilder ausblenden */
html.zb-hideimg body img,
html.zb-hideimg body picture,
html.zb-hideimg body video {
	visibility: hidden !important;
}
