/*
 * Stil der API-Doku unter api.<basisdomain>.
 *
 * Die Seite laeuft ausserhalb der Oberflaeche und bringt ihre Farben selbst
 * mit - sie gehoert keiner Einrichtung, also traegt sie auch kein Branding.
 */

:root {
    --grund: #ffffff;
    --grund-leise: #f4f6f9;
    --rand: #dde2e9;
    --text: #1c2430;
    --text-leise: #5a6675;
    --akzent: #1b5e8c;
    --akzent-leise: #e8f1f8;
    --warn: #8a5a00;
    --warn-grund: #fdf6e7;
    --code-grund: #10202c;
    --code-text: #e6edf3;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #121820;
        --grund-leise: #182029;
        --rand: #2a3542;
        --text: #e7ecf2;
        --text-leise: #a3b0be;
        --akzent: #6fb7e8;
        --akzent-leise: #172734;
        --warn: #e0b45f;
        --warn-grund: #2a2313;
        --code-grund: #0c141c;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--grund);
    color: var(--text);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--akzent); }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .92em;
    background: var(--grund-leise);
    border: 1px solid var(--rand);
    border-radius: 5px;
    padding: .08em .35em;
}

pre {
    background: var(--code-grund);
    color: var(--code-text);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    overflow-x: auto;
}

pre code { background: none; border: 0; padding: 0; color: inherit; font-size: .88rem; }

/* -- Kopf ---------------------------------------------------------------- */

:root { --kopf-hoehe: 3.25rem; }

.kopf {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--kopf-hoehe);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: 1.25rem;
    background: color-mix(in srgb, var(--grund) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--rand);
}

.kopf p { margin: 0; }
.kopf .klein { color: var(--text-leise); }

.marke { font-weight: 700; letter-spacing: .03em; color: var(--akzent); }
.marke span { color: var(--text-leise); font-weight: 400; }

h1 { margin: 0 0 .8rem; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; }

.lead { max-width: 65ch; color: var(--text-leise); margin: 0 0 .5rem; }
.lead.klein, .klein { font-size: .88rem; }

/* -- Raster: Menue | Inhalt | Playground ----------------------------------- */

.raster {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr) minmax(24rem, 30rem);
    align-items: start;
}

/* Menue und Playground bleiben stehen und scrollen fuer sich. */
.menue,
.spielwiese {
    position: sticky;
    top: var(--kopf-hoehe);
    max-height: calc(100vh - var(--kopf-hoehe));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.menue {
    padding: 1.2rem 1rem 2rem 1.25rem;
    border-right: 1px solid var(--rand);
    font-size: .9rem;
}

.menue-titel {
    margin: 0 0 .4rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-leise);
}

.menue ul { list-style: none; margin: 0 0 1.3rem; padding: 0; }
.menue ul ul { margin: .15rem 0 .5rem .7rem; padding-left: .6rem; border-left: 1px solid var(--rand); }
.menue li { margin: 0; }

.menue a {
    display: block;
    padding: .22rem .5rem;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menue a:hover { background: var(--grund-leise); }
.menue a.aktiv { background: var(--akzent-leise); color: var(--akzent); font-weight: 600; }
.menue .route-link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; }
.methode.klein { font-size: .6rem; padding: .08rem .3rem; min-width: 2.9rem; text-align: center; }

.inhalt { padding: 2rem 2.5rem 4rem; min-width: 0; }

.spielwiese {
    min-width: 0;
    overflow-x: hidden;
    padding: 1.2rem 1.25rem 2rem;
    border-left: 1px solid var(--rand);
    background: var(--grund-leise);
}

.spielwiese h2 { font-size: 1.2rem; }

/* -- Abschnitte ---------------------------------------------------------- */

section, .route, .karten article { scroll-margin-top: calc(var(--kopf-hoehe) + 1rem); }
.inhalt > section { margin-bottom: 3.5rem; }
h2 { font-size: 1.5rem; margin: 0 0 1.2rem; padding-bottom: .5rem; border-bottom: 2px solid var(--rand); }
h3 { font-size: 1.1rem; margin: 0 0 .5rem; }

.schritte { counter-reset: schritt; list-style: none; padding: 0; display: grid; gap: 1.2rem; }

.schritte li {
    counter-increment: schritt;
    background: var(--grund-leise);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem 1.3rem 3.4rem;
    position: relative;
}

.schritte li::before {
    content: counter(schritt);
    position: absolute;
    left: 1.1rem;
    top: 1.15rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--akzent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .85rem;
    font-weight: 700;
}

.karten { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); }

.karten article {
    background: var(--grund-leise);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
}

.karten p:last-child { margin-bottom: 0; }

.warn {
    background: var(--warn-grund);
    border-left: 3px solid var(--warn);
    color: var(--warn);
    padding: .6rem .9rem;
    border-radius: 0 6px 6px 0;
}

/* -- Playground ---------------------------------------------------------- */

.playground {
    background: var(--grund);
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.3rem;
    display: grid;
    gap: .9rem;
}

.zeile { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.zeile.oben { align-items: flex-start; }
.zeile label { flex: 1 0 100%; font-weight: 600; font-size: .85rem; }

.playground input,
.playground select,
.playground textarea {
    flex: 1 1 10rem;
    width: 100%;
    min-width: 0;
    font: inherit;
    font-size: .92rem;
    padding: .5rem .65rem;
    border: 1px solid var(--rand);
    border-radius: 7px;
    background: var(--grund);
    color: var(--text);
}

.playground textarea { font-family: ui-monospace, Menlo, Consolas, monospace; resize: vertical; }

.playground button {
    font: inherit;
    font-weight: 600;
    padding: .5rem 1.1rem;
    border-radius: 7px;
    border: 1px solid var(--akzent);
    background: var(--akzent);
    color: #fff;
    cursor: pointer;
}

a.download {
    display: inline-block;
    padding: .45rem 1rem;
    border-radius: 7px;
    background: var(--akzent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
a.download:hover { filter: brightness(1.1); }

.playground button.still,
button.still {
    background: transparent;
    color: var(--akzent);
    border: 1px solid var(--rand);
    font-weight: 600;
    font-size: .85rem;
    padding: .35rem .8rem;
    border-radius: 7px;
    cursor: pointer;
}

.knoepfe { justify-content: flex-start; }
.status { font-size: .92rem; font-weight: 600; }
.status.ok { color: #1a7f4b; }
.status.fehler { color: #b3261e; }

@media (prefers-color-scheme: dark) {
    .status.ok { color: #6fd39b; }
    .status.fehler { color: #f0817a; }
}

/* -- Referenz ------------------------------------------------------------ */

.bereich { margin-bottom: 2.5rem; }

.route {
    border: 1px solid var(--rand);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    margin-bottom: .9rem;
    background: var(--grund);
}

.route h4 { margin: 0 0 .5rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: 1rem; }
.route p { margin: .3rem 0; }
.route .hinweis { color: var(--text-leise); font-size: .9rem; }
.route .antwort { font-size: .92rem; }

.methode {
    display: inline-block;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: .2rem .5rem;
    border-radius: 5px;
    background: var(--akzent);
    color: #fff;
}

.m-get { background: #1b5e8c; }
.m-post { background: #1a7f4b; }
.m-put { background: #7a5bb5; }
.m-patch { background: #8a5a00; }
.m-delete { background: #b3261e; }

.recht {
    font-size: .78rem;
    color: var(--text-leise);
    border: 1px dashed var(--rand);
    border-radius: 5px;
    padding: .15rem .5rem;
}

.feldtitel { font-weight: 600; font-size: .88rem; margin-top: .8rem; }

.route dl { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: .25rem .9rem; margin: .3rem 0 .6rem; }
.route dt { margin: 0; }
.route dd { margin: 0; color: var(--text-leise); font-size: .92rem; }

/* -- Fuss ---------------------------------------------------------------- */

.fuss {
    border-top: 1px solid var(--rand);
    background: var(--grund-leise);
    padding: 1.6rem 1.25rem;
    color: var(--text-leise);
    font-size: .92rem;
}

/* Mittelbreit: Menue oben als Leiste, Playground bleibt rechts. */
@media (max-width: 75rem) {
    .raster { grid-template-columns: minmax(0, 1fr) minmax(22rem, 26rem); }
    .menue {
        grid-column: 1 / -1;
        position: sticky;
        top: var(--kopf-hoehe);
        z-index: 5;
        max-height: none;
        display: flex;
        gap: .3rem;
        overflow-x: auto;
        padding: .5rem 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--rand);
        background: var(--grund);
    }
    .menue-titel, .menue ul ul { display: none; }
    .menue ul { display: flex; gap: .2rem; margin: 0; }
    .spielwiese { top: calc(var(--kopf-hoehe) + 2.6rem); max-height: calc(100vh - var(--kopf-hoehe) - 2.6rem); }
    section, .route, .karten article { scroll-margin-top: calc(var(--kopf-hoehe) + 3.6rem); }
    .inhalt { padding: 1.5rem 1.5rem 3rem; }
}

/* Schmal: eine Spalte, Playground unter dem Inhalt. */
@media (max-width: 52rem) {
    .raster { grid-template-columns: minmax(0, 1fr); }
    .spielwiese { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--rand); }
    .kopf .klein { display: none; }
    .inhalt { padding: 1.25rem 1rem 2.5rem; }
}

@media (max-width: 40rem) {
    .route dl { grid-template-columns: 1fr; }
    .route dd { margin-bottom: .4rem; }
}
