/* Wohnbau Schnellzugriff – Leiste rechts mit Fenstern.
   Größen und Kontraste nach WCAG 2.2 AA, Klickflächen 56 px. */

.wbsz {
	--wbsz-breite: 56px;
	--wbsz-text: #1f1f1f;
	--wbsz-link: #00639a;
	--wbsz-dunkel: #1f2328;
	font-size: 17px;
	line-height: 1.5;
}

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

#wbsz-anfang:focus {
	outline: none;
}

/* ---------- Leiste ---------- */

/* Ohne transform, damit die Fenster (position: fixed) sich am Bildschirm ausrichten.
   Die Leiste ist doppelt so hoch wie der Abstand von oben → Mitte liegt bei --wbsz-hoehe. */
.wbsz-leiste {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 9000;
	display: flex;
	flex-direction: column;
	justify-content: center;
	justify-content: safe center;
	height: calc(var(--wbsz-hoehe, 60) * 2vh);
	pointer-events: none;
}

.wbsz-liste > li {
	pointer-events: auto;
}

.wbsz-liste {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wbsz-liste > li {
	margin: 0;
	padding: 0;
	position: relative;
}

.wbsz-liste > li::before,
.wbsz-liste > li::marker {
	content: none;
}

.wbsz-oben-eintrag.ist-versteckt {
	display: none;
}

/* Leiste ganz unten rechts (Einstellung „Ganz unten“) */
.wbsz--unten .wbsz-leiste {
	top: auto;
	bottom: 24px;
	height: auto;
}

/* „Nach oben“ steht abgesetzt links neben dem untersten Knopf, rundum abgerundet und dunkelblau */
.wbsz-liste {
	position: relative;
}

.wbsz-liste > .wbsz-oben-eintrag {
	position: absolute;
	right: calc(100% + 10px);
	bottom: 0;
}

.wbsz .wbsz-oben-eintrag .wbsz-knopf {
	border-radius: 10px;
	background: var(--wbsz-oben, #005e8f);
}

@media (hover: hover) {
	.wbsz .wbsz-oben-eintrag .wbsz-knopf:hover {
		background: var(--wbsz-oben-hover, #03324d);
	}
}

.wbsz .wbsz-knopf {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--wbsz-breite);
	height: var(--wbsz-breite);
	margin: 0;
	padding: 0;
	border: 2px solid transparent; /* sichtbar im Kontrastmodus von Windows */
	border-radius: 10px 0 0 10px;
	background: var(--wbsz-farbe, #0089d0);
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	text-decoration: none;
	font: inherit;
	line-height: 1;
}

@media (hover: hover) {
	.wbsz .wbsz-knopf:hover {
		background: #565656;
		background: color-mix(in srgb, var(--wbsz-farbe, #0089d0) 78%, #000);
		color: #fff;
	}
}

.wbsz .wbsz-knopf[aria-expanded="true"] {
	background: #fff;
	color: var(--wbsz-farbe, #0089d0);
	border-color: var(--wbsz-farbe, #0089d0);
	border-right-color: transparent;
}

.wbsz .wbsz-knopf:focus {
	outline: none;
}

.wbsz .wbsz-knopf:focus-visible,
.wbsz .wbsz-schliessen:focus-visible,
.wbsz .wbsz-panel a:focus-visible,
.wbsz .wbsz-panel-titel:focus-visible {
	outline: 3px solid var(--wbsz-dunkel);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px #fff;
}

.wbsz .wbsz-icon {
	display: block;
	width: var(--wbsz-icon-gr, 28px);
	height: var(--wbsz-icon-gr, 28px);
	flex: none;
	pointer-events: none;
}

/* Beschriftung erscheint links neben dem Knopf (Maus oder Tastatur). */
.wbsz .wbsz-label {
	position: absolute;
	top: 50%;
	right: calc(100% + 12px);
	transform: translate(6px, -50%);
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--wbsz-dunkel);
	color: #fff;
	font-size: var(--wbsz-label-gr, 16px);
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	opacity: 0;
	pointer-events: none;
}

.wbsz .wbsz-label::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -6px;
	margin-top: -6px;
	border: 6px solid transparent;
	border-right: 0;
	border-left-color: var(--wbsz-dunkel);
}

.wbsz .wbsz-knopf:focus-visible .wbsz-label {
	opacity: 1;
	transform: translate(0, -50%);
}

@media (hover: hover) {
	.wbsz .wbsz-knopf:hover .wbsz-label {
		opacity: 1;
		transform: translate(0, -50%);
	}
}

.wbsz.ohne-beschriftung .wbsz-label,
.wbsz .wbsz-knopf[aria-expanded="true"] .wbsz-label {
	opacity: 0 !important;
}

/* ---------- Fenster ---------- */

.wbsz-panel {
	position: fixed;
	top: 16px;
	right: calc(var(--wbsz-breite) + 12px);
	z-index: 9001;
	box-sizing: border-box;
	width: min(var(--wbsz-fenster-b, 420px), calc(100vw - var(--wbsz-breite) - 28px));
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	color: var(--wbsz-text);
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	text-align: left;
}

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

.wbsz-panel-kopf {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 12px 12px 24px;
	background: #fff;
	border-bottom: 1px solid #e3e3e3;
}

.wbsz .wbsz-panel-titel {
	margin: 0;
	padding: 0;
	color: var(--wbsz-text);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
}

.wbsz .wbsz-schliessen {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: var(--wbsz-text);
	cursor: pointer;
}

.wbsz .wbsz-schliessen:hover {
	background: #f0f0f0;
	color: #000;
}

.wbsz-panel-inhalt {
	padding: 16px 24px 24px;
	font-size: 17px;
	line-height: 1.55;
	color: var(--wbsz-text);
}

.wbsz-panel-inhalt > :first-child {
	margin-top: 0;
}

.wbsz-panel-inhalt > :last-child {
	margin-bottom: 0;
}

.wbsz-panel-inhalt p,
.wbsz-panel-inhalt ul,
.wbsz-panel-inhalt ol {
	margin: 0 0 14px;
	font-size: 17px;
	color: var(--wbsz-text);
}

.wbsz-panel-inhalt h2,
.wbsz-panel-inhalt h3,
.wbsz-panel-inhalt h4 {
	margin: 20px 0 8px;
	font-size: 19px;
	line-height: 1.3;
	color: var(--wbsz-text);
}

.wbsz-panel-inhalt a:not(.wp-block-button__link):not(.kb-button) {
	color: var(--wbsz-link);
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 600;
}

.wbsz-panel-inhalt a[href^="tel:"] {
	white-space: nowrap;
}

.wbsz .wbsz-panel .wbsz-panel-inhalt hr {
	width: 100%;
	max-width: none;
	margin: 18px 0;
	border: 0;
	border-top: 1px solid #dcdcdc;
}

.wbsz-panel-inhalt .wp-block-buttons {
	margin-top: 8px;
}

.wbsz-hinweis {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-left: 5px solid var(--wbsz-hinweis-rand, #b45f00);
	border-radius: 6px;
	background: var(--wbsz-hinweis-flaeche, #fff4e0);
	color: var(--wbsz-hinweis-text, #3d2600);
	font-weight: 600;
}

.wbsz-hinweis a {
	color: var(--wbsz-hinweis-text, #3d2600);
}

/* ---------- Bewegung nur, wenn erwünscht ---------- */

@media (prefers-reduced-motion: no-preference) {
	.wbsz .wbsz-knopf {
		transition: background-color 0.15s ease, color 0.15s ease;
	}
	.wbsz .wbsz-label {
		transition: opacity 0.15s ease, transform 0.15s ease;
	}
	.wbsz-panel {
		transition: opacity 0.18s ease, transform 0.18s ease;
	}
	.wbsz-panel:not(.ist-sichtbar) {
		opacity: 0;
		transform: translateX(12px);
	}
}

/* ---------- Kontrastmodus / Druck ---------- */

@media (forced-colors: active) {
	.wbsz .wbsz-knopf,
	.wbsz-panel {
		border: 2px solid CanvasText;
	}
	.wbsz .wbsz-knopf[aria-expanded="true"] {
		border-color: Highlight;
	}
}

@media print {
	.wbsz {
		display: none !important;
	}
}
