/* =========================================================
   Template "Stephan Merk" für WBCE
   Farben und Schrift angelehnt an merkst.de
   ========================================================= */

@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-display: swap;
	font-weight: 200 900;
	src: url(../fonts/source-sans-3-latin-wght-normal.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-display: swap;
	font-weight: 200 900;
	src: url(../fonts/source-sans-3-latin-ext-wght-normal.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Source Sans 3";
	font-style: italic;
	font-display: swap;
	font-weight: 200 900;
	src: url(../fonts/source-sans-3-latin-wght-italic.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Source Sans 3";
	font-style: italic;
	font-display: swap;
	font-weight: 200 900;
	src: url(../fonts/source-sans-3-latin-ext-wght-italic.woff2) format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--nachtblau: #101a30;
	--nachtblau-tief: #0a1222;
	--nachtblau-leiste: #17233d;
	--logoblau: #3b68ac;
	--blau: #2563eb;
	--gelb: #f4a900;
	--grund: #ffffff;
	--flaeche: #f2f5fa;
	--linie: #dce2ec;
	--text: #1a2233;
	--text-leise: #4f596b;
	--link: #1d4ed8;
	--link-hover: #0b2257;
	--fokus: #0b2257;
	--schrift: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
	--breite: 1180px;
	--textbreite: 760px;
	--radius: 8px;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
	margin: 0;
	background: var(--grund);
	color: var(--text);
	font-family: var(--schrift);
	font-size: 1.125rem;
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--nachtblau); font-weight: 700; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .35em; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 2em 0; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.5em; }
th, td { border: 1px solid var(--linie); padding: .5em .75em; text-align: left; vertical-align: top; }
th { background: var(--flaeche); }

/* ---------- Sprunglink ---------- */
.sprunglink {
	position: absolute; left: 1rem; top: -100px; z-index: 100;
	background: var(--gelb); color: var(--nachtblau);
	padding: .6em 1em; font-weight: 700; border-radius: var(--radius);
	text-decoration: none;
}
.sprunglink:focus { top: 1rem; outline: 3px solid var(--nachtblau); }

/* ---------- Kopf mit Logo ---------- */
.kopf { background: var(--grund); border-bottom: 1px solid var(--linie); }
.kopf-innen {
	max-width: var(--breite); margin: 0 auto; padding: .9rem 1.25rem;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { display: inline-block; line-height: 0; }
.logo img { width: var(--logo-breite, 248px); max-width: 100%; height: auto; }
.kopf-info { margin-left: auto; text-align: right; line-height: 1.35; }
.kopf-info p { margin: 0; }
.kopf-leistungen { color: var(--text-leise); font-size: 1rem; }
.kopf-kontakt { color: var(--nachtblau); font-weight: 700; font-size: 1.2rem; margin-top: .2rem !important; }
.kopf-kontakt a { color: inherit; text-decoration: none; }
.kopf-kontakt a:hover { text-decoration: underline; }
.kopf-zeiten { color: var(--text-leise); font-size: .95rem; }
@media (max-width: 899.98px) {
	.kopf-innen { flex-wrap: wrap; }
	.kopf-info { order: 3; flex-basis: 100%; text-align: left; margin: 0; padding-top: .6rem; border-top: 1px solid var(--linie); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .6rem; }
	.kopf-leistungen { display: none; }
	.kopf-kontakt { font-size: 1.05rem; margin-top: 0 !important; }
}

/* ---------- Navigation ---------- */
.navigation { background: var(--nachtblau); color: #fff; }
.navigation-innen { max-width: var(--breite); margin: 0 auto; padding: 0 1.25rem; }
.hauptmenue, .untermenue { list-style: none; margin: 0; padding: 0; }
.hauptmenue li { margin: 0; }
.hauptmenue a { color: #fff; text-decoration: none; }
.navigation :focus-visible { outline-color: var(--gelb); }

/* Schalter zum Aufklappen (von menue.js eingefügt) */
.unter-schalter {
	background: transparent; border: 0; color: #fff; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.25rem; height: 2.25rem; border-radius: 4px; padding: 0;
}
.unter-schalter svg { width: 14px; height: 14px; transition: transform .15s ease; }
.unter-schalter[aria-expanded="true"] svg { transform: rotate(180deg); }
.unter-schalter:hover { background: rgba(255,255,255,.12); }

/* Unsichtbar, aber vorlesbar */
.nur-vorlesen {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Breite Bildschirme: waagerechte Leiste */
@media (min-width: 900px) {
	.hauptmenue { display: flex; flex-wrap: wrap; }
	.hauptmenue > li { position: relative; display: flex; align-items: center; }
	.hauptmenue > li > a {
		display: block; padding: .95rem .9rem; font-weight: 600;
		border-bottom: 3px solid transparent;
	}
	.hauptmenue > li > a:hover,
	.hauptmenue > li.aktuell > a,
	.hauptmenue > li > a[aria-current] { border-bottom-color: var(--gelb); }
	.hauptmenue > li > .unter-schalter { margin-left: -.55rem; margin-right: .2rem; }

	.untermenue {
		position: absolute; left: 0; top: 100%; z-index: 50;
		min-width: 17rem; background: var(--grund);
		border: 1px solid var(--linie); border-top: 3px solid var(--logoblau);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: 0 10px 24px rgba(16,26,48,.14);
		padding: .4rem 0;
		display: none;
	}
	.untermenue a {
		display: block; color: var(--text); padding: .55rem 1.1rem; line-height: 1.35;
	}
	.untermenue a:hover, .untermenue a[aria-current] { background: var(--flaeche); color: var(--link); }
	.navigation .untermenue :focus-visible { outline-color: var(--fokus); outline-offset: -3px; }

	/* Ohne JavaScript: Aufklappen per Maus und Tastaturfokus */
	html:not(.js) .hauptmenue > li:hover > .untermenue,
	html:not(.js) .hauptmenue > li:focus-within > .untermenue { display: block; }
	/* Mit JavaScript: Maus darf weiter aufklappen, Tastatur nimmt den Schalter */
	.js .hauptmenue > li:hover > .untermenue,
	.js .hauptmenue > li.offen > .untermenue { display: block; }
}

/* Schmale Bildschirme: Menü zum Aufklappen */
.menue-schalter {
	display: none; align-items: center; gap: .55rem;
	font: inherit; font-weight: 700; color: var(--nachtblau);
	background: var(--grund); border: 2px solid var(--nachtblau);
	border-radius: var(--radius); padding: .45rem .9rem; cursor: pointer;
}
.menue-symbol, .menue-symbol::before, .menue-symbol::after {
	display: block; width: 18px; height: 2px; background: currentColor; position: relative;
}
.menue-symbol::before, .menue-symbol::after { content: ""; position: absolute; left: 0; }
.menue-symbol::before { top: -6px; }
.menue-symbol::after { top: 6px; }

@media (max-width: 899.98px) {
	.logo { min-width: 0; }
	.logo img { width: min(calc(var(--logo-breite, 248px) * .72), 58vw); }
	.js .menue-schalter:not([hidden]) { display: inline-flex; }
	.js .navigation:not(.offen) { display: none; }
	.navigation-innen { padding: .4rem 0 .8rem; }
	.hauptmenue > li { display: flex; flex-wrap: wrap; align-items: center; border-top: 1px solid rgba(255,255,255,.1); }
	.hauptmenue > li:first-child { border-top: 0; }
	.hauptmenue > li > a { flex: 1; padding: .8rem 1.25rem; font-weight: 600; }
	.hauptmenue > li.aktuell > a { box-shadow: inset 4px 0 0 var(--gelb); }
	.hauptmenue > li > .unter-schalter { width: 3rem; height: 3rem; margin-right: .5rem; }
	.untermenue { flex-basis: 100%; background: var(--nachtblau-leiste); padding: .3rem 0; }
	.js .hauptmenue > li:not(.offen) > .untermenue { display: none; }
	.untermenue a { display: block; padding: .6rem 1.25rem .6rem 2.25rem; color: #dfe6f3; }
	.untermenue a[aria-current] { color: #fff; box-shadow: inset 4px 0 0 var(--gelb); }
}

/* ---------- Seitenkopf mit Titel ---------- */
.seitenkopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.seitenkopf-innen { max-width: var(--breite); margin: 0 auto; padding: 2rem 1.25rem 1.8rem; }
.seitenkopf h1::after {
	content: ""; display: block; width: 3.5rem; height: 4px; margin-top: .7rem;
	background: var(--logoblau); border-radius: 2px;
}

/* ---------- Inhalt ---------- */
.rahmen {
	flex: 1; width: 100%; max-width: var(--breite); margin: 0 auto;
	padding: 2.2rem 1.25rem 3.5rem;
}
.inhalt { max-width: var(--textbreite); }
.rahmen:not(.mit-seitenleiste) .inhalt { max-width: 860px; }
.inhalt:focus { outline: none; }
.inhalt > :first-child, .inhalt .section_anchor + * { margin-top: 0; }
.mit-seitenleiste { display: grid; gap: 3rem; }
@media (min-width: 900px) {
	.mit-seitenleiste { grid-template-columns: minmax(0, 1fr) 300px; }
}
.seitenleiste {
	background: var(--flaeche); border: 1px solid var(--linie);
	border-radius: var(--radius); padding: 1.25rem 1.4rem; align-self: start;
	font-size: 1rem;
}
.seitenleiste > :first-child { margin-top: 0; }

/* Knöpfe, falls im Editor die Klasse buttonlink genutzt wird */
a.buttonlink {
	display: inline-block; background: var(--link); color: #fff; font-weight: 600;
	padding: .6em 1.1em; border-radius: var(--radius); text-decoration: none; margin: .3em .6em .3em 0;
}
a.buttonlink:hover { background: var(--link-hover); color: #fff; }

/* ---------- Fuß ---------- */
.fuss { background: var(--nachtblau-tief); color: #c3ccdc; font-size: 1rem; }
.fuss-innen { max-width: var(--breite); margin: 0 auto; padding: 2rem 1.25rem; text-align: center; }
.fuss p { margin: 0 0 .6em !important; text-align: center !important; }
.fuss p:last-child { margin-bottom: 0 !important; font-size: .92rem; color: #9aa6bb; }
.fuss a { color: #fff; }
.fuss a:hover { color: var(--gelb); }
.fuss :focus-visible { outline-color: var(--gelb); }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* ---------- Automatischer Dunkelmodus (folgt der Systemeinstellung) ---------- */
@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--grund: #101a30;
		--flaeche: #18243f;
		--linie: #2c3a5a;
		--text: #e9edf5;
		--text-leise: #b3bccd;
		--link: #8db6ff;
		--link-hover: #d6e4ff;
		--fokus: var(--gelb);
	}
	h1, h2, h3, h4 { color: #fff; }
	.kopf-kontakt { color: #fff; }
	.kopf { background: var(--nachtblau-tief); }
	.navigation { background: #131e36; border-bottom: 1px solid var(--linie); }
	.seitenkopf h1::after { background: #6b8fd0; }
	.menue-schalter { color: #fff; border-color: #fff; background: transparent; }
	.untermenue { background: var(--flaeche); border-color: var(--linie); box-shadow: 0 10px 24px rgba(0,0,0,.45); }
	@media (min-width: 900px) {
		.untermenue { border-top-color: #6b8fd0; }
		.untermenue a { color: var(--text); }
		.untermenue a:hover, .untermenue a[aria-current] { background: #22304f; color: #fff; }
	}
	.navigation .untermenue :focus-visible { outline-color: var(--gelb); }
	th { background: var(--flaeche); }
	a.buttonlink { background: var(--blau); }
	a.buttonlink:hover { background: #1d4ed8; }
	.fuss { background: var(--nachtblau-tief); border-top: 1px solid var(--linie); }
}
