/* ============================================
   SECTION PAGE SIDEBAR NAVIGATION
   Google Docs-style document outline
   ============================================ */

/* Layout wrapper for sidebar + content */
.section-page-wrapper {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
}

/* The sidebar container */
.doc-sidebar {
    position: sticky;
    top: 80px; /* Below the header */
    height: calc(100vh - 100px);
    width: 280px;
    min-width: 280px;
    padding: 1.5rem 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    background-color: var(--light-bg);
    flex-shrink: 0;
}

/* Sidebar header */
.doc-sidebar-header {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    padding: 0 1.25rem 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

/* Navigation list */
.doc-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-sidebar-nav li {
    margin: 0;
}

/* Navigation links */
.doc-sidebar-nav a {
    display: block;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--dark-text);
    text-decoration: none;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.doc-sidebar-nav a:hover {
    background-color: rgba(201, 169, 89, 0.1);
    color: var(--primary-color);
}

/* Active/current section highlight */
.doc-sidebar-nav a.active {
    background-color: rgba(201, 169, 89, 0.15);
    border-left-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: 500;
}

/* Main content area adjustment */
.section-main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
    padding: 3rem 4rem;
}

/* Override the default main styles when sidebar is present */
.section-page-wrapper .section-main-content {
    margin: 0;
}

/* Smooth scroll offset for anchors (accounts for sticky header) */
.section-anchor {
    scroll-margin-top: 100px;
}

/* Toggle button for mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--light-text);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

/* Scrollbar styling for sidebar */
.doc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.doc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.doc-sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.doc-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--secondary-color);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .doc-sidebar {
        width: 240px;
        min-width: 240px;
    }
    
    .doc-sidebar-nav a {
        font-size: 0.85rem;
        padding: 0.45rem 1rem;
    }
}

@media (max-width: 768px) {
    .section-page-wrapper {
        flex-direction: column;
    }
    
    .doc-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        min-width: 280px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: 70px;
    }
    
    .doc-sidebar.open {
        left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .section-main-content {
        padding: 2rem 1rem;
    }
}

/* ============================================
   SECTION HEADER STYLING UPDATES
   ============================================ */

/* Style for section headers within content */
.content-section .section-header {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
}

.content-section .section-header b {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--primary-color);
}
