/* Sticky sidebar TOC for whitepaper/guide pages */

.guide-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
}

.guide-sidebar {
    position: relative;
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
}

.guide-sidebar-inner {
    width: 260px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 24px 0;
}

.guide-sidebar-inner.is-sticky {
    position: fixed;
    top: 100px;
}

.guide-sidebar-inner.is-bottomed {
    position: absolute;
    bottom: 0;
}

.guide-sidebar-toc {
    border-left: 2px solid var(--gray-200);
    padding-left: 0;
}

.guide-sidebar-toc h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px;
    padding-left: 20px;
}

.guide-sidebar-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-sidebar-toc li {
    margin: 0;
    padding: 0;
}

.guide-sidebar-toc a {
    display: block;
    padding: 6px 20px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--gray-500);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.guide-sidebar-toc a:hover {
    color: var(--navy);
}

.guide-sidebar-toc a.active {
    color: var(--blue);
    border-left-color: var(--blue);
    font-weight: 600;
}

/* Content takes remaining space */
.guide-layout .guide-content {
    flex: 1;
    min-width: 0;
    max-width: 780px;
}

/* Hide sidebar on tablets and below, show inline TOC */
@media (max-width: 1024px) {
    .guide-sidebar {
        display: none !important;
    }

    .guide-layout {
        display: block;
    }

    .guide-layout .guide-content {
        max-width: 780px;
        margin: 0 auto;
    }
}

/* On desktop, hide the inline TOC (sidebar takes over) */
@media (min-width: 1025px) {
    .guide-layout .guide-toc {
        display: none;
    }
}

/* Smooth scroll offset for fixed navbar */
.guide-content h2[id] {
    scroll-margin-top: 100px;
}
