/* Shared styling for the /guides pages. Same design system as the API
   reference (docs.html): plum-dark surfaces, violet accent, Bricolage
   Grotesque headings, Source Sans 3 body, JetBrains Mono details.
   All foreground/background pairs meet WCAG AA (4.5:1). */

:root {
    --docs-bg: #141218;
    --docs-bg-deep: #0f0d15;
    --docs-bg-surface: #1c1922;
    --docs-bg-surface-2: #241f2e;
    --docs-border: #2e2939;
    --docs-text: #e9e6f0;
    --docs-text-muted: #9a94ab;
    --docs-primary: #a78bfa;
    --docs-code-ink: #ddd8ea;
    --docs-code-comment: #8d86a3;
    --note-ink: #e8c98a;
    --note-accent: #e8b04b;
    --note-bg: #241d12;
    --note-border: #45351c;
    --get: #34d399;
    --post: #7ab0ff;
    --put: #e8c257;
    --del: #f87171;
    --badge-ink: #141218;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--docs-bg);
    color: var(--docs-text);
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    font-size: 16.5px;
    line-height: 1.62;
}

/* Sticky nav — same structure as docs.html */
.docs-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--docs-bg);
    border-bottom: 1px solid var(--docs-border);
}
.docs-nav-brand {
    font-family: 'Bricolage Grotesque', 'Source Sans 3', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--docs-text);
    letter-spacing: 0.025em;
    text-decoration: none;
}
.docs-nav-links { display: flex; gap: 20px; }
.docs-nav-links a {
    font-size: 14px;
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.docs-nav-links a:hover,
.docs-nav-links a[aria-current="page"] { color: var(--docs-text); }

/* Article layout */
.guide-wrap {
    max-width: 47rem;
    margin: 0 auto;
    padding: 40px 24px 96px;
}

.guide-wrap h1 {
    font-family: 'Bricolage Grotesque', 'Source Sans 3', sans-serif;
    font-size: clamp(2rem, 5vw, 2.7rem);
    font-weight: 700;
    line-height: 1.12;
    text-wrap: balance;
    margin: 0 0 10px;
}
.guide-lede {
    color: var(--docs-text-muted);
    max-width: 40rem;
    font-size: 1.05rem;
    margin: 0 0 32px;
}
.guide-wrap h2 {
    font-family: 'Bricolage Grotesque', 'Source Sans 3', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
    margin: 54px 0 6px;
    scroll-margin-top: 70px;
}
.guide-wrap > h2::before {
    content: "# ";
    color: var(--docs-primary);
}
.guide-wrap h3 {
    font-family: 'Bricolage Grotesque', 'Source Sans 3', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 34px 0 6px;
}
.guide-wrap a { color: var(--docs-primary); }
.guide-wrap p { margin: 12px 0; max-width: 44rem; }
.guide-wrap strong { font-weight: 600; }
.guide-wrap ul, .guide-wrap ol { margin: 12px 0; padding-left: 22px; max-width: 44rem; }
.guide-wrap li { margin: 7px 0; }
.guide-wrap li::marker { color: var(--docs-primary); }

/* Inline code + blocks */
.guide-wrap code {
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 0.83em;
    background: var(--docs-bg-surface);
    color: var(--docs-code-ink);
    border: 1px solid var(--docs-border);
    border-radius: 5px;
    padding: 1px 5px;
}
.guide-wrap pre {
    background: var(--docs-bg-deep);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 16px 0;
}
.guide-wrap pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--docs-code-ink);
    font-size: 13px;
    line-height: 1.65;
}
.guide-wrap pre .c { color: var(--docs-code-comment); }  /* comment */
.guide-wrap pre .s { color: #86efac; }                    /* string  */
.guide-wrap pre .k { color: #b8a5f5; }                    /* key     */

/* Endpoint tables */
.guide-wrap .table-scroll {
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--docs-border);
    border-radius: 10px;
}
.guide-wrap table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14.5px;
}
.guide-wrap th {
    text-align: left;
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--docs-text-muted);
    background: var(--docs-bg-surface);
    border-bottom: 1px solid var(--docs-border);
}
.guide-wrap th, .guide-wrap td {
    padding: 9px 14px;
    vertical-align: top;
}
.guide-wrap td { border-bottom: 1px solid var(--docs-border); }
.guide-wrap tr:last-child td { border-bottom: none; }
.guide-wrap td code { white-space: nowrap; }

/* HTTP method chips — bright colours with dark ink, ≥4.5:1 on every pair */
.m {
    display: inline-block;
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--badge-ink);
    border-radius: 4px;
    padding: 2px 7px;
    min-width: 42px;
    text-align: center;
}
.m-get { background: var(--get); }
.m-post { background: var(--post); }
.m-put { background: var(--put); }
.m-delete { background: var(--del); }

/* "Integrator notes" callout — amber aside */
.notes {
    background: var(--note-bg);
    border: 1px solid var(--note-border);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 20px 0;
}
.notes-title {
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--note-accent);
    margin: 0 0 6px;
}
.notes p, .notes li { color: var(--note-ink); }
.notes ul { margin: 6px 0 2px; padding-left: 20px; }
.notes li { margin: 7px 0; }
.notes li:last-child { margin-bottom: 0; }
.notes li::marker { color: var(--note-accent); }
.notes code {
    background: var(--docs-bg-deep);
    border-color: var(--note-border);
    color: inherit;
}

/* Table of contents — pill chips */
.toc { margin: 0 0 26px; padding: 0 0 26px; border-bottom: 1px solid var(--docs-border); }
.toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: none;
}
.toc li { margin: 0; }
.toc a {
    display: inline-block;
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 12px;
    text-decoration: none;
    color: var(--docs-text);
    background: var(--docs-bg-surface);
    border: 1px solid var(--docs-border);
    padding: 5px 11px;
    border-radius: 999px;
}
.toc a:hover, .toc a:focus-visible {
    border-color: var(--docs-primary);
    color: var(--docs-primary);
    outline: none;
}

/* Per-section API reference link */
.ref-link {
    margin: -6px 0 14px;
    font-family: 'JetBrains Mono', Menlo, monospace;
    font-size: 12px;
}
.ref-link a {
    color: var(--docs-primary);
    text-decoration: none;
}
.ref-link a::after { content: " \2197"; }
.ref-link a:hover, .ref-link a:focus-visible { text-decoration: underline; }

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