@charset "UTF-8";
/* ==========================================================================
   sidebar-navigation.css — sidebar shell, nav list, tabs (the frontend's
   TabNav), active states, and the responsive / off-canvas behaviour.
   ========================================================================== */

#sidebar {
    background-color: rgb(var(--c-surface));
    border-right: 1px solid rgb(var(--c-line));
    position: fixed;
    top: 0;
    width: 300px;
    bottom: 0;
    left: 0;
    font-weight: 400;
    font-size: .875rem;
    box-sizing: border-box;
}
#sidebar a {
    color: rgb(var(--c-fg-muted));
    text-decoration: none;
}
#sidebar a:hover { color: rgb(var(--c-fg)); }
#sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#sidebar .highlightable { padding-top: 0; }

/* ---- Nav list ---- */
#sidebar .topics { padding: .25rem 0 1rem; }

#sidebar .nav-header {
    list-style: none;
    font-family: var(--font-mono);
    color: rgb(var(--c-accent));
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    padding: 1.1rem 1.25rem .35rem;
    margin: 0;
}

#sidebar .topics li.dd-item { list-style: none; }
#sidebar .topics li.dd-item > a {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 .6rem;
    padding: .35rem .65rem;
    border-radius: var(--radius-control);
    font-size: .875rem;
    color: rgb(var(--c-fg-muted));
    transition: color .15s, background-color .15s;
}
#sidebar .topics li.dd-item > a:hover {
    color: rgb(var(--c-fg));
    background: rgb(var(--c-raised) / .6);
}
#sidebar .topics li.dd-item > a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#sidebar .topics li.dd-item > a .mdi {
    font-size: 1.1rem;
    width: 1.3em;
    text-align: center;
    flex: 0 0 auto;
    color: rgb(var(--c-fg-subtle));
    transition: color .15s;
}
#sidebar .topics li.dd-item > a:hover .mdi { color: rgb(var(--c-fg-muted)); }

/* Active item: raised row, fg text, accent edge — the frontend's active nav-link */
#sidebar .topics li.dd-item.active > a {
    color: rgb(var(--c-fg));
    background: rgb(var(--c-raised));
    box-shadow: inset 2px 0 0 0 rgb(var(--c-accent));
    font-weight: 500;
}
#sidebar .topics li.dd-item.active > a .mdi { color: rgb(var(--c-accent)); }

/* ---- Sidebar tabs — TabNav: bordered pill group, active = raised ---- */
#sidebar ul.sidebar-tabs {
    display: flex;
    gap: .25rem;
    margin: 1rem .85rem .5rem;
    padding: .25rem;
    list-style: none;
    box-sizing: border-box;
    background: rgb(var(--c-page));
    border: 1px solid rgb(var(--c-line));
    border-radius: var(--radius-control);
}
#sidebar ul.sidebar-tabs li { padding: 0; }
#sidebar ul.sidebar-tabs li.tab-home { flex: 0 0 auto; }
#sidebar ul.sidebar-tabs li.tab-browse { flex: 1; min-width: 0; }
#sidebar ul.sidebar-tabs li a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .45rem .9rem;
    color: rgb(var(--c-fg-muted));
    font-size: .875rem;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: var(--radius-control);
    background: transparent;
    transition: color .15s, background-color .15s;
    box-sizing: border-box;
}
#sidebar ul.sidebar-tabs li.tab-home a { padding: .45rem .6rem; }
#sidebar ul.sidebar-tabs li a:hover { color: rgb(var(--c-fg)); }
#sidebar ul.sidebar-tabs li.active > a {
    color: rgb(var(--c-fg));
    background: rgb(var(--c-raised));
}
#sidebar ul.sidebar-tabs li a .mdi { font-size: 1.15rem; line-height: 1; }

.sidebar-panel { display: none; }
.sidebar-panel.active { display: block; }

/* ---- Responsive / off-canvas ---- */
#sidebar-toggle { display: none; }

@media only all and (max-width: 59.938em) {
    #sidebar { width: 230px; }
}

@media (min-width: 48em) {
    #sidebar {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        width: 300px;
        flex: 0 0 300px;
        min-height: calc(100vh - var(--topbar-h));
        overflow: visible !important; /* beats scrollbar JS inline overflow */
    }
    #sidebar .highlightable {
        position: sticky;
        top: var(--topbar-h);
        max-height: calc(100vh - var(--topbar-h));
        overflow-y: auto !important; /* beats scrollbar JS inline overflow */
        height: auto !important;     /* beats learn.js setMenuHeight() */
        box-sizing: border-box;
        max-width: 100%;
        margin-top: 0;
        padding-top: 0;
        scrollbar-width: thin;
        scrollbar-color: rgb(var(--c-line-strong)) transparent;
    }
}

@media only all and (max-width: 47.938em) {
    #sidebar {
        width: 260px;
        left: -260px;
        top: var(--topbar-h);
        bottom: 0;
        z-index: 1000;
        overflow-y: auto !important; /* beats scrollbar JS inline overflow */
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-hidden { overflow: hidden; }
    .sidebar-hidden #sidebar {
        left: 0;
        box-shadow: var(--shadow-float);
    }
    .sidebar-hidden #body {
        overflow: hidden;
    }
    .sidebar-hidden #overlay {
        position: fixed;
        left: 0;
        right: 0;
        top: var(--topbar-h);
        bottom: 0;
        z-index: 999;
        background: rgb(0 0 0 / .5);
        cursor: pointer;
    }
}
