/* =============================================================
   api-sidebar.css
   Styles exclusively owned by the sidebar component.
   Covers: sidebar shell, nav groups, nav links, and the
   accordion expand/collapse animation.

   Shared elements used in BOTH sidebar and mobile header
   (search button, badges) remain in api-portal.css.
   ============================================================= */

/* ---------------------------------------------------------------
   1. Sidebar Shell
   --------------------------------------------------------------- */
.api-sidebar {
    position: fixed;
    top: var(--api-header-height);
    bottom: 0;
    left: 0;
    width: var(--api-sidebar-width);
    background: var(--api-surface-alt);
    border-right: 1px solid var(--api-border);
    overflow-y: auto;
    z-index: 100;
}
.api-sidebar-inner {
    padding: 18px 14px;
}

/* ---------------------------------------------------------------
   2. Nav Groups (accordion parents)
   --------------------------------------------------------------- */
.api-nav-group {
    margin-bottom: 2px;
}

/* The clickable heading button */
.api-nav-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 5px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    color: var(--api-text-main);
    /* One type treatment for the whole nav. The heading used to be 11px
       uppercase and letter-spaced against 14px sentence-case links, which read
       as two different fonts and inverted the hierarchy -- the child looked
       bigger than its parent. Group and page now share a size and a face;
       what separates them is weight, colour and the indent below. */
    font-family: var(--api-font-sans);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
    /* Not margin-bottom alone: this class is a <button> in the desktop
       sidebar but an <h4> in the mobile header nav, and the h4's default
       top margin is what was pushing the groups apart there. */
    margin: 0;
    transition: background 0.15s;
    user-select: none;
}
.api-nav-heading:hover {
    background: #f1f5f9;
}

/* Chevron icon inside the heading */
.api-nav-chevron {
    flex-shrink: 0;
    transition: transform 0.22s ease;
    color: var(--api-text-light);
}

/* Collapsed state — rotate chevron and hide list */
.api-nav-group.collapsed .api-nav-chevron {
    transform: rotate(-90deg);
}

/* ---------------------------------------------------------------
   3. Nav List (accordion children)
   --------------------------------------------------------------- */
.api-nav-list {
    list-style: none;
    /* The indent and the hairline are what say "these belong to the heading
       above", now that size alone no longer does. */
    padding: 0 0 0 9px;
    margin: 0 0 8px 9px;
    border-left: 1px solid var(--api-border);
    overflow: hidden;
    /* max-height is set and animated via JS (scrollHeight) */
    transition: max-height 0.25s ease;
}

/* ---------------------------------------------------------------
   4. Nav Links
   --------------------------------------------------------------- */
.api-nav-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    text-decoration: none;
    color: var(--api-text-muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.35;
    border-radius: 4px;
    transition: background 0.1s;
}
.api-nav-list a:hover {
    background: #f1f5f9;
    color: var(--api-text-main);
}
.api-nav-list a.active {
    background: #e2e8f0;
    color: var(--api-text-main);
    font-weight: 600;
}

/* Coming-soon items */
.api-nav-list a.nav-coming-soon {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}