/* ===== Docs page ===== */

.docs-body {
    background: var(--ink);
}

.docs-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 64px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 0;
}

/* ---- Sidebar ---- */
.docs-sidebar {
    position: sticky;
    top: 64px;
    align-self: start;
    height: calc(100vh - 64px);
    padding: 40px 20px 40px 26px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.sidebar-head { margin-bottom: 24px; }
.sidebar-tag {
    display: inline-block;
    color: var(--orange);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.sidebar-head h2 {
    margin: 0 0 8px;
    font-size: 22px;
    background: linear-gradient(135deg, #FFFFFF 0%, #A7C7E7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-head p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0; }

.docs-toc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-top: 4px;
}
.toc-link {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: #B8C7DB;
    font-size: 14px;
    line-height: 1.3;
    transition: background 0.2s, color 0.2s;
    border: 1px solid transparent;
}
.toc-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: white;
}
.toc-link.active {
    background: rgba(0, 119, 200, 0.18);
    color: white;
    border-color: rgba(34, 167, 240, 0.3);
}
.toc-idx {
    font-family: 'SF Mono', monospace;
    font-size: 11px;
    color: var(--orange);
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.toc-title { flex: 1; }

.sidebar-foot {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.side-link {
    color: var(--muted);
    font-size: 13px;
    transition: color 0.2s;
}
.side-link:hover { color: white; }

/* ---- Content area ---- */
.docs-content {
    padding: 56px 56px 80px;
    max-width: 900px;
    margin: 0 auto;
}

.docs-hero {
    margin-bottom: 64px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--border);
}
.docs-hero .section-tag { margin-bottom: 16px; display: block; }
.docs-hero h1 {
    font-size: clamp(36px, 5vw, 54px);
    line-height: 1.05;
    margin: 0;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #FFFFFF 0%, #59B3ED 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.docs-sub {
    font-size: 0.55em;
    font-weight: 600;
    color: #A7C7E7;
    -webkit-text-fill-color: #A7C7E7;
    letter-spacing: 0;
}
.docs-lede {
    color: #B6C7DB;
    font-size: 18px;
    line-height: 1.65;
    margin-top: 24px;
    max-width: 740px;
}

/* ---- Sections ---- */
.docs-section {
    margin-bottom: 72px;
    padding-top: 20px;
    scroll-margin-top: 84px;
}
.docs-section-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 26px;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(34, 167, 240, 0.2);
}
.docs-section-num {
    font-family: 'SF Mono', monospace;
    color: var(--orange);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
}
.docs-section-head h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

/* ---- Markdown styling ---- */
.md { color: #C6D5E8; font-size: 15.5px; line-height: 1.75; }
.md p { margin: 14px 0; }
.md strong { color: white; }
.md em { color: #AEBED3; }
.md a { color: var(--blue-bright); text-decoration: none; border-bottom: 1px dashed rgba(34, 167, 240, 0.4); }
.md a:hover { color: white; border-bottom-color: var(--blue-bright); }

.md h1, .md h2, .md h3, .md h4, .md h5 {
    color: white;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin-top: 32px;
    margin-bottom: 12px;
}
.md h1 { font-size: 26px; }
.md h2 { font-size: 22px; color: var(--blue-bright); }
.md h3 { font-size: 18px; color: #E6EEF9; }
.md h4 { font-size: 15px; letter-spacing: 1px; text-transform: uppercase; color: var(--orange-soft); }

.md ul, .md ol { padding-left: 24px; margin: 12px 0; }
.md li { margin: 6px 0; }
.md li::marker { color: var(--blue-bright); }

.md blockquote {
    border-left: 3px solid var(--orange);
    margin: 16px 0;
    padding: 4px 16px;
    color: #AEBED3;
    background: rgba(231, 93, 42, 0.05);
    border-radius: 0 8px 8px 0;
}

.md code {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.88em;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(34, 167, 240, 0.12);
    color: #B8DCF7;
    border: 1px solid rgba(34, 167, 240, 0.22);
}
.md pre {
    background: #07111F;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    overflow-x: auto;
    margin: 18px 0;
    font-size: 13.5px;
    line-height: 1.6;
    box-shadow: var(--shadow);
}
.md pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #E6EEF9;
    font-size: inherit;
}
/* pygments overrides (via noclasses=True we inline styles, but in case classes leak) */
.md .codehilite { background: transparent; }

.md table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}
.md th, .md td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.md th {
    background: rgba(0, 119, 200, 0.18);
    color: white;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.md tr:last-child td { border-bottom: none; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---- Bottom CTA ---- */
.docs-bottom {
    margin-top: 60px;
    padding: 34px 32px;
    border-radius: var(--radius);
    border: 1px solid rgba(34, 167, 240, 0.25);
    background: linear-gradient(135deg, rgba(0, 119, 200, 0.12), rgba(231, 93, 42, 0.08));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.docs-bottom strong { color: white; font-size: 20px; display: block; }
.docs-bottom .muted { margin: 4px 0 0; }
.docs-ctas { display: flex; gap: 10px; }

/* ---- Mobile ---- */
@media (max-width: 900px) {
    .docs-shell { grid-template-columns: 1fr; }
    .docs-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 24px 20px;
    }
    .docs-sidebar { overflow-y: visible; }
    .sidebar-head { text-align: center; }
    .docs-toc { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .toc-link { flex: 0 1 auto; }
    .docs-content { padding: 36px 20px 60px; }
    .docs-bottom { flex-direction: column; align-items: flex-start; }
}
