/* ── Layout: Inhalt links, TOC rechts ────── */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 3rem;
    align-items: start;
    margin-top: 2rem;
}

.content-body {
    grid-column: 1;
    grid-row: 1;
    max-width: 720px;
    margin-top: 0;
}

.content-body:first-child {
    margin-top: 0;
}

.content-toc {
    grid-column: 2;
    padding: 1em;
    position: sticky;
    top: calc( 80px + 1rem );
    box-shadow: var(--shadow-1);
    border-radius: var(--radius);
}

p {
    margin-top: 0.4rem;
}

/* ── TOC-Inhalt ──────────────────────────── */
.content-toc__title {
    font-size: 1.2em;
    margin: 0 0 1rem 0;
}

.content-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border);
}

.content-toc__item a {
    display: block;
    padding: 0.3rem 0 0.3rem 1rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
}

.content-toc__item a:hover,
.content-toc__item a.is-active {
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 600;
}

.content-toc__item--h3 a {
    padding-left: 2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.content-toc__row { display: flex; align-items: center; gap: .25rem; }

.content-toc__sublist { list-style: none; margin: 0; padding-left: 0; }
.content-toc__sublist[hidden] { display: none; }   /* falls ein Reset display erzwingt */

.content-toc__toggle {
    border: 0; background: none; cursor: pointer;
    padding: .25rem; line-height: 1; font: inherit;
}
.content-toc__toggle::before {
    content: "▸"; display: inline-block; transition: transform .15s ease;
}
.content-toc__toggle[aria-expanded="true"]::before { transform: rotate( 90deg ); }

/* ── Inhalt: Anker-Offset für sticky Header ─ */
.content-body h2,
.content-body h3 {
    scroll-margin-top: 100px;
}
.content-body h2 { 
    margin-top: 2.5rem;
    border-bottom: 1px #c4c4c4 solid;
}

html { scroll-behavior: smooth; }

/* ── Mobil: TOC oben, eine Spalte ────────── */
@media ( max-width: 900px ) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    .content-body {
        grid-column: 1;
        grid-row: 2;
    }
    .content-toc {
        grid-column: 1;
        grid-row: 1;
        position: static;
        background: var(--light-grey);
        padding: 1.25rem;
        border-radius: 8px;
    }
}