/* ==========================================
   Authenticated chrome (header-auth.php / footer-auth.php)
   Only loaded on the 8 private templates — see functions.php's
   rabta_enqueue_assets(). Public site-header/site-footer (layout.css)
   is untouched by anything in this file.
   ========================================== */

/* Container hybrid: identical to .container above 640px (falls
   through to wp-theme's existing responsive widths); at <=640px caps
   to 420px, matching the prototype's own app-shell token exactly. */
@media (max-width: 640px) {
    .container--app-shell {
        max-width: 420px;
    }
}

/* ---------- Slim header ---------- */

.site-header-auth {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface-container-lowest);
    box-shadow: var(--shadow-sm);
}

.site-header-auth__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    height: var(--nav-height);
}

.site-header-auth__brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.site-header-auth__brand:hover .site-header-auth__title {
    color: var(--primary);
}

.site-header-auth__school-name {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-header-auth__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text);
    line-height: var(--line-height-tight);
}

.site-header-auth__logout {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: var(--radius-full);
    background: none;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.site-header-auth__logout:hover {
    background: var(--surface-container);
    color: var(--primary);
}

.site-header-auth__logout svg {
    width: 1.375rem;
    height: 1.375rem;
}

.site-header-auth__quicklinks {
    border-top: 1px solid var(--outline-variant);
}

.site-header-auth__quicklinks-inner {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    overflow-x: auto;
    padding-block: var(--space-3);
}

.site-header-auth__quicklink {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-light);
}

.site-header-auth__quicklink svg {
    width: 1.125rem;
    height: 1.125rem;
}

.site-header-auth__quicklink:hover,
.site-header-auth__quicklink.is-active {
    color: var(--primary);
}

/* At <=640px the bottom tab bar (site-tabbar-auth) takes over these
   same 5 destinations, so the inline row steps aside rather than
   duplicating navigation across two places at once. */
@media (max-width: 640px) {
    .site-header-auth__quicklinks {
        display: none;
    }
}

/* ---------- Bottom tab bar ---------- */

.site-tabbar-auth {
    display: none;
}

@media (max-width: 640px) {
    .site-tabbar-auth {
        display: flex;
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 50;
        justify-content: space-around;
        background: var(--surface-container-lowest);
        border-top: 1px solid var(--outline-variant);
        box-shadow: var(--shadow-md);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* Reserve room so page content never sits behind the fixed tab bar. */
    .rabta-main-auth {
        padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0));
    }
}

.site-tabbar-auth__tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding-block: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-light);
}

.site-tabbar-auth__tab svg {
    width: 1.375rem;
    height: 1.375rem;
}

.site-tabbar-auth__tab.is-active {
    color: var(--primary);
}
