/* ── Docs Layout ── */
.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.docs-sidebar {
    width: 280px;
    min-width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    background: rgba(8, 8, 16, 0.95);
    border-right: 1px solid var(--border-subtle);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.02em;
    text-decoration: none;
}
.sidebar-logo:hover { color: var(--text-primary); }
.sidebar-logo img { opacity: 0.8; }

.sidebar-nav {
    padding: 16px 0;
    overflow-y: auto;
    flex: 1;
}

/* Nav sections */
.nav-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 12px 6px;
}

.nav-link {
    display: block;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--lavender);
    background: rgba(200, 160, 232, 0.08);
    font-weight: 500;
}

/* ── Content ── */
.docs-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

.docs-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 48px 120px;
}

/* ── Welcome page ── */
.docs-welcome h1 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.docs-welcome > p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.welcome-card {
    padding: 24px;
    background: rgba(10, 10, 18, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}
.welcome-card:hover {
    border-color: var(--lavender-soft);
    background: rgba(15, 15, 28, 0.6);
    transform: translateY(-2px);
}

.welcome-card-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--lavender);
    margin-bottom: 6px;
}

.welcome-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ── Markdown rendered content ── */
.docs-article h1 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 32px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.2;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.docs-article h2 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 20px;
    color: var(--text-primary);
    margin: 48px 0 16px;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.docs-article h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin: 32px 0 12px;
}

.docs-article h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--lavender);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 24px 0 8px;
}

.docs-article p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 16px;
}

.docs-article a {
    color: var(--lavender);
    text-decoration: underline;
    text-decoration-color: rgba(200, 160, 232, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}
.docs-article a:hover {
    text-decoration-color: var(--lavender);
}

.docs-article strong {
    color: var(--text-primary);
    font-weight: 600;
}

.docs-article em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
}

/* Lists */
.docs-article ul,
.docs-article ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.docs-article li {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 4px;
}

.docs-article li::marker {
    color: var(--lavender-soft);
}

/* Code */
.docs-article code {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--code-text);
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.docs-article pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px 24px;
    overflow-x: auto;
    margin: 0 0 24px;
}

.docs-article pre code {
    background: none;
    padding: 0;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

/* Tables */
.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 24px;
    font-size: 14px;
}

.docs-article th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.docs-article td {
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.65);
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.docs-article td code {
    font-size: 12px;
}

/* Blockquotes */
.docs-article blockquote {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-left: 3px solid var(--lavender-soft);
    background: rgba(200, 160, 232, 0.04);
    border-radius: 0 8px 8px 0;
}

.docs-article blockquote p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Horizontal rules */
.docs-article hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
    margin: 40px 0;
}

/* Images */
.docs-article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* Error state */
.docs-error {
    text-align: center;
    padding: 80px 24px;
}
.docs-error h2 {
    color: var(--text-primary);
    margin-bottom: 8px;
}
.docs-error p {
    color: var(--text-secondary);
}

/* ── Mobile header ── */
.docs-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(8, 8, 16, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 99;
}

.menu-toggle {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.menu-toggle:hover {
    color: var(--text-primary);
    border-color: var(--lavender-soft);
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .docs-mobile-header {
        display: flex;
    }

    .docs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-content {
        margin-left: 0;
        padding-top: 56px;
    }

    .docs-article {
        padding: 32px 20px 80px;
    }

    .welcome-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar styling for sidebar */
.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}
.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
