/* ===================================================================
   DAS BUCH — DIE BEDIENUNG IM VOLLBILD

   Im Vollbild ist nur das Buch da: keine Kopf-, keine Fußleiste, keine
   Steuerleiste. Nur ein Schließen-Kreuz, zwei Pfeile, ein
   Seitenzähler und das Inhaltsverzeichnis.

   Alle vier schweben über der Seite. Sie sind das einzige auf dieser
   Webseite, das nichts unter sich hat außer Text — deshalb sind sie
   die einzigen Flächen, die wirklich Milchglas brauchen, damit man
   sieht, dass sie darüber liegen.
   =================================================================== */

:root[data-thema] .buch-schliessen,
:root[data-thema] .buch-pfeil,
:root[data-thema] .buch-inhalt-btn,
:root[data-thema] .buch-zaehler {
    display: none;
}

:root[data-thema] .buch-reader.vollbild .buch-schliessen,
:root[data-thema] .buch-reader.vollbild .buch-inhalt-btn,
:root[data-thema] .buch-reader.vollbild .buch-pfeil {
    display: flex;
}

:root[data-thema] .buch-reader.vollbild .buch-zaehler {
    display: block;
}

:root[data-thema] .buch-schliessen,
:root[data-thema] .buch-inhalt-btn {
    position: fixed;
    top: 1.1rem;
    z-index: 3;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-width: 1px;
    border-style: solid;
    border-radius: 50%;
    background: var(--k-menue);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
    color: var(--k-text-leise);
    font-size: 1rem;
    cursor: pointer;
    transition: color var(--bew-schnell) var(--bew-beides),
        transform var(--bew-ruhig) var(--bew-feder);
}

:root[data-thema] .buch-schliessen {
    right: 1.1rem;
}

:root[data-thema] .buch-inhalt-btn {
    left: 1.1rem;
}

:root[data-thema] .buch-schliessen:hover,
:root[data-thema] .buch-inhalt-btn:hover,
:root[data-thema] .buch-schliessen:focus-visible,
:root[data-thema] .buch-inhalt-btn:focus-visible {
    color: var(--k-text);
    outline: none;
}

:root[data-thema] .buch-schliessen > .fenster__ring,
:root[data-thema] .buch-inhalt-btn > .fenster__ring,
:root[data-thema] .buch-pfeil > .fenster__ring,
:root[data-thema] .buch-schliessen > .fenster__zeichen-pixel,
:root[data-thema] .buch-inhalt-btn > .fenster__zeichen-pixel,
:root[data-thema] .buch-pfeil > .fenster__zeichen-pixel {
    position: absolute;
    pointer-events: none;
    max-width: none;
    max-height: none;
}

:root[data-thema] .buch-schliessen > i.zeichen--zerfaellt::before,
:root[data-thema] .buch-inhalt-btn > i.zeichen--zerfaellt::before,
:root[data-thema] .buch-pfeil > i.zeichen--zerfaellt::before {
    visibility: hidden;
}

:root[data-thema] .buch-pfeil {
    position: fixed;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-width: 1px;
    border-style: solid;
    border-radius: 50%;
    background: var(--k-menue);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
    font-size: 1.2rem;
    cursor: pointer;
    transition: opacity var(--bew-schnell) var(--bew-beides);
}

:root[data-thema] .buch-pfeil > i::before,
:root[data-thema] .buch-pfeil::before {
    background-image: var(--k-verlauf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

:root[data-thema] .buch-pfeil--zurueck {
    left: 1.2rem;
}

:root[data-thema] .buch-pfeil--vor {
    right: 1.2rem;
}

:root[data-thema] .buch-pfeil:focus-visible {
    outline: none;
}

:root[data-thema] .buch-pfeil[disabled] {
    opacity: 0.28;
    cursor: default;
}

:root[data-thema] .buch-zaehler {
    position: fixed;
    bottom: 1.1rem;
    left: 50%;
    z-index: 3;
    transform: translateX(-50%);
    padding: 0.35rem 0.9rem;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--k-rund-pille);
    background: var(--k-menue);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
    color: var(--k-text-still);
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

:root[data-thema] .buch-inhalt {
    display: none;
    position: fixed;
    top: 4.6rem;
    left: 1.1rem;
    right: 1.1rem;
    z-index: 4;
    max-width: 760px;
    max-height: 72vh;
    margin: 0 auto;
    padding: 1rem;
    overflow-y: auto;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--k-rund-gross);
    background: var(--k-menue);
    backdrop-filter: blur(28px) saturate(1.45);
    -webkit-backdrop-filter: blur(28px) saturate(1.45);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

:root[data-thema] .buch-inhalt.offen {
    display: grid;
}

:root[data-thema] .buch-inhalt button {
    position: relative;
    padding: 0.7rem 1rem;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--k-rund-klein);
    background: var(--k-vertieft);
    color: var(--k-text-leise);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: color var(--bew-schnell) var(--bew-beides);
}

:root[data-thema] .buch-inhalt button:hover,
:root[data-thema] .buch-inhalt button:focus-visible {
    color: var(--k-text);
    outline: none;
}

:root[data-thema] .buch-inhalt button.aktiv {
    color: var(--k-text);
}

:root[data-thema] .buch-inhalt button.aktiv::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: var(--k-rund-klein) 0 0 var(--k-rund-klein);
    background-image: var(--k-verlauf);
    pointer-events: none;
}

:root[data-thema] .buch-inhalt button > .fenster__ring {
    position: absolute;
    pointer-events: none;
    max-width: none;
    max-height: none;
}

:root[data-thema] .buch-inhalt button span {
    display: block;
    color: var(--k-text-still);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

:root[data-thema] .buch-reader.vollbild {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: clamp(0.6rem, 2vw, 1.6rem);
    background: var(--k-grund);
}

:root[data-thema] .buch-reader.vollbild .buch {
    flex: 1;
    width: 100%;
    max-width: 860px;
    min-height: 0;
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: var(--k-rund-gross);
    scrollbar-width: thin;
    scrollbar-color: var(--k-rand-seite) transparent;
}

:root[data-thema] .buch-reader.vollbild .buch::-webkit-scrollbar {
    width: 8px;
}

:root[data-thema] .buch-reader.vollbild .buch::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: var(--k-rand-seite);
}

@media (max-width: 640px) {
    :root[data-thema] .buch-reader.vollbild {
        padding: 0.5rem;
    }

    :root[data-thema] .buch-reader.vollbild .buch {
        padding: 3.2rem 1.2rem 4.4rem;
    }

    :root[data-thema] .buch-pfeil {
        top: auto;
        bottom: 1rem;
        width: 48px;
        height: 48px;
        transform: none;
    }

    :root[data-thema] .buch-pfeil--zurueck {
        left: 1rem;
    }

    :root[data-thema] .buch-pfeil--vor {
        right: 1rem;
    }

    :root[data-thema] .buch-zaehler {
        bottom: 1.5rem;
    }
}
