/* Docs Layout - 3 Columns (Fixed App-Shell via Flexbox) */

html,
body {
    margin: 0;
    padding: 0;
    /* Normal page scroll; the sidebars are sticky (plays well with Lenis smooth-scroll) */
}

/* The viewport (<html>) must be the scroll container, not <body>.
   global.css sets body overflow-y:auto, which would otherwise capture the
   sticky sidebars and stop them from pinning. */
body {
    overflow: visible;
}

.docs-wrapper {
    max-width: 1440px;
    margin: 0 auto;
    padding: 100px 0 60px;
    /* Top space clears the fixed navbar */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    /* Critical: lets children use position: sticky */
    position: relative;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

/* --- Left Sidebar (Navigation) — stays put while the center scrolls --- */
.docs-sidebar-left {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 10px 20px 40px;
    border-right: 1px solid #f0f0f0;
}

/* --- Center Content (Main) — the only column that scrolls with the page --- */
.docs-main {
    flex: 1;
    /* Take all remaining space */
    min-width: 0;
    /* Prevent flex overflow bug */
    padding: 10px 60px 40px;
}

/* --- Right Sidebar (Table of Contents) — also sticky --- */
.docs-sidebar-right {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 10px 20px 40px 0;
}


/* --- Shared Styles --- */
.docs-header {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.docs-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 15px;
    color: #111;
    line-height: 1.1;
}

.docs-meta {
    color: #666;
    font-size: 1rem;
    font-weight: 400;
}

.docs-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 60px;
    margin-bottom: 25px;
    color: #111;
    letter-spacing: -0.02em;
    scroll-margin-top: 140px;
}

.docs-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 24px;
}

.docs-content ul {
    margin-bottom: 24px;
    padding-left: 20px;
}

.docs-content li {
    margin-bottom: 12px;
    line-height: 1.7;
    font-size: 1.1rem;
    color: #333;
}

.docs-content strong {
    font-weight: 600;
    color: #000;
}

.docs-nav-group {
    margin-bottom: 35px;
}

.docs-nav-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #888;
    margin-bottom: 15px;
    font-weight: 700;
}

.docs-nav-link {
    display: block;
    color: #555;
    text-decoration: none;
    padding: 8px 12px;
    margin-left: -12px;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.docs-nav-link:hover {
    color: #111;
    background-color: #f7f7f7;
}

.docs-nav-link.active {
    color: #000;
    font-weight: 600;
    background-color: #f0f0f0;
}

.toc-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #888;
    margin-bottom: 15px;
    font-weight: 700;
}

.toc-link {
    display: block;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 0;
    border-left: 2px solid transparent;
    padding-left: 15px;
    transition: all 0.2s;
}

.toc-link:hover {
    color: #000;
    border-left-color: #ddd;
}

.toc-link.active {
    color: #000;
    border-left-color: #111;
    font-weight: 500;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}


/* --- Responsive (Mobile Fallback) --- */
@media (max-width: 1024px) {
    .docs-wrapper {
        padding-left: 0;
        padding-right: 0;
    }

    .docs-sidebar-right {
        display: none;
    }

    .docs-main {
        padding-right: 40px;
    }
}

@media (max-width: 768px) {

    /* Restore Body Scroll on Mobile for better UX */
    html,
    body {
        height: auto;
        overflow: auto;
    }

    .docs-wrapper {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding-left: 20px;
        padding-right: 20px;
    }

    .docs-sidebar-left {
        display: none;
    }

    .docs-main {
        height: auto;
        overflow: visible;
        padding-left: 0;
        padding-right: 0;
    }

    .docs-title {
        font-size: 2.25rem;
    }
}