
/* ============================================================
    API Integration documentation
    Inherits theme tokens from landing_page.css:
        --themeColor: #6B83F3
        --bodyColor : #434343
        --bodyFont  : Rubik
        --headFont  : Bricolage Grotesque
    The site-header is position: fixed, so the hero must reserve
    top space (announcement bar ~46px + header strip ~78px ~= 124px).
    ============================================================ */
.api-doc {
    --code-bg   : #0f172a;
    --code-text : #e2e8f0;
    --code-key  : #93c5fd;
    --code-str  : #fcd34d;
    --code-num  : #f9a8d4;
    --doc-border: #e5e7eb;
    --doc-muted : #6b7280;
    --doc-soft  : #f8fafc;
    --doc-panel : #ffffff;
    --tag-get   : #10b981;
    --tag-post  : #2563eb;
    --tag-put   : #d97706;
    --tag-del   : #dc2626;
    --doc-radius: 10px;
    --doc-gap   : 24px;
    background: var(--doc-soft);
    color: var(--bodyColor);
    max-width: 100vw;
    /* `overflow-x: clip` prevents horizontal overflow WITHOUT becoming a
        * scroll container -- so the sidebar's position:sticky keeps working.
        * (overflow-x: hidden would also clip, but it breaks sticky.) */
    overflow-x: clip;
}
.api-doc * { box-sizing: border-box; min-width: 0; }

/* ------------------------------- HERO ------------------------------- */
.api-doc__hero {
    background: linear-gradient(135deg, var(--themeColor) 0%, #4f63d6 100%);
    color: #fff;
    padding: 150px 0 64px; /* clears the fixed site-header */
}
.api-doc__hero h1 {
    font-family: var(--headFont);
    font-size: 44px;
    line-height: 54px;
    font-weight: 600;
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}
.api-doc__hero p {
    font-size: 16px;
    line-height: 26px;
    max-width: 720px;
    margin: 0;
    opacity: .92;
    overflow-wrap: anywhere;
}
.api-doc__chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 26px;
}
.api-doc__chips span {
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.3);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .api-doc__hero { padding: 130px 0 48px; }
    .api-doc__hero h1 { font-size: 32px; line-height: 40px; }
}
@media (max-width: 480px) {
    .api-doc__hero { padding: 120px 0 36px; }
    .api-doc__hero h1 { font-size: 26px; line-height: 34px; }
    .api-doc__hero p  { font-size: 14.5px; line-height: 23px; }
    .api-doc__chips span { font-size: 12px; padding: 6px 12px; }
}

/* ------------------------------- BREADCRUMB ------------------------- */
.api-doc__breadcrumb {
    padding: 18px 0;
    font-size: 13.5px;
    color: var(--doc-muted);
}
.api-doc__breadcrumb a { color: var(--themeColor); }
.api-doc__breadcrumb strong { color: #111827; font-weight: 600; }

/* ------------------------------- SHELL ------------------------------ */
.api-doc__shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 36px;
    padding: 8px 0 90px;
    align-items: start;
}
@media (max-width: 992px) {
    .api-doc__shell { grid-template-columns: 1fr; gap: 24px; }
}

/* ------------------------------- SIDEBAR ---------------------------- */
.api-doc__side {
    position: sticky;
    top: 110px;
    align-self: start;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    background: var(--doc-panel);
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    padding: 10px 0;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.api-doc__side h4 {
    font-family: var(--headFont);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--doc-muted);
    padding: 14px 20px 8px;
    margin: 0;
    font-weight: 600;
}
.api-doc__side h4:not(:first-child) { border-top: 1px solid #f1f5f9; margin-top: 6px; }
.api-doc__side ul { list-style: none; padding: 0; margin: 0; }
.api-doc__side ul li a {
    display: block;
    padding: 8px 20px 8px 24px;
    color: var(--bodyColor);
    font-size: 14px;
    line-height: 20px;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}
.api-doc__side ul li a:hover {
    background: #f1f5f9;
    color: var(--themeColor);
}
.api-doc__side ul li a.is-active {
    color: var(--themeColor);
    background: #eef2ff;
    border-left-color: var(--themeColor);
    font-weight: 600;
}
@media (max-width: 992px) {
    .api-doc__side { position: static; max-height: none; }
}

/* ------------------------------- CONTENT ---------------------------- */
.api-doc__main {
    background: var(--doc-panel);
    border: 1px solid var(--doc-border);
    border-radius: var(--doc-radius);
    padding: 8px 36px 12px;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;            /* clip, not hidden -- keeps sticky working in any descendant */
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
@media (max-width: 768px) { .api-doc__main { padding: 8px 20px 12px; } }
@media (max-width: 480px) { .api-doc__main { padding: 8px 14px 12px; } }

/* Allow long words/URLs anywhere in the content to break instead of overflowing. */
.api-doc__main,
.api-doc__main * { overflow-wrap: anywhere; }

.api-doc__main section {
    scroll-margin-top: 110px;
    padding: 32px 0;
    border-bottom: 1px solid #f1f5f9;
}
.api-doc__main section:last-child { border-bottom: 0; }

.api-doc__main h2 {
    font-family: var(--headFont);
    font-size: 28px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 12px;
    line-height: 36px;
}
.api-doc__main h3 {
    font-family: var(--headFont);
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 28px 0 10px;
    line-height: 28px;
}
.api-doc__main h4 {
    font-family: var(--headFont);
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 26px 0 12px;
}
.api-doc__main p {
    font-size: 14.5px;
    line-height: 25px;
    margin: 0 0 14px;
    color: #4b5563;
}
.api-doc__main a { color: var(--themeColor); }
.api-doc__main a:hover { text-decoration: underline; }

/* Lists: uniform padding & spacing, both ol and ul */
.api-doc__main ul,
.api-doc__main ol {
    margin: 0 0 18px;
    padding-left: 26px;
}
.api-doc__main li {
    font-size: 14.5px;
    line-height: 25px;
    margin: 6px 0;
    color: #4b5563;
    padding-left: 4px;
}
.api-doc__main li::marker { color: var(--themeColor); }
.api-doc__main ol li::marker { font-weight: 600; }
.api-doc__main li code { font-size: 13px; }
.api-doc__main li strong { color: #111827; font-weight: 600; }

/* Inline code in body */
.api-doc__main p code,
.api-doc__main li code {
    background: #f1f5f9;
    color: #1e293b;
    padding: 1px 7px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12.5px;
}

/* Endpoint pill */
.api-doc__endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--doc-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 14px;
    margin: 12px 0 20px;
    flex-wrap: wrap;
    max-width: 100%;
}
.api-doc__method {
    font-weight: 700;
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 12px;
    letter-spacing: .06em;
    font-family: var(--bodyFont);
    flex-shrink: 0;
}
.method-get  { background: var(--tag-get); }
.method-post { background: var(--tag-post); }
.method-put  { background: var(--tag-put); }
.method-del  { background: var(--tag-del); }
.api-doc__path {
    color: #0f172a;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

/* Tables */
.api-doc__table {
    width: 100%;
    border-collapse: collapse;
    background: var(--doc-panel);
    border: 1px solid var(--doc-border);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 0 20px;
    font-size: 13.5px;
    table-layout: auto;
}
.api-doc__table th, .api-doc__table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--doc-border);
    vertical-align: top;
    line-height: 22px;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 150px;
}
.api-doc__table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.api-doc__table tr:last-child td { border-bottom: none; }
.api-doc__table td code {
    background: #eef2ff;
    color: #3730a3;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: inline-block;
    max-width: 100%;
}
@media (max-width: 480px) {
    .api-doc__table th, .api-doc__table td { padding: 10px 10px; font-size: 12.5px; }
    .api-doc__table { font-size: 12.5px; }
}
.api-doc__badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}
.badge-req  { background: #fee2e2; color: #b91c1c; }
.badge-opt  { background: #e0e7ff; color: #3730a3; }
.badge-info { background: #ecfeff; color: #155e75; }

/* Code blocks: long lines wrap instead of triggering horizontal scroll. */
.api-doc__code {
    position: relative;
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: 8px;
    padding: 18px 20px;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 13px;
    line-height: 22px;
    margin: 0 0 20px;
    overflow: hidden;
    max-width: 100%;
}
.api-doc__code pre {
    margin: 0;
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
@media (max-width: 480px) {
    .api-doc__code { padding: 14px 14px 16px; font-size: 12.5px; }
}
.api-doc__code .tok-key { color: var(--code-key); }
.api-doc__code .tok-str { color: var(--code-str); }
.api-doc__code .tok-num { color: var(--code-num); }
.api-doc__code .tok-com { color: #94a3b8; font-style: italic; }
.api-doc__copy {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,.08);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,.18);
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--bodyFont);
    font-weight: 500;
    letter-spacing: .02em;
    transition: background .15s;
}
.api-doc__copy:hover { background: rgba(255,255,255,.18); }

/* Status code chips */
.api-doc__status { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 16px; }
.api-doc__status span {
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: 600;
    line-height: 1;
}
.status-2 { background: #d1fae5; color: #065f46; }
.status-4 { background: #fef3c7; color: #92400e; }
.status-5 { background: #fee2e2; color: #991b1b; }

/* Callout */
.api-doc__note {
    border-left: 4px solid var(--themeColor);
    background: #eef2ff;
    padding: 14px 18px;
    border-radius: 6px;
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 22px;
    color: #1f2937;
}
.api-doc__note strong { color: var(--themeColor); }

/* Download card */
.api-doc__download {
    background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 100%);
    border: 1px solid var(--doc-border);
    border-radius: 12px;
    padding: 24px 26px;
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
    margin: 4px 0 22px;
}
.api-doc__download .icon {
    width: 56px;
    height: 56px;
    background: var(--themeColor);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    font-family: var(--headFont);
    flex-shrink: 0;
    letter-spacing: .02em;
}
.api-doc__download .meta { flex: 1; min-width: 220px; }
.api-doc__download h3 {
    margin: 0 0 4px;
    font-size: 17px;
    line-height: 24px;
}
.api-doc__download p { margin: 0; color: var(--doc-muted); font-size: 13.5px; }
.api-doc__hero {
    padding: 50px 0 60px;
    margin: 143px 0 0;
}

.api-doc__side {
    top: 170px;
}

.api-doc__main li::marker {
    color: var(--bodyColor);
}

.api-doc__main a {
    color: #5368da;
    text-decoration: underline;
}

.api-doc__main a.fill_btn {
    color: #fff;
    text-decoration: none;
}

.api-doc__main a:hover {
    text-decoration: none;
}

@media only screen and (max-width:1220px) {
    .api-doc__hero {
        margin: 143px 0 0;
    }
}

@media only screen and (max-width:1100px) {
    .api-doc__hero {
        margin: 191px 0 0;
    }
}

@media only screen and (max-width:1024px) {
    .api-doc__hero {
        margin: 181px 0 0;
    }
}

@media only screen and (max-width:992px) {
    .api-doc__side {
        display: none;
    }
}

@media only screen and (max-width:767px) {
    .api-doc__hero {
        margin: 75px 0 0;
    }
    .api-doc__hero {
        padding: 30px 0 40px;
    }
    .api-doc__hero h1 {
        font-size: 28px;
        line-height: 34px;
    }
    .api-doc__hero p {
        font-size: 14px;
        line-height: 20px;
    }
    .api-doc__chips span {
        font-size:12px;
        padding: 6px 14px;
    }
    .api-doc__chips {
        gap: 8px;
    }
    .api-doc__main h2 {
        font-size: 20px;
        line-height: 28px;
        margin: 0 0 10px;
    }
    .api-doc__main ul, .api-doc__main ol {
        padding-left:15px;
    }
    .api-doc__main p {
        font-size: 13px;
        line-height: 20px;
        margin: 0 0 10px;
    }
    .api-doc__main li {
        font-size: 13px;
        line-height: 20px;
        margin: 5px 0;
    }
    .api-doc__main section {
        padding: 20px 0;
    }
    .api-doc__table th, .api-doc__table td {
        padding: 10px;
        line-height: 18px;
    }
    .api-doc__endpoint {
        font-size: 13px;
        padding: 12px;
    }
    .api-doc__method {
       padding: 5px 10px;
       font-size: 10px;
       line-height: 14px;
    }
    .api-doc__note {
        font-size: 13px;
        line-height: 18px;
        padding: 12px 16px;
    }
    .api-doc__download {
        padding: 15px;
        gap: 15px;
    }
    .api-doc__download .icon {
        font-size: 15px;
        line-height: 18px;
        width: 42px;
        height: 42px;
        border-radius: 8px;
    }
    .api-doc__download h3 {
        font-size: 15px;
        line-height: 20px;
    }
    .api-doc__download p {
        margin-bottom:0;
    }
    .api-doc__table td {
        font-size: 13px;
        line-height: 16px;
    }
    .api-doc__main {
        padding: 0 15px;
    }
    .api-doc__shell {padding: 0 0 15px;}  a
}
.api-table-div {
    display: block;
    width: 100%;
    overflow: auto;
}