/* ==========================================================================
   WBG Thalheim – Accessibility Layer (WCAG 2.0 AA)
   Behebt Findings aus dem decareto-Report (1.4.1, 1.4.3, 2.4.4, 4.1.2, 1.4.4)
   ========================================================================== */

/* --- Skip-Link & Screen-Reader-Text ----------------------------------- */
.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	overflow: hidden;
	white-space: nowrap;
	border: 0;
	padding: 0;
	margin: -1px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 100000;
	background: #003366;
	color: #fff;
	padding: 12px 18px;
	font-weight: 700;
	text-decoration: underline;
}

.skip-link:focus {
	left: 8px;
	top: 8px;
	clip: auto;
	clip-path: none;
	width: auto;
	height: auto;
	outline: 3px solid #ffcc00;
	outline-offset: 2px;
}

/* --- Sichtbarer Tastatur-Fokus überall -------------------------------- */
:focus {
	outline: 3px solid #ffcc00;
	outline-offset: 2px;
}
:focus:not(:focus-visible) {
	outline: none;
}
:focus-visible {
	outline: 3px solid #ffcc00;
	outline-offset: 2px;
}

/* Bestätigt sichtbar bei Buttons und Custom-Controls */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid #ffcc00;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.35);
}

/* --- WCAG 1.4.1: Links müssen vom Text unterscheidbar sein ------------ */
/* Body-Links zwingend unterstreichen */
.entry-content a,
.property-description a,
#footer a,
.listing-content a,
.widget-content a,
.fullwidth-light a:not(.button):not(.details) {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Navigation/Buttons brauchen die Unterstreichung nicht, aber Fokus muss stark sein */
.nav-menu a:focus-visible,
.button:focus-visible {
	text-decoration: underline;
}

/* --- WCAG 1.4.3: Kontrast-Korrekturen --------------------------------- */
/* Telefon / kleine Texte im Header lesbarer */
.header-widget .data,
.header-widget .data a {
	color: #003366 !important;
}

.header-widget .title {
	color: #1a1a1a !important;
}

/* Helle Preise auf hellem Hintergrund waren Problem 1.4.3 */
.listing-price,
.property-price {
	color: #ffffff !important;
	background: #003366 !important;
	text-shadow: none !important;
	padding: 4px 10px;
	border-radius: 4px;
	font-weight: 700;
}

/* Footer-Text */
#footer {
	color: #1a1a1a !important;
}
#footer a {
	color: #003366 !important;
	text-decoration: underline;
}
#footer a:hover,
#footer a:focus-visible {
	color: #001f3f !important;
}

/* Suchformular-Labels „Bitte wählen" etc. – das Grau war 1.4.3 */
.chosen-container-single .chosen-single,
.chosen-container .chosen-results,
.chosen-container-single .chosen-single span {
	color: #1a1a1a !important;
}
.chosen-container .chosen-results li {
	color: #1a1a1a;
}
.chosen-container .chosen-results li.highlighted {
	background: #003366;
	color: #ffffff;
}

/* Banner-Text auf Parallax-Bild: weiße Schrift mit Text-Shadow für Kontrast.
   KEIN Box-Wrapper – das hat den Hero gestaucht. */
.parallax h2,
.parallax .search-container label,
.parallax .adv-search-btn,
.parallax .adv-search-btn a {
	color: #ffffff !important;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* Hero-Headline: Subtitle bekommt eigene Zeile, ohne extra Wrapper-Div */
.hero-headline {
	font-size: 38px;
	line-height: 1.15;
	margin: 0 0 24px;
}
.hero-headline__sub {
	display: block;
	font-weight: 700;
	margin-top: 4px;
}
@media (max-width: 640px) {
	.hero-headline { font-size: 28px; }
}

/* --- Aktuelle Seite kenntlich machen (aria-current) ------------------- */
.nav-menu a[aria-current="page"],
.nav-menu li.current-menu-item > a {
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 700;
}

/* --- Buttons: weiße Icons gegen blauen Hintergrund ist ok,
       aber Hover/Fokus muss klar sein --------------------------------- */
.button {
	transition: background-color 0.15s, color 0.15s, outline 0.15s;
}
.button:hover,
.button:focus-visible {
	filter: brightness(0.9);
}

/* --- Reduced Motion respektieren -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   A11y-Toolbar (Schriftgröße / Kontrast / Lesehilfe)
   ========================================================================== */
.a11y-toolbar {
	position: fixed;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	z-index: 99998;
	background: #ffffff;
	color: #1a1a1a;
	border: 1px solid #d6d9e0;
	border-right: 0;
	border-radius: 10px 0 0 10px;
	box-shadow: -4px 4px 18px rgba(0, 0, 0, 0.18);
	transition: transform 0.25s ease;
	font-size: 14px;
	line-height: 1.4;
}

.a11y-toolbar[hidden] { display: none !important; }

.a11y-toolbar.is-collapsed {
	transform: translate(calc(100% - 52px), -50%);
}

/* Toggle: kräftiges Gelb mit dunkler Schrift – klassische A11y-Signalfarbe,
   hoher Kontrast und sofort als „Hilfe" erkennbar. */
.a11y-toolbar__toggle {
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffcc00;
	color: #1a1a1a;
	border: 0;
	cursor: pointer;
	border-radius: 8px 0 0 8px;
	font-size: 28px;
	line-height: 1;
	box-shadow: -2px 0 0 #003366 inset;
}
.a11y-toolbar__toggle:hover,
.a11y-toolbar__toggle:focus-visible {
	background: #ffd633;
}

.a11y-toolbar__panel {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 270px;
	max-width: 80vw;
}

.a11y-toolbar.is-collapsed .a11y-toolbar__panel {
	display: none;
}

.a11y-toolbar h2.a11y-toolbar__title {
	font-size: 15px;
	margin: 0 0 4px 0;
	color: #1a1a1a;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 6px;
}
.a11y-toolbar h2.a11y-toolbar__title::before {
	content: "♿";
	font-size: 18px;
}

.a11y-toolbar__group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-bottom: 6px;
	border-bottom: 1px solid #eef0f4;
}
.a11y-toolbar__group:last-of-type {
	border-bottom: 0;
	padding-bottom: 0;
}

.a11y-toolbar__group-label {
	font-size: 11px;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
}

.a11y-toolbar__row {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

/* Buttons: heller, mit deutlicheren Hover/Pressed-States */
.a11y-toolbar__btn {
	flex: 1 0 auto;
	background: #f4f6fa;
	border: 1px solid #c9cfd9;
	color: #1a1a1a;
	padding: 8px 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	min-width: 38px;
	min-height: 38px;
	transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.a11y-toolbar__btn:hover {
	background: #ffefb3;
	border-color: #d4a900;
}
.a11y-toolbar__btn:focus-visible {
	outline: 3px solid #ffcc00;
	outline-offset: 2px;
}
.a11y-toolbar__btn[aria-pressed="true"] {
	background: #ffcc00;
	color: #1a1a1a;
	border-color: #c79e00;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Modi der A11y-Toolbar (am <html> aktiviert)
   ========================================================================== */

/* Schriftgrößen-Stufen
   Das Theme arbeitet mit absoluten px-Werten. Eine reine font-size-Erhöhung
   am <html> propagiert deshalb nicht. Wir kombinieren deshalb zwei Mechanismen:
     1) `zoom` auf <body> (wird inzwischen von allen großen Browsern unterstützt)
        – skaliert alles inklusive Bildern, Abständen und Buttons proportional.
     2) Zusätzliches font-size-!important-Override auf Body und Textelemente
        als Fallback, falls eine Engine `zoom` ignoriert. */
html.a11y-fs-1 body { zoom: 1.10; }
html.a11y-fs-2 body { zoom: 1.20; }
html.a11y-fs-3 body { zoom: 1.35; }

/* Fallback per direkter font-size auf Text-Elementen.
   Greift in Browsern ohne `zoom`-Support und für Nutzer, die das Layout
   selbst minimal halten möchten. */
html.a11y-fs-1 body,
html.a11y-fs-1 p,
html.a11y-fs-1 li,
html.a11y-fs-1 td,
html.a11y-fs-1 dd,
html.a11y-fs-1 dt,
html.a11y-fs-1 a,
html.a11y-fs-1 span,
html.a11y-fs-1 label,
html.a11y-fs-1 input,
html.a11y-fs-1 select,
html.a11y-fs-1 textarea,
html.a11y-fs-1 button {
	font-size: 17px !important;
}
html.a11y-fs-2 body,
html.a11y-fs-2 p,
html.a11y-fs-2 li,
html.a11y-fs-2 td,
html.a11y-fs-2 dd,
html.a11y-fs-2 dt,
html.a11y-fs-2 a,
html.a11y-fs-2 span,
html.a11y-fs-2 label,
html.a11y-fs-2 input,
html.a11y-fs-2 select,
html.a11y-fs-2 textarea,
html.a11y-fs-2 button {
	font-size: 19px !important;
}
html.a11y-fs-3 body,
html.a11y-fs-3 p,
html.a11y-fs-3 li,
html.a11y-fs-3 td,
html.a11y-fs-3 dd,
html.a11y-fs-3 dt,
html.a11y-fs-3 a,
html.a11y-fs-3 span,
html.a11y-fs-3 label,
html.a11y-fs-3 input,
html.a11y-fs-3 select,
html.a11y-fs-3 textarea,
html.a11y-fs-3 button {
	font-size: 22px !important;
}

/* Überschriften sollen relativ zur Body-Größe wachsen (em statt px) */
html.a11y-fs-1 h1, html.a11y-fs-2 h1, html.a11y-fs-3 h1 { font-size: 2.0em !important; }
html.a11y-fs-1 h2, html.a11y-fs-2 h2, html.a11y-fs-3 h2 { font-size: 1.65em !important; }
html.a11y-fs-1 h3, html.a11y-fs-2 h3, html.a11y-fs-3 h3 { font-size: 1.35em !important; }
html.a11y-fs-1 h4, html.a11y-fs-2 h4, html.a11y-fs-3 h4 { font-size: 1.15em !important; }

/* Die Toolbar selbst soll NICHT mitskalieren, sonst wird sie riesig. */
html.a11y-fs-1 .a11y-toolbar,
html.a11y-fs-2 .a11y-toolbar,
html.a11y-fs-3 .a11y-toolbar {
	zoom: 1 !important;
	font-size: 14px !important;
}
html.a11y-fs-1 .a11y-toolbar *,
html.a11y-fs-2 .a11y-toolbar *,
html.a11y-fs-3 .a11y-toolbar * {
	font-size: inherit !important;
}

/* Hoher Kontrast */
html.a11y-contrast-high body,
html.a11y-contrast-high #wrapper {
	background: #000 !important;
	color: #ffffff !important;
}
html.a11y-contrast-high a,
html.a11y-contrast-high a:visited {
	color: #ffea00 !important;
	text-decoration: underline !important;
}
html.a11y-contrast-high #header,
html.a11y-contrast-high #navigation,
html.a11y-contrast-high #footer,
html.a11y-contrast-high section,
html.a11y-contrast-high .container,
html.a11y-contrast-high .property-description,
html.a11y-contrast-high .widget,
html.a11y-contrast-high .listing-item,
html.a11y-contrast-high .contact-box {
	background: #000 !important;
	color: #ffffff !important;
	border-color: #ffffff !important;
}
html.a11y-contrast-high img:not(.a11y-keep-color) {
	filter: contrast(1.1);
}
html.a11y-contrast-high .button,
html.a11y-contrast-high button {
	background: #ffea00 !important;
	color: #000 !important;
	border: 2px solid #ffea00 !important;
}

/* Invertiert */
html.a11y-contrast-invert {
	filter: invert(1) hue-rotate(180deg);
	background: #fff;
}
html.a11y-contrast-invert img,
html.a11y-contrast-invert video,
html.a11y-contrast-invert iframe,
html.a11y-contrast-invert .a11y-toolbar {
	filter: invert(1) hue-rotate(180deg);
}

/* Graustufen */
html.a11y-grayscale {
	filter: grayscale(1);
}
html.a11y-grayscale .a11y-toolbar {
	filter: grayscale(0);
}

/* Lesehilfe – alles unterstreichen */
html.a11y-underline a {
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

/* Größerer Cursor */
html.a11y-bigcursor,
html.a11y-bigcursor * {
	cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="%23000" stroke="%23fff" stroke-width="2" d="M4 2 L4 26 L10 20 L14 30 L18 28 L14 18 L22 18 Z"/></svg>') 4 2, auto !important;
}

/* ==========================================================================
   Belegungsplan-Plugin (Frontend-Styles)
   ========================================================================== */
.wbg-fewo-kalender {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
	margin: 24px 0;
}

.wbg-fewo-kalender__month {
	border: 1px solid #cfd6df;
	border-radius: 6px;
	padding: 12px;
	background: #fff;
}

.wbg-fewo-kalender__title {
	margin: 0 0 8px 0;
	font-size: 16px;
	color: #003366;
}

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

.wbg-fewo-kalender__nav button {
	background: #003366;
	color: #fff;
	border: 0;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
}
.wbg-fewo-kalender__nav button:hover,
.wbg-fewo-kalender__nav button:focus-visible {
	background: #001f3f;
}

.wbg-fewo-kalender__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.wbg-fewo-kalender__day-name {
	font-size: 12px;
	text-align: center;
	font-weight: 700;
	color: #555;
	padding: 4px 0;
}

.wbg-fewo-kalender__day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	background: #e8f3e8;
	color: #1b3d1b;
	border-radius: 3px;
	border: 1px solid transparent;
}

.wbg-fewo-kalender__day--empty {
	background: transparent;
}

.wbg-fewo-kalender__day--past {
	background: #f1f1f1;
	color: #999;
}

.wbg-fewo-kalender__day--booked {
	background: #b00020;
	color: #ffffff;
}

.wbg-fewo-kalender__day--pending {
	background: #ffc107;
	color: #3a2a00;
}

.wbg-fewo-kalender__day--today {
	border-color: #003366;
	font-weight: 700;
}

.wbg-fewo-kalender__legend {
	display: flex;
	gap: 16px;
	margin-top: 12px;
	font-size: 13px;
	flex-wrap: wrap;
}
.wbg-fewo-kalender__legend-swatch {
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 4px;
	vertical-align: middle;
	border-radius: 2px;
}

/* Anfrageformular */
.wbg-fewo-anfrage {
	background: #f6f8fb;
	border: 1px solid #cfd6df;
	border-radius: 6px;
	padding: 20px;
	margin: 24px 0;
}
.wbg-fewo-anfrage h3 {
	margin-top: 0;
	color: #003366;
}
.wbg-fewo-anfrage label {
	display: block;
	font-weight: 600;
	margin: 12px 0 4px 0;
	color: #1a1a1a;
}
.wbg-fewo-anfrage input,
.wbg-fewo-anfrage textarea,
.wbg-fewo-anfrage select {
	width: 100%;
	padding: 10px;
	border: 1px solid #999;
	border-radius: 4px;
	font: inherit;
	background: #fff;
	color: #1a1a1a;
}
.wbg-fewo-anfrage input:focus,
.wbg-fewo-anfrage textarea:focus,
.wbg-fewo-anfrage select:focus {
	border-color: #003366;
	outline: 3px solid #ffcc00;
	outline-offset: 1px;
}
.wbg-fewo-anfrage .wbg-fewo-anfrage__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.wbg-fewo-anfrage__hp {
	position: absolute;
	left: -9999px;
}
.wbg-fewo-anfrage__submit {
	background: #003366;
	color: #fff;
	border: 0;
	padding: 12px 24px;
	border-radius: 4px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 16px;
}
.wbg-fewo-anfrage__submit:hover,
.wbg-fewo-anfrage__submit:focus-visible {
	background: #001f3f;
}
.wbg-fewo-anfrage__error {
	color: #b00020;
	margin-top: 4px;
	font-size: 14px;
}
.wbg-fewo-anfrage__notice {
	padding: 12px;
	border-radius: 4px;
	margin-bottom: 12px;
}
.wbg-fewo-anfrage__notice--ok {
	background: #e7f4e7;
	color: #1b3d1b;
	border: 1px solid #2c7a2c;
}
.wbg-fewo-anfrage__notice--err {
	background: #fdecea;
	color: #611a15;
	border: 1px solid #b00020;
}

/* ==========================================================================
   FeWo-Listing
   ========================================================================== */
.wbg-fewo-liste {
	list-style: none;
	margin: 24px 0;
	padding: 0;
	display: grid;
	gap: 20px;
}
.wbg-fewo-liste--cols-1 { grid-template-columns: 1fr; }
.wbg-fewo-liste--cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.wbg-fewo-liste--cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.wbg-fewo-liste--cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.wbg-fewo-liste__item {
	background: #fff;
	border: 1px solid #cfd6df;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.15s, transform 0.15s;
}
.wbg-fewo-liste__item:hover,
.wbg-fewo-liste__item:focus-within {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.wbg-fewo-liste__link {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
	height: 100%;
}
.wbg-fewo-liste__link:hover,
.wbg-fewo-liste__link:focus-visible {
	text-decoration: none;
	color: inherit;
}

.wbg-fewo-liste__img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	display: block;
}
.wbg-fewo-liste__noimg {
	display: block;
	width: 100%;
	height: 220px;
	background: linear-gradient(135deg, #e5ebf2 0%, #c9d4e1 100%);
}

.wbg-fewo-liste__body {
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.wbg-fewo-liste__title {
	margin: 0;
	color: #003366;
	font-size: 20px;
}
.wbg-fewo-liste__facts {
	margin: 0;
	color: #555;
	font-size: 14px;
}
.wbg-fewo-liste__excerpt {
	margin: 4px 0 0;
	color: #333;
	font-size: 15px;
	line-height: 1.45;
}
.wbg-fewo-liste__price {
	margin: 8px 0 0;
	font-size: 16px;
	color: #1a1a1a;
}
.wbg-fewo-liste__price span {
	font-weight: 400;
	color: #555;
	font-size: 14px;
}
.wbg-fewo-liste__cta {
	margin-top: auto;
	padding-top: 10px;
	color: #003366;
	font-weight: 600;
}

/* ==========================================================================
   FeWo-Single (Plugin-Template)
   ========================================================================== */
.wbg-fewo-single__back a {
	color: #003366;
	text-decoration: underline;
}
.wbg-fewo-single__address {
	color: #555;
	margin: 0 0 24px;
}

.wbg-fewo-gallery-front {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px;
	margin: 16px 0 24px;
}
.wbg-fewo-gallery-front a {
	display: block;
	overflow: hidden;
	border-radius: 4px;
}
.wbg-fewo-gallery-front img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
	transition: transform 0.2s;
}
.wbg-fewo-gallery-front a:hover img,
.wbg-fewo-gallery-front a:focus-visible img {
	transform: scale(1.04);
}

.wbg-fewo-meta {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 6px 16px;
	margin: 16px 0 24px;
	background: #f6f8fb;
	border: 1px solid #cfd6df;
	padding: 14px 18px;
	border-radius: 6px;
}
.wbg-fewo-meta dt {
	font-weight: 700;
	color: #1a1a1a;
}
.wbg-fewo-meta dd {
	margin: 0;
	color: #1a1a1a;
}

.wbg-fewo-ausstattung {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 4px 16px;
	padding: 0;
	list-style: none;
	margin: 0 0 24px;
}
.wbg-fewo-ausstattung li {
	padding-left: 22px;
	position: relative;
}
.wbg-fewo-ausstattung li::before {
	content: "✓";
	color: #2c7a2c;
	position: absolute;
	left: 0;
	font-weight: 700;
}
