/* Layout Grid for Blogs */
.layout-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem var(--spacing-container) 8rem;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 4rem;
    align-items: start;
}

/* Sidebar TOC (Desktop) */
.sidebar {
    position: sticky;
    top: 8rem;
    display: flex;
    flex-direction: column;
}

.toc-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.toc-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    margin-left: -2px;
    transition: all 0.2s;
}

.toc-link:hover {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* Article */
article {
    max-width: var(--max-width-text);
}

/* Images & Captions */
img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 3rem auto 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.caption {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Mobile Navigation Toggle (Hamburger) */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
    margin-right: 1rem;
}

.mobile-nav-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-main);
    stroke-width: 2;
    stroke-linecap: round;
}

/* Background Overlay when Sidebar is open */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Specific Layout (Drawer) */
@media (max-width: 1024px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
        padding-top: 2rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        /* Hidden state */
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1000;
        padding: 5rem 2rem 2rem;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
    }

    .sidebar.active {
        transform: translateX(280px);
    }

    .mobile-nav-toggle {
        display: block;
    }
}