:root {
    --bg: #faf7f2;
    --text: #000;
    --accent: #800000;
    --heading: #800000;
    --link: blue;
    --link-visited: purple;
    --link-active: #c00;          /* dunkleres Rot: besserer Kontrast auf --bg */
    --tint: rgba(0, 128, 128, 0.1);
    --rule: rgba(0, 128, 128, 0.35);
    /* Markierungen in Handschriften-Transkriptionen */
    --rot: #b3001b;
    --blau: #1f4fa3;
    --gruen: #2b6e2f;
    --braun: #8a5226;
    --grau: #6b6b6b;
    --papier: #fffdf9;            /* Vordrucke/Formulare */
    color-scheme: light dark;
}

/* Dunkelmodus: nur aktiv, wenn das Gerät ihn anfordert */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #15191a;
        --text: #e9e9df;
        --accent: #4fd1c5;
        --heading: #a9bcff;
        --link: #8ab4ff;
        --link-visited: #c9a6ff;
        --link-active: #ff8f86;
        --tint: rgba(79, 209, 197, 0.12);
        --rule: rgba(79, 209, 197, 0.4);
        --rot: #ff8a80;
        --blau: #a3bdff;
        --gruen: #8fd694;
        --braun: #e2ab78;
        --grau: #a8a8a8;
        --papier: #1c2122;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 1em;      /* Sprungziele (Fußnoten, Inhalt) kleben nicht am Rand */
}
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
html:has(main.transkription) {
    scroll-behavior: auto;        /* sehr lange Seite: Sprünge sofort, nicht animiert */
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1em;
    line-height: 1.5;
    text-align: left;
    -webkit-hyphens: auto;
    hyphens: auto;                /* benötigt lang-Attribut: <html lang="de"> */
    overflow-wrap: break-word;    /* lange URLs sprengen das Layout nicht */
    max-width: 45em;              /* angenehme Zeilenlänge */
    margin: 0 auto;
    padding: 1em;
}

/* Fließtext: auf schmalen Displays linksbündig (Blocksatz erzeugt dort Löcher),
   ab Tablet-Breite im Blocksatz */
p {
    text-align: left;
    text-wrap: pretty;
    margin: 0 0 0.75em;
}
@media (min-width: 40em) {
    p {
        text-align: justify;
    }
    td p,
    th p {
        text-align: left;     /* in Tabellenzellen kein Blocksatz */
    }
}

a {
    text-underline-offset: 0.15em;
    text-decoration-thickness: from-font;
}

/* Reihenfolge LVHA (link, visited, hover, active) */
a:link {
    color: var(--link);
}
a:visited {
    color: var(--link-visited);
}
a:hover,
a:active {
    color: var(--link-active);
}
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Überschriften */
h1,
h2,
h3 {
    text-wrap: balance;
}
h1,
h2 {
    text-align: center;
}
h1 {
    color: var(--accent);
    font-family: Garamond, "EB Garamond", Georgia, serif;
    font-size: 2em;
    line-height: 1.3;
    margin: 0.3em 0 0;
}
h2 {
    color: var(--heading);
    font-size: 1.5em;
    line-height: 1.3;
}
h3 {
    color: var(--accent);
}
h3 small {
    font-size: 0.75em;
    font-weight: normal;
}

.lead {
    text-align: center;
    color: var(--heading);
    margin-bottom: 1.5em;
}

/* Linkliste */
.linkliste {
    list-style: none;
    margin: 0;
    padding: 0;
}
.linkliste li {
    margin-bottom: 0.5em;
}
.linkliste a {
    display: inline-block;
    padding: 0.2em 0;       /* größere Tippfläche auf Mobilgeräten */
}
.linkliste.zentriert {
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    margin: 1em 0 1.5em;
}
.linkliste.inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5em;
}
.linkliste.gross a {
    font-size: 1.1em;
}
.artikel .linkliste {
    padding: 0;               /* sonst greift .artikel ul (Einzug) */
}

/* Kachel-Links, z. B. Jahreszahlen einer Zeitleiste (indexz.htm) */
.chips,
.artikel .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    margin: 0 0 1em;
    padding: 0;
    list-style: none;
}
.chips li,
.artikel .chips li {
    margin: 0;
}
.chips a {
    display: block;
    min-width: 4.5em;
    padding: 0.4em 0.8em;
    border: 1px solid var(--accent);
    background: var(--tint);
    text-align: center;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.chips a:hover,
.chips a:focus-visible {
    background: var(--accent);
    color: var(--bg);         /* statt #fff: lesbar auch auf dem hellen Türkis im Dunkelmodus */
}

/* Einstiegsseite (<main class="start">, z. B. main.htm) */
.start h1 {
    margin-bottom: 0.8em;
}
.unterzeile {                 /* zweite Titelzeile innerhalb von <h1> */
    display: block;
    margin-top: 0.2em;
    color: var(--heading);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.75em;
}
.start .linkliste {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5em 2.5em;
    font-size: 1.15em;
    text-align: center;
}
.start .linkliste li {
    margin: 0;
}

/* Fußbereich */
footer {
    margin-top: 2em;
    padding-top: 0.5em;
    border-top: 1px solid var(--accent);
    font-size: 0.9em;
}
footer p {
    margin-bottom: 0.25em;
    text-align: left;
}
footer .linkliste li {
    margin-bottom: 0;
}

/* Bilder */
img {
    max-width: 100%;
    height: auto;
}

/* Tabellen */
table {
    border-collapse: collapse;
    margin: 0 auto;
    max-width: 100%;
}
caption {
    font-weight: bold;
    color: var(--heading);
    padding-bottom: 0.4em;
}
th,
td {
    padding: 10px;
    text-align: left;
    vertical-align: top;
}
th {
    color: var(--heading);
}

/* Messwert-Tabelle (z. B. pegel.htm) */
.messwerte {
    margin: 1em auto 1.5em;
}
.messwerte th,
.messwerte td {
    padding: 0.4em 1em;
    border-bottom: 1px solid var(--rule);
}
.messwerte .zahl {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.messwerte .aktuell {
    background: var(--tint);
    font-weight: bold;
}

/* Hinweis- und Bildunterschrift-Blöcke */
.hinweis {
    background: var(--tint);
    border-left: 3px solid var(--accent);
    padding: 0.5em 1em;
    margin: 1em 0;
}
figure {
    margin: 1em 0;
}
figcaption {
    font-size: 0.9em;
    margin-top: 0.4em;
}

/* Foto-Galerie mit Bildunterschriften (z. B. rhein.htm, 2026) */
.galerie {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12em, 1fr));
    gap: 1.5em 1em;
    margin: 0 0 1.5em;
}
.galerie figure {
    margin: 0;
}
.galerie a {
    display: block;
}
.galerie img {
    display: block;
    width: 100%;
    height: auto;
}
.galerie figcaption {
    text-align: left;
}

/* Thumbnail-Reihen (z. B. rhein.htm, 2003) */
.thumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5em;
    margin: 0 0 1.5em;
}
.thumbs a {
    display: inline-block;
    font-size: 0.85em;
    text-align: center;
    line-height: 1.3;
}
.thumbs a.gruppe {
    display: flex;
    gap: 0.5em;
}
.thumbs img {
    display: block;
    margin: 0 auto 0.2em;
}

/* ------------------------------------------------------------
   Wissenschaftlicher Artikel (<main class="artikel">)
   ------------------------------------------------------------ */
.artikel h1,
.chronik h1 {
    margin-bottom: 0.6em;
}
.artikel h2,
.chronik h2 {
    text-align: left;
    font-size: 1.3em;
    margin: 1.8em 0 0.5em;
}

/* Inhaltsverzeichnis */
.toc {
    background: var(--tint);
    border-left: 3px solid var(--accent);
    padding: 0.6em 1em;
    margin: 1em 0 1.5em;
}
.toc h2,
.chronik .toc h2 {
    font-size: 1.1em;
    margin: 0 0 0.3em;
}
.toc ul,
.toc ol {
    margin: 0;
    padding-left: 1.4em;
}
.toc a {
    display: inline-block;
    padding: 0.15em 0;      /* Tippfläche */
}

/* Listen im Text */
.artikel ul,
.artikel ol {
    margin: 0 0 0.75em;
    padding-left: 1.6em;
}
.artikel li {
    margin-bottom: 0.4em;
}

/* Zitate */
blockquote {
    margin: 1em 0 1em 1em;
    padding-left: 1em;
    border-left: 3px solid var(--accent);
}
blockquote p:last-child {
    margin-bottom: 0;
}

/* Predigttext (lateinisch): Serifenschrift, Seitenwechsel dezent */
.predigttext p,
.latein p {
    font-family: Georgia, "Times New Roman", serif;
}
.latein .quelle {
    font-family: inherit;
}
.seite {
    color: var(--accent);
    font-size: 0.8em;
    white-space: nowrap;
}

/* Fußnoten / Anmerkungen */
sup {
    line-height: 0;
}
.fn a {
    padding: 0.2em 0.15em;  /* größere Tippfläche */
    text-decoration: none;
}
.endnoten {
    font-size: 0.9em;
}
.endnoten li {
    text-align: left;
}
.endnoten li:target,
.fn a:target {
    background: var(--tint);
}
.rueck {
    text-decoration: none;
    margin-left: 0.3em;
}

/* Literaturverzeichnis: hängender Einzug */
.artikel .literatur {
    list-style: none;
    padding: 0;
}
.literatur li {
    padding-left: 2em;
    text-indent: -2em;
    text-align: left;
}

/* ------------------------------------------------------------
   Gedichtlisten, Lebensdaten, antike Zitate (z. B. lesbia.htm)
   ------------------------------------------------------------ */
hr {
    border: 0;
    border-top: 1px solid var(--accent);
    margin: 1.5em 0;
}

.gedichte {
    list-style: none;
    margin: 0 0 1em;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5em, 1fr));
    gap: 0 1em;
}
.gedichte li {
    margin: 0;
}
.gedichte a {
    display: inline-block;
    padding: 0.2em 0.1em;   /* Tippfläche */
}
.stern {
    color: var(--accent);
    font-weight: bold;
}

.daten {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4em 1em;
    margin: 0 0 0.75em;
}
.daten dt {
    color: var(--heading);
    font-weight: bold;
}
.daten dd {
    margin: 0;
}
@media (max-width: 30em) {
    .daten {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .daten dd {
        margin-bottom: 0.5em;
    }
}

/* Zitate mit Zeilenumbruch (Verse) und Quellenangabe */
.verse p {
    text-align: left;
    -webkit-hyphens: manual;      /* Verse nicht trennen */
    hyphens: manual;
}
.quelle {
    color: var(--accent);
    font-size: 0.85em;
    text-align: left;
}

/* ------------------------------------------------------------
   Lateinische Verstexte und Briefe
   (z. B. archipoeta_carmina.htm, ausonius_mosella.htm, petrarca.htm)
   <div class="latein verse" lang="la"><p><span class="v">…</span>…</p></div>
   ------------------------------------------------------------ */
.verse .v {
    display: block;
    padding-left: 1.5em;          /* zu lange Verse: hängender Einzug */
    text-indent: -1.5em;
}
.verse .luecke {
    color: var(--accent);
    letter-spacing: 0.4em;
}
.verse p[id]:target {
    background: var(--tint);
}

/* Verszählung am Rand: <span class="v" data-n="5"> */
.nummeriert {
    padding-left: 2.5em;
}
.nummeriert .v {
    position: relative;
}
.nummeriert .v[data-n]::before {
    content: attr(data-n);
    position: absolute;
    left: -3.4em;
    width: 2.6em;
    text-indent: 0;
    text-align: right;
    color: var(--accent);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.75em;
    line-height: 2;
    font-variant-numeric: tabular-nums;
}

/* Absatzzählung in Prosatexten: <span class="absatz">12</span> */
.absatz {
    color: var(--accent);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.75em;
    font-weight: bold;
    margin-right: 0.3em;
    font-variant-numeric: tabular-nums;
}
.latein p[id]:target {
    background: var(--tint);
}
.latein blockquote.verse p {
    margin-bottom: 0.25em;
}
.datum {
    text-align: right;            /* Ort und Datum am Briefende */
}

h2 small {
    font-size: 0.7em;
    font-weight: normal;
}
h2 .rueck {
    font-size: 0.8em;
}

/* ------------------------------------------------------------
   Chronik-Seiten (<main class="chronik">) mit Dokumentenlisten
   (<table class="dokumente">: Jahr/Titel, Kurzbeschreibung, Bild)
   ------------------------------------------------------------ */
body:has(> main.chronik) {
    max-width: 60em;              /* mehr Platz für drei Spalten */
}
.chronik h2[id] {
    scroll-margin-top: 1em;
}
.chronik h2:target {
    background: var(--tint);
}

.dokumente {
    width: 100%;
    margin: 0 0 1.5em;
}
.dokumente th,
.dokumente td {
    padding: 0.5em 0.75em;
    border-bottom: 1px solid var(--rule);
}
.dokumente thead th {
    border-bottom: 2px solid var(--accent);
    white-space: nowrap;
}
.dokumente tbody th {
    color: var(--accent);         /* Zeilenüberschrift (Gruppe/Jahr) */
}
.dokumente tbody + tbody > tr:first-child > * {
    border-top: 2px solid var(--rule);   /* Gruppen voneinander absetzen */
}
.dokumente tbody tr:hover {
    background: var(--tint);
}
.dokumente td p {
    margin: 0 0 0.4em;
}
.dokumente td p:last-child {
    margin-bottom: 0;
}
.dokumente .kurz {               /* Kurzbeschreibung unter dem Titel */
    font-size: 0.9em;
    color: color-mix(in srgb, var(--text) 75%, var(--bg));
}

/* Schmale Displays: Zeilen als Karten, Spaltenköpfe als Beschriftung */
@media (max-width: 40em) {
    .dokumente,
    .dokumente tbody,
    .dokumente tr,
    .dokumente th,
    .dokumente td {
        display: block;
    }
    .dokumente thead {            /* nur visuell ausgeblendet, bleibt für Screenreader */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
    .dokumente tr {
        padding: 0.4em 0;
        border-bottom: 1px solid var(--rule);
    }
    .dokumente th,
    .dokumente td {
        border: 0;
        padding: 0.15em 0.25em;
    }
    .dokumente tbody th {
        background: var(--tint);
        padding: 0.3em 0.6em;
    }
    .dokumente tbody + tbody > tr:first-child > * {
        border-top: 0;
    }
    .dokumente td:empty {
        display: none;
    }
    .dokumente td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--heading);
        font-size: 0.85em;
    }
    .dokumente tbody tr:hover {
        background: none;
    }
}

/* ------------------------------------------------------------
   Rätselseiten (<main class="raetsel">, z. B. fisch.htm)
   ------------------------------------------------------------ */
.raetsel h2 {
    text-align: left;
    font-size: 1.3em;
    margin: 1.5em 0 0.5em;
}
.raetsel ol {
    margin: 0 0 1em;
    padding-left: 2em;
}
.raetsel li {
    margin-bottom: 0.3em;
}
.raetsel ol li::marker {
    color: var(--accent);
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* Rechnung (SEND + MORE = MONEY): Ziffern exakt untereinander */
.raetsel pre {
    width: fit-content;
    margin: 1em auto;
    padding: 0.5em 1.5em;
    background: var(--tint);
    border-left: 3px solid var(--accent);
    font-size: 1.3em;
    line-height: 1.4;
    overflow-x: auto;
    max-width: 100%;
}

/* Aufklappbare Lösung */
.raetsel details {
    margin: 2em 0 1em;
    border: 1px solid var(--rule);
    border-radius: 4px;
}
.raetsel summary {
    cursor: pointer;
    padding: 0.6em 1em;
    color: var(--heading);
    font-weight: bold;
}
.raetsel summary:hover {
    background: var(--tint);
}
.raetsel summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.raetsel details[open] summary {
    border-bottom: 1px solid var(--rule);
}
.raetsel details > :not(summary) {
    margin-left: 1em;
    margin-right: 1em;
}
.raetsel details > p:first-of-type {
    margin-top: 0.75em;
}
.raetsel details > pre {
    margin: 1em auto;             /* Rechnung auch in der Lösung mittig */
}
.raetsel .frage {
    text-align: left;             /* kurze Fragezeile nicht im Blocksatz zerreißen */
    margin-top: 1em;
}

/* Breite Tabellen auf dem Handy seitlich scrollen statt Layout sprengen */
.scroll {
    overflow-x: auto;
    margin-bottom: 1em;
}
.loesung {
    margin: 0.5em auto 0.5em 0;
}
.loesung thead th {
    border-bottom: 2px solid var(--accent);
    text-align: center;
}
.loesung tbody th {
    color: var(--accent);
    white-space: nowrap;
}
.loesung th,
.loesung td {
    padding: 0.35em 0.7em;
}

/* ------------------------------------------------------------
   Statistik-Tabellen (<table class="statistik">,
   z. B. 1990 bundestag.htm, 1990 volkskammerwahlen.htm)
   ------------------------------------------------------------ */
.statistik {
    margin: 1em auto 1.5em;
    font-variant-numeric: tabular-nums;
}
.scroll > .statistik {
    margin-top: 0;
}
.statistik caption {
    text-align: left;
}
.statistik th,
.statistik td {
    padding: 0.35em 0.8em;
    border-bottom: 1px solid var(--rule);
}
.statistik thead th {
    border-bottom: 2px solid var(--accent);
    vertical-align: bottom;
}
.statistik .einheit {           /* zweite Zeile im Spaltenkopf: Einheit */
    display: block;
    font-size: 0.85em;
    font-weight: normal;
}
.statistik th {
    -webkit-hyphens: manual;      /* Namen und Begriffe nicht trennen */
    hyphens: manual;
}
.statistik tbody th {
    font-weight: normal;
    color: inherit;
    min-width: 9em;
}
.statistik .zahl {
    text-align: right;
    white-space: nowrap;
}
.statistik thead .zahl {
    white-space: normal;          /* lange Spaltenköpfe dürfen umbrechen */
}
.statistik tbody tr:hover {
    background: var(--tint);
}
.statistik .gruppe th {          /* Zwischenüberschrift innerhalb der Tabelle */
    color: var(--accent);
    font-weight: bold;
    padding-top: 0.8em;
}
.statistik .einzug {
    padding-left: 1.8em;
}
.statistik .summe > *,
.statistik tfoot th,
.statistik tfoot td {
    font-weight: bold;
}
.statistik tfoot th,
.statistik tfoot td {
    border-top: 2px solid var(--accent);
    border-bottom: 0;
}
.statistik tbody + tbody > tr:first-child > * {
    border-top: 2px solid var(--rule);
}

/* Balken in Tabellenzellen: <td class="balken"><span style="--w: 42%"></span></td> */
.statistik .balken {
    width: 40%;
    min-width: 6em;
    vertical-align: middle;
}
.balken span {
    display: block;
    width: var(--w, 0);
    height: 0.8em;
    background: var(--accent);
    opacity: 0.75;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

/* Gestapelte Balken für Anteile, die zusammen 100 % ergeben */
.stapel {
    margin: 1em 0 1.5em;
}
.stapel .zeile {
    display: grid;
    grid-template-columns: 3em 1fr;
    gap: 0.75em;
    align-items: center;
    margin-bottom: 0.35em;
}
.stapel .leiste {
    display: flex;
    height: 1.4em;
    border: 1px solid var(--rule);
}
.stapel .leiste span,
.stapel .legende i {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}
.stapel .leiste span {
    width: var(--w);
}
.stapel .t1 { background: var(--accent); }
.stapel .t2 { background: color-mix(in srgb, var(--accent) 60%, var(--bg)); }
.stapel .t3 { background: color-mix(in srgb, var(--accent) 25%, var(--bg)); }
.stapel .t4 { background: color-mix(in srgb, var(--text) 55%, var(--bg)); }
.stapel .t5 { background: transparent; }
.stapel .legende {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em 1.25em;
    font-size: 0.85em;
    margin-top: 0.6em;
    padding-left: 3.75em;
}
.stapel .legende i {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.35em;
    vertical-align: -0.1em;
    border: 1px solid var(--rule);
}

/* Anmerkungen unter Tabellen */
.anmerkungen {
    font-size: 0.9em;
    margin: 0 0 1em;
    padding-left: 1.2em;
}
.anmerkungen li {
    margin-bottom: 0.3em;
}

/* ------------------------------------------------------------
   Rücksprung-Navigation, Adressen, Quellenkästen
   (z. B. Macke-Seiten: hauptmann.htm, rez graeuel.htm)
   ------------------------------------------------------------ */
body > nav {
    margin-top: 2em;
    padding-top: 0.5em;
    border-top: 1px solid var(--rule);
}
body > nav a {
    display: inline-block;
    padding: 0.3em 0;             /* Tippfläche */
}

address {
    font-style: normal;
}

article > header p {
    text-align: center;
    color: var(--heading);
    margin: 0;
}

/* Bibliografische Kästen am Ende einer Rezension */
.box {
    background: var(--tint);
    border-left: 3px solid var(--accent);
    padding: 0.5em 1em;
    margin: 0 0 0.75em;
}
.box .header {
    color: var(--heading);
    font-weight: bold;
    margin-bottom: 0.25em;
}
.box p {
    text-align: left;
}

/* Bild mit fester Größe (z. B. orden.htm) zentrieren */
main > figure {
    text-align: center;
}
main > figure figcaption {
    text-align: center;
}

/* ------------------------------------------------------------
   Handschriften-Transkriptionen (<main class="transkription">,
   z. B. passiones anonym alle.htm): je Handschrift eine
   <section class="hs">, Farbmarkierungen der Vorlage als Klassen
   ------------------------------------------------------------ */
.rot   { color: var(--rot); }
.blau  { color: var(--blau); }
.gruen { color: var(--gruen); }
.braun { color: var(--braun); }
.grau  { color: var(--grau); }
.kap {
    font-variant: small-caps;
    letter-spacing: 0.03em;
}
.transkription u {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}
.transkription s.s2 {
    text-decoration-style: double;
}
abbr[title] {
    cursor: help;
}

.hs {
    border-top: 1px solid var(--rule);
    margin-top: 2.5em;
}
.transkription .hs h2 {
    margin-top: 1em;
}
.sigle {
    color: var(--accent);
    margin-right: 0.3em;
}
.ueberlief {
    font-size: 0.9em;
    color: color-mix(in srgb, var(--text) 75%, var(--bg));
}
p.ueberlief {
    text-align: left;
}
.incipit {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05em;
    color: var(--text);
    margin: 1em 0 0.6em;
}
a.absatz:link,
a.absatz:visited {
    color: var(--accent);
    text-decoration: none;
}
a.absatz:hover {
    text-decoration: underline;
}
.latein p[id] {
    scroll-margin-top: 1em;
}

/* Handschriftenliste im Inhaltsverzeichnis, mehrspaltig */
.toc h3 {
    font-size: 1em;
    color: var(--heading);
    margin: 0.9em 0 0.2em;
}
.toc h3 small {
    font-weight: normal;
}
.toc .hs-liste {
    list-style: none;
    padding: 0;
    columns: 17em;
    column-gap: 2em;
    font-size: 0.95em;
    -webkit-hyphens: manual;
    hyphens: manual;
}
.toc .hs-liste a {
    text-decoration: none;
}
.toc .hs-liste a:hover span {
    text-decoration: underline;
}
.hs-liste li {
    break-inside: avoid;
}
.hs-liste b {
    display: inline-block;
    min-width: 3.2em;
}

/* Zeichenerklärung, aufklappbar */
.legende summary {
    cursor: pointer;
    color: var(--heading);
    font-weight: bold;
}
.legende[open] summary {
    margin-bottom: 0.5em;
}
.legende .daten dt {
    font-weight: normal;
    color: inherit;
}

/* ------------------------------------------------------------
   Quellentexte / Dokumenteditionen (<main class="dokument">,
   z. B. 19350419 landrat an rp.htm, 19350712 urteil vgh kaup.htm)
   ------------------------------------------------------------ */
.dokument h1 {
    margin-bottom: 0.4em;
}
.dokument .lead {
    margin-bottom: 1.5em;
}
.dokument h2 {
    font-size: 1.25em;
    margin: 1.5em 0 0.5em;
}
.dokument h3 {
    font-size: 1.05em;
    margin: 1em 0 0.3em;
}
.dokument .zentriert {
    text-align: center;
}
.gesperrt {
    letter-spacing: 0.25em;
}
.dokument .einzug {
    margin-left: 2em;
}
.dokument ol.einzug {
    margin-left: 0;
    padding-left: 2.5em;
}
.dokument ul,
.dokument ol {
    margin: 0 0 0.75em;
    padding-left: 1.6em;
}
.dokument li {
    margin-bottom: 0.3em;
}
.dokument ul.ohne-punkte {      /* Namenslisten (Anwesende, Verteiler) ohne Aufzählungszeichen */
    list-style: none;
    padding-left: 0;
}
.dokument .normal {
    font-weight: normal;
}
.abschnitt {
    text-align: center;
    font-weight: bold;
    margin: 1.5em 0 0.5em;
}
.dokument p.abschnitt,
.dokument p.zentriert,
.dokument p.seite,
.dokument p.datum {
    text-align: center;
}
.dokument p.seite {
    text-align: left;
    margin: 1em 0 0.5em;
}
.dokument p.datum {
    text-align: right;
}
.hrsg {                       /* Bemerkungen des Herausgebers im Quellentext */
    color: var(--grau);
    font-style: italic;
}
.vermerk {                    /* Akten- und Absendevermerke, Briefkopf */
    margin-bottom: 0.25em;
}
.dokument p.vermerk {
    text-align: left;
}
.unterschrift {
    margin-top: 1em;
}
.dokument p.unterschrift {
    text-align: left;
}
.dokument del,
.dokument s {
    text-decoration-thickness: 1px;
}
.dito {                       /* Wiederholungszeichen der Vorlage */
    color: var(--grau);
}

/* Zwei Spalten nebeneinander (Unterschriften, Briefkopf links/rechts) */
.zweispaltig {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.5em;
    margin: 1em 0;
}
.zweispaltig p {
    text-align: left;
    margin-bottom: 0.2em;
}
@media (max-width: 30em) {
    .zweispaltig {
        grid-template-columns: 1fr;
        gap: 1em;
    }
}

/* Transkription eines Vordrucks (<section class="formular">, z. B. Meldebogen 1) */
.formular {
    background: var(--papier);
    border: 1px solid var(--rule);
    padding: 1.4em 1.3em;
    margin: 1.5em 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.92em;
    line-height: 1.45;
    -webkit-hyphens: manual;
    hyphens: manual;
}
.formular .kopf {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5em;
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 1em;
}
.formular .feld {
    border-bottom: 1px dotted var(--rule);
    padding: 0.4em 0;
    min-height: 2.1em;
}
.formular .raster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
    margin: 1em 0;
}
.formular .raster > div {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 0.4em 0.5em;
    min-height: 2.6em;
}
.formular .raster .breit {
    grid-column: span 2;
}
.formular .unter {
    padding-left: 1.5em;
}
.formular .frei {
    border: 2px solid var(--text);
    min-height: 9em;
    margin: 1.4em 0 0.4em;
    padding: 0.6em;
    font-weight: bold;
    text-align: center;
}
.formular .zweispaltig {
    margin-top: 2em;
}
.formular .zweispaltig > div {
    border-top: 1px solid var(--text);
    padding-top: 0.3em;
    font-size: 0.85em;
}
.formular .fussnoten {
    font-size: 0.82em;
    margin-top: 1.4em;
}
.formular .fussnoten p {
    text-align: left;
    margin-bottom: 0.3em;
}
@media (max-width: 40em) {
    .formular {
        padding: 1em 0.8em;
    }
    .formular .raster {
        grid-template-columns: 1fr;
    }
    .formular .raster .breit {
        grid-column: auto;
    }
}

/* Anmerkungsblock unter einem Quellentext */
.dokument .endnoten {
    border-top: 1px solid var(--accent);
    margin-top: 2em;
    padding-top: 0.5em;
}
.dokument .endnoten h2 {
    font-size: 1em;
    text-align: left;
    margin: 0 0 0.4em;
}
.endnoten ol {
    padding-left: 1.8em;
}
.endnoten li {
    margin-bottom: 0.3em;
    scroll-margin-top: 1em;
}
.endnoten p {
    text-align: left;
}
.fn a[id] {
    scroll-margin-top: 1em;
}

/* Druck: immer hell und schwarz auf weiß, auch bei Dunkelmodus */
@media print {
    :root {                       /* helle Markierungsfarben auch bei Dunkelmodus */
        color-scheme: light;
        --rot: #b3001b;
        --blau: #1f4fa3;
        --gruen: #2b6e2f;
        --braun: #8a5226;
        --grau: #6b6b6b;
        --papier: #fff;
        --rule: #999;
        --text: #000;
        --bg: #fff;
    }
    .rot, .blau, .gruen, .braun, .grau {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    body {
        background: #fff;
        color: #000;
        max-width: none;
        font-size: 11pt;
        padding: 0;
    }
    footer nav,
    body > nav,
    .toc,
    .rueck,
    .raetsel details {            /* Rätselblatt ohne Lösung drucken */
        display: none;
    }
    a:link,
    a:visited {
        color: inherit;           /* a:link hat höhere Spezifität als a */
    }
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        word-break: break-all;
    }
    h1,
    h2,
    h3 {
        break-after: avoid;
    }
    p {
        orphans: 3;
        widows: 3;
    }
    blockquote,
    figure,
    .box,
    .dokumente tr,
    .endnoten li,
    .literatur li {
        break-inside: avoid;
    }
    .dokumente thead,
    .statistik thead {
        display: table-header-group;   /* Kopfzeile auf jeder Druckseite */
    }
    .statistik tr {
        break-inside: avoid;
    }
    .dokumente tbody tr:hover,
    .statistik tbody tr:hover {
        background: none;
    }
    .scroll {
        overflow: visible;
    }
}
