/* Fachbuch (/fachbuch, /fachbuch/{slug}). Diese Datei lädt auf jeder Seite: alle Regeln unter .seite-buch oder .buch-… */
.seite-buch .inhalt { max-width: 48rem; }

.buch-kopf { margin-bottom: 0.5rem; }
.buch-kopf h1 { margin: 0.25rem 0 0.25rem; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.buch-teil { margin: 0; font-size: 0.95rem; }
.buch-teil a { color: var(--akzent); text-decoration: none; }
.buch-teil a:hover, .buch-teil a:focus { text-decoration: underline; }
.buch-untertitel { margin: 0; font-size: 1.15rem; color: #44525c; }
.buch-herkunft { font-size: 0.95rem; color: #44525c; }

/* Kasten „Das Wichtigste in Kürze“ */
.buch-kurz {
    margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--flaeche);
    border-left: 4px solid var(--signal); border-radius: 0 6px 6px 0;
}
.buch-kurz h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.buch-kurz ul { margin: 0; padding-left: 1.25rem; }
.buch-kurz li + li { margin-top: 0.35rem; }
.buch-kurz-mehr { margin: 0.75rem 0 0; }

/* Abschnitte im Kapitel */
.buch-abschnitte { margin: 1.5rem 0; padding: 0.75rem 1rem; border: 1px solid var(--rand); border-radius: 6px; }
.buch-abschnitte h2 { margin: 0 0 0.25rem; font-size: 1rem; }
.buch-abschnitte ol { margin: 0; padding-left: 1.5rem; }
.buch-abschnitte li { padding: 0.15rem 0; }
.buch-abschnitte a { display: inline-block; min-height: 1.75rem; }

/* Fachtext */
.buch-text h2 { margin: 2rem 0 0.5rem; font-size: 1.3rem; line-height: 1.3; scroll-margin-top: 1rem; }
.buch-text p { margin: 0 0 1rem; }
.buch-text [id] { scroll-margin-top: 1rem; }
.buch-text em { font-style: italic; }
.buch-thema { text-decoration-style: dotted; }

.buch-text .tabellenrahmen, .seite-buch .tabellenrahmen {
    overflow-x: auto; max-width: 100%; margin: 1rem 0 1.25rem;
    -webkit-overflow-scrolling: touch; border: 1px solid var(--rand); border-radius: 4px;
}
.buch-tabelle { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: 0.92rem; line-height: 1.45; }
.buch-tabelle th, .buch-tabelle td { padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rand); }
.buch-tabelle thead th { background: #e5edf0; }
.buch-tabelle tbody td:first-child { font-weight: 600; }
.buch-tabelle tbody tr:last-child td { border-bottom: 0; }

.buch-bild { margin: 1.25rem 0 1.5rem; }
.buch-bild img { display: block; width: 100%; height: auto; max-width: 100%; background: #fff; border: 1px solid var(--rand); border-radius: 4px; }
.buch-bild-link { display: block; cursor: zoom-in; }
.buch-bild figcaption { margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.45; color: #3a4750; }

.buch-quellen, .buch-verweise { margin: -0.25rem 0 1.25rem; font-size: 0.88rem; color: #44525c; }
.buch-quellen a, .buch-verweise a { display: inline-block; padding: 0.15rem 0; }
.buch-quelle { padding-left: 3.5rem; text-indent: -3.5rem; font-size: 0.95rem; overflow-wrap: anywhere; }
.buch-quelle strong { display: inline-block; min-width: 3.25rem; text-indent: 0; }
.buch-quelle:target, .buch-bild:target, .buch-text h2:target { background: #fff6d6; }

.buch-rechner { margin: 2rem 0; }
.buch-rechner-link a { font-weight: 600; }

/* Fragen und Antworten */
.buch-fragen { margin-top: 2.5rem; padding-top: 1rem; border-top: 3px solid var(--signal); }
.buch-fragen h2 { margin-top: 0; }
.buch-fragen h3 { margin: 1.25rem 0 0.25rem; font-size: 1.05rem; }
.buch-fragen p { margin: 0; }

/* Blättern */
.buch-blaettern { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 2.5rem; }
.buch-blaettern a {
    display: block; min-height: 2.75rem; padding: 0.6rem 0.9rem; text-decoration: none; color: var(--text);
    border: 1px solid var(--rand); border-radius: 6px; overflow-wrap: anywhere;
}
.buch-blaettern a:hover, .buch-blaettern a:focus { border-color: var(--akzent); }
.buch-blaettern a span:first-child { display: block; font-size: 0.85rem; color: var(--akzent); }
.buch-blaettern .buch-nach { text-align: right; }
.buch-blaettern .buch-verzeichnis { text-align: center; color: var(--akzent); }
@media (min-width: 40em) {
    .buch-blaettern { grid-template-columns: 1fr 1fr; }
    .buch-blaettern .buch-verzeichnis { grid-column: 1 / -1; }
    .buch-blaettern .buch-nach:only-of-type { grid-column: 2; }
}

/* Inhaltsverzeichnis /fachbuch: kurzer Kopf, Knöpfe, Teile als Kacheln, Einleitungen und Vorwort zum Aufklappen */
.buch-start .buch-kopf { margin: 0; }
.buch-start-knoepfe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 1.5rem; }
.buch-knopf {
    display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.5rem 1.1rem; font-weight: 600;
    color: var(--akzent-text); background: var(--akzent); border: 2px solid var(--akzent); border-radius: 6px; text-decoration: none;
}
.buch-knopf:hover, .buch-knopf:focus { background: #174a6c; border-color: #174a6c; }
.buch-knopf-zweit { color: var(--akzent); background: var(--grund); }
.buch-knopf-zweit:hover, .buch-knopf-zweit:focus { color: var(--akzent-text); }

.buch-teile h2, .buch-inhalt > h2, .buch-vorwort h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.buch-teile-raster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); gap: 0.6rem; }
.buch-teile-raster a {
    display: flex; flex-direction: column; height: 100%; padding: 0.55rem 0.7rem; color: var(--text); text-decoration: none;
    border: 1px solid var(--rand); border-left: 4px solid var(--signal); border-radius: 6px; background: var(--grund);
}
.buch-teile-raster a:hover, .buch-teile-raster a:focus { border-color: var(--akzent); border-left-color: var(--signal); background: var(--flaeche); }
.buch-teile-nr { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6870; }
.buch-teile-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; overflow-wrap: anywhere; hyphens: auto; }
@media (min-width: 40em) {
    .buch-teile-raster { grid-template-columns: repeat(4, 1fr); }
    .buch-teile-name { hyphens: manual; }
}
.buch-teile-zahl { margin-top: auto; padding-top: 0.25rem; font-size: 0.85rem; color: var(--akzent); }

.buch-rechner-hinweis { margin: 1.5rem 0; padding: 0.75rem 1rem; background: var(--flaeche); border-radius: 6px; }
.buch-rechner-hinweis h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.buch-rechner-hinweis ul { margin: 0; }
.buch-teilblock { margin-top: 1.75rem; padding-top: 0.25rem; border-top: 1px solid var(--rand); }
.buch-teilblock h3 { margin: 0.75rem 0 0.25rem; font-size: 1.15rem; scroll-margin-top: 1rem; }
.buch-teil-einleitung { margin: 0 0 0.5rem; font-size: 0.95rem; }
.buch-teil-einleitung summary, .buch-vorwort summary { display: inline-block; min-height: 2rem; padding: 0.25rem 0; color: var(--akzent); cursor: pointer; }
.buch-teil-einleitung summary::before, .buch-vorwort summary::before { content: "▸ "; }
.buch-teil-einleitung[open] summary::before, .buch-vorwort details[open] summary::before { content: "▾ "; }
.buch-teil-einleitung summary::-webkit-details-marker, .buch-vorwort summary::-webkit-details-marker { display: none; }
.buch-teil-einleitung .buch-text { padding: 0.5rem 0 0 1rem; border-left: 2px solid var(--flaeche); }
.buch-liste { list-style: none; margin: 0; padding: 0; }
.buch-liste li { padding: 0.5rem 0; border-bottom: 1px solid var(--flaeche); }
.buch-liste a { display: inline-flex; gap: 0.5rem; align-items: baseline; min-height: 2rem; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.buch-liste a:hover span + span, .buch-liste a:focus span + span { text-decoration: underline; }
.buch-nr { flex: none; min-width: 1.75rem; font-variant-numeric: tabular-nums; color: #5b6870; }
.buch-liste-text { display: block; margin-left: 2.25rem; font-size: 0.92rem; color: #44525c; }

/* Großansicht */
.buch-gross { width: calc(100vw - 1rem); max-width: 90rem; max-height: calc(100vh - 1rem); padding: 0; border: 0; border-radius: 6px; background: #fff; }
.buch-gross::backdrop { background: rgba(15, 22, 28, 0.85); }
.buch-gross-innen { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
.buch-gross-zu { align-self: flex-end; min-height: 2.75rem; padding: 0.4rem 1rem; font: inherit; color: var(--akzent-text); background: var(--akzent); border: 0; border-radius: 4px; cursor: pointer; }
.buch-gross-bild { display: block; width: 100%; height: auto; max-height: calc(100vh - 9rem); object-fit: contain; cursor: zoom-out; }
.buch-gross-text { margin: 0; font-size: 0.9rem; }
