/* ============================================================================
   Business & Client API documentation — modern component layer
   Scoped to /documentation/business-api/* pages (loaded per-page).
   Reuses the site brand tokens (--color-brand #1a2f6e, Inter/Roboto) and the
   existing .api-doc-* endpoint cards; adds a two-column TOC layout, tabbed
   code samples, callouts, method tags for PATCH/PUT, steps and comparison
   tables. Light theme only (matches the rest of the site).
   ========================================================================== */

:root {
    --biz-brand: var(--color-brand, #1a2f6e);
    --biz-brand-2: #2c5aa0;
    --biz-ink: #1f2733;
    --biz-muted: #5b6675;
    --biz-border: var(--color-border, #e2e8f0);
    --biz-surface: #ffffff;
    --biz-surface-2: #f7f8fc;
    --biz-radius: 14px;
    --biz-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

/* ---- Two-column layout: content + sticky "On this page" rail ------------- */
.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 48px;
    align-items: start;
}
.doc-main { min-width: 0; }

.doc-toc {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-left: 20px;
    border-left: 1px solid var(--biz-border);
    font-family: 'Inter', sans-serif;
}
.doc-toc__title {
    font-size: .72rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--biz-muted);
    margin-bottom: 12px;
}
.doc-toc a {
    display: block;
    padding: 5px 0;
    font-size: .86rem;
    line-height: 1.35;
    color: var(--biz-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -20px;
    padding-left: 18px;
    transition: color .15s ease, border-color .15s ease;
}
.doc-toc a:hover { color: var(--biz-brand); }
.doc-toc a.is-active {
    color: var(--biz-brand);
    font-weight: 600;
    border-left-color: var(--biz-brand);
}
.doc-toc a.doc-toc__sub { padding-left: 32px; font-size: .8rem; }

@media (max-width: 991px) {
    .doc-layout { grid-template-columns: 1fr; gap: 0; }
    .doc-toc {
        position: static; max-height: none; overflow: visible;
        border-left: 0; border-bottom: 1px solid var(--biz-border);
        padding-left: 0; padding-bottom: 18px; margin-bottom: 28px;
    }
    .doc-toc a { margin-left: 0; padding-left: 12px; }
}

/* ---- Section anchors clear the fixed navbar ------------------------------ */
.doc-section { scroll-margin-top: 96px; margin-bottom: 44px; }
.doc-section > h2, .doc-section > h3 { font-family: 'Inter', sans-serif; }
.doc-lead { font-size: 1.08rem; color: var(--biz-muted); line-height: 1.6; }

/* ---- Eyebrow / page intro ----------------------------------------------- */
.doc-eyebrow {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: .72rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--biz-brand-2);
    background: var(--color-brand-light, #eef2ff);
    padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}

/* ---- Callouts (note / warning / tip) ------------------------------------ */
.doc-callout {
    position: relative;
    display: flex; gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--biz-border);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--biz-surface-2);
    margin: 22px 0;
    font-size: .95rem; line-height: 1.55;
}
.doc-callout__icon { flex: 0 0 auto; font-size: 1.15rem; line-height: 1.4; }
.doc-callout__body { min-width: 0; }
.doc-callout__body > *:last-child { margin-bottom: 0; }
.doc-callout__title { font-weight: 700; font-family: 'Inter', sans-serif; margin-bottom: 3px; }
.doc-callout code { word-break: break-word; }
.doc-callout--note    { border-left-color: #3b82f6; background: #f2f7ff; }
.doc-callout--tip     { border-left-color: #10b981; background: #f1fbf6; }
.doc-callout--warning { border-left-color: #f59e0b; background: #fff8ec; }
.doc-callout--danger  { border-left-color: #dc2626; background: #fdf3f3; }

/* ---- Tabbed code samples (cURL / Python / Node.js) ---------------------- */
.code-tabs {
    border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius);
    overflow: hidden;
    background: #0b1020;              /* dark chrome around Prism blocks     */
    margin: 18px 0;
    box-shadow: var(--biz-shadow);
}
.code-tabs__nav {
    display: flex; flex-wrap: wrap; gap: 2px;
    background: #11162a;
    padding: 6px 6px 0 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.code-tabs__btn {
    appearance: none; border: 0; cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: .82rem; font-weight: 600;
    color: #9aa4bf; background: transparent;
    padding: 9px 16px; border-radius: 8px 8px 0 0;
    transition: color .15s ease, background .15s ease;
}
.code-tabs__btn:hover { color: #e6ebff; }
.code-tabs__btn.is-active { color: #ffffff; background: #0b1020; }
.code-tabs__panels { position: relative; }
.code-tabs__panel { display: none; }
.code-tabs__panel.is-active { display: block; }
/* keep Prism blocks flush inside the tab chrome */
.code-tabs pre[class*="language-"],
.code-tabs pre {
    margin: 0; border-radius: 0; max-width: 100%; overflow-x: auto;
}
.code-tabs__panel > pre { padding: 16px 18px; }

/* copy button on the tab bar */
.code-tabs__copy {
    margin-left: auto; align-self: center;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif; font-size: .78rem; font-weight: 600;
    color: #9aa4bf; background: transparent; border: 0; cursor: pointer;
    padding: 6px 10px; border-radius: 8px;
}
.code-tabs__copy:hover { color: #fff; background: rgba(255, 255, 255, .07); }

/* ---- Method tags: add PATCH / PUT (GET/POST/DELETE already in styles.css) */
.api-doc-tag-patch,
.api-doc-tag-put {
    border-radius: 3px; font-weight: bold; color: #fff;
    text-align: center; float: left; overflow: hidden;
    padding: 5px; min-width: 70px;
}
.api-doc-tag-patch { background-color: #fca130; }   /* PATCH = orange */
.api-doc-tag-put   { background-color: #6f42c1; }   /* PUT   = purple */

/* Card header tints for the methods missing one today */
.api-doc-card-header-delete { background-color: #fef1f1; }
.api-doc-card-header-patch  { background-color: #fff6ec; }
.api-doc-card-header-put    { background-color: #f5f1fb; }

/* Endpoint cards: a touch more polish on top of .api-doc-card */
.doc-endpoints .card.api-doc-card {
    border: 1px solid var(--biz-border);
    border-radius: 12px;
    box-shadow: var(--biz-shadow);
    margin-top: 16px;
    overflow: hidden;
}
.doc-endpoints .card.api-doc-card .card-header {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left; border: 0;
}
.doc-endpoints .api-doc-tag-text { float: none; }

/* ---- Quick-start numbered steps ----------------------------------------- */
.doc-steps { list-style: none; counter-reset: doc-step; padding: 0; margin: 24px 0; }
.doc-steps > li {
    position: relative;
    padding: 4px 0 22px 56px;
    border-left: 2px solid var(--biz-border);
    margin-left: 18px;
}
.doc-steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.doc-steps > li::before {
    counter-increment: doc-step; content: counter(doc-step);
    position: absolute; left: -19px; top: 0;
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    font-family: 'Inter', sans-serif; font-weight: 700; font-size: .95rem;
    color: #fff; background: var(--biz-brand);
    box-shadow: 0 0 0 4px var(--biz-surface, #f1f1f9);
}
.doc-steps h4 { font-family: 'Inter', sans-serif; font-size: 1.02rem; margin: 4px 0 8px; }
.doc-steps p { color: var(--biz-muted); }

/* ---- Comparison table (strict id vs zero-touch ref) --------------------- */
.doc-compare {
    width: 100%; border-collapse: separate; border-spacing: 0;
    margin: 22px 0; font-size: .93rem;
    border: 1px solid var(--biz-border); border-radius: 12px; overflow: hidden;
}
.doc-compare th, .doc-compare td {
    padding: 13px 16px; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--biz-border);
}
.doc-compare thead th {
    font-family: 'Inter', sans-serif; background: var(--biz-surface-2);
    color: var(--biz-ink); font-weight: 700;
}
.doc-compare tbody th {
    font-weight: 600; color: var(--biz-muted); white-space: nowrap;
    background: var(--biz-surface-2);
}
.doc-compare tr:last-child th, .doc-compare tr:last-child td { border-bottom: 0; }
.doc-compare code { white-space: nowrap; }

/* ---- Feature / navigation cards on the hub ------------------------------ */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 26px 0; }
.doc-card {
    display: block; padding: 22px; border: 1px solid var(--biz-border);
    border-radius: var(--biz-radius); background: var(--biz-surface);
    text-decoration: none; color: inherit; box-shadow: var(--biz-shadow);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.doc-card:hover { transform: translateY(-3px); border-color: var(--biz-brand); box-shadow: 0 10px 30px rgba(26, 47, 110, .12); text-decoration: none; }
.doc-card__eyebrow { font-family: 'Inter', sans-serif; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--biz-brand-2); font-weight: 700; }
.doc-card__title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.08rem; margin: 8px 0 6px; color: var(--biz-ink); }
.doc-card__desc { color: var(--biz-muted); font-size: .92rem; margin: 0; }

/* ---- Inline header/param pills ------------------------------------------ */
.doc-pill {
    display: inline-block; font-family: 'Inter', sans-serif; font-weight: 600;
    font-size: .72rem; padding: 2px 9px; border-radius: 999px;
    background: var(--color-brand-light, #eef2ff); color: var(--biz-brand);
    vertical-align: middle;
}
.doc-pill--req { background: #fdecec; color: #b42318; }
.doc-pill--opt { background: #eef2ff; color: var(--biz-brand); }

/* small helpers */
.doc-kbd { font-family: 'Roboto Mono', ui-monospace, monospace; background: #f0f1f6; border: 1px solid var(--biz-border); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
.doc-hr { border: 0; border-top: 1px solid var(--biz-border); margin: 40px 0; }
