/* Redaktionsschluss – Leseausgabe im Netz */

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("schrift/literata.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("schrift/literata-kursiv.woff2") format("woff2");
}

:root {
  --papier: #fbfaf7;
  --text: #1f1d1a;
  --leise: #6d6860;
  --linie: #dcd7cd;
  --akzent: #b11d2c;
  --notiz: #f2efe8;
  --leiste: rgba(251, 250, 247, 0.94);
  --groesse: 1;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --grotesk: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --spalte: 35rem;
  --rand: 16rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --papier: #161514; --text: #e4e0d8; --leise: #9b968d; --linie: #3a3733;
    --akzent: #ec6a6a; --notiz: #22201e; --leiste: rgba(22, 21, 20, 0.94);
    color-scheme: dark;
  }
}
:root[data-thema="dunkel"] {
  --papier: #161514; --text: #e4e0d8; --leise: #9b968d; --linie: #3a3733;
  --akzent: #ec6a6a; --notiz: #22201e; --leiste: rgba(22, 21, 20, 0.94);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--text);
  font-family: var(--serif);
  font-size: calc(1.125rem * var(--groesse));
  line-height: 1.62;
  font-optical-sizing: auto;
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ------------------------------------------------ Kopfleiste */
.leiste {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0.55rem max(1rem, calc(50% - 26rem));
  background: var(--leiste);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
  font-family: var(--grotesk); font-size: 0.85rem;
}
.leiste .buch {
  margin-right: auto; min-width: 0; text-decoration: none; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.leiste .buch span { color: var(--leise); font-weight: 400; letter-spacing: 0.02em; text-transform: none; }
.knopf {
  border: 1px solid transparent; background: none; border-radius: 6px;
  padding: 0.3rem 0.6rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.knopf:hover, .knopf[aria-expanded="true"] { border-color: var(--linie); }
.fortschritt { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; }
.fortschritt span { display: block; height: 100%; width: 0; background: var(--akzent); }

/* Ausklappbare Tafeln: Inhalt und Einstellungen */
.tafel {
  position: fixed; z-index: 30; top: 3.1rem; right: max(0.5rem, calc(50% - 26rem));
  width: min(26rem, calc(100% - 1rem)); max-height: calc(100vh - 4rem); overflow-y: auto;
  background: var(--papier); border: 1px solid var(--linie); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 1rem 1.2rem; font-family: var(--grotesk); font-size: 0.9rem; line-height: 1.45;
}
.tafel[hidden] { display: none; }
.tafel h2 { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--leise); margin: 1rem 0 0.4rem; }
.tafel h2:first-child { margin-top: 0; }
.tafel ol { list-style: none; margin: 0; padding: 0; }
.tafel li a { display: block; padding: 0.22rem 0; text-decoration: none; }
.tafel li a:hover { color: var(--akzent); }
.tafel li a[aria-current="page"] { color: var(--akzent); font-weight: 600; }
.einstellung { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; }
.einstellung + .einstellung { border-top: 1px solid var(--linie); }
.wahl { display: inline-flex; border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; }
.wahl button { border: 0; background: none; padding: 0.3rem 0.65rem; cursor: pointer; }
.wahl button + button { border-left: 1px solid var(--linie); }
.wahl button[aria-pressed="true"] { background: var(--notiz); font-weight: 600; }
.einstellung small { display: block; color: var(--leise); font-size: 0.78rem; }

/* ------------------------------------------------ Lesespalte */
main { padding: 0 1rem 4rem 2.1rem; }
/* flow-root: Randnotizen, die unter den letzten Absatz reichen, bleiben im Textblock */
.text { position: relative; max-width: var(--spalte); margin: 0 auto; display: flow-root; }
@media (min-width: 1100px) {
  main { padding-left: 2rem; }
  .text { margin-left: max(4rem, calc(50% - (var(--spalte) + var(--rand) + 2.5rem) / 2)); }
}
.text .dachzeile {
  margin: 3.2rem 0 0.6rem; text-indent: 0; text-align: left; font-family: var(--grotesk); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--akzent);
}
.dachzeile + h1 { margin-top: 0; }
h1 {
  margin: 0 0 2.2rem; font-family: var(--grotesk); font-weight: 700; font-size: 1.35em;
  line-height: 1.3; letter-spacing: 0.04em; text-transform: uppercase;
  -webkit-hyphens: manual; hyphens: manual; text-wrap: balance;
}
.text > h1:first-child { margin-top: 3.2rem; }
.text p {
  margin: 0; text-indent: 1.3em; text-align: justify;
  -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 7 3 3;
  orphans: 2; widows: 2;
}
.text h1 + p, .text p.ohne-einzug { text-indent: 0; }
.text i { font-style: italic; }

/* Absatz-Link (nur mit Maus sichtbar) */
.text p[id] { position: relative; }
.absatzlink {
  position: absolute; left: -1.3rem; top: 0; width: 1rem; text-align: center;
  font-family: var(--grotesk); font-size: 0.75rem; color: var(--leise); text-decoration: none;
  text-indent: 0; opacity: 0; transition: opacity 0.15s;
}
@media (hover: hover) { .text p:hover > .absatzlink { opacity: 0.8; } }

/* Seitenzahlen der Druckausgabe: Haarlinie im Text, Zahl am linken Rand */
.seite { border-left: 1px solid var(--linie); margin: 0 1px; }
.seite::before {
  content: attr(data-s); position: absolute; left: -2.15rem; width: 1.5rem;
  text-align: right; text-indent: 0; font-family: var(--grotesk); font-size: 0.62rem;
  line-height: 2.6; color: var(--leise); font-style: normal; font-weight: 400;
}
@media (min-width: 700px) { .seite::before { left: -3.4rem; width: 2.2rem; font-size: 0.7rem; } }
:root[data-seiten="aus"] .seite { border: 0; margin: 0; }
:root[data-seiten="aus"] .seite::before { content: none; }

/* Anmerkungen: Ziffer im Text, Notiz am Rand bzw. zum Aufklappen */
.anm {
  font-family: var(--grotesk); font-size: 0.62em; font-weight: 700; vertical-align: super;
  line-height: 0; color: var(--akzent); cursor: pointer; padding: 0 0.1em;
  -webkit-user-select: none; user-select: none;
}
.anm-schalter { display: none; }
.randnotiz {
  display: none; font-family: var(--grotesk); font-size: 0.8rem; line-height: 1.45;
  text-align: left; text-indent: 0; font-style: normal; font-weight: 400;
  -webkit-hyphens: manual; hyphens: manual; overflow-wrap: anywhere; color: var(--text);
}
.randnotiz .nr { font-weight: 700; color: var(--akzent); margin-right: 0.3em; }
.randnotiz a { color: var(--leise); }
.anm-schalter:checked + .randnotiz {
  display: block; float: left; clear: both; width: 100%; margin: 0.6rem 0;
  padding: 0.6rem 0.8rem; background: var(--notiz); border-left: 2px solid var(--akzent); border-radius: 0 6px 6px 0;
}
@media (min-width: 1100px) {
  .anm { cursor: default; }
  .randnotiz, .anm-schalter:checked + .randnotiz {
    display: block; float: right; clear: right; width: var(--rand);
    margin: 0.35rem calc(-1 * var(--rand) - 2.5rem) 0.6rem 0; padding: 0;
    background: none; border: 0; color: var(--leise);
  }
  .randnotiz .nr { color: var(--akzent); }
  .anm-schalter:checked + .randnotiz { color: var(--text); }
}

/* Blättern und Fuß */
.blaettern {
  max-width: var(--spalte); margin: 3.5rem auto 0; display: grid; clear: both; grid-template-columns: 1fr 1fr; gap: 1rem;
  font-family: var(--grotesk); font-size: 0.85rem; border-top: 1px solid var(--linie); padding-top: 1.2rem;
}
@media (min-width: 1100px) {
  .blaettern { margin-left: max(4rem, calc(50% - (var(--spalte) + var(--rand) + 2.5rem) / 2)); }
}
.blaettern a { text-decoration: none; display: block; }
.blaettern a span { display: block; color: var(--leise); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.blaettern a:hover { color: var(--akzent); }
.blaettern .weiter { text-align: right; grid-column: 2; }
.fuss {
  padding: 2rem 1rem 3rem; text-align: center; font-family: var(--grotesk); font-size: 0.78rem;
  color: var(--leise); line-height: 1.8;
}
.fuss a { color: inherit; }

/* ------------------------------------------------ Startseite */
.start { max-width: 40rem; margin: 0 auto; padding: 0 0 3rem; }
.umschlag {
  margin: 2.5rem auto 2rem; max-width: 22rem; aspect-ratio: 5 / 8; padding: 2.6rem 1.6rem;
  background: #f4f1ea; color: #181818; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 14px 40px rgba(0, 0, 0, 0.14);
  display: flex; flex-direction: column; justify-content: space-between; text-align: center;
}
.umschlag .linie { border-top: 4px solid #181818; padding-top: 3px; }
.umschlag .linie::after { content: ""; display: block; border-top: 1px solid #181818; }
.umschlag .linie.unten { border-top: 1px solid #181818; padding-top: 3px; }
.umschlag .linie.unten::after { border-top: 4px solid #181818; }
.umschlag .autor { font-family: var(--grotesk); font-weight: 700; letter-spacing: 0.22em; font-size: 0.8rem; margin-top: 0.9rem; }
.umschlag .titel { font-family: var(--serif); font-weight: 700; color: #b11d2c; font-size: min(1.95rem, 7.4vw); line-height: 1.1; margin: 0; letter-spacing: -0.01em; text-transform: none; }
.umschlag .unter { font-family: var(--grotesk); letter-spacing: 0.16em; font-size: 0.68rem; color: #5f5f5f; margin-top: 0.8rem; }
.widmung { text-align: center; font-style: italic; color: var(--leise); margin: 0 0 2rem; font-size: 0.95rem; }
.einleitung { margin: 0 0 1.6rem; }
.aktionen { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; font-family: var(--grotesk); font-size: 0.95rem; }
.aktion {
  display: inline-block; padding: 0.65rem 1.1rem; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--linie);
}
.aktion.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--papier); font-weight: 600; }
.aktion small { color: var(--leise); margin-left: 0.3em; }
main.startseite { padding-left: 1rem; }
.aufschlagen { font-family: var(--grotesk); font-size: 0.85rem; color: var(--leise); margin: 0 0 2.4rem; }
.aufschlagen input { width: 4.5em; font: inherit; padding: 0.2rem 0.4rem; border: 1px solid var(--linie); border-radius: 5px; background: var(--papier); color: var(--text); }
.aufschlagen button { padding: 0.2rem 0.6rem; border: 1px solid var(--linie); border-radius: 5px; background: none; cursor: pointer; }
.verzeichnis h2 {
  font-family: var(--grotesk); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  margin: 2rem 0 0.5rem; color: var(--akzent);
}
.verzeichnis ol { list-style: none; margin: 0; padding: 0; }
.verzeichnis li { border-bottom: 1px solid var(--linie); }
.verzeichnis li a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; text-decoration: none; }
.verzeichnis li a:hover { color: var(--akzent); }
.verzeichnis .dauer { font-family: var(--grotesk); font-size: 0.75rem; color: var(--leise); white-space: nowrap; padding-top: 0.25rem; }

/* ------------------------------------------------ Anhang */
.anhang h2 {
  font-family: var(--grotesk); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--akzent); margin: 2.2rem 0 0.6rem;
}
.anmerkungen { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.anmerkungen li { display: flex; gap: 0.8rem; padding: 0.18rem 0; }
.anmerkungen .zurueck { font-family: var(--grotesk); font-weight: 700; font-size: 0.8rem; color: var(--akzent); min-width: 2rem; text-decoration: none; padding-top: 0.15rem; }
.lit { margin: 0 0 0.75rem; padding-left: 1.3em; text-indent: -1.3em; font-size: 0.92rem; overflow-wrap: anywhere; text-align: left; }
.lit b { font-family: var(--grotesk); font-size: 0.92em; }
.lit:target, .anmerkungen li:target { background: var(--notiz); }
.lit a, .anmerkungen a { color: var(--leise); }
.hinweis { font-family: var(--grotesk); font-size: 0.82rem; color: var(--leise); margin: 0 0 1.5rem; }

@media print {
  .leiste, .tafel, .blaettern, .fuss, .absatzlink { display: none !important; }
  .randnotiz { display: none !important; }
}
