/**
 * docs.css — Phase X8c
 * User documentation pages: landing grid + section pages with sidebar.
 */

.docs-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.docs-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.docs-header h1 {
    font-size: 2.2rem;
    color: var(--text, #f7fafc);
    margin: 0 0 0.5rem;
}
.docs-subtitle {
    color: var(--text-muted, #cbd5e0);
    font-size: 1rem;
    margin: 0 0 1.5rem;
}
.docs-search input {
    width: 100%;
    max-width: 480px;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    background: var(--surface-soft, rgba(255,255,255,0.04));
    color: var(--text, #f7fafc);
}
.docs-search input:focus {
    outline: none;
    border-color: var(--accent, #3B82F6);
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.docs-card {
    background: var(--surface, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.docs-card:hover {
    border-color: var(--accent, #3B82F6);
    transform: translateY(-3px);
}
.docs-card-icon {
    font-size: 2rem;
    line-height: 1;
}
.docs-card h3 {
    color: var(--text, #f7fafc);
    margin: 0.5rem 0 0.25rem;
    font-size: 1rem;
}
.docs-card-desc {
    font-size: 0.75rem;
    color: var(--text-muted, #a0aec0);
    margin: 0;
}

/* ── Section pages (sidebar + content) ────────────────────────── */
.docs-section-page {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}
.docs-sidebar {
    background: var(--surface, rgba(255,255,255,0.03));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 1.25rem;
    position: sticky;
    top: 80px;
    height: max-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.docs-sidebar h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted, #a0aec0);
    margin: 0 0 0.75rem;
    letter-spacing: 0.05em;
}
.docs-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.docs-sidebar li { margin-bottom: 2px; }
.docs-sidebar a {
    display: block;
    padding: 0.5rem 0.7rem;
    color: var(--text-muted, #cbd5e0);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.82rem;
    transition: background 0.15s ease, color 0.15s ease;
}
.docs-sidebar a:hover { background: rgba(255,255,255,0.04); color: var(--text, #f7fafc); }
.docs-sidebar a.active {
    background: var(--accent, #3B82F6);
    color: #fff;
}

.docs-content {
    background: var(--surface, rgba(255,255,255,0.02));
    border: 1px solid var(--border, rgba(255,255,255,0.06));
    border-radius: 12px;
    padding: 2rem 2.25rem;
    line-height: 1.65;
    color: var(--text, #e2e8f0);
}
.docs-content h1 {
    color: var(--text, #f7fafc);
    margin: 0 0 0.75rem;
    font-size: 1.8rem;
}
.docs-content h2 {
    color: var(--text, #f7fafc);
    margin: 1.75rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    font-size: 1.25rem;
}
.docs-content h3 {
    color: var(--text, #f7fafc);
    margin: 1.2rem 0 0.4rem;
    font-size: 1rem;
}
.docs-content p, .docs-content li {
    color: var(--text-muted, #cbd5e0);
}
.docs-content p strong { color: var(--text, #e2e8f0); }
.docs-content a {
    color: var(--accent, #3B82F6);
    text-decoration: none;
}
.docs-content a:hover { text-decoration: underline; }
.docs-content code {
    background: var(--c-app-accent-soft, rgba(59, 130, 246, 0.1));
    color: var(--accent, #60A5FA);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.88em;
}
.docs-content table {
    margin: 0.8rem 0;
}
.docs-content table th,
.docs-content table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
    font-size: 0.88rem;
}
.docs-content table th {
    color: var(--text, #f7fafc);
}

.docs-content details {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}
.docs-content details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text, #f7fafc);
    list-style: none;
}
.docs-content details summary::-webkit-details-marker { display: none; }
.docs-content details summary::before {
    content: "▸ ";
    color: var(--accent, #3B82F6);
    transition: transform 0.15s ease;
    display: inline-block;
}
.docs-content details[open] summary::before {
    content: "▾ ";
}
.docs-content details p {
    margin-top: 0.6rem;
}

.docs-breadcrumb {
    font-size: 0.78rem;
    color: var(--text-muted, #a0aec0);
    margin-bottom: 0.75rem;
}
.docs-breadcrumb a {
    color: var(--text-muted, #a0aec0);
    text-decoration: none;
}
.docs-breadcrumb a:hover { color: var(--accent, #3B82F6); }
.docs-breadcrumb strong { color: var(--text, #e2e8f0); }

.video-coming-soon-banner {
    background: linear-gradient(135deg, var(--c-app-accent-soft, rgba(59, 130, 246, 0.1)), var(--c-accent, rgba(6, 182, 212, 0.05)));
    border: 1px solid var(--c-app-accent-soft, rgba(59, 130, 246, 0.3));
    border-radius: 14px;
    padding: 1.75rem;
    margin: 1.25rem 0;
}
.video-coming-soon-banner h2 {
    color: var(--accent, #3B82F6) !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

/* ── Light theme overrides ────────────────────────────────────── */
body.theme-light .docs-card,
body.theme-light .docs-sidebar,
body.theme-light .docs-content,
body.theme-light .docs-content details {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}
body.theme-light .docs-search input {
    background: var(--bg-input, #ffffff);
    border-color: rgba(0,0,0,0.1);
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .docs-section-page {
        grid-template-columns: 1fr;
    }
    .docs-sidebar {
        position: static;
        max-height: none;
    }
    .docs-content { padding: 1.25rem; }
    .docs-page { padding: 1.25rem 0.75rem 3rem; }
    .docs-header h1 { font-size: 1.7rem; }
}
