/* Docs Layout — Three Column */
.docs-layout {
    display: grid;
    grid-template-columns: 240px 1fr 200px;
    gap: var(--spacing-2xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Left Sidebar */
.docs-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-bottom: var(--spacing-2xl);
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.docs-sidebar-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.docs-sidebar-title:not(:first-child) {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

.docs-sidebar a {
    display: block;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    line-height: 1.5;
}

.docs-sidebar a:hover {
    color: var(--text-primary);
    background: var(--color-brand-dim);
}

.docs-sidebar a.active {
    color: var(--color-brand);
    background: var(--color-brand-dim);
    font-weight: 500;
}

/* Main Content */
.docs-content {
    min-width: 0;
}

.docs-content h1 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.docs-content .docs-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

/* Right TOC */
.docs-toc {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.docs-toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
}

.docs-toc a {
    display: block;
    padding: 4px 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: color 0.15s, border-color 0.15s;
    line-height: 1.5;
}

.docs-toc a:hover {
    color: var(--text-primary);
}

.docs-toc a.active {
    color: var(--color-brand);
    border-left-color: var(--color-brand);
}

.docs-toc a.depth-3 {
    padding-left: 24px;
    font-size: 0.8125rem;
}

/* Docs Landing Page — Card Grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.docs-card {
    display: block;
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.docs-card:hover {
    border-color: var(--color-brand);
    transform: translateY(-2px);
}

.docs-card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--spacing-md);
    color: var(--color-brand);
}

.docs-card-icon svg {
    width: 100%;
    height: 100%;
}

.docs-card h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.docs-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 220px 1fr;
    }

    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border-subtle);
        padding-bottom: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
}
