* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

#top-nav-wrapper {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 100;
    grid-column: 1;
    grid-row: 1;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-logo {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}

#top-nav {
    display: flex;
    align-items: center;
    gap: 0;
}

#top-nav a {
    color: #0066cc;
    text-decoration: none;
    margin-right: 2rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

#top-nav a:hover {
    color: #0052a3;
}


.layout-container {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    grid-column: 1;
    grid-row: 2;
}

.sidebar-left {
    grid-column: 1;
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
}

.sidebar-left nav h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.sidebar-left nav h3:first-child {
    margin-top: 0;
}

.sidebar-left nav h3 a {
    color: inherit;
    text-decoration: none;
}

.sidebar-left nav h3 a:hover {
    color: #0066cc;
}

.sidebar-left nav h3 a.active {
    color: #0066cc;
}

.sidebar-left nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
}

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

.sidebar-left nav a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.5rem 0.75rem 0.5rem 0.75rem;
    margin: 0 -1.5rem;
    border-left: 3px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
    padding-right: 1.5rem;
}

.sidebar-left nav ul a {
    padding-left: 2rem;
    font-size: 0.85rem;
}

.sidebar-left nav a:hover {
    color: #0066cc;
    background-color: rgba(0, 102, 204, 0.05);
}

.sidebar-left nav a.active {
    color: #0066cc;
    background-color: rgba(0, 102, 204, 0.1);
    border-left-color: #0066cc;
    font-weight: 500;
}

.content {
    grid-column: 2;
    width: 100%;
    padding: 1.5rem 2rem;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.content h1:first-child {
    margin-top: 0;
}

.toc {
    grid-column: 3;
    position: sticky;
    top: 80px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 1.5rem 0;
    padding-left: 1.5rem;
}

.toc h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 1rem 0;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.toc ul {
    list-style: none;
    padding-left: 0;
    font-size: 0.875rem;
    margin: 0;
}

.toc ul ul {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.toc a {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 0.4rem 0;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    transition: all 0.2s ease;
}

.toc a:hover {
    color: #0066cc;
    border-left-color: #0066cc;
}

a { color: #0066cc; }
a:hover { color: #0052a3; }

/* Responsive: hide sidebars on smaller screens */
@media (max-width: 1200px) {
    .layout-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .sidebar-left,
    .toc {
        grid-column: 1;
        position: static;
        max-height: none;
        top: auto;
    }

    .content {
        grid-column: 1;
    }
}