/* Ratgeber-Seitenleiste (Entscheidung 652/653, freigegeben 23.11.2026)
   Gemeinsamer Baustein: nur auf Seiten geladen, die ihn aktivieren (includes/head.php, wenn $page['leiste'] gesetzt ist).
   Die Leiste selbst baut assets/js/ratgeber-leiste.js aus dem vorhandenen .wh-ar-toc.
   Maße 1:1 aus den Lokalvorne-Ratgebern (lv.css .artikel-grid/.artikel-seite/.toc/.seite-cta, live gemessen 23.11.2026),
   Farben und Schrift Wohlstandshüter. Unter 1101 px: keine Leiste, Inhaltsverzeichnis im Text bleibt offen wie live. */
.wh-ar-section .wh-rl { display: none; }

@media (min-width: 1101px) {
    @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

    /* body davor: höhere Gewichtung als der Reset „.wh-ar-section, .wh-ar-section * { margin:0; padding:0 }“ im Artikel-Block, der nach dieser Datei kommt */
    body .wh-ar-section {
        display: grid;
        grid-template-columns: minmax(0, 740px) 300px;
        column-gap: 72px;
        justify-content: space-between;
        align-items: start;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 24px;
    }
    .wh-ar-section > .wh-ar { grid-column: 1; grid-row: 1; max-width: none; min-width: 0; margin: 0; padding-left: 0; padding-right: 0; }
    .wh-ar-section .wh-ar-toc { display: none; }
    .wh-ar-section .wh-ar h2[id], .wh-ar-section .wh-ar h3[id] { scroll-margin-top: 100px; }
    .wh-ar-section .wh-ar > p:not([class]) { font-size: 18px; line-height: 1.75; }
    .wh-ar-section .wh-ar > h2 { margin: 56px 0 16px; }

    .wh-ar-section .wh-rl {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: calc(var(--header-h, 76px) + 24px);
        margin-top: 5px;
        margin-bottom: 48px; /* Abstand zum nächsten Abschnitt, auch wenn die Leiste unten anschlägt (Dennis 23.11.) */
        display: flex;
        flex-direction: column;
        gap: 20px;
        max-height: calc(100vh - var(--header-h, 76px) - 48px);
    }
    .wh-ar-section .wh-rl-toc {
        position: relative;
        flex: 0 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: #ffffff;
        border: 1px solid var(--line, #dbe3ea);
        border-radius: 12px;
        padding: 24px;
        font-size: 15px;
        line-height: 1.6;
    }
    .wh-ar-section .wh-rl-titel {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .18em;
        text-transform: uppercase;
        color: var(--orange, #db5b00);
    }
    /* Nur die Links scrollen, Titel und CTA bleiben sichtbar */
    .wh-ar-section .wh-rl-links {
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        display: grid;
        align-content: start;
        gap: 10px;
        margin-left: -24px;
        padding-left: 24px;
    }
    .wh-ar-section .wh-rl-links::-webkit-scrollbar { display: none; }
    .wh-ar-section .wh-rl-links a {
        position: relative;
        color: var(--ink, #1c3550);
        text-decoration: none;
        transition: color .2s;
    }
    .wh-ar-section .wh-rl-links a::before {
        content: "";
        position: absolute;
        left: -24px;
        top: 3px;
        bottom: 3px;
        width: 3px;
        border-radius: 0 3px 3px 0;
        background: var(--orange, #db5b00);
        opacity: 0;
        transition: opacity .2s;
    }
    .wh-ar-section .wh-rl-links a:hover { color: var(--orange, #db5b00); }
    .wh-ar-section .wh-rl-links a.is-aktiv { color: var(--navy, #002947); font-weight: 700; }
    .wh-ar-section .wh-rl-links a.is-aktiv::before { opacity: 1; }

    /* Scroll-Hinweis: nur wenn die Liste überläuft und noch nicht ganz unten */
    .wh-ar-section .wh-rl-mehr {
        position: absolute;
        left: 1px;
        right: 1px;
        bottom: 1px;
        height: 84px;
        display: flex;
        align-items: flex-end;
        padding: 0 24px 14px;
        border: 0;
        border-radius: 0 0 11px 11px;
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, #ffffff 38%, #ffffff 100%);
        font-family: var(--font, 'Varela', Arial, sans-serif);
        font-size: 13px;
        font-weight: 700;
        letter-spacing: .02em;
        color: var(--orange, #db5b00);
        cursor: pointer;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }
    .wh-ar-section .wh-rl-toc.is-mehr .wh-rl-mehr { opacity: 1; pointer-events: auto; }
    .wh-ar-section .wh-rl-mehr:focus-visible { outline: 2px solid var(--orange, #db5b00); outline-offset: -4px; }

    .wh-ar-section .wh-rl-cta {
        flex: none;
        background: var(--navy, #002947);
        color: #ffffff;
        border-radius: 12px;
        padding: 24px;
    }
    .wh-ar-section .wh-rl-cta-titel {
        font-size: 22px;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: -0.4px;
        color: #ffffff;
    }
    .wh-ar-section .wh-rl-cta p {
        font-size: 15px;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.85);
        margin: 8px 0 16px;
    }
    .wh-ar-section .wh-rl-cta-titel + .wh-rl-btn { margin-top: 16px; }
    .wh-ar-section .wh-rl-btn {
        display: flex;
        width: 100%;
        padding: 13px 18px;
        font-size: 15px;
        line-height: 1.35;
        text-align: center;
    }
}
