/* WP A11y Widget – Frontend-Styles. Hohe Spezifität, damit Elementor-Regeln nicht überschreiben. */

:root {
	--a11y-primary: #1a4f8b;
	--a11y-font-scale: 1;
	--a11y-letter-spacing: 0em;
	--a11y-line-height: 1.4;
	--a11y-saturation: 1;
}

/* ---------- Widget-Container ---------- */
.a11y-widget {
	position: fixed;
	z-index: 2147483000; /* über Elementor-Overlays/Sticky-Headern */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
	/* Vertikaler Abstand vom Boden. Bei "unten links" so gesetzt, dass der Button
	   5px ÜBER dem Cookie-Button sitzt: 20px (Cookie-Abstand) + 50px (Cookie-Höhe) + 5px Lücke.
	   Falls der Cookie-Button eine andere Höhe hat, hier den mittleren Wert (50px) anpassen. */
	--a11y-offset-bottom: 20px;
	--a11y-offset-bottom-left: 75px;
}
.a11y-widget.a11y-pos-bottom-right { right: 20px; bottom: var(--a11y-offset-bottom); }
.a11y-widget.a11y-pos-bottom-left  { left: 20px; bottom: var(--a11y-offset-bottom-left); }
.a11y-widget.a11y-pos-top-right    { right: 20px; top: 20px; }
.a11y-widget.a11y-pos-top-left     { left: 20px; top: 20px; }

/* ---------- Trigger-Button ---------- */
.a11y-widget .a11y-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--a11y-primary);
	color: #fff;
	border: 2px solid rgba(255,255,255,.6);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.28);
	padding: 0;
	transition: transform .15s ease, box-shadow .15s ease;
}
.a11y-widget .a11y-trigger:hover { transform: scale(1.06); }
.a11y-widget .a11y-trigger:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }
.a11y-widget .a11y-trigger svg { width: 60%; height: 60%; }

/* ---------- Panel ---------- */
.a11y-widget .a11y-panel {
	position: absolute;
	width: 320px;
	max-width: calc(100vw - 40px);
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0,0,0,.35);
	padding: 0;
}
.a11y-widget.a11y-pos-bottom-right .a11y-panel,
.a11y-widget.a11y-pos-top-right .a11y-panel { right: 0; }
.a11y-widget.a11y-pos-bottom-left .a11y-panel,
.a11y-widget.a11y-pos-top-left .a11y-panel { left: 0; }
.a11y-widget.a11y-pos-bottom-right .a11y-panel,
.a11y-widget.a11y-pos-bottom-left .a11y-panel { bottom: calc(100% + 12px); }
.a11y-widget.a11y-pos-top-right .a11y-panel,
.a11y-widget.a11y-pos-top-left .a11y-panel { top: calc(100% + 12px); }

.a11y-widget .a11y-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 16px; background: var(--a11y-primary); color: #fff;
	border-radius: 12px 12px 0 0; position: sticky; top: 0;
}
.a11y-widget .a11y-title { margin: 0; font-size: 17px; font-weight: 700; color: #fff; }
.a11y-widget .a11y-close {
	background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1;
	cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.a11y-widget .a11y-close:focus-visible { outline: 3px solid #ffbf00; }

.a11y-widget .a11y-body {
	display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px;
}
.a11y-widget .a11y-item {
	display: flex; align-items: center; justify-content: center; text-align: center;
	min-height: 64px; padding: 8px; background: #f2f4f7; color: #1a1a1a;
	border: 2px solid transparent; border-radius: 10px; cursor: pointer;
	font-size: 13px; font-weight: 600;
}
.a11y-widget .a11y-item:hover { background: #e6eaf0; }
.a11y-widget .a11y-item:focus-visible { outline: 3px solid var(--a11y-primary); outline-offset: 1px; }
.a11y-widget .a11y-item.is-active { background: var(--a11y-primary); color: #fff; border-color: var(--a11y-primary); }

.a11y-widget .a11y-stepper {
	grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
	background: #f2f4f7; border-radius: 10px; padding: 8px 12px;
}
.a11y-widget .a11y-stepper-label { font-size: 13px; font-weight: 600; }
.a11y-widget .a11y-step-controls { display: flex; align-items: center; gap: 8px; }
.a11y-widget .a11y-step-btn {
	width: 32px; height: 32px; border-radius: 8px; border: 0; cursor: pointer;
	background: var(--a11y-primary); color: #fff; font-size: 18px; line-height: 1;
}
.a11y-widget .a11y-step-btn:focus-visible { outline: 3px solid #ffbf00; }
.a11y-widget .a11y-step-val { min-width: 24px; text-align: center; font-weight: 700; }

.a11y-widget .a11y-footer { padding: 0 14px 14px; }
.a11y-widget .a11y-reset {
	width: 100%; padding: 10px; border: 2px solid var(--a11y-primary); background: #fff;
	color: var(--a11y-primary); font-weight: 700; border-radius: 10px; cursor: pointer;
}
.a11y-widget .a11y-reset:hover { background: var(--a11y-primary); color: #fff; }
.a11y-widget .a11y-reset:focus-visible { outline: 3px solid #ffbf00; }

/* ---------- Angewandte Effekte (auf <html>) ---------- */

/* Schriftskalierung – wirkt auf gängige Textelemente, nicht aufs Widget selbst. */
html.a11y-font-active body :not(.a11y-widget):not(.a11y-widget *) {
	font-size: calc(1em * var(--a11y-font-scale)) !important;
}
html.a11y-ls-active body :not(.a11y-widget):not(.a11y-widget *) {
	letter-spacing: var(--a11y-letter-spacing) !important;
}
html.a11y-lh-active body :not(.a11y-widget):not(.a11y-widget *) {
	line-height: var(--a11y-line-height) !important;
}

html.a11y-contrast body :not(.a11y-widget):not(.a11y-widget *) {
	background-color: #000 !important; color: #fff !important; text-shadow: none !important;
}
html.a11y-contrast a:not(.a11y-widget *) { color: #ffff00 !important; }

html.a11y-invert { filter: invert(1) hue-rotate(180deg); }
html.a11y-invert .a11y-widget { filter: invert(1) hue-rotate(180deg); } /* Widget zurückdrehen */

html.a11y-grayscale { filter: grayscale(1); }
html.a11y-grayscale .a11y-widget { filter: grayscale(0); }

html.a11y-saturation { filter: saturate(var(--a11y-saturation)); }
html.a11y-saturation .a11y-widget { filter: saturate(1); }

html.a11y-dyslexia body :not(.a11y-widget):not(.a11y-widget *) {
	font-family: "Comic Sans MS", "Trebuchet MS", Verdana, sans-serif !important;
}
html.a11y-readable body :not(.a11y-widget):not(.a11y-widget *) {
	font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-links a:not(.a11y-widget *) {
	text-decoration: underline !important; outline: 2px solid #ffbf00 !important;
	background: rgba(255,191,0,.25) !important;
}

html.a11y-hide-images img:not(.a11y-widget img),
html.a11y-hide-images picture:not(.a11y-widget picture),
html.a11y-hide-images video:not(.a11y-widget video) { visibility: hidden !important; }

html.a11y-big-cursor,
html.a11y-big-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='2' d='M6 2l30 18-13 3 8 15-6 3-8-15-11 8z'/%3E%3C/svg%3E") 4 2, auto !important;
}

html.a11y-focus *:focus {
	outline: 3px solid #ff5722 !important; outline-offset: 2px !important;
}

html.a11y-stop-anim *:not(.a11y-widget):not(.a11y-widget *) {
	animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

html.a11y-align-left body :not(.a11y-widget):not(.a11y-widget *)  { text-align: left !important; }
html.a11y-align-center body :not(.a11y-widget):not(.a11y-widget *){ text-align: center !important; }
html.a11y-align-right body :not(.a11y-widget):not(.a11y-widget *) { text-align: right !important; }

/* Leselineal */
.a11y-reading-guide {
	position: fixed; left: 0; width: 100%; height: 3px; background: #ff5722;
	pointer-events: none; z-index: 2147482000; transform: translateY(-1px);
}
/* Lesemaske */
.a11y-mask {
	position: fixed; left: 0; width: 100%; background: rgba(0,0,0,.6);
	pointer-events: none; z-index: 2147482000;
}
.a11y-mask-top { top: 0; }
.a11y-mask-bottom { bottom: 0; height: 100%; }

/* Responsiv */
@media (max-width: 480px) {
	.a11y-widget .a11y-panel { width: calc(100vw - 40px); }
	.a11y-widget .a11y-body { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.a11y-widget .a11y-trigger { transition: none; }
}
