/*
 * bei.pm - modernes Stylesheet.
 * Die Darstellung wird über Klassen am <html>-Element gesteuert
 * (Farbschema, Hell/Dunkel, Schriftgröße, Schriftart, Zeilenhöhe) und in
 * CSS-Custom-Properties übersetzt. Kompatibel zum Klassen-Kontrakt der
 * PHP-Vorlage, technisch aber als Custom-Properties umgesetzt.
 */

/* ---------- Basis-Tokens -------------------------------------------------- */
:root {
	--fs-scale: 1;
	--lh: 1.6;
	--font-body: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "Commit Mono", ui-monospace, "Fira Mono", "SFMono-Regular", Menlo, monospace;

	--radius: 14px;
	--maxw: 64rem;
	--space: clamp(1rem, 2.5vw, 2rem);

	/* Farb-Fallbacks (helle Variante des Standardschemas). */
	--bg: #f7f7f9;
	--surface: #ffffff;
	--fg: #1b1d23;
	--muted: #5c6270;
	--border: #e3e5ea;
	--accent: #3457d5;
	--accent-fg: #ffffff;
}

/* ---------- Schriftgröße -------------------------------------------------- */
html.sxs { --fs-scale: 0.8; }
html.ss  { --fs-scale: 0.9; }
html.sm  { --fs-scale: 1; }
html.sl  { --fs-scale: 1.15; }
html.sxl { --fs-scale: 1.3; }

/* ---------- Zeilenhöhe (lh8 ... lh26) -------------------------------------- */
html.lh8 { --lh: 0.8; }  html.lh9 { --lh: 0.9; }  html.lh10 { --lh: 1.0; }
html.lh11 { --lh: 1.1; } html.lh12 { --lh: 1.2; } html.lh13 { --lh: 1.3; }
html.lh14 { --lh: 1.4; } html.lh15 { --lh: 1.5; } html.lh16 { --lh: 1.6; }
html.lh17 { --lh: 1.7; } html.lh18 { --lh: 1.8; } html.lh19 { --lh: 1.9; }
html.lh20 { --lh: 2.0; } html.lh21 { --lh: 2.1; } html.lh22 { --lh: 2.2; }
html.lh23 { --lh: 2.3; } html.lh24 { --lh: 2.4; } html.lh25 { --lh: 2.5; }
html.lh26 { --lh: 2.6; }

/* ---------- Webfonts ----------------------------------------------------- */
/* Aus der PHP-Fassung (content/font) übernommen, nur WOFF2. Der Browser lädt
   nur die Schnitte, die die gewählte Schrift tatsächlich nutzt. Pfad /font/1/
   ist versioniert und wird dauerhaft gecacht (bei Änderungen -> /font/2/). */
@font-face { font-family: "Commit Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/CommitMono-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "Commit Mono"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/CommitMono-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "Commit Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/CommitMono-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Commit Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/CommitMono-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/FiraMono-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/font/1/FiraMono-Normal-500.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/FiraMono-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 100; font-display: swap; src: url("/font/1/FiraSans-Italic-100.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 200; font-display: swap; src: url("/font/1/FiraSans-Italic-200.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/FiraSans-Italic-300.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/FiraSans-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 500; font-display: swap; src: url("/font/1/FiraSans-Italic-500.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url("/font/1/FiraSans-Italic-600.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/FiraSans-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 800; font-display: swap; src: url("/font/1/FiraSans-Italic-800.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 900; font-display: swap; src: url("/font/1/FiraSans-Italic-900.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 100; font-display: swap; src: url("/font/1/FiraSans-Normal-100.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 200; font-display: swap; src: url("/font/1/FiraSans-Normal-200.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/FiraSans-Normal-300.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/FiraSans-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/font/1/FiraSans-Normal-500.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/font/1/FiraSans-Normal-600.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/FiraSans-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("/font/1/FiraSans-Normal-800.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 900; font-display: swap; src: url("/font/1/FiraSans-Normal-900.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 100; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-100.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 200; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-200.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-300.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 500; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 600; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/IBMPlexMono-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 100; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-100.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 200; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-200.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-300.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/IBMPlexMono-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 100; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-100.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 200; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-200.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-300.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 500; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 600; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/IBMPlexSans-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-100.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 200; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-200.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-300.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/IBMPlexSans-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 100; font-display: swap; src: url("/font/1/Lato-Italic-100.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/Lato-Italic-300.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/Lato-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/Lato-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 900; font-display: swap; src: url("/font/1/Lato-Italic-900.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 100; font-display: swap; src: url("/font/1/Lato-Normal-100.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/Lato-Normal-300.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/Lato-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/Lato-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 900; font-display: swap; src: url("/font/1/Lato-Normal-900.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Symbols"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/NotoSansSymbols-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/NotoSerif-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/NotoSerif-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Playfair"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/Playfair-Italic-300.woff2") format("woff2"); } /* Playfair 5pt SemiExpanded Light */
@font-face { font-family: "Playfair"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/Playfair-Normal-300.woff2") format("woff2"); } /* Playfair 5pt SemiExpanded Light */
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 100; font-display: swap; src: url("/font/1/Roboto-Italic-100.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/Roboto-Italic-300.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/Roboto-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 500; font-display: swap; src: url("/font/1/Roboto-Italic-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/Roboto-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 900; font-display: swap; src: url("/font/1/Roboto-Italic-900.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 100; font-display: swap; src: url("/font/1/Roboto-Normal-100.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/Roboto-Normal-300.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/Roboto-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("/font/1/Roboto-Normal-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/Roboto-Normal-700.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 900; font-display: swap; src: url("/font/1/Roboto-Normal-900.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: italic; font-weight: 300; font-display: swap; src: url("/font/1/Ubuntu-Italic-300.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: italic; font-weight: 400; font-display: swap; src: url("/font/1/Ubuntu-Italic-400.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: italic; font-weight: 500; font-display: swap; src: url("/font/1/Ubuntu-Italic-500.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: italic; font-weight: 700; font-display: swap; src: url("/font/1/Ubuntu-Italic-700.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 300; font-display: swap; src: url("/font/1/Ubuntu-Normal-300.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 400; font-display: swap; src: url("/font/1/Ubuntu-Normal-400.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 500; font-display: swap; src: url("/font/1/Ubuntu-Normal-500.woff2") format("woff2"); }
@font-face { font-family: "Ubuntu"; font-style: normal; font-weight: 700; font-display: swap; src: url("/font/1/Ubuntu-Normal-700.woff2") format("woff2"); }

/* ---------- Schriftarten -------------------------------------------------- */
html.fcLato { --font-body: "Lato", system-ui, sans-serif; }
html.fcFiraSans { --font-body: "Fira Sans", system-ui, sans-serif; }
html.fcIBMPlexSans { --font-body: "IBM Plex Sans", system-ui, sans-serif; }
html.fcRoboto { --font-body: "Roboto", system-ui, sans-serif; }
html.fcUbuntu { --font-body: "Ubuntu", system-ui, sans-serif; }
html.fcNotoSerif { --font-body: "Noto Serif", Georgia, serif; }
html.fcPlayfair { --font-body: "Playfair", Georgia, serif; }
html.fcNotoSansSymbols { --font-body: "Noto Sans Symbols", system-ui, sans-serif; }
html.fmCommitMono { --font-mono: "Commit Mono", ui-monospace, monospace; }
html.fmFiraMono { --font-mono: "Fira Mono", ui-monospace, monospace; }
html.fmIBMPlexMono { --font-mono: "IBM Plex Mono", ui-monospace, monospace; }

/* ---------- Farbschemata: hell / dunkel ---------------------------------- */
/* Jede Kombination aus Schema (cDefault/cGreen/cPolar) und Modus
 * (ml hell / md dunkel / ma automatisch) setzt die Farb-Tokens. Bei ma greift
 * zusätzlich prefers-color-scheme für die automatische Umschaltung. */
html.cDefault.ml { --bg:#f7f7f9; --surface:#fff; --fg:#1b1d23; --muted:#5c6270; --border:#e3e5ea; --accent:#3457d5; --accent-fg:#fff; }
html.cDefault.md { --bg:#15171c; --surface:#1d2027; --fg:#e8eaf0; --muted:#9aa0ad; --border:#2b2f38; --accent:#7a93ff; --accent-fg:#0f1115; }
html.cDefault.ma { --bg:#f7f7f9; --surface:#fff; --fg:#1b1d23; --muted:#5c6270; --border:#e3e5ea; --accent:#3457d5; --accent-fg:#fff; }
@media (prefers-color-scheme: dark) {
	html.cDefault.ma { --bg:#15171c; --surface:#1d2027; --fg:#e8eaf0; --muted:#9aa0ad; --border:#2b2f38; --accent:#7a93ff; --accent-fg:#0f1115; }
}

html.cGreen.ml { --bg:#f3f8f3; --surface:#fff; --fg:#16231a; --muted:#546356; --border:#dceadd; --accent:#2e9e5b; --accent-fg:#fff; }
html.cGreen.md { --bg:#101712; --surface:#161e18; --fg:#e3efe6; --muted:#93a596; --border:#26312a; --accent:#4cc985; --accent-fg:#0c130e; }
html.cGreen.ma { --bg:#f3f8f3; --surface:#fff; --fg:#16231a; --muted:#546356; --border:#dceadd; --accent:#2e9e5b; --accent-fg:#fff; }
@media (prefers-color-scheme: dark) {
	html.cGreen.ma { --bg:#101712; --surface:#161e18; --fg:#e3efe6; --muted:#93a596; --border:#26312a; --accent:#4cc985; --accent-fg:#0c130e; }
}

html.cPolar.ml { --bg:#eef3f8; --surface:#fff; --fg:#1a2530; --muted:#566472; --border:#d6e2ee; --accent:#2f7fc1; --accent-fg:#fff; }
html.cPolar.md { --bg:#121922; --surface:#18212c; --fg:#e6eef7; --muted:#94a3b4; --border:#243140; --accent:#5aa9e6; --accent-fg:#0b1118; }
html.cPolar.ma { --bg:#eef3f8; --surface:#fff; --fg:#1a2530; --muted:#566472; --border:#d6e2ee; --accent:#2f7fc1; --accent-fg:#fff; }
@media (prefers-color-scheme: dark) {
	html.cPolar.ma { --bg:#121922; --surface:#18212c; --fg:#e6eef7; --muted:#94a3b4; --border:#243140; --accent:#5aa9e6; --accent-fg:#0b1118; }
}

/* ---------- Reset & Grundlayout ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--fs-scale)); }
body {
	margin: 0;
	font-family: var(--font-body);
	line-height: var(--lh);
	background: var(--bg);
	color: var(--fg);
	-webkit-font-smoothing: antialiased;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space); }
main.container { flex: 1; padding-block: clamp(1.5rem, 4vw, 3rem); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--font-mono); }

.skip-link {
	position: absolute; left: -999px; top: 0;
	background: var(--accent); color: var(--accent-fg); padding: .5rem 1rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; z-index: 100; }

/* ---------- Header / Footer ---------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 10;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; color: var(--fg); }
.brand-dot { color: var(--accent); }
.icon-link { font-size: 1.3rem; color: var(--muted); }
.icon-link-first { margin-inline-start: auto; } /* Icons rechtsbündig */
.header-inner .icon-link + .icon-link { margin-inline-start: -.5rem; } /* engerer Abstand zwischen Icons */
.icon-link:hover { color: var(--fg); text-decoration: none; }
.icon-link .icon { display: block; }
/* Inline-Icons im Textfluss (Pfeile, externer Link). */
.icon-inline { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; flex: none; }
.card-cta, .chapter-nav-dir { display: inline-flex; align-items: center; gap: .35em; }
/* Externe Links: Icon hängt am letzten Wort (span.nowrap), bricht nie allein um. */
.nowrap { white-space: nowrap; }
.icon-external { width: .8em; height: .8em; margin-inline-start: .18em; vertical-align: 0; opacity: .75; }
a:hover .icon-external { opacity: 1; }
.card:hover .card-cta .icon-inline { transform: translateX(2px); transition: transform .15s ease; }

/* Mobile Kopfzeile: etwas kompakter. */
@media (max-width: 40rem) {
	.header-inner { min-height: 3.25rem; }
}

.breadcrumb { border-bottom: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.breadcrumb .container { padding-block: .6rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { margin-inline: .5rem; opacity: .5; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; padding-block: 1.5rem; }
.site-footer nav { flex-wrap: wrap; align-items: baseline; }
.footer-feed { display: inline-flex; gap: .5rem; align-items: baseline; }
.footer-feed-format { font-size: .8em; padding: .05rem .4rem; border: 1px solid var(--border); border-radius: 6px; }
.footer-feed-format:hover { text-decoration: none; color: var(--fg); border-color: var(--accent); }
.site-footer nav { display: flex; gap: 1rem; }
.site-footer a { color: var(--muted); }

/* ---------- Inhalte ------------------------------------------------------- */
/* Nur für Screenreader (z. B. die h1 der Startseite). */
.visually-hidden {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lead { font-size: 1.2rem; color: var(--muted); margin: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem; margin-block: 2.5rem; }
.card {
	display: flex; flex-direction: column; gap: .5rem;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 1.5rem; color: var(--fg);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px -12px rgba(0,0,0,.25); }
.card h2 { margin: 0; font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); }
.card-cta { margin-top: auto; color: var(--accent); font-weight: 600; }
.card-tag { display: inline-block; vertical-align: middle; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: .05rem .55rem; }
.card-planned { border-style: dashed; opacity: .85; }

/* Entwurfs-Banner */
.draft-banner {
	margin: 0 0 1.5rem; padding: .7rem 1rem; border-radius: var(--radius);
	border: 1px solid color-mix(in srgb, #e0a23a 50%, var(--border));
	background: color-mix(in srgb, #e0a23a 12%, transparent);
	font-size: .9rem;
}
.draft-banner strong { color: color-mix(in srgb, #e0a23a 80%, var(--fg)); }
.archived-banner { border-color: var(--border); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.archived-banner strong { color: var(--fg); }

.section-head { max-width: 46rem; margin-block: clamp(1rem, 4vw, 2rem) .5rem; }
.section-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; margin: 0 0 .5rem; }

/* Fotografie: Jahres-Übersicht */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; margin-block: 2rem; }
.year-card {
	position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
	background-color: var(--surface); background-size: cover; background-position: center;
	border: 1px solid var(--border); display: flex; align-items: flex-end;
	transition: transform .15s ease, box-shadow .15s ease;
}
.year-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -12px rgba(0,0,0,.45); text-decoration: none; }
.year-card-overlay {
	width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
	padding: .7rem .9rem; color: #fff;
	background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,0));
}
.year-card-year { font-size: 1.5rem; font-weight: 800; }
.year-card-count { font-size: .85rem; opacity: .85; }

/* Galerie-Seite */
.gallery-page { max-width: 72rem; margin-inline: auto; }
.gallery-text { max-width: 44rem; }
.gallery-heading { margin: 2.5rem 0 1rem; font-size: 1.5rem; letter-spacing: -.01em; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem; margin-bottom: 1.5rem; }
.gallery-image {
	position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
	background-color: var(--surface); background-size: cover; background-position: center;
	display: flex; align-items: flex-end; transition: transform .12s ease;
}
.gallery-image:hover { transform: scale(1.02); text-decoration: none; }
.gallery-image-meta {
	width: 100%; padding: .45rem .55rem; color: #fff; font-size: .72rem; line-height: 1.35;
	display: flex; flex-direction: column; gap: .05rem; opacity: 0;
	background: linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,0)); transition: opacity .12s ease;
}
.gallery-image:hover .gallery-image-meta,
.gallery-image:focus-visible .gallery-image-meta { opacity: 1; }
.gi-desc { font-weight: 600; }
.gi-date { opacity: .95; }
.gi-cam { opacity: .9; }
.gi-opt { opacity: .8; font-variant-numeric: tabular-nums; }

/* Dichtere Raster auf Mobilgeräten */
@media (max-width: 36rem) {
	.year-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
	.year-card-year { font-size: 1.2rem; }
	.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .4rem; }
	/* Touch-Geräte haben keinen Hover: Metadaten dezent dauerhaft andeuten. */
	.gallery-image-meta { opacity: 0; }
}

/* Lightbox */
body.lightbox-open { overflow: hidden; }
body.lightbox-open .site-header { display: none; } /* kein Durchscheinen der Kopfzeile */

.lightbox {
	position: fixed; inset: 0; z-index: 1000;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0,0,0,.96); touch-action: none;
}
.lightbox[hidden] { display: none; }

/* Feste Bühne: das Bild lädt in eine zentrierte Fläche, ohne Layout-Shift. */
.lightbox-stage {
	position: absolute; inset: 0; overflow: hidden; touch-action: none;
	display: flex; align-items: center; justify-content: center;
}
.lightbox-img {
	max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
	border-radius: 4px; user-select: none; -webkit-user-drag: none;
	opacity: 0; transition: opacity .2s ease; transform-origin: center center; will-change: transform;
}
.lightbox:not(.is-loading) .lightbox-img { opacity: 1; }
.lightbox-img.is-pixelated { image-rendering: pixelated; max-width: none; max-height: none; }
/* Artikelbilder, die die Lightbox öffnen */
.article .lightbox-trigger { cursor: zoom-in; }
.article img.lightbox-trigger:focus-visible, .article a.lightbox-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lightbox.is-zoomed .lightbox-img { cursor: grab; }

.lightbox-spinner {
	position: absolute; width: 2.5rem; height: 2.5rem; border-radius: 50%;
	border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
	opacity: 0; transition: opacity .15s ease; animation: lb-spin .8s linear infinite;
}
.lightbox.is-loading .lightbox-spinner { opacity: 1; }
@keyframes lb-spin { to { transform: rotate(360deg); } }

.lightbox-caption {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;
	padding: 1.4rem 1rem .9rem; text-align: center; color: #eaeaea; font-size: .85rem;
	background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0));
}
.lightbox-caption[hidden] { display: none; }
.lightbox-counter { position: absolute; top: 1rem; left: 1.1rem; z-index: 2; color: #cfcfcf; font-size: .85rem; font-variant-numeric: tabular-nums; }

.lightbox-close, .lightbox-nav {
	position: absolute; z-index: 3; padding: 0; border: 0; cursor: pointer; color: #fff;
	width: 3rem; height: 3rem; border-radius: 999px; background: rgba(255,255,255,.12);
	display: inline-flex; align-items: center; justify-content: center; transition: background .12s ease;
}
.lightbox-close svg, .lightbox-nav svg { width: 1.4rem; height: 1.4rem; display: block; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.28); }
.lightbox-close { top: 1rem; right: 1.1rem; }
.lightbox-prev { left: clamp(.4rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lightbox-next { right: clamp(.4rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); }
.lightbox.is-zoomed .lightbox-nav { opacity: 0; pointer-events: none; }
.lightbox.is-single .lightbox-nav, .lightbox.is-single .lightbox-counter { display: none; }

@media (max-width: 36rem) {
	.lightbox-nav { width: 2.6rem; height: 2.6rem; }
	.lightbox-caption { font-size: .78rem; padding-bottom: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
	.lightbox-img { transition: none; }
	.lightbox-spinner { animation-duration: 1.6s; }
}

.prose { max-width: 44rem; }
.prose.center { text-align: center; margin-inline: auto; }
.prose h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; }
.note, .hint { color: var(--muted); }
.note code { background: color-mix(in srgb, var(--fg) 8%, transparent); padding: .15em .4em; border-radius: 6px; }

/* Lesetypografie für lange Artikel. */
.article { margin-inline: auto; }
.article-header { margin-block: 0 2rem; }
.article-meta { color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }
.article p { margin-block: 1.1em; }
.article h2, .article h3 { margin-block: 2rem .6rem; line-height: 1.25; letter-spacing: -.01em; }
.article h3 { font-size: 1.3rem; }
.article a { text-decoration: underline; text-underline-offset: 2px; }
.article code { background: color-mix(in srgb, var(--fg) 8%, transparent); padding: .12em .4em; border-radius: 6px; font-size: .9em; }
.article img { max-width: 100%; height: auto; border-radius: var(--radius); }
.article blockquote { margin: 1.5em 0; padding-inline-start: 1.2em; border-inline-start: 3px solid var(--accent); color: var(--muted); }

/* Layout-Bausteine portierter Artikel (Text + Screenshot nebeneinander). */
.article .contentWrapper { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; margin-block: 1.5rem; }
.article .contentWrapper.reverse { flex-direction: row-reverse; }
.article .textWrap { flex: 1 1 22rem; min-width: 0; }
.article .floatWrap { flex: 0 1 18rem; }
.article .floatWrap img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.article .mediaDescriptor { color: var(--muted); font-size: .85rem; text-align: center; margin-top: .4rem; }
.article .mediaDescriptor p { margin: 0; }
.article .well { background: color-mix(in srgb, var(--fg) 5%, transparent); border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem 1.25rem; margin-block: 1.25rem; }

/* Hex-/Datenformat-Tabellen (Outpost-2) */
.article .tableWrapper { overflow-x: auto; margin-block: 1.5rem; }
.article .tableHex table { min-width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: .78rem; }
.article .tableHex th, .article .tableHex td { border: 1px solid var(--border); padding: .25em .45em; vertical-align: top; text-align: left; }
.article .tableHex thead th { background: color-mix(in srgb, var(--fg) 6%, transparent); font-weight: 600; text-align: center; }
/* Nur das eigentliche Hex-Raster zentrieren; die Erklärungstabelle bleibt links. */
.article .tableHex .col, .article .tableHex .ascii { text-align: center; }
.article .tableHex .addr { text-align: right; color: var(--muted); white-space: nowrap; }
.article .tableHex .ascii { border-inline: 0; }

/* Feld-Farben c1-c16 zur visuellen Gruppierung (wie im PHP-Original: Farbton
   je Stufe um 22,25 Grad gedreht, Start bei Blau). */
.article .tableHex [class*=" c"] { background: hsl(var(--hex-hue) 72% 55% / .17); }
.article .tableHex .c1 { --hex-hue: 220; }
.article .tableHex .c2 { --hex-hue: 242.25; }
.article .tableHex .c3 { --hex-hue: 264.5; }
.article .tableHex .c4 { --hex-hue: 286.75; }
.article .tableHex .c5 { --hex-hue: 309; }
.article .tableHex .c6 { --hex-hue: 331.25; }
.article .tableHex .c7 { --hex-hue: 353.5; }
.article .tableHex .c8 { --hex-hue: 15.75; }
.article .tableHex .c9 { --hex-hue: 38; }
.article .tableHex .c10 { --hex-hue: 60.25; }
.article .tableHex .c11 { --hex-hue: 82.5; }
.article .tableHex .c12 { --hex-hue: 104.75; }
.article .tableHex .c13 { --hex-hue: 127; }
.article .tableHex .c14 { --hex-hue: 149.25; }
.article .tableHex .c15 { --hex-hue: 171.5; }
.article .tableHex .c16 { --hex-hue: 193.75; }

/* Hover-Hervorhebung: aktives Feld betonen, übrige Felder dämpfen. */
.article .tableHex.is-highlighting .field { opacity: .3; }
.article .tableHex.is-highlighting .field.is-active { opacity: 1; }
.article .tableHex .field.is-active { outline: 2px solid var(--accent); outline-offset: -2px; }
.article .tableHex .field { transition: opacity .1s ease; cursor: help; }

/* IP-/Lizenz-Hinweisblock */
.article .license { border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--fg) 4%, transparent); padding: .3rem 1.2rem; margin-block: 1.5rem; font-size: .92em; color: var(--muted); }
.article .license strong { color: var(--fg); }

/* Abbildungen */
.figure { margin: 1.8em 0; text-align: center; }
.figure img { display: inline-block; image-rendering: pixelated; background: #fff; padding: .25rem; }
.figure figcaption { margin-top: .6rem; color: var(--muted); font-size: .9rem; }

/* Tabellen */
.article table { border-collapse: collapse; margin: 1.5em 0; font-size: .92em; display: block; overflow-x: auto; }
.article th, .article td { border: 1px solid var(--border); padding: .35em .6em; text-align: left; }
.article thead th { background: color-mix(in srgb, var(--fg) 6%, transparent); }

/* Definitionslisten (Farbkanäle) */
.article dl { margin: 1.2em 0; }
.article dt { font-weight: 700; margin-top: .8em; }
.article dd { margin: .1em 0 0 1.2em; color: var(--muted); }

.article pre { background: color-mix(in srgb, var(--fg) 6%, transparent); padding: 1em; border-radius: var(--radius); overflow-x: auto; }

/* Serien-Übersicht */
.series-toc { margin-top: 2.5rem; }
.series-list { padding-inline-start: 1.2rem; }
.series-list li { margin-block: .4em; }
/* Export-/Download-Optionen der Serie (eigene Ebene, getrennt vom "Weiter"). */
.series-export { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.series-export-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.series-export ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1.25rem; }

/* Gesamtansicht (single-page) */
.single-chapter { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.single-chapter-title { font-size: 1.6rem; letter-spacing: -.01em; margin: 0 0 1rem; }
.single-page-back { margin-top: 2.5rem; }

/* Kapitel-Kopf & Blätter-Navigation */
.article-series { color: var(--muted); font-size: .9rem; margin: 0 0 .25rem; }
.chapter-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.chapter-nav-next { text-align: right; margin-inline-start: auto; }
.chapter-nav a { display: inline-flex; flex-direction: column; gap: .2rem; text-decoration: none; }
.chapter-nav-dir { color: var(--muted); font-size: .85rem; }
.chapter-nav-title { font-weight: 600; }

/* ---------- Buttons & Formulare ------------------------------------------ */
.button {
	display: inline-block; padding: .6rem 1.2rem; border-radius: 999px;
	border: 1px solid var(--border); background: var(--surface); color: var(--fg);
	font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.button:hover { border-color: var(--accent); text-decoration: none; }
.button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Einstellungen: Die Vorschau bleibt beim Scrollen sichtbar - auf breiten
   Bildschirmen als rechte Spalte, auf schmalen kompakt unter der Kopfzeile. */
.settings-form { display: grid; gap: 0 2rem; }
.settings-fields { min-width: 0; }
.settings-preview {
	position: sticky; top: 3.5rem; z-index: 5;
	background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
	margin-block: 1rem; box-shadow: 0 6px 16px -12px rgb(0 0 0 / .45);
}
.settings-preview summary {
	display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem;
	list-style: none; cursor: pointer; user-select: none;
}
.settings-preview summary::-webkit-details-marker { display: none; }
.settings-preview .preview-title { font-weight: 700; }
.settings-preview .unsaved {
	font-size: .8rem; font-weight: 600; color: var(--accent-fg); background: var(--accent);
	padding: .1em .55em; border-radius: 999px;
}
.settings-preview .preview-toggle { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .9rem; }
.settings-preview .chevron { transition: transform .15s ease; }
.settings-preview[open] .chevron { transform: rotate(180deg); }
.settings-preview .when-open, .settings-preview[open] .when-closed { display: none; }
.settings-preview[open] .when-open { display: inline; }
.settings-preview .preview-body { padding: 0 1rem .75rem; max-height: 34vh; overflow: auto; font-size: .95em; }
.settings-preview p { margin: 0 0 .5rem; }
.settings-preview .preview-styles { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.settings-preview pre { margin: 0; font-size: .85em; white-space: pre-wrap; background: color-mix(in srgb, var(--fg) 6%, transparent); padding: .6em .9em; border-radius: var(--radius); }
.settings-preview code { font-family: var(--font-mono); }
.settings-preview p code { background: color-mix(in srgb, var(--fg) 8%, transparent); padding: .12em .4em; border-radius: 6px; font-size: .9em; }
@media (min-width: 56rem) {
	.settings-form { grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); align-items: start; }
	.settings-preview { grid-column: 2; grid-row: 1; top: 5rem; margin-block: 1.25rem 0; box-shadow: none; }
	.settings-preview summary { cursor: default; padding: 1rem 1.25rem .5rem; }
	.settings-preview .preview-toggle { display: none; } /* Desktop: immer offen */
	.settings-preview .preview-body { padding: 0 1.25rem 1rem; max-height: calc(100vh - 9rem); font-size: 1em; }
	.settings-fields { grid-column: 1; grid-row: 1; }
}
:is(.settings-form, .settings-dialog-form) fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin-block: 1.25rem; }
:is(.settings-form, .settings-dialog-form) legend { font-weight: 700; padding-inline: .4rem; }
.option-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
	display: inline-block; padding: .45rem .9rem; border-radius: 999px;
	border: 1px solid var(--border); background: var(--surface); color: var(--muted); user-select: none;
}
.chip input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--fg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
:is(.settings-form, .settings-dialog-form) input[type="range"] { width: 100%; accent-color: var(--accent); }
:is(.settings-form, .settings-dialog-form) select { font: inherit; padding: .5rem .75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--fg); }

/* Einstellungsdialog (Zahnrad): Desktop als Seitenleiste rechts, mobil als
   Bottom-Sheet - die Seite dahinter bleibt als Vorschau sichtbar. */
.settings-dialog {
	padding: 0; border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--surface); color: var(--fg);
	box-shadow: 0 18px 50px -20px rgb(0 0 0 / .55);
	width: min(26rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
	margin: 1rem 1rem auto auto; /* oben rechts, unter dem Zahnrad */
	overflow: hidden;
}
.settings-dialog[open] { display: flex; }
.settings-dialog::backdrop { background: rgb(0 0 0 / .08); }
.settings-dialog-form { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.settings-dialog-head, .settings-dialog-foot { display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; }
.settings-dialog-head { border-bottom: 1px solid var(--border); }
.settings-dialog-head h2 { margin: 0; font-size: 1.05rem; }
.settings-dialog-head .unsaved {
	font-size: .8rem; font-weight: 600; color: var(--accent-fg); background: var(--accent);
	padding: .1em .55em; border-radius: 999px;
}
.settings-dialog-head .icon-button { margin-inline-start: auto; }
.settings-dialog-body { overflow: auto; padding: 0 1rem; overscroll-behavior: contain; }
.settings-dialog-body fieldset { margin-block: .9rem; padding: .6rem .9rem .9rem; }
.settings-dialog-foot { border-top: 1px solid var(--border); flex-wrap: nowrap; gap: .5rem; }
.settings-dialog-foot .button { padding-inline: .85rem; white-space: nowrap; }
.settings-dialog-foot .subtle { margin-inline-start: auto; }
.icon-button {
	display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0;
	border: 1px solid transparent; border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
}
.icon-button:hover { color: var(--fg); border-color: var(--border); }
.button.subtle { background: none; border-color: transparent; color: var(--muted); }
.button.subtle:hover { color: var(--fg); border-color: var(--border); }
@media (max-width: 40rem) {
	.settings-dialog {
		width: 100vw; max-width: 100vw; max-height: 62dvh;
		margin: auto 0 0 0; border-radius: var(--radius) var(--radius) 0 0; border-inline: 0; border-bottom: 0;
	}
}
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Feed-Übersicht (/feed) */
.feed-subscribe { color: var(--muted); }
.feed-list { list-style: none; padding: 0; max-width: 46rem; }
.feed-list li { padding-block: 1rem; border-bottom: 1px solid var(--border); }
.feed-list h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
.feed-list p { margin: .25rem 0 0; }

/* Suche (/search) */
.search-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; max-width: 46rem; }
.search-bar label { font-weight: 600; }
.search-bar input[type="search"] {
	flex: 1 1 16rem; font: inherit; padding: .55rem .8rem; border-radius: 10px;
	border: 1px solid var(--border); background: var(--surface); color: var(--fg);
}
.search-count { font-weight: 600; margin-top: 1.5rem; }
.page-nav { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: 1.5rem; color: var(--muted); }
.page-nav a { padding: .2rem .6rem; border: 1px solid var(--border); border-radius: 8px; }
.page-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Suche in der Kopfzeile (search.js) */
.header-search { display: none; flex: 1 1 0; min-width: 0; max-width: 30rem; margin-inline-start: auto; align-items: center; gap: .25rem; }
.site-header.search-open .header-inner { gap: .75rem; }
.site-header.search-open .header-search { display: flex; }
.site-header.search-open .icon-link-first { display: none; }
.header-search input[type="search"] {
	flex: 1 1 auto; min-width: 0; font: inherit; padding: .45rem .75rem; border-radius: 10px;
	border: 1px solid var(--border); background: var(--surface); color: var(--fg);
}
.header-search input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Erhöhte Fläche: hell = Kartenfarbe, dunkel = etwas heller als die Karten. */
:root { --raised: var(--surface); --scrim: rgb(15 18 24 / .32); }
html.md { --raised: color-mix(in srgb, var(--surface) 86%, var(--fg)); --scrim: rgb(0 0 0 / .55); }
@media (prefers-color-scheme: dark) {
	html.ma { --raised: color-mix(in srgb, var(--surface) 86%, var(--fg)); --scrim: rgb(0 0 0 / .55); }
}
.header-search-results {
	position: absolute; inset-inline-end: max(var(--space), calc((100vw - var(--maxw)) / 2 + var(--space)));
	top: calc(100% + .35rem); width: min(30rem, calc(100vw - 2 * var(--space)));
	background: var(--raised); color: var(--fg);
	border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: var(--radius);
	box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 30%, transparent), 0 24px 60px -12px rgb(0 0 0 / .55);
	padding: .35rem; z-index: 20;
	max-height: min(70vh, 32rem); overflow: auto;
}
/* Abdunklung der Seite hinter der Trefferliste (unterhalb der Kopfzeile). */
.search-scrim {
	position: fixed; inset: 0; z-index: 9;
	background: var(--scrim); backdrop-filter: blur(2px);
}
.header-search-results ul { list-style: none; margin: 0; padding: 0; }
.hs-item, .hs-all { display: block; padding: .5rem .65rem; border-radius: 8px; color: var(--fg); text-decoration: none; }
.hs-item:hover, .hs-item:focus, .hs-all:hover, .hs-all:focus { background: color-mix(in srgb, var(--accent) 16%, var(--raised)); outline: none; text-decoration: none; }
.hs-item:focus-visible, .hs-all:focus-visible { box-shadow: inset 3px 0 0 var(--accent); }
.hs-title { display: block; font-weight: 600; }
.hs-preview { display: block; font-size: .85rem; color: var(--muted); }
.hs-all { font-size: .9rem; font-weight: 600; color: var(--accent); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: .25rem; }
.hs-note { margin: .4rem .65rem; color: var(--muted); }
/* Eigenes Schließen-Symbol genügt: Browser-Leeren-Kreuz im Kopfzeilen-Feld ausblenden. */
.header-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* Seitenwechsel per nav.js: dezenter Fortschrittsbalken oben */
html.is-navigating::before {
	content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 100;
	background: var(--accent); transform-origin: left; animation: nav-progress 1.2s ease-out forwards;
}
@keyframes nav-progress { from { transform: scaleX(.05); } to { transform: scaleX(.85); } }
@media (prefers-reduced-motion: reduce) { html.is-navigating::before { animation: none; transform: scaleX(.6); } }
main h1:focus { outline: none; }

/* Jahresgalerien: kompakte Blätter-Navigation im Kopf */
.gallery-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; }
.gallery-nav-compact { display: flex; gap: .5rem; }
.gallery-nav-compact a {
	display: inline-flex; align-items: center; gap: .35em; padding: .3rem .75rem; font-size: .9rem; font-weight: 600;
	border: 1px solid var(--border); border-radius: 999px; color: var(--fg); text-decoration: none;
}
.gallery-nav-compact a:hover { border-color: var(--accent); color: var(--accent); }
