/* ── DOXOM Studio Docs ──────────────────────────────────────────────── */
:root {
    --doc-sidebar-w: 280px;
    --doc-header-h: 56px;
    --dxm-black:      #1a1a2e;
    --dxm-dark:       #16213e;
    --dxm-blue:       #4a5fc1;
    --dxm-violet:     #7b2d8e;
    --dxm-gradient:   linear-gradient(135deg, #4a5fc1 0%, #7b2d8e 100%);
    --dxm-light:      #f5f5f5;
    --dxm-white:      #ffffff;
    --dxm-gray:       #8892a4;
    --dxm-gray-light: #e8eaf0;
    --dxm-text:       #2c3e50;
    --dxm-radius:     8px;
    --dxm-font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --dxm-font-mono:  'JetBrains Mono', 'Fira Code', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--dxm-font);
    color: var(--dxm-text);
    background: var(--dxm-white);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--dxm-blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--dxm-violet); }

/* ── Header ────────────────────────────────────────────────────────── */
.doc-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--doc-header-h);
    background: var(--dxm-black);
    display: flex; align-items: center; padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.doc-header .brand {
    font-size: 1.15rem; font-weight: 800; color: #fff; margin-right: 8px;
}
.doc-header .brand .x { color: var(--dxm-blue); }
.doc-header .separator { color: rgba(255,255,255,0.3); margin: 0 12px; }
.doc-header .doc-title { color: rgba(255,255,255,0.85); font-size: 0.95rem; font-weight: 500; }
.doc-header .home-link {
    margin-left: auto; color: rgba(255,255,255,0.6); font-size: 0.88rem;
}
.doc-header .home-link:hover { color: #fff; }
.doc-sidebar-toggle {
    display: none; background: none; border: none; color: #fff; font-size: 1.4rem;
    cursor: pointer; margin-right: 12px; padding: 4px 8px;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.doc-sidebar {
    position: fixed; top: var(--doc-header-h); left: 0; bottom: 0;
    width: var(--doc-sidebar-w);
    background: #fafbfc; border-right: 1px solid var(--dxm-gray-light);
    overflow-y: auto; padding: 24px 0;
    transition: transform 0.3s ease;
}
.doc-sidebar h4 {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--dxm-gray); padding: 8px 24px 4px; margin-top: 16px;
}
.doc-sidebar h4:first-child { margin-top: 0; }
.doc-sidebar ul { list-style: none; }
.doc-sidebar li a {
    display: block; padding: 6px 24px 6px 28px; font-size: 0.9rem;
    color: var(--dxm-text); border-left: 3px solid transparent;
    transition: all 0.15s;
}
.doc-sidebar li a:hover { background: rgba(74,95,193,0.06); color: var(--dxm-blue); }
.doc-sidebar li a.active {
    color: var(--dxm-blue); font-weight: 600;
    border-left-color: var(--dxm-blue); background: rgba(74,95,193,0.08);
}
.doc-sidebar li.sub a { padding-left: 44px; font-size: 0.85rem; color: var(--dxm-gray); }
.doc-sidebar li.sub a:hover { color: var(--dxm-blue); }

/* ── Main content ──────────────────────────────────────────────────── */
.doc-main {
    margin-left: var(--doc-sidebar-w);
    margin-top: var(--doc-header-h);
    max-width: 820px;
    padding: 40px 48px 80px;
}
.doc-main h1 {
    font-size: 2rem; color: var(--dxm-black); margin-bottom: 8px;
    border-bottom: 2px solid var(--dxm-gray-light); padding-bottom: 12px;
}
.doc-main h2 {
    font-size: 1.45rem; color: var(--dxm-black); margin-top: 48px; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 1px solid var(--dxm-gray-light);
}
.doc-main h3 {
    font-size: 1.15rem; color: var(--dxm-dark); margin-top: 32px; margin-bottom: 8px;
}
.doc-main p { margin-bottom: 16px; }
.doc-main ul, .doc-main ol {
    margin-bottom: 16px; padding-left: 28px;
}
.doc-main li { margin-bottom: 6px; }

/* Breadcrumb */
.doc-breadcrumb {
    font-size: 0.85rem; color: var(--dxm-gray); margin-bottom: 24px;
}
.doc-breadcrumb a { color: var(--dxm-gray); }
.doc-breadcrumb a:hover { color: var(--dxm-blue); }

/* Info/Tip boxes */
.doc-tip, .doc-note, .doc-warn {
    padding: 16px 20px; border-radius: 8px; margin: 20px 0; font-size: 0.93rem;
    border-left: 4px solid;
}
.doc-tip  { background: #f0fdf4; border-color: #22c55e; }
.doc-note { background: #eff6ff; border-color: var(--dxm-blue); }
.doc-warn { background: #fef3c7; border-color: #f59e0b; }

/* Code */
code {
    background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
    font-family: var(--dxm-font-mono); font-size: 0.88em; color: #1e40af;
}
pre {
    background: var(--dxm-dark); color: #e2e8f0; padding: 20px 24px;
    border-radius: 8px; overflow-x: auto; margin: 16px 0; font-size: 0.88rem;
    line-height: 1.6;
}
pre code { background: none; color: inherit; padding: 0; }

/* Tables */
.doc-main table {
    width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.92rem;
}
.doc-main th {
    background: var(--dxm-dark); color: #fff; text-align: left;
    padding: 10px 14px; font-weight: 600;
}
.doc-main td { padding: 10px 14px; border-bottom: 1px solid var(--dxm-gray-light); }
.doc-main tr:hover td { background: #f8fafc; }

/* Keyboard shortcuts */
kbd {
    background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 4px;
    padding: 2px 7px; font-family: var(--dxm-font-mono); font-size: 0.82em;
    box-shadow: 0 1px 0 #94a3b8;
}

/* Images */
.doc-main img {
    max-width: 100%; border-radius: 8px; margin: 16px 0;
    border: 1px solid var(--dxm-gray-light); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.doc-main img.full { width: 55%; }
.doc-main img.half { max-width: 35%; }
.doc-main img.clickable { cursor: zoom-in; transition: transform 0.2s, box-shadow 0.2s; }
.doc-main img.clickable:hover { transform: scale(1.03); box-shadow: 0 4px 20px rgba(74,95,193,0.25); }
figure.doc-fig {
    margin: 24px 0; text-align: center;
}
figure.doc-fig img { margin: 0 auto; display: block; }
figure.doc-fig figcaption {
    font-size: 0.85rem; color: var(--dxm-gray); margin-top: 8px; font-style: italic;
}
/* Lightbox overlay */
.doc-lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.88); display: flex; align-items: center;
    justify-content: center; z-index: 9999; cursor: zoom-out;
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.doc-lightbox.active { opacity: 1; pointer-events: auto; }
.doc-lightbox img {
    max-width: 95%; max-height: 92vh; border: none; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    border-radius: 6px; margin: 0; animation: lightbox-in 0.3s ease;
}
@keyframes lightbox-in {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Card grid for index */
.doc-card-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px; margin: 24px 0;
}
.doc-card {
    border: 1px solid var(--dxm-gray-light); border-radius: 10px;
    padding: 24px; transition: all 0.2s;
}
.doc-card:hover {
    border-color: var(--dxm-blue); box-shadow: 0 4px 20px rgba(74,95,193,0.12);
    transform: translateY(-2px);
}
.doc-card h3 { font-size: 1.1rem; margin-top: 0; margin-bottom: 8px; }
.doc-card p { font-size: 0.9rem; color: var(--dxm-gray); margin-bottom: 12px; }
.doc-card .card-icon { font-size: 2rem; margin-bottom: 12px; }
.doc-card .card-logo { height: 36px; max-width: 140px; object-fit: contain; margin-bottom: 12px; }

/* Prev/Next navigation */
.doc-nav-footer {
    display: flex; justify-content: space-between; margin-top: 64px;
    padding-top: 24px; border-top: 1px solid var(--dxm-gray-light);
}
.doc-nav-footer a {
    padding: 12px 20px; border: 1px solid var(--dxm-gray-light);
    border-radius: 8px; font-size: 0.92rem; transition: all 0.2s;
}
.doc-nav-footer a:hover {
    border-color: var(--dxm-blue); background: rgba(74,95,193,0.04);
}
.doc-nav-footer .label { display: block; font-size: 0.78rem; color: var(--dxm-gray); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .doc-sidebar {
        transform: translateX(-100%); z-index: 90;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .doc-sidebar.open { transform: translateX(0); }
    .doc-sidebar-toggle { display: block; }
    .doc-main { margin-left: 0; padding: 32px 20px 60px; }
}
