/* ==========================================================================
   dropdowns.css
   Admin/User dropdown containers, positioning, and menu item styling.
   Edit here for dropdown sizes, offsets, headers, and item indentation.
   ========================================================================== */

.nav-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1002;
}

/* The TOGGLES sit on the top bar, so they take the header's semantic colour
   (--app-header-fg, reassigned per area) — not a fixed platform grey, which is
   unreadable once an area gives the bar a dark surface. The MENUS below are
   floating panels on their own white surface and keep their own colours. */
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--app-header-fg);
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    min-width: 200px;
    background: var(--white);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-radius: 10px;
    z-index: 1000;
    padding: 0.4rem 0.4rem;
    margin-top: 6px;
    left: 0;
    /* Cap height so a long menu (admin has ~25 items) can't extend past
       the viewport; scroll inside the dropdown to reach the rest. Matches
       the .user-dropdown-menu pattern. */
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.user-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1002;
}

.user-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--app-header-fg);
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    line-height: 1;
}

.dropdown-caret {
    font-size: 0.65em;
    margin-left: 0.35em;
    opacity: 0.55;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    min-width: 220px;
    width: max-content;
    max-width: min(320px, calc(100vw - 2rem));
    background: var(--white);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-radius: 10px;
    z-index: 1000;
    padding: 0.4rem 0.4rem;
    margin-top: 6px;
    right: 0;
    left: auto;
    box-sizing: border-box;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: normal;
}

/* Dropdown link styles */
.nav-dropdown-menu .site-nav-link,
.user-dropdown-menu .site-nav-link,
.user-dropdown-menu button.site-nav-link {
    padding: 10px 28px;
    color: var(--gray-600);
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    text-decoration: none;
    font-size: 0.96rem;
    cursor: pointer;
    transition: background 0.11s, color 0.13s;
}

/* #161 rev 6 D7'/D10: the switcher's DEFAULT marker — a text token, deliberately NOT
   aria-current (that attribute already means CURRENT CONTEXT in this menu; a row can be
   current, default, both, or neither) — and the per-row set-default form wrapper, which must
   not break the menu's block flow. (Code-critic F1: these blocks were first inserted MID-LIST
   inside the three-selector rule above, splitting it — placed AFTER it, whole, deliberately.) */
.site-nav-note {
    margin-left: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--blue-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.site-nav-inline-form {
    margin: 0;
    padding: 0;
}

.nav-dropdown-menu .site-nav-link:hover,
.user-dropdown-menu .site-nav-link:hover,
.user-dropdown-menu button.site-nav-link:hover {
    background: var(--slate-470);
    color: var(--blue-600);
}

.nav-dropdown-header {
    display: block;
    padding: 10px 12px 6px;
    font-size: 0.96rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--gray-600);
}

.nav-dropdown-menu.show,
.user-dropdown-menu.show {
    display: block;
}