/* =============================================================================
   doku-oeffentlich.css — die oeffentlichen Seiten von docs.rivus360.com
   =============================================================================
   Grundlage ist das Design von rivus360.com: frontend-main.css, core_theme.css,
   frontend-dunkel.css, hilfsklassen.css und kopfbild.css sind UNVERAENDERTE
   Kopien aus rivus360-shop (Stand 2026-11-15). Aenderungen gehoeren dort hin
   und werden hierher nachgezogen - sonst laufen die beiden Seiten auseinander.

   Diese Datei traegt nur, was die Doku zusaetzlich braucht:
   1. drei Variablen, die docs.css erwartet und der Shop nicht kennt;
   2. Suchfeld, Sprachauswahl (gruppiert, mit Suche) und Hell/Dunkel-Schalter
      aus der alten main.css - die bleibt fuer Dashboard und Anmeldung;
   3. das Doku-Layout: Bereiche, Seitenleiste, "Auf dieser Seite", Bilder,
      Hinweiskaesten, Vor/Zurueck.

   Geladen nur von templates/oeffentlich/basis.html.
   ============================================================================= */

:root {
    --brand-red: var(--primary);
    --primary-rgb: 197, 2, 60;
    --radius-sm: 6px;
}

/* -----------------------------------------------------------------------------
   2. Aus main.css: Hell/Dunkel-Schalter
   ----------------------------------------------------------------------------- */
/* =============================================================================
   THEME TOGGLE BUTTON
   ============================================================================= */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    background: var(--light);
    color: var(--text-primary);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}


/* -----------------------------------------------------------------------------
   2. Aus main.css: Suchfeld und Sprachauswahl
   ----------------------------------------------------------------------------- */
/* Nav Search */
.nav-search {
    flex: 1;
    max-width: 480px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    padding: 0.625rem 0.875rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-btn:hover {
    color: var(--primary);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Sprachauswahl: das Core-Modul aus rivus360-law (static/js/core_language.js
   + static/css/core_language.css, Flaggen in static/flags/language_flags.svg).
   Hier stand bis 2026-11-15 ein eigener Wahlkasten; seine Klassen
   (.language-option, .language-no-results) heissen im Core-Modul gleich und
   haetten es verbogen - darum ersatzlos entfernt. */
.nav-actions .language-selector-wrapper {
    min-width: 11rem;
}
/* Rahmen und Fokus der Sprachwahl in der Markenfarbe (core_language.css
   bringt Bootstrap-Blau #80bdff mit). */
.nav-actions .language-selector-display:hover,
html[data-theme="dark"] .nav-actions .language-selector-display:hover {
    border-color: var(--primary);
}
.nav-actions .language-selector-display:focus-visible,
.nav-actions .language-selector-display.open,
.nav-actions .language-selector-search input:focus,
html[data-theme="dark"] .nav-actions .language-selector-display.open,
html[data-theme="dark"] .nav-actions .language-selector-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgb(197 2 60 / 0.2);
}

/* Gruppe ohne Ueberschrift (siehe main.js, SelectorUITexts.all = ""):
   eine Trennlinie statt einer leeren Zeile. */
.language-option-group:empty {
    padding: 0;
    height: 1px;
    margin: 0.25rem 0;
    background: var(--border-color);
}
/* Gewaehlte Sprache in der Markenfarbe statt Bootstrap-Blau. */
.language-option.selected {
    color: var(--primary);
    background: rgb(197 2 60 / 0.07);
}
/* core_language.css setzt hier Blau mit !important - darum ebenfalls
   !important und eine Stufe spezifischer. */
html[data-theme="dark"] .language-option.selected {
    color: var(--marke-auf-dunkel, #e8365d) !important;
    background: rgb(232 54 93 / 0.12) !important;
}
.language-option.highlighted {
    background: rgb(197 2 60 / 0.07);
    outline: 2px solid var(--primary);
}
html[data-theme="dark"] .language-option.highlighted {
    background: rgb(232 54 93 / 0.12) !important;
    outline-color: var(--marke-auf-dunkel, #e8365d) !important;
}

/* Handy: nur Flagge und Pfeil, sonst ragt die Wahl rechts aus dem Kopf
   (gemessen 2026-11-15: 414 px Seitenbreite bei 390 px Fenster). Die
   Liste klappt weiter in voller Breite auf. */
@media (max-width: 600px) {
    .nav-actions .language-selector-wrapper {
        min-width: 0;
        width: 4.5rem;
    }
    .nav-actions .language-selector-display .text {
        display: none;
    }
    .nav-actions .language-selector-dropdown {
        right: 0;
        left: auto;
        width: min(20rem, calc(100vw - 2rem));
    }
}

/* -----------------------------------------------------------------------------
   3. Doku-Layout
   ----------------------------------------------------------------------------- */

.sprungmarke {
    position: absolute;
    left: -9999px;
    top: 0;
}
.sprungmarke:focus {
    left: 1rem;
    top: 1rem;
    z-index: 1000;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

/* Breiter als die 1200px des Shops: Leiste + Text + "Auf dieser Seite".
   Kopfleiste, Kopfbild, Hilfeband und Footer ziehen mit, sonst stehen
   Logo und Fusszeile eingerueckt ueber einem breiteren Inhalt (Pierre am
   2026-11-15: "der inhalt ist breiter wie header und footer"). */
.container.doku-breit,
.doku .main-nav,
.doku .hero > .container,
.doku .help-band > .container,
.doku .site-footer > .container {
    max-width: 1400px;
}

/* Kopfbild der Startseite: Reserve fuer die schraege Kante wie im Shop
   (shop.css .hero--shop). */
.hero--shop {
    position: relative;
    overflow: hidden;
    padding-bottom: 10.5rem;
}
.hero--shop > .container {
    position: relative;
    z-index: 3;
}
.hero__suche {
    position: relative;
    max-width: 560px;
    margin: 2rem auto 0;
}
.hero__suche i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}
.hero__suche input {
    width: 100%;
    padding: 0.95rem 1.2rem 0.95rem 2.9rem;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 999px;
    background: #ffffff;
    color: #1d1d1f;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.hero__suche input:focus {
    outline: 3px solid rgb(232 54 93 / 0.45);
    outline-offset: 2px;
}

/* .site-main ist eine Flex-Spalte (frontend-main.css). Ein Kind mit
   margin:auto schrumpft dort auf seine Inhaltsbreite - die Kacheln sassen
   schmal in der Mitte statt unter dem Kopf. */
.site-main > .container {
    width: 100%;
}

.doku-abschnitt {
    padding-top: 2rem;
    /* Das Hilfeband darunter zieht sich mit margin-top:-40px hoch
       (frontend-main.css .help-band) und beginnt mit einer schraegen Kante.
       3rem ergaben 8 px, 6rem gemessen 56 px - beides stiess fuer Pierre an
       "Hilfe & Support". 8rem = rund 90 px bis zur Linie (2026-11-16). */
    padding-bottom: 8rem;
}

/* Kopfleiste: Logo + "Docs", Bereichsnavigation, Suche */
.doku-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.doku-logo__wort {
    font-weight: 600;
    color: var(--text-primary);
    border-left: 1px solid var(--border-color);
    padding-left: 0.6rem;
    line-height: 1;
}
.doku-bereichsnav .nav-link.aktiv {
    color: var(--primary);
}
.doku-kopfsuche {
    max-width: 260px;
}
@media (max-width: 1100px) {
    .doku-kopfsuche { display: none; }
}

/* Seitenkopf im Hausstil: dunkle Flaeche, eine rote Linie. */
.doku-kopf {
    position: relative;
    background: #07080a;
    color: #f4f4f5;
    padding: 3.5rem 0 3rem;
    overflow: hidden;
}
.doku-kopf::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--primary);
}
.doku-kopf__vorzeile a {
    color: #a1a1aa;
    text-decoration: none;
    font-size: 0.9rem;
}
.doku-kopf__titel {
    color: #fff;
    margin: 0.25rem 0 0.75rem;
}
.doku-kopf__titel .bi {
    color: var(--primary);
}
.doku-kopf__text {
    color: #c4c4cc;
    max-width: 60ch;
    font-size: 1.1rem;
    margin: 0;
}
.doku-kopf__suche {
    margin-top: 1.75rem;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fff;
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
}
.doku-kopf__suche .bi {
    color: #6c757d;
}
.doku-kopf__suche input {
    border: 0;
    outline: none;
    flex: 1;
    font-size: 1rem;
    background: transparent;
    color: #212529;
}
.doku-kopf__suche:focus-within {
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.35);
}

/* Startseite: drei Bereiche */
.doku-bereiche {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}
.doku-bereichskarte {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: var(--theme-bg-primary, #fff);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.doku-bereichskarte:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.doku-bereichskarte__kopf {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}
.doku-bereichskarte__kopf .bi {
    font-size: 1.5rem;
    color: var(--primary);
}
.doku-bereichskarte__kopf h2 {
    font-size: 1.35rem;
    margin: 0;
}
.doku-bereichskarte__text,
.doku-bereichskarte__leer {
    color: var(--text-secondary);
    margin: 0;
}
.doku-bereichskarte__kategorien {
    list-style: none;
    padding: 0;
    margin: 0 0 auto;
    display: grid;
    gap: 0.35rem;
}
.doku-bereichskarte__kategorien a {
    color: var(--text-primary);
    text-decoration: none;
}
.doku-bereichskarte__kategorien a:hover {
    color: var(--primary);
}
.doku-bereichskarte .btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}
.doku-zahl {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Bereichsseite: Kategorien als Karten mit Artikelliste */
.doku-kategorienraster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 1.5rem;
}
.doku-kategoriekarte {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    background: var(--theme-bg-primary, #fff);
}
.doku-kategoriekarte__titel {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}
.doku-kategoriekarte__titel .bi {
    color: var(--primary);
}
.doku-kategoriekarte__titel a {
    color: var(--text-primary);
    text-decoration: none;
}
.doku-kategoriekarte__text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.doku-kategoriekarte__liste {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.3rem;
}
.doku-kategoriekarte__liste a {
    text-decoration: none;
}

/* Drei Spalten: Leiste | Text | Auf dieser Seite */
.doku-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}
.doku-layout--artikel {
    grid-template-columns: 260px minmax(0, 1fr) 220px;
}
@media (max-width: 1200px) {
    .doku-layout--artikel { grid-template-columns: 240px minmax(0, 1fr); }
    .doku-gliederung { display: none; }
}
@media (max-width: 900px) {
    .doku-layout,
    .doku-layout--artikel { grid-template-columns: minmax(0, 1fr); }
}

.doku-leiste {
    position: sticky;
    top: calc(var(--kopfhoehe, 3.75rem) + 1rem);
    max-height: calc(100vh - var(--kopfhoehe, 3.75rem) - 2rem);
    overflow-y: auto;
}
@media (max-width: 900px) {
    /* Auf dem Telefon stand der ganze Baum VOR dem Text - erst eine
       Bildschirmhoehe Navigation, dann der Artikel. Jetzt danach. */
    .doku-leiste { position: static; max-height: none; order: 2; }
}
.doku-leiste__kategorien,
.doku-leiste__artikel {
    list-style: none;
    margin: 0;
    padding: 0;
}
.doku-leiste__kategorie {
    margin-bottom: 0.75rem;
}
.doku-leiste__kategorielink {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.25rem 0;
}
.doku-leiste__kategorielink .bi {
    color: var(--primary);
}
.doku-leiste__artikel {
    border-left: 1px solid var(--border-color);
    margin-left: 0.45rem;
}
.doku-leiste__artikellink {
    display: block;
    padding: 0.3rem 0 0.3rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.93rem;
    line-height: 1.4;
}
.doku-leiste__artikellink:hover,
.doku-leiste__kategorielink:hover {
    color: var(--primary);
}
.doku-leiste__artikellink.aktiv,
.doku-leiste__kategorielink.aktiv {
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
.doku-leiste__leer {
    color: var(--text-muted);
}

/* Artikel */
.doku-einleitung {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 70ch;
}
.doku-text {
    max-width: 78ch;
    line-height: 1.7;
}
.doku-text h2 {
    margin-top: 2.5rem;
    padding-top: 0.5rem;
    scroll-margin-top: calc(var(--kopfhoehe, 3.75rem) + 1rem);
}
.doku-text h3 {
    margin-top: 1.75rem;
    scroll-margin-top: calc(var(--kopfhoehe, 3.75rem) + 1rem);
}
.doku-text ol,
.doku-text ul {
    padding-left: 1.4rem;
}
.doku-text li {
    margin: 0.3rem 0;
}
.doku-text code {
    background: var(--light);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
}
.doku-text kbd {
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
    font-size: 0.85em;
}
.doku-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.95rem;
}
.doku-text th,
.doku-text td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    text-align: start;
    vertical-align: top;
}
.doku-text th {
    background: var(--light);
}

/* Bildschirmfotos: Rahmen, voller Textblock, Klick oeffnet gross. */
.doku-bild__link {
    display: block;
    margin: 1.5rem 0;
}
/* Breite Aufnahmen fuellen den Textblock; hohe Dialogausschnitte werden in der
   Hoehe begrenzt und mittig gesetzt, statt auf volle Breite aufzublasen. */
.doku-bild {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(80vh, 720px);
    height: auto;
    margin-inline: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Hinweiskaesten: "> **Hinweis:** ..." / "> **Achtung:** ..." */
.doku-text blockquote {
    margin: 1.5rem 0;
    padding: 0.9rem 1.1rem;
    border-left: 4px solid var(--border-color);
    background: var(--light);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.doku-text blockquote p:last-child {
    margin-bottom: 0;
}
.doku-text .kasten--hinweis {
    border-left-color: #0d6efd;
}
.doku-text .kasten--warnung {
    border-left-color: var(--primary);
}

/* Vor / Zurueck */
.doku-blaettern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.doku-blaettern__link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
}
.doku-blaettern__link:hover {
    border-color: var(--primary);
}
.doku-blaettern__link--nachher {
    grid-column: 2;
    text-align: end;
}
.doku-blaettern__richtung {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.doku-blaettern__titel {
    font-weight: 600;
}

/* Auf dieser Seite */
.doku-gliederung {
    position: sticky;
    top: calc(var(--kopfhoehe, 3.75rem) + 1rem);
    font-size: 0.9rem;
}
.doku-gliederung__titel {
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.doku-gliederung ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 1px solid var(--border-color);
}
.doku-gliederung a {
    display: block;
    padding: 0.25rem 0 0.25rem 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.doku-gliederung a:hover {
    color: var(--primary);
}
/* Abschnitt, in dem man gerade liest (static/js/doku.js) */
.doku-gliederung a.aktiv {
    color: var(--primary);
    font-weight: 600;
    margin-left: -1px;
    border-left: 2px solid var(--primary);
    padding-left: calc(0.8rem - 1px);
}

/* Kategorieseite: Artikel als Liste */
.doku-artikelliste {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: grid;
    gap: 0.75rem;
}
.doku-artikelliste__link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}
.doku-artikelliste__link:hover {
    border-color: var(--primary);
}
.doku-artikelliste__titel {
    font-weight: 600;
}
.doku-artikelliste__auszug {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Dunkelmodus: Flaechen aus core_theme.css */
[data-theme="dark"] .doku-bereichskarte,
[data-theme="dark"] .doku-kategoriekarte {
    background: var(--theme-bg-secondary, #1e1e1e);
}
[data-theme="dark"] .doku-text code,
[data-theme="dark"] .doku-text th,
[data-theme="dark"] .doku-text blockquote {
    background: var(--theme-bg-tertiary, #2d2d2d);
}
[data-theme="dark"] .doku-logo__wort {
    color: var(--theme-text-primary, #e4e4e7);
}

.doku-neu {
    margin-top: 3rem;
}

/* Dunkelmodus: frontend-dunkel.css faerbt Verweise rot (Marke auf Dunkel).
   In der Doku-Navigation waere dann alles rot und nichts mehr hervorgehoben -
   dort normale Schrift, Rot nur fuer Aktiv/Hover. Fliesstext-Links bleiben rot.

   :not(#_) ist Absicht: die Shop-Regel steht mit fuenf :not(.klasse) bei
   (0,6,1). Ein :not(#_) zaehlt als ID und hebt diese Regeln ueber (1,0,0),
   ohne !important und ohne die Shop-Kopie anzufassen. */
html[data-theme="dark"]:not(#_) .doku-bereichskarte__kopf,
html[data-theme="dark"]:not(#_) .doku-bereichskarte__kategorien a,
html[data-theme="dark"]:not(#_) .doku-kategoriekarte__titel a,
html[data-theme="dark"]:not(#_) .doku-artikelliste__link,
html[data-theme="dark"]:not(#_) .doku-blaettern__link,
html[data-theme="dark"]:not(#_) .doku-leiste__kategorielink {
    color: var(--theme-text-primary, #e4e4e7);
}
html[data-theme="dark"]:not(#_) .doku-leiste__artikellink,
html[data-theme="dark"]:not(#_) .doku-gliederung a {
    color: var(--theme-text-secondary, #a1a1aa);
}
html[data-theme="dark"]:not(#_) .doku-bereichskarte__kopf .bi,
html[data-theme="dark"]:not(#_) .doku-leiste__kategorielink .bi,
html[data-theme="dark"]:not(#_) .doku-leiste__artikellink.aktiv,
html[data-theme="dark"]:not(#_) .doku-bereichskarte__kategorien a:hover,
html[data-theme="dark"]:not(#_) .doku-leiste__artikellink:hover,
html[data-theme="dark"]:not(#_) .doku-gliederung a:hover,
html[data-theme="dark"]:not(#_) .doku-gliederung a.aktiv {
    color: var(--primary);
}

@media (max-width: 600px) {
    .doku-artikel.docs-article {
        padding: 1.25rem;
    }
    .doku-kopf {
        padding: 2.25rem 0 2rem;
    }
}

/* Startseite: Abstand zwischen Suche und den drei Bereichsknoepfen. */
.hero__suche + .hero-actions {
    margin-top: 1.75rem;
}


/* =============================================================================
   Nachbesserungen 2026-11-15 (Pierre)
   ============================================================================= */

/* Kein Unterstreichen beim Ueberfahren, in keinem Modus. Die Rueckmeldung
   gibt die Farbe. :not(#_) hebt die Regel ueber alle a:hover-Regeln aus
   frontend-main.css, docs.css und den Shop-Kopien.
   Ausnahme Footer: dort unterstreicht wie auf support.rivus360.com ein
   border-bottom, kein text-decoration - bleibt unberuehrt. */
body.doku:not(#_) a:hover,
body.doku:not(#_) a:focus-visible {
    text-decoration: none;
}

/* Footer-Links grau wie auf support.rivus360.com - im Dunkelmodus gewann
   hier die rote Verweisregel der Shop-Kopie. */
html[data-theme="dark"]:not(#_) .footer-link {
    color: #9aa1a9;
}
html[data-theme="dark"]:not(#_) .footer-link:hover,
html[data-theme="dark"]:not(#_) .footer-link:focus-visible {
    color: #e6e8ea;
}

/* Bereichsseite im Dunkelmodus: die Artikellisten der Kategoriekarten
   waren komplett rot. Weiss und dauerhaft unterstrichen (das ist der
   Hinweis "Verweis", nicht der Hover), Rot nur beim Ueberfahren. */
html[data-theme="dark"]:not(#_) .doku-kategoriekarte__liste a,
html[data-theme="dark"]:not(#_) .doku-kategoriekarte__liste a:hover {
    text-decoration: underline;
    text-decoration-color: rgb(228 228 231 / 0.35);
    text-underline-offset: 3px;
}
html[data-theme="dark"]:not(#_) .doku-kategoriekarte__liste a {
    color: var(--theme-text-primary, #e4e4e7);
}
html[data-theme="dark"]:not(#_) .doku-kategoriekarte__liste a:hover {
    color: var(--marke-auf-dunkel, #e8365d);
    text-decoration-color: currentColor;
}
/* Brotkrumen und Bereichstitel der Leiste: grau/weiss statt rot. */
html[data-theme="dark"]:not(#_) .doku-kopf__vorzeile a,
html[data-theme="dark"]:not(#_) .docs-breadcrumb__item a,
html[data-theme="dark"]:not(#_) a.docs-breadcrumb__item {
    color: #a1a1aa;
}
html[data-theme="dark"]:not(#_) .docs-sidebar__home {
    color: var(--theme-text-primary, #e4e4e7);
}

/* Startseite: Umriss-Knoepfe im Kopfbild beim Ueberfahren fast weiss
   hinterlegt, Schrift dunkel - vorher 14 % Weiss, die Schrift verschwamm
   im Bild. */
html:not(#_) .hero--kulisse .btn-outline:hover,
html:not(#_) .hero--kulisse .btn-outline:focus-visible {
    background: rgb(255 255 255 / 0.92);
    border-color: #ffffff;
    color: #1d1d1f;
}
html:not(#_) .hero--kulisse .btn-outline:hover i,
html:not(#_) .hero--kulisse .btn-outline:focus-visible i {
    color: #1d1d1f;
}

/* Seitenleiste aufklappbar (static/js/doku.js) */
.doku-leiste__kopfzeile {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.doku-leiste__kopfzeile .doku-leiste__kategorielink {
    flex: 1;
    min-width: 0;
}
.doku-leiste__klapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm, 6px);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}
.doku-leiste__klapper:hover {
    background: var(--light, #f4f4f5);
    color: var(--text-primary);
}
.doku-leiste__klapper:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
.doku-leiste__klapper .bi {
    transition: transform 0.15s ease;
}
.doku-leiste__kategorie--offen > .doku-leiste__kopfzeile .doku-leiste__klapper .bi {
    transform: rotate(180deg);
}
.doku-leiste--klappbar .doku-leiste__kategorie:not(.doku-leiste__kategorie--offen) > .doku-leiste__artikel {
    display: none;
}
.doku-leiste--klappbar .doku-leiste__kategorie {
    margin-bottom: 0.35rem;
}
.doku-leiste--klappbar .doku-leiste__kategorie--offen {
    margin-bottom: 0.75rem;
}
html[data-theme="dark"] .doku-leiste__klapper:hover {
    background: rgb(255 255 255 / 0.08);
}
@media (prefers-reduced-motion: reduce) {
    .doku-leiste__klapper .bi { transition: none; }
}

/* Bildschirmfoto gross (static/js/doku.js) */
.doku-grossbild {
    /* Ein allgemeines `* { margin: 0 }` nimmt dem <dialog> sein
       margin:auto - ohne diese zwei Zeilen klebte es oben links. */
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(96vw, 1600px);
    max-width: none;
    max-height: 94vh;
    padding: 2.75rem 1rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius, 10px);
    background: var(--theme-bg-primary, #ffffff);
    color: var(--text-primary);
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.35);
    overflow: auto;
}
.doku-grossbild::backdrop {
    background: rgb(10 10 12 / 0.72);
}
.doku-grossbild__bild {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(94vh - 4rem);
    object-fit: contain;
    border-radius: var(--radius-sm, 6px);
}
.doku-grossbild__zu {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 6px);
    background: var(--theme-bg-primary, #ffffff);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}
.doku-grossbild__zu:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.doku-grossbild__zu:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
html[data-theme="dark"] .doku-grossbild,
html[data-theme="dark"] .doku-grossbild__zu {
    background: #18181b;
    border-color: #3f3f46;
    color: #e4e4e7;
}
html[data-theme="dark"] .doku-grossbild__zu:hover {
    border-color: var(--marke-auf-dunkel, #e8365d);
    color: var(--marke-auf-dunkel, #e8365d);
}
.doku-bild__link {
    cursor: zoom-in;
}
