/*
 * Application-shell foundation.
 *
 * This file intentionally loads after the legacy style layers. It provides a
 * stable accessibility and responsive baseline while those layers are
 * consolidated during the broader redesign.
 */

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10000;
    padding: 0.65rem 0.9rem;
    border: 2px solid #c7d2fe;
    border-radius: 0.5rem;
    background: #111827;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(calc(-100% - 1rem));
    transition: transform 150ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.nav-group--first {
    margin-top: -10px;
}

.page-title {
    margin: 0;
}

.nav-item:focus-visible,
.logout-btn:focus-visible {
    outline: 3px solid #c7d2fe !important;
    outline-offset: -3px;
}

.logout-btn {
    display: inline-flex;
    min-width: 2rem;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

#mainContent:focus {
    outline: none;
}

@media (max-width: 768px) {
    .top-bar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 0.5rem;
        height: 56px !important;
        padding: 0 0.75rem !important;
    }

    .topbar-section.left,
    .topbar-section.center,
    .topbar-section.right {
        width: auto !important;
        margin: 0 !important;
    }

    .topbar-section.left {
        min-width: 0;
        justify-content: flex-start !important;
    }

    .topbar-section.center {
        flex-grow: 0 !important;
        justify-content: center !important;
    }

    .topbar-section.right {
        display: flex !important;
        justify-content: flex-end !important;
    }

    .page-title {
        overflow: hidden;
        text-align: left !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-info {
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #username {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
