/* ─────────────────────────────────────────────────────────────
   Nexling API documentation — layout only.
   Surfaces, text and borders come from landing.css (--lp-*), the
   green from its --lf-* palette, so both themes work on their own.
   No new colours are introduced here.
   Shared by DocsDe.cshtml (de-CH) and Docs.cshtml (en).
   ───────────────────────────────────────────────────────────── */

/* landing.css keeps the --lf-* palette fixed across themes and lets each component
   pick the right step per theme (see .btn-lf-outline). One token here does the same
   job for the whole page: darker green on light, lighter green on dark. */
:root                      { --doc-accent: var(--lf-600); }
html[data-theme="dark"]    { --doc-accent: var(--lf-400); }

.doc-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px 120px;
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 56px;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.doc-side {
    position: sticky;
    top: 92px;
    align-self: start;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    padding-right: 8px;
}

.doc-side-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--lp-text-muted);
    margin: 22px 0 8px;
}
.doc-side-title:first-child { margin-top: 0; }

.doc-side a {
    display: block;
    padding: 6px 10px;
    margin-left: -10px;
    border-radius: 7px;
    font-size: 14px;
    color: var(--lp-text-sub);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color .15s ease, background .15s ease;
}
.doc-side a:hover { color: var(--doc-accent); background: var(--lp-bg-alt); }
.doc-side a.is-active {
    color: var(--doc-accent);
    border-left-color: var(--doc-accent);
    font-weight: 600;
}

/* ── Content ───────────────────────────────────────────────── */
.doc-hero { padding: 56px 0 8px; }
.doc-hero h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 900; letter-spacing: -.02em; margin-bottom: 12px; }
.doc-hero p  { font-size: 17px; color: var(--lp-text-sub); max-width: 62ch; }

.doc-sec { padding-top: 56px; scroll-margin-top: 88px; }
.doc-sec > h2 {
    font-size: 27px; font-weight: 800; letter-spacing: -.01em;
    padding-bottom: 10px; margin-bottom: 18px;
    border-bottom: 1px solid var(--lp-border);
}
.doc-sec h3 { font-size: 17px; font-weight: 700; margin: 30px 0 10px; }
.doc-sec p  { color: var(--lp-text-sub); max-width: 68ch; margin-bottom: 14px; }
.doc-sec ol, .doc-sec ul { color: var(--lp-text-sub); max-width: 68ch; padding-left: 20px; }
.doc-sec li { margin-bottom: 7px; }

.doc-lead { font-size: 16px; }

/* ── Code blocks ───────────────────────────────────────────── */
.doc-code { position: relative; margin: 14px 0 22px; }
.doc-code pre {
    background: var(--lp-bg-alt);
    border: 1px solid var(--lp-border);
    border-radius: 11px;
    padding: 16px 52px 16px 18px;
    overflow-x: auto;
    margin: 0;
}
.doc-code code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--lp-text);
    white-space: pre;
}
.doc-copy {
    position: absolute; top: 9px; right: 9px;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 9px;
    font-size: 11px; font-family: var(--font-sans); font-weight: 600;
    color: var(--lp-text-muted);
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-border);
    border-radius: 7px;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.doc-copy:hover { color: var(--doc-accent); border-color: var(--doc-accent); }
.doc-copy.is-done { color: var(--doc-accent); border-color: var(--doc-accent); }

/* Inline code */
.doc-sec :not(pre) > code {
    font-family: var(--font-mono);
    font-size: .88em;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--lp-bg-alt);
    border: 1px solid var(--lp-border);
    color: var(--doc-accent);
}

/* ── Tables ────────────────────────────────────────────────── */
.doc-table-wrap { overflow-x: auto; margin: 14px 0 22px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.doc-table th {
    text-align: left; font-weight: 700; font-size: 11.5px;
    letter-spacing: .07em; text-transform: uppercase;
    color: var(--lp-text-muted);
    padding: 9px 14px 9px 0;
    border-bottom: 1px solid var(--lp-border);
    white-space: nowrap;
}
.doc-table td {
    padding: 11px 14px 11px 0;
    border-bottom: 1px solid var(--lp-border);
    color: var(--lp-text-sub);
    vertical-align: top;
}
.doc-table td:first-child { white-space: nowrap; }
.doc-table code { white-space: nowrap; }

/* ── Method / endpoint pills ───────────────────────────────── */
.doc-verb {
    display: inline-block;
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    padding: 3px 8px; border-radius: 6px; margin-right: 8px;
    background: rgba(5,150,105,.12); color: var(--doc-accent);
    border: 1px solid rgba(5,150,105,.28);
}
.doc-endpoint {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
    font-family: var(--font-mono); font-size: 13.5px;
    padding: 11px 14px; margin: 22px 0 6px;
    background: var(--lp-bg-alt);
    border: 1px solid var(--lp-border);
    border-radius: 9px;
    overflow-x: auto;
}

/* ── Callout ───────────────────────────────────────────────── */
.doc-note {
    display: flex; gap: 12px;
    padding: 14px 16px; margin: 18px 0;
    border-radius: 10px;
    border: 1px solid var(--lp-border);
    border-left: 3px solid var(--doc-accent);
    background: var(--lp-bg-alt);
    font-size: 14px; color: var(--lp-text-sub);
    max-width: 68ch;
}
.doc-note i { color: var(--doc-accent); margin-top: 2px; }
.doc-note.is-warn { border-left-color: #d97706; }
.doc-note.is-warn i { color: #d97706; }

/* ── "Your projects" strip (signed-in visitors only) ───────── */
.doc-mine {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    margin: 26px 0 6px; padding: 13px 16px;
    border: 1px solid var(--lp-border);
    border-left: 3px solid var(--doc-accent);
    border-radius: 10px;
    background: var(--lp-bg-alt);
    font-size: 14px;
}
.doc-mine label { color: var(--lp-text-sub); margin: 0; white-space: nowrap; }
.doc-mine select {
    padding: 7px 11px; font-size: 13.5px;
    color: var(--lp-text); background: var(--lp-bg);
    border: 1px solid var(--lp-border); border-radius: 7px;
    max-width: 100%;
}
.doc-mine code { font-family: var(--font-mono); font-size: 12px; color: var(--doc-accent); }
.doc-mine .doc-mine-hint { color: var(--lp-text-muted); font-size: 12.5px; }

/* ── Try it ────────────────────────────────────────────────── */
.doc-try {
    border: 1px solid var(--lp-border);
    border-radius: 13px;
    padding: 20px;
    background: var(--lp-card-bg);
    margin: 16px 0 22px;
}
.doc-try-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.doc-try input, .doc-try select {
    flex: 1 1 190px;
    padding: 9px 12px;
    font-family: var(--font-mono); font-size: 13px;
    color: var(--lp-text);
    background: var(--lp-bg);
    border: 1px solid var(--lp-border);
    border-radius: 8px;
}
.doc-try input:focus, .doc-try select:focus { outline: 2px solid var(--doc-accent); outline-offset: -1px; }
.doc-try button {
    padding: 9px 20px; font-size: 14px; font-weight: 700;
    color: #fff; background: var(--lf-600);
    border: none; border-radius: 8px; cursor: pointer;
    transition: background .15s ease;
}
.doc-try button:hover { background: var(--lf-700); }
.doc-try button:disabled { opacity: .55; cursor: default; }
.doc-try-out {
    margin-top: 4px; max-height: 320px; overflow: auto;
    background: var(--lp-bg-alt);
    border: 1px solid var(--lp-border);
    border-radius: 9px;
    padding: 14px 16px;
}
.doc-try-out pre { margin: 0; }
.doc-try-out code { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.doc-try-status { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.doc-try-status.ok  { color: var(--doc-accent); }
.doc-try-status.err { color: #dc2626; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .doc-shell { grid-template-columns: 1fr; gap: 0; }
    .doc-side {
        position: static; max-height: none; overflow: visible;
        margin-bottom: 28px; padding: 16px 0 20px;
        border-bottom: 1px solid var(--lp-border);
        display: flex; flex-wrap: wrap; gap: 4px;
    }
    .doc-side-title { display: none; }
    .doc-side a { margin-left: 0; border-left: none; padding: 5px 11px; background: var(--lp-bg-alt); font-size: 13px; }
    .doc-side a.is-active { border-left: none; background: rgba(5,150,105,.14); }
    .doc-hero { padding-top: 36px; }
}
