/* =====================================================================
   LESESEITE — Basis-Stylesheet (VORLAGE, Standard ab 2026-07)
   REDUZIERTES ARCHITEKTUR-WEBDESIGN: Weiß · Schwarz · eine Akzentfarbe.
   Grotesk-Sans, Haarlinien, keine Rundungen, keine Verläufe, viel Weißraum,
   große Uppercase-Titel links, CSS-nummerierte Abschnitte, Sidebar-TOC mit
   laufenden Nummern. Klassensystem identisch zu allen früheren Leseseiten.

   >>> PRO BUCH nur den folgenden Farb-Block ändern: die DREI Variablen
       --accent, --accent-light, --accent-wash (= sehr heller Ton des Accents
       für Flächen wie .merksatz und Card-Hover). Sonst NICHTS anfassen.
       Default = Knallorange #ff4d00. Es gibt KEINE data-URI-SVG-Hex mehr
       und KEINEN Topbar-Verlauf, die man zusätzlich anpassen müsste.
       Farb-Register (bereits vergeben) siehe Leseseite_Standard.md §6.
   ===================================================================== */
:root {
  --bg: #ffffff;
  --text: #0a0a0a;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --accent: #4a4e7c;          /* Knallorange */
  --accent-light: #8a8db8;
  --accent-wash: #f2f2f5;     /* hauchzarter Orange-Ton für Flächen */
  --border: #e4e2dd;          /* Haarlinie hell */
  --rule: #0a0a0a;            /* Haarlinie schwarz */
  --panel: #f6f5f2;           /* warmes Off-White für Panels */
  --card: #ffffff;
  --highlight: #f2f2f5;
  --sys1: #0a0a0a;
  --sys2: #6b6b6b;
  --sans: "Helvetica Neue", Helvetica, Arial, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", "IBM Plex Mono", "Roboto Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
p { margin: 0 0 18px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 700; }
em { font-style: italic; }

/* ============================ TOPBAR ============================ */
.topbar {
  background: #ffffff;
  color: var(--ink);
  padding: 0 clamp(18px, 4vw, 46px);
  min-height: 66px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--ink);
}
.topbar .home {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 3px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
}
.topbar .home:hover { text-decoration: none; color: var(--accent); }
.topbar .home::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: var(--accent);
  /* kleines Quadrat als Signet – architektonische Marke */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.topbar nav { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.topbar nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 11px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.topbar nav a:hover { color: var(--accent); text-decoration: none; }
.topbar nav a.current { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================ LAYOUT ============================ */
.layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: calc(100vh - 68px);
  max-width: 1360px;
  margin: 0 auto;
}
nav.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 40px 26px 40px 34px;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
  font-size: 13px;
  font-family: var(--sans);
}
nav.sidebar h2 {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
nav.sidebar ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
nav.sidebar li { margin: 0; }
nav.sidebar ol > li > a {
  color: var(--ink);
  text-decoration: none;
  display: block;
  padding: 8px 0 8px 30px;
  position: relative;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
  transition: color .15s;
}
nav.sidebar ol > li > a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 8px;
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0;
}
nav.sidebar a:hover { color: var(--accent); text-decoration: none; }
nav.sidebar .nextprev {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}
nav.sidebar .nextprev a {
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  padding: 11px 12px;
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: background .15s, color .15s;
}
nav.sidebar .nextprev a:hover { background: var(--ink); color: #fff; text-decoration: none; }

main {
  max-width: 880px;
  padding: 64px clamp(22px, 5vw, 74px) 90px;
  margin: 0;
  counter-reset: sec;
  min-width: 0;            /* Grid-Kind darf unter min-content schrumpfen */
}
.layout > * { min-width: 0; }

/* ========================= SEITENKOPF ========================= */
header.page-title {
  position: relative;
  text-align: left;
  padding: 6px 0 40px;
  margin: 0 0 46px;
  border-bottom: 2px solid var(--ink);
}
header.page-title .teil-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 26px;
  padding-bottom: 8px;
}
header.page-title h1 {
  font-family: var(--sans);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 22px;
  line-height: 1.02;
}
header.page-title .subtitle {
  font-family: var(--sans);
  font-size: 18px;
  font-style: normal;
  color: var(--muted);
  max-width: 680px;
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}
header.page-title .author {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ========================= ÜBERSCHRIFTEN ========================= */
h2.section-title {
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-top: 62px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
  line-height: 1.15;
  position: relative;
}
h2.section-title::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 12px;
}
h3.kapitel {
  font-size: 21px;
  font-weight: 700;
  margin-top: 44px;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  page-break-after: avoid;
}
h3.kapitel .knr {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  padding: 3px 9px;
  margin-right: 12px;
  vertical-align: middle;
  font-family: var(--mono);
  font-weight: 600;
}
.en {
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  font-size: 0.86em;
  letter-spacing: 0;
  text-transform: none;
}
h4 {
  margin-top: 28px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--ink);
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}
h4::before { content: "— "; color: var(--accent); }

/* ========================= INHALTSELEMENTE ========================= */
.lead {
  font-size: 21px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 30px;
  font-weight: 400;
  max-width: 760px;
}

.kernidee {
  background: #fff;
  border-left: 4px solid var(--accent);
  padding: 4px 24px;
  margin: 26px 0;
  font-size: 18px;
  line-height: 1.55;
}
.kernidee strong {
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
  font-family: var(--sans);
}

.merksatz {
  position: relative;
  background: var(--accent-wash);
  padding: 22px 24px 20px;
  margin: 28px 0;
  font-size: 16px;
  line-height: 1.55;
  border-top: 2px solid var(--accent);
}
.merksatz::before {
  content: "Merksatz";
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
}

.zitat {
  border-left: none;
  margin: 26px 0;
  padding: 8px 0 8px 30px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.5;
  font-weight: 400;
  position: relative;
}
.zitat::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
}
.zitat .quelle {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--mono);
}
.zitat.lang { font-size: 18px; }

.experiment {
  background: #fff;
  border: 1px solid var(--ink);
  padding: 20px 22px;
  margin: 26px 0;
}
.experiment .label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 700;
}
.experiment .label::before { content: "▸ "; color: var(--accent); }

.anwendung {
  background: var(--panel);
  border: none;
  border-left: 4px solid var(--ink);
  padding: 20px 24px;
  margin: 26px 0;
}
.anwendung .label {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 700;
}

/* ============================ GRAFIK ============================ */
.grafik {
  background: #fff;
  border: 1px solid var(--border);
  padding: 30px 26px 20px;
  margin: 34px 0;
  text-align: center;
}
.grafik svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.grafik figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 18px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ========================= BEGRIFFSKARTEN ========================= */
.begriffe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 28px 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.begriff {
  background: #fff;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 18px 20px;
  font-size: 15px;
  line-height: 1.5;
  font-family: var(--sans);
}
.begriff strong {
  color: var(--ink);
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.begriff strong::before { content: "› "; color: var(--accent); }

/* ============================ TABELLE ============================ */
table.vergleich {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-family: var(--sans);
  font-size: 14px;
}
table.vergleich th, table.vergleich td {
  border: 1px solid var(--ink);
  padding: 12px 15px;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}
table.vergleich th {
  background: var(--ink);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: 700;
}
table.vergleich tr:nth-child(even) td { background: var(--panel); }
table.vergleich td:first-child { font-weight: 700; color: var(--ink); }

/* ============================ KACHELN ============================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 0;
  margin: 34px 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.card {
  background: #fff;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 24px 22px 26px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
  position: relative;
}
.card:hover { background: var(--accent-wash); text-decoration: none; }
.card::after {
  content: "→";
  position: absolute;
  top: 20px; right: 20px;
  color: var(--accent);
  font-size: 18px;
  opacity: 0;
  transition: opacity .15s;
}
.card:hover::after { opacity: 1; }
.card .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}
.card h3 { margin: 12px 0 8px; font-size: 18px; color: var(--ink); font-weight: 700; letter-spacing: -0.005em; line-height: 1.2; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ========================= SEITENNAVIGATION ========================= */
.pagenav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-top: 72px;
  padding-top: 0;
  border-top: 2px solid var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  gap: 0;
}
.pagenav a {
  color: var(--ink);
  text-decoration: none;
  padding: 22px 4px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  transition: color .15s;
  flex: 1;
}
.pagenav a:hover { color: var(--accent); text-decoration: none; }
.pagenav .next { text-align: right; }
.pagenav .prev::before { content: "←  "; color: var(--accent); }
.pagenav .next::after { content: "  →"; color: var(--accent); }

.top-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.top-link:hover { color: var(--accent); text-decoration: none; }

/* ============================ FUSS ============================ */
footer {
  margin-top: 80px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.3px;
}
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
footer a:hover { color: var(--accent); }

/* ============================ INDEX/START ============================ */
.nest-home-link { border-bottom: 2px solid var(--ink) !important; background: #fff !important; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  nav.sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--ink); padding: 24px 22px; }
  nav.sidebar ol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  main { padding: 40px 22px 70px; }
  .begriffe { grid-template-columns: 1fr; }
  .topbar { min-height: 0; padding: 10px 18px; }
  .topbar .home { padding: 8px 0; }
  /* breite Vergleichstabellen horizontal scrollbar statt Überlauf */
  table.vergleich { display: block; overflow-x: auto; white-space: normal; -webkit-overflow-scrolling: touch; }
  table.vergleich th, table.vergleich td { min-width: 130px; }
  table.vergleich td:first-child, table.vergleich th:first-child { min-width: 110px; position: sticky; left: 0; }
  table.vergleich th:first-child { background: var(--ink); }
  table.vergleich td:first-child { background: #fff; }
}
/* globaler Überlauf-Schutz auf kleinen Viewports */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .grafik { overflow-x: auto; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .lead { font-size: 18px; }
  nav.sidebar ol { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
}

/* ============================ DRUCK ============================ */
@media print {
  .topbar, nav.sidebar, .pagenav, .nest-home-link { display: none; }
  .layout { display: block; max-width: none; }
  main { max-width: none; padding: 0; }
  body { font-size: 11pt; }
  a { color: #000; }
  h2.section-title, h3.kapitel { page-break-after: avoid; }
  .grafik, .kernidee, .merksatz, .experiment, .anwendung, .zitat, table.vergleich, .begriff { page-break-inside: avoid; }
}
