/*
   Shared sub-navigation chrome. Generic .subnav.* classes used by every
   context-specific sub-nav partial (_ServicesNav, _CollegiateNav, _ProfileNav).
   Modifier classes (.subnav--services, .subnav--collegiate, .subnav--profile)
   override accent + active colors per context.

   Mobile (< 768px): the horizontal link list collapses into a single
   "current section ▾" disclosure that expands to reveal all sub-items —
   improves discoverability over the prior horizontal-scroll pattern.
*/

:root {
    --subnav-surface: #f8f9fa;
    --subnav-border: rgba(0, 0, 0, 0.08);
    --subnav-muted: #6b7380;
    --subnav-primary: #031326;
    --subnav-accent: #00c896;
    --subnav-transition: 0.15s ease;
}

/* Sits flush under the fixed _MainNav (h ~56px). */
.subnav {
    background: var(--subnav-surface);
    border-bottom: 1px solid var(--subnav-border);
    margin-top: 56px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
    position: relative;
    z-index: 1010;
}

.subnav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .subnav__inner::-webkit-scrollbar { display: none; }

.subnav__link {
    flex: 0 0 auto;
    padding: 0.85rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--subnav-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--subnav-transition), border-color var(--subnav-transition);
    white-space: nowrap;
}

    .subnav__link:hover {
        color: var(--subnav-primary);
        text-decoration: none;
    }

    .subnav__link.is-active {
        color: var(--subnav-primary);
        border-bottom-color: var(--subnav-accent);
    }

    /* Keyboard focus ring — WCAG 2.4.7 Focus Visible.
       Pattern C from the Round 1 master backlog. */
    .subnav__link:focus-visible {
        outline: 2px solid var(--subnav-accent);
        outline-offset: 2px;
        border-radius: 2px;
    }

.subnav__cta {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0.45rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--subnav-primary);
    background: var(--subnav-accent);
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    transition: filter var(--subnav-transition);
}

    .subnav__cta:hover {
        color: var(--subnav-primary);
        text-decoration: none;
        filter: brightness(0.95);
    }

    /* Inverted focus ring for the on-accent CTA so it's visible against the
       cyan/green pill background. */
    .subnav__cta:focus-visible {
        outline: 2px solid var(--subnav-primary);
        outline-offset: 2px;
    }

/*
   Mobile dropdown collapse — at narrow widths the link list hides behind a
   "current section ▾" disclosure. Built with <details>/<summary> so there's
   no JS dependency and accessibility comes free.
*/

.subnav__mobile {
    display: none;
}

.subnav__mobile-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: transparent;
    border: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--subnav-primary);
    cursor: pointer;
    list-style: none;
}

    .subnav__mobile-trigger::-webkit-details-marker { display: none; }
    .subnav__mobile-trigger::after {
        content: "▾";
        font-size: 0.8rem;
        margin-left: 0.5rem;
        transition: transform var(--subnav-transition);
    }

.subnav__mobile[open] .subnav__mobile-trigger::after {
    transform: rotate(180deg);
}

/* Keyboard focus ring on the mobile disclosure trigger + each list link. */
.subnav__mobile-trigger:focus-visible {
    outline: 2px solid var(--subnav-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.subnav__mobile-list a:focus-visible {
    outline: 2px solid var(--subnav-accent);
    outline-offset: -2px;
}

.subnav__mobile-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem;
    background: var(--subnav-surface);
    border-top: 1px solid var(--subnav-border);
}

    .subnav__mobile-list a {
        display: block;
        padding: 0.75rem 1rem;
        color: var(--subnav-primary);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
    }

        .subnav__mobile-list a.is-active {
            color: var(--subnav-accent);
            font-weight: 700;
            background: rgba(0, 200, 150, 0.06);
        }

        .subnav__mobile-list a:hover {
            background: rgba(0, 0, 0, 0.03);
        }

@media (max-width: 768px) {
    .subnav__inner { display: none; }
    .subnav__mobile { display: block; }
}

/*
   Context accent overrides. Each modifier swaps the design tokens above.
*/

/* Services — teal accent matches the existing /services/* chrome. */
.subnav--services { --subnav-accent: #00c896; }

/* Collegiate — UCL cyan matches the v2 design token. */
.subnav--collegiate {
    --subnav-accent: #1FB8E0;
    --subnav-surface: #0a1f3d;
    --subnav-border: rgba(255, 255, 255, 0.08);
    --subnav-muted: rgba(255, 255, 255, 0.65);
    --subnav-primary: #ffffff;
}

    .subnav--collegiate .subnav__cta {
        color: #031326;
    }

    .subnav--collegiate .subnav__mobile-trigger,
    .subnav--collegiate .subnav__mobile-list a {
        color: var(--subnav-primary);
    }

    .subnav--collegiate .subnav__mobile-list {
        background: var(--subnav-surface);
    }

/* Profile — neutral light grey accent. */
.subnav--profile { --subnav-accent: #0d3b66; }
