/* Barrierefreiheit Floating Tool – Frontend */

/* Floating-Container: fixed, direkt unter <body> (JS verschiebt ihn dorthin) */
#bfp-root {
	--bfp-x: 20px;
	--bfp-y: 20px;
	--bfp-size: 56px;
	--bfp-bg: #1a4f8b;
	--bfp-fg: #ffffff;
	--bfp-z: 99999;
	--bfp-cols: 5;
	position: fixed;
	z-index: var(--bfp-z);
	width: var(--bfp-size);
	height: var(--bfp-size);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: #111111;
	text-align: left;
	transition: opacity 0.4s ease;
}

#bfp-root.bfp-pos-bottom-right { right: var(--bfp-x); bottom: calc(var(--bfp-y) + env(safe-area-inset-bottom, 0px)); }
#bfp-root.bfp-pos-bottom-left  { left: var(--bfp-x);  bottom: calc(var(--bfp-y) + env(safe-area-inset-bottom, 0px)); }
#bfp-root.bfp-pos-top-right    { right: var(--bfp-x); top: var(--bfp-y); }
#bfp-root.bfp-pos-top-left     { left: var(--bfp-x);  top: var(--bfp-y); }
#bfp-root.bfp-pos-middle-right { right: var(--bfp-x); top: 50%; margin-top: calc(var(--bfp-size) / -2); }
#bfp-root.bfp-pos-middle-left  { left: var(--bfp-x);  top: 50%; margin-top: calc(var(--bfp-size) / -2); }

#bfp-root.bfp-fading { opacity: 0; pointer-events: none; }
#bfp-root.bfp-hidden,
.bfp-gone #bfp-root { display: none !important; }

#bfp-root *,
#bfp-root *::before,
#bfp-root *::after { box-sizing: border-box; }

@media (min-width: 783px) {
	#bfp-root.bfp-no-desktop { display: none !important; }
}
@media (max-width: 782px) {
	#bfp-root.bfp-no-mobile { display: none !important; }
}

/* Button */
.bfp-toggle {
	width: 100%;
	height: 100%;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border: 3px solid #ffffff;
	border-radius: 50%;
	background: var(--bfp-bg);
	color: var(--bfp-fg);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	font: inherit;
	line-height: 1;
}
.bfp-toggle.bfp-shape-rounded { border-radius: 18px; }
.bfp-toggle.bfp-shape-square  { border-radius: 0; }
.bfp-toggle svg { width: 52%; height: 52%; fill: currentColor; }
.bfp-toggle .bfp-text { margin-top: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.bfp-toggle:hover { filter: brightness(1.1); }

/* Panel – Popup: neben dem Button, alle Menüpunkte ohne Scrollen */
#bfp-root .bfp-panel {
	position: absolute;
	width: min(400px, calc(100vw - 32px));
	max-height: 80vh;
	overflow-y: auto;
	padding: 14px;
	background: #ffffff;
	color: #111111;
	border: 2px solid #1a4f8b;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
#bfp-root .bfp-panel[hidden] { display: none !important; }
#bfp-root.bfp-pos-bottom-right .bfp-panel,
#bfp-root.bfp-pos-bottom-left .bfp-panel { bottom: calc(100% + 14px); }
#bfp-root.bfp-pos-top-right .bfp-panel,
#bfp-root.bfp-pos-top-left .bfp-panel { top: calc(100% + 14px); }
#bfp-root.bfp-pos-bottom-right .bfp-panel,
#bfp-root.bfp-pos-top-right .bfp-panel { right: 0; }
#bfp-root.bfp-pos-bottom-left .bfp-panel,
#bfp-root.bfp-pos-top-left .bfp-panel { left: 0; }
#bfp-root.bfp-pos-middle-right .bfp-panel { right: calc(100% + 14px); top: 50%; transform: translateY(-50%); }
#bfp-root.bfp-pos-middle-left .bfp-panel { left: calc(100% + 14px); top: 50%; transform: translateY(-50%); }

#bfp-root .bfp-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}
#bfp-root .bfp-panel h2 { margin: 0; font-size: 17px; line-height: 1.3; color: #111111; }
#bfp-root .bfp-close {
	min-width: 44px;
	min-height: 44px;
	margin: -8px -8px -8px 0;
	border: 0;
	background: transparent;
	color: #111111;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

#bfp-root .bfp-group-title {
	margin: 10px 0 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #333333;
}

/* Raster der Menüpunkte */
#bfp-root .bfp-grid {
	display: grid;
	grid-template-columns: repeat(var(--bfp-cols), minmax(0, 1fr));
	gap: 6px;
}
#bfp-root .bfp-opt {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 66px;
	margin: 0;
	padding: 6px 4px;
	border: 2px solid #1a4f8b;
	border-radius: 8px;
	background: #ffffff;
	color: #111111;
	font: inherit;
	font-size: 12px;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	hyphens: auto;
}
#bfp-root .bfp-opt .bfp-icon { flex: none; width: 24px; height: 24px; margin-bottom: 4px; }
#bfp-root .bfp-opt[aria-pressed="true"] { background: #1a4f8b; color: #ffffff; }
#bfp-root .bfp-opt[aria-pressed="true"] .bfp-icon { color: #ffffff; }
#bfp-root .bfp-opt[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

#bfp-root .bfp-help { margin-top: 8px; font-size: 13px; }
#bfp-root .bfp-help ul { margin: 0; padding-left: 18px; }
#bfp-root .bfp-help li { margin-bottom: 3px; }
#bfp-root kbd {
	display: inline-block;
	padding: 0 4px;
	border: 1px solid #777777;
	border-radius: 4px;
	background: #f3f3f3;
	color: #111111;
	font-family: inherit;
	font-size: 12px;
}

#bfp-root .bfp-status { min-height: 1.2em; margin: 8px 0 0; font-size: 13px; color: #1a4f8b; font-weight: 600; }
#bfp-root .bfp-note { margin: 6px 0; font-size: 13px; color: #333333; }
#bfp-root .bfp-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: #1a4f8b;
	font-weight: 600;
}

#bfp-root .bfp-toggle:focus-visible,
#bfp-root .bfp-opt:focus-visible,
#bfp-root .bfp-close:focus-visible,
#bfp-root .bfp-link:focus-visible,
.bfp-skip:focus-visible {
	outline: 3px solid #000000;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #ffffff;
}

/* Mobil: Popup wird Bottom-Sheet über die volle Breite, 4 Spalten */
@media (max-width: 782px) {
	#bfp-root .bfp-panel {
		position: fixed;
		left: 0 !important;
		right: 0 !important;
		top: auto !important;
		bottom: 0 !important;
		width: auto;
		max-height: 85vh;
		transform: none !important;
		border-radius: 16px 16px 0 0;
		padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
	}
	#bfp-root .bfp-grid { --bfp-cols: 4; }
	#bfp-root .bfp-opt { min-height: 64px; }
}

/* Vollbild: Panel deckt den Viewport ab, Seite dahinter wird nicht gescrollt */
#bfp-root.bfp-menu-fullscreen .bfp-panel {
	position: fixed !important;
	top: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	width: 100% !important;
	max-width: none !important;
	max-height: none !important;
	transform: none !important;
	margin: 0;
	padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
	border: 0;
	border-radius: 0;
	box-shadow: none;
	overflow-y: auto;
}
#bfp-root.bfp-menu-fullscreen .bfp-panel h2 { font-size: 22px; }
#bfp-root.bfp-menu-fullscreen .bfp-group-title { font-size: 14px; margin-top: 18px; }
#bfp-root.bfp-menu-fullscreen .bfp-grid { --bfp-cols: 4; gap: 10px; }
#bfp-root.bfp-menu-fullscreen .bfp-opt { min-height: 96px; font-size: 15px; }
#bfp-root.bfp-menu-fullscreen .bfp-opt .bfp-icon { width: 30px; height: 30px; margin-bottom: 6px; }
html.bfp-menu-open { overflow: hidden; }

/* Sprungmarken: nur bei Tastaturfokus sichtbar */
.bfp-skip {
	position: fixed;
	left: 8px;
	top: 8px;
	z-index: 100000;
	padding: 10px 14px;
	background: #ffffff;
	color: #111111;
	border: 2px solid #1a4f8b;
	border-radius: 6px;
	transform: translateY(-200%);
}
.bfp-skip:focus { transform: none; }
.bfp-skip-main { top: 8px; left: 8px; }
.bfp-skip-main + .bfp-skip { top: 56px; }

@media (prefers-reduced-motion: reduce) {
	#bfp-root { transition: none; }
}

/* ---------- Anzeigeeinstellungen (Klassen auf <html>) ---------- */

/* Hoher Kontrast */
html.bfp-contrast body,
html.bfp-contrast body *:not(#bfp-root):not(#bfp-root *) {
	background-color: #000000 !important;
	color: #ffffff !important;
	border-color: #ffffff !important;
	box-shadow: none !important;
}
html.bfp-contrast body a,
html.bfp-contrast body a * {
	color: #ffff00 !important;
}

/* Graustufen: Filter auf Seiteninhalte, nicht auf body (sonst bricht position:fixed) */
html.bfp-grayscale body > *:not(#bfp-root) {
	filter: grayscale(100%) !important;
}

/* Lesbare Schrift */
html.bfp-readable body *:not(#bfp-root):not(#bfp-root *) {
	font-family: Arial, Helvetica, sans-serif !important;
	letter-spacing: 0.03em !important;
}

/* Mehr Zeilenabstand */
html.bfp-spacing body p,
html.bfp-spacing body li,
html.bfp-spacing body td,
html.bfp-spacing body dd {
	line-height: 1.8 !important;
	word-spacing: 0.08em !important;
}

/* Links unterstreichen */
html.bfp-links body a {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

/* Animationen anhalten */
html.bfp-nomotion *,
html.bfp-nomotion *::before,
html.bfp-nomotion *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* Fokus verstärken: dicker, kontrastreicher Rahmen auf allen Seitenelementen */
html.bfp-focus-strong body :focus:not(#bfp-root *) {
	outline: 4px solid #ffdd00 !important;
	outline-offset: 3px !important;
	box-shadow: 0 0 0 7px #000000 !important;
}
