/**
 * Barrierefreiheit (Plugin „System - Barrierefreiheit“): Grundgestaltung.
 * Das Menü selbst nutzt nur px, damit es von der Schriftgröße der Seite unberührt bleibt.
 * Eigene Änderungen im Plugin unter „Aussehen → Eigenes CSS“ (wird danach geladen).
 */

/* ---------- Wirkung auf die Seite ---------- */

html.bf-letter-1 body *:not(.bf, .bf *, .n2-section-smartslider *) { letter-spacing: 0.05em !important; }
html.bf-letter-2 body *:not(.bf, .bf *, .n2-section-smartslider *) { letter-spacing: 0.1em !important; word-spacing: 0.08em !important; }
html.bf-letter-3 body *:not(.bf, .bf *, .n2-section-smartslider *) { letter-spacing: 0.16em !important; word-spacing: 0.16em !important; }

html.bf-line-1 body *:not(.bf, .bf *, .n2-section-smartslider *, i, svg, svg *) { line-height: 1.6 !important; }
html.bf-line-2 body *:not(.bf, .bf *, .n2-section-smartslider *, i, svg, svg *) { line-height: 1.9 !important; }
html.bf-line-3 body *:not(.bf, .bf *, .n2-section-smartslider *, i, svg, svg *) { line-height: 2.25 !important; }

html.bf-wrap body *:not(.bf, .bf *, .n2-section-smartslider *) { overflow-wrap: break-word !important; }

html.bf-motion,
html.bf-motion *,
html.bf-motion *::before,
html.bf-motion *::after {
	animation-delay: 0s !important;
	animation-duration: 0.001ms !important;
	animation-iteration-count: 1 !important;
	transition-delay: 0s !important;
	transition-duration: 0.001ms !important;
	scroll-behavior: auto !important;
}

.bf-svg {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	pointer-events: none;
}

/* Lesehilfe: oben und unten abgedunkelt, dazwischen ein heller Streifen */
.bf-guide {
	--bf-guide-y: 33vh;
	--bf-guide-h: 56px;
	position: fixed;
	inset: 0;
	pointer-events: none;
}

.bf-guide__top,
.bf-guide__bottom {
	position: absolute;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.5);
}

.bf-guide__top {
	top: 0;
	height: max(0px, calc(var(--bf-guide-y) - var(--bf-guide-h) / 2));
	border-bottom: 3px solid #ffd400;
}

.bf-guide__bottom {
	top: calc(var(--bf-guide-y) + var(--bf-guide-h) / 2);
	bottom: 0;
	border-top: 3px solid #ffd400;
}

/* ---------- das Menü ---------- */

.bf {
	--bf-primary: #2f5353;
	--bf-accent: #4e2a56;
	--bf-size: 52px;
	--bf-x: 16px;
	--bf-y: 16px;
	position: fixed;
	bottom: calc(var(--bf-y) + env(safe-area-inset-bottom, 0px));
	z-index: 1040;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	color: #1d2626;
}

.bf--left { left: var(--bf-x); }
.bf--right { right: var(--bf-x); }

/* Bei aktivem Filter liegt das Menü als Popover in der obersten Ebene: Browser-Vorgaben dafür aufheben */
.bf[popover] {
	top: auto;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.bf--left[popover] { right: auto; }
.bf--right[popover] { left: auto; }

.bf *,
.bf *::before,
.bf *::after {
	box-sizing: border-box;
	letter-spacing: normal;
	word-spacing: normal;
}

.bf button {
	margin: 0;
	font: inherit;
	line-height: 1.2;
	text-transform: none;
	-webkit-appearance: none;
	appearance: none;
}

.bf svg {
	display: block;
	fill: currentColor;
}

.bf__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.bf .bf__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--bf-size);
	height: var(--bf-size);
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--bf-primary);
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: background-color 0.15s, transform 0.15s;
}

.bf .bf__toggle svg {
	width: 62%;
	height: 62%;
}

.bf .bf__toggle:hover,
.bf--open .bf__toggle {
	background: var(--bf-accent);
	color: #fff;
}

/* Punkt am Icon: etwas ist verändert */
.bf__dot {
	display: none;
	position: absolute;
	top: -2px;
	right: -2px;
	width: 14px;
	height: 14px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #ffd400;
}

.bf--changed .bf__dot {
	display: block;
}

.bf .bf__toggle:focus-visible,
.bf button:focus-visible,
.bf .bf__title:focus-visible {
	outline: 3px solid #ffd400;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px #1d2626;
}

.bf__panel {
	position: absolute;
	bottom: calc(var(--bf-size) + 12px);
	width: min(360px, calc(100vw - 2 * var(--bf-x)));
	max-height: calc(100vh - var(--bf-size) - var(--bf-y) - 28px);
	max-height: calc(100dvh - var(--bf-size) - var(--bf-y) - 28px);
	padding: 14px 16px 16px;
	border-radius: 16px;
	background: #fff;
	color: #1d2626;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.bf__panel[hidden] {
	display: none;
}

.bf--left .bf__panel { left: 0; }
.bf--right .bf__panel { right: 0; }

/* Mindestens 16 px Rand, auch wenn der Abstand vom Rand kleiner eingestellt ist */
@media (max-width: 400px) {
	.bf__panel { width: calc(100vw - 2 * max(var(--bf-x), 8px)); }
}

.bf__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

/* doppelte Klasse: Templates setzen h2 oft mit höherer Gewichtung */
.bf .bf__title {
	margin: 0;
	padding: 0;
	color: var(--bf-primary);
	font-family: inherit;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.25;
	text-transform: none;
}

.bf .bf__close {
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bf-primary);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.bf .bf__close:hover {
	background: #eef3f3;
	color: var(--bf-accent);
}

.bf__steppers {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.bf__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 6px 6px 12px;
	border-radius: 12px;
	background: #e9efef;
}

.bf__label {
	font-weight: 600;
}

.bf__stepper {
	display: flex;
	align-items: center;
	gap: 4px;
}

.bf .bf__step {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--bf-primary);
	color: #fff;
	font-size: 22px;
	font-weight: 700;
	cursor: pointer;
}

.bf .bf__step:hover {
	background: var(--bf-accent);
	color: #fff;
}

.bf .bf__step:disabled {
	background: #b4c0c0;
	color: #3d4a4a;
	cursor: default;
}

.bf__value {
	min-width: 66px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

.bf__group {
	margin-bottom: 12px;
}

.bf .bf__groupTitle {
	margin: 0 0 6px;
	color: var(--bf-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
}

.bf__tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
	gap: 6px;
}

.bf .bf__tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 62px;
	padding: 8px 2px;
	border: 2px solid #a9b8b8;
	border-radius: 12px;
	background: #f7f9f9;
	color: var(--bf-primary);
	font-size: 12.5px;
	text-align: center;
	cursor: pointer;
	hyphens: auto;
	overflow-wrap: break-word;
}

.bf .bf__tile:hover {
	border-color: var(--bf-primary);
	background: #fff;
	color: var(--bf-primary);
}

.bf .bf__tile[aria-pressed="true"] {
	border-color: var(--bf-accent);
	background: var(--bf-accent);
	color: #fff;
}

/* gleich hohe Kacheln, auch wenn die Beschriftung zweizeilig ist */
.bf__tileIcon svg {
	width: 22px;
	height: 22px;
}

.bf .bf__note {
	margin: 0 0 12px;
	padding: 8px 10px;
	border-left: 4px solid #ffd400;
	border-radius: 6px;
	background: #fff8d6;
	color: #1d2626;
	font-size: 13px;
	line-height: 1.4;
}

.bf .bf__note[hidden] {
	display: none;
}

.bf .bf__reset {
	display: block;
	width: 100%;
	padding: 11px 16px;
	border: 2px solid var(--bf-primary);
	border-radius: 999px;
	background: #fff;
	color: var(--bf-primary);
	font-weight: 700;
	cursor: pointer;
}

.bf .bf__reset:hover {
	border-color: var(--bf-accent);
	background: var(--bf-accent);
	color: #fff;
}

@media print {
	.bf,
	.bf-guide {
		display: none !important;
	}
}
