/*
 * Handbuch DigElite Verein – eine Stilvorlage für alles: hell, dunkel, Druck.
 * Keine fremden Schriften: Es gelten die Schriften des Geräts, nichts wird nachgeladen.
 * Farbe trägt Information: --halt heißt „Achtung“, --marke heißt „merken“.
 */

/* ——— Farben ——— */
:root {
	--papier: #ffffff;
	--gesenkt: #f6f5fc;
	--tinte: #1c1a3a;
	--tinte-leise: #5d5b78;
	--linie: #e6e4f5;
	--linie-satt: #cfcbea;
	--marke: #4f3fd6;
	--marke-hell: #f1efff;
	--halt: #9a4a12;
	--halt-grund: #fdf3e7;
	--mass: 68ch;
	--schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
	:root {
		--papier: #14132a;
		--gesenkt: #1d1b3a;
		--tinte: #ecebf7;
		--tinte-leise: #aaa8c6;
		--linie: #2e2c52;
		--linie-satt: #45427a;
		--marke: #b3acff;
		--marke-hell: #25224d;
		--halt: #f0b37a;
		--halt-grund: #33230f;
	}
}
[data-theme="dark"] {
	--papier: #14132a;
	--gesenkt: #1d1b3a;
	--tinte: #ecebf7;
	--tinte-leise: #aaa8c6;
	--linie: #2e2c52;
	--linie-satt: #45427a;
	--marke: #b3acff;
	--marke-hell: #25224d;
	--halt: #f0b37a;
	--halt-grund: #33230f;
}

/* ——— Grundgerüst ——— */
* { box-sizing: border-box; }
html { scroll-padding-top: 5rem; }
body { margin: 0; font: 1.0625rem/1.65 var(--schrift); color: var(--tinte); background: var(--papier); }
a { color: var(--marke); text-underline-offset: .15em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--marke); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
code { font: .9em var(--mono); background: var(--gesenkt); border: 1px solid var(--linie); border-radius: .3em; padding: .05em .35em; overflow-wrap: anywhere; }
.nur-fuer-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprung { position: absolute; left: -999rem; top: 0; background: var(--marke); color: var(--papier); padding: .6rem 1rem; z-index: 20; }
.sprung:focus { left: 0; }

/* ——— Kopfband ——— */
.kopf { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; background: var(--papier); border-bottom: 1px solid var(--linie); }
.marke { display: flex; align-items: center; gap: .7rem; font-weight: 800; color: var(--tinte); text-decoration: none; }
/* Das Logo trägt dunkle Schrift auf durchsichtigem Grund: Es steht immer auf Weiß, sonst verschwindet „Web“ im Dunkelmodus. */
.marke img { border-radius: 8px; flex: none; background: #fff; padding: 2px 6px; box-sizing: content-box; }

/* ——— Was nur mit Skript erscheint ——— */
.suche { display: none; position: relative; flex: 0 1 24rem; }
.js-an .suche { display: block; }
.suche input { width: 100%; font: inherit; padding: .45rem .8rem; color: var(--tinte); background: var(--gesenkt); border: 1px solid var(--linie-satt); border-radius: .6rem; }
.treffer { position: absolute; right: 0; left: 0; top: calc(100% + .4rem); max-height: 70vh; overflow: auto; background: var(--papier); border: 1px solid var(--linie-satt); border-radius: .6rem; }
.treffer:empty { display: none; }
.treffer a { display: block; padding: .6rem .9rem; border-bottom: 1px solid var(--linie); text-decoration: none; color: var(--tinte); }
.treffer a:last-child { border-bottom: 0; }
.treffer a:hover, .treffer a:focus { background: var(--marke-hell); }
.treffer .t-titel { display: block; font-weight: 700; color: var(--marke); }
.treffer .t-ort { display: block; font-size: .8rem; color: var(--tinte-leise); }
.treffer .t-text { display: block; font-size: .88rem; line-height: 1.45; }
.treffer .t-leer { margin: 0; padding: .7rem .9rem; font-size: .9rem; color: var(--tinte-leise); }
.verzeichnis-knopf { display: none; }

/* ——— Rahmen: Verzeichnis links, Text rechts ——— */
.rahmen { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2.5rem; max-width: 78rem; margin: 0 auto; padding: 0 1.25rem; }
.seitenleiste { padding: 1.5rem 0; }
#verzeichnis { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow: auto; font-size: .93rem; }
.nav-teil { margin-bottom: 1.1rem; }
.nav-teil-titel { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tinte-leise); margin-bottom: .3rem; }
.nav-teil ul { list-style: none; margin: 0; padding: 0; }
.nav-teil a { display: block; padding: .28rem .6rem; border-radius: .4rem; color: var(--tinte); text-decoration: none; line-height: 1.35; }
.nav-teil a:hover { background: var(--gesenkt); }
.nav-teil a[aria-current="page"] { background: var(--marke-hell); color: var(--marke); font-weight: 700; }

@media (max-width: 56rem) {
	.rahmen { display: block; }
	.seitenleiste { padding: 1rem 0 0; }
	#verzeichnis { position: static; max-height: none; }
	.js-an .verzeichnis-knopf { display: block; width: 100%; font: inherit; font-weight: 700; text-align: left; padding: .6rem .9rem; color: var(--tinte); background: var(--gesenkt); border: 1px solid var(--linie-satt); border-radius: .6rem; }
	.js-an .verzeichnis-knopf::after { content: " ▾"; }
	.js-an .verzeichnis-knopf[aria-expanded="true"]::after { content: " ▴"; }
	.js-an .verzeichnis-knopf[aria-expanded="false"] + #verzeichnis { display: none; }
	.js-an #verzeichnis { padding-top: 1rem; }
	.kopf { flex-wrap: wrap; }
	.suche { flex-basis: 100%; }
}

/* ——— Text ——— */
main { min-width: 0; padding: 2rem 0 3rem; }
main > * { max-width: var(--mass); }
main > .tabelle-rahmen, main > figure, main > .bilder-2, main > .bild-text, main > .karten, main > .blaettern { max-width: 60rem; }
.teil { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--marke); }
h1 { font-size: 2.1rem; line-height: 1.15; letter-spacing: -.02em; margin: .2rem 0 1rem; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 2.4rem 0 .7rem; }
h3 { font-size: 1.12rem; margin: 1.8rem 0 .5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: .35rem; }
.fassung { font-size: .88rem; color: var(--tinte-leise); border-left: 3px solid var(--linie-satt); padding-left: .8rem; }

/* ——— Bausteine ——— */
.vorspann { font-size: 1.18rem; line-height: 1.55; color: var(--tinte); }
.wo { font-size: .93rem; color: var(--tinte-leise); background: var(--gesenkt); border: 1px solid var(--linie); border-radius: .5rem; padding: .5rem .8rem; }
.ort { white-space: normal; color: var(--tinte); background: var(--gesenkt); border-radius: .3em; padding: .05em .3em; }
.wo .ort, .wo b { background: none; padding: 0; color: var(--tinte); }
.merksatz, .achtung { border-radius: .6rem; padding: .9rem 1.1rem; margin: 1.4rem 0; }
.merksatz { background: var(--marke-hell); border-left: 4px solid var(--marke); }
.achtung { background: var(--halt-grund); border-left: 4px solid var(--halt); }
.merksatz-titel, .achtung-titel { display: block; font-weight: 800; margin-bottom: .2rem; }
.merksatz-titel { color: var(--marke); }
.achtung-titel { color: var(--halt); }
.merksatz p:last-child, .achtung p:last-child { margin-bottom: 0; }
.tabelle-rahmen { overflow-x: auto; margin: 1.2rem 0 1.5rem; border: 1px solid var(--linie); border-radius: .6rem; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: .55rem .8rem; border-bottom: 1px solid var(--linie); }
th { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-leise); background: var(--gesenkt); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
ol.schritte { list-style: none; counter-reset: schritt; padding: 0; }
ol.schritte > li { counter-increment: schritt; position: relative; padding-left: 2.6rem; margin-bottom: .8rem; }
ol.schritte > li::before { content: counter(schritt); position: absolute; left: 0; top: .1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 800; color: var(--papier); background: var(--marke); }
ul.kacheln { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .8rem; max-width: 60rem; }
ul.kacheln li { margin: 0; padding: .8rem 1rem; font-size: .93rem; line-height: 1.5; background: var(--gesenkt); border: 1px solid var(--linie); border-radius: .6rem; }
ul.kacheln b { display: block; color: var(--marke); }
ul.zweispaltig { columns: 2 18rem; column-gap: 2rem; }
ul.zweispaltig li { break-inside: avoid; }

/* ——— Bildschirmfotos ——— */
figure.bild { margin: 1.6rem 0; }
figure.bild img { display: block; border: 1px solid var(--linie-satt); border-radius: .6rem; background: #fff; }
figure.bild figcaption { margin-top: .5rem; font-size: .88rem; color: var(--tinte-leise); }
figure.bild.schmal { max-width: 22rem; }
figure.bild.mittel { max-width: 34rem; }
.bilder-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.bilder-2 figure.bild { margin: 1rem 0; }

/* ——— Blättern und Fuß ——— */
.blaettern { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--linie); }
.blaettern a { display: block; padding: .8rem 1rem; border: 1px solid var(--linie-satt); border-radius: .6rem; text-decoration: none; font-weight: 700; }
.blaettern a span { display: block; font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tinte-leise); }
.blaettern .weiter { text-align: right; }
.fuss { border-top: 1px solid var(--linie); padding: 1.5rem 1.25rem 2.5rem; text-align: center; font-size: .86rem; color: var(--tinte-leise); }
.fuss p { margin: 0 0 .3rem; }

/* ——— Startseite ——— */
.knopf { display: inline-block; padding: .65rem 1.4rem; border-radius: .6rem; font-weight: 800; text-decoration: none; color: var(--papier); background: var(--marke); }
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.karte { padding: 1.1rem 1.2rem; background: var(--gesenkt); border: 1px solid var(--linie); border-radius: .8rem; }
.karte-titel { margin: 0 0 .6rem; font-size: 1.05rem; }
.karte ul { list-style: none; margin: 0; padding: 0; }
.karte li { margin-bottom: .7rem; }
.karte a { font-weight: 700; }
.karte-kurz { display: block; font-size: .86rem; line-height: 1.45; color: var(--tinte-leise); }

/* ——— Druck ——— */
@media print {
	.kopf, .seitenleiste, .blaettern, .sprung { display: none !important; }
	.rahmen { display: block; max-width: none; padding: 0; }
	body { font-size: 10.5pt; }
	main > * { max-width: none; }
	a { color: inherit; text-decoration: none; }
	figure.bild, .merksatz, .achtung, tr { break-inside: avoid; }
	h2, h3 { break-after: avoid; }
}
