/* --- Anleitungsseite -------------------------------------------------
 *
 * Eine Seite, die jemand liest, WÄHREND er die Anwendung bedient — oft
 * auf dem Handy, oft mit einer Hand, oft im Stehen. Daraus folgt alles
 * Weitere: breite Schritte, große Bilder, ein Inhaltsverzeichnis, das
 * mitwandert, und keine Spalte, die man seitlich schieben muss.
 * ------------------------------------------------------------------- */

.guide {
    max-width: 68rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
    display: grid;
    grid-template-columns: 15rem 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Unter 62 rem gibt es keine zweite Spalte mehr. Ein 15-rem-Verzeichnis
 * neben 20 rem Text ist kein Verzeichnis, sondern ein Hindernis. */
@media (max-width: 62rem) {
    .guide { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* --- Inhaltsverzeichnis --------------------------------------------- */

.guide-toc {
    position: sticky;
    top: 1rem;
    font-size: 0.95rem;
}

@media (max-width: 62rem) {
    .guide-toc { position: static; }
}

.guide-toc h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.guide-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: schritt;
}

.guide-toc li { margin: 0 0 0.15rem; counter-increment: schritt; }

.guide-toc a {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 0.4rem;
    text-decoration: none;
    color: var(--text);
    border-left: 3px solid transparent;
}

.guide-toc a::before {
    content: counter(schritt) ". ";
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
    background: var(--surface-2);
    border-left-color: var(--accent);
}

/* --- Der Text -------------------------------------------------------- */

.guide-body > section {
    margin: 0 0 2.5rem;
    scroll-margin-top: 1.5rem;
}

.guide-body h2 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent);
}

.guide-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
.guide-body p { margin: 0 0 0.75rem; line-height: 1.65; max-width: 42rem; }

.guide-body ol,
.guide-body ul { margin: 0 0 1rem; padding-left: 1.4rem; max-width: 42rem; line-height: 1.6; }

.guide-body li { margin: 0 0 0.5rem; }

/* Schritte sollen nummeriert bleiben, auch wenn ein Bild dazwischen
 * steht — deshalb liegen die Bilder IN dem <li>, nicht daneben. */
.guide-body ol > li > figure { margin: 0.6rem 0 0; }

/* --- Bilder ---------------------------------------------------------- */

.guide-body figure {
    margin: 0 0 1.25rem;
    max-width: 42rem;
}

.guide-body figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface-2);
}

.guide-body figcaption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Handybilder sind hoch. Ohne Deckel füllt eines davon den ganzen
 * Bildschirm, und man scrollt an der Anleitung vorbei statt durch sie. */
.guide-body figure.hoch img { max-width: 22rem; margin: 0 auto; }

/* --- Tabellen -------------------------------------------------------- */

.guide-body .guide-scroll { overflow-x: auto; margin: 0 0 1.25rem; }

.guide-body table {
    border-collapse: collapse;
    width: 100%;
    min-width: 26rem;
    font-size: 0.95rem;
}

.guide-body th,
.guide-body td {
    text-align: left;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.guide-body th { font-weight: 700; }
.guide-body tr:last-child td { border-bottom: 0; }

/* --- Hinweiskasten --------------------------------------------------- */

.guide-body .achtung {
    border-left: 3px solid var(--status-alarm, #b42318);
    background: var(--surface-2);
    padding: 0.75rem 1rem;
    border-radius: 0 0.4rem 0.4rem 0;
    margin: 0 0 1.25rem;
    max-width: 42rem;
}

.guide-body .achtung p:last-child { margin-bottom: 0; }
.guide-code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 0.4rem; padding: 0.75rem 0.9rem; overflow-x: auto; font-size: 0.88rem; line-height: 1.5; max-width: 42rem; }
.guide-body blockquote { margin: 0 0 1.25rem; padding: 0.6rem 1rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 0.4rem 0.4rem 0; max-width: 42rem; }
.guide-body blockquote p:last-child { margin-bottom: 0; }
.guide-body hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; max-width: 42rem; }
