/*
 * ============================================================
 * M.H College
 * File: 91-responsive-header.css
 * Purpose:
 * Responsive header and mobile navigation
 * ============================================================
 */

/*
 * ============================================================
 * Medium desktop and tablet landscape
 * Maximum width: 1050px
 * ============================================================
 */

@media (max-width: 1050px) {
    /*
     * Desktop navigation spacing
     */

    .main-nav {
        gap: 18px;
    }

    .main-nav a {
        font-size: .95rem;
    }

    /*
     * Header actions
     */

    .nav-actions {
        gap: 10px;
    }

    .nav-actions .button {
        width: 44px;
        min-width: 44px;

        padding-inline: 0;
    }

    .nav-actions .button span {
        display: none;
    }

    /*
     * Brand logo
     */

    .brand-logo {
        height: 74px;
        max-width: 118px;
    }

    .site-header.scrolled .brand-logo {
        height: 64px;
        max-width: 102px;
    }
}

/*
 * ============================================================
 * Tablet and mobile
 * Maximum width: 820px
 * ============================================================
 */

@media (max-width: 820px) {
    /*
     * ========================================================
     * Mobile header shell
     * ========================================================
     */

    .site-header {
        background: rgba(7, 7, 7, .9);

        border-bottom-color: rgba(217, 173, 87, .18);

        box-shadow:
            0 8px 28px rgba(0, 0, 0, .2);
    }

    .site-header.scrolled {
        background: rgba(7, 7, 7, .97);

        border-bottom-color: var(--line);

        box-shadow:
            0 12px 34px rgba(0, 0, 0, .3);
    }

    /*
     * Mobile header layout
     *
     * RTL visual order:
     * Logo on the right
     * Language switch near the left
     * Menu button on the far left
     */

    .nav-wrap {
        display: flex;
        align-items: center;

        min-height: 78px;

        gap: 10px;
    }

    .site-header.scrolled .nav-wrap {
        min-height: 74px;
    }

    /*
     * ========================================================
     * Brand
     * ========================================================
     */

    .brand {
        order: 0;

        flex: 0 0 auto;

        margin-inline-end: auto;
    }

    .brand-image {
        padding-block: 2px;
    }

    .brand-logo {
        height: 64px;
        max-width: 102px;
    }

    .site-header.scrolled .brand-logo {
        height: 58px;
        max-width: 92px;
    }

    /*
     * ========================================================
     * Header actions
     * ========================================================
     */

    .nav-actions {
        order: 1;

        display: flex;
        align-items: center;

        flex: 0 0 auto;

        gap: 0;
        margin: 0;
    }

    .nav-actions .button {
        display: none;
    }

    /*
     * ========================================================
     * Language switch
     * ========================================================
     */

    .language-link {
        min-height: 46px;

        padding: 8px 11px;

        color: var(--cream);

        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, .045),
                rgba(255, 255, 255, .015)
            );

        border: 1px solid rgba(217, 173, 87, .26);
        border-radius: 13px;

        font-size: .88rem;
        line-height: 1;
        white-space: nowrap;

        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .025);
    }

    .language-link:hover {
        color: var(--gold-light);

        background:
            linear-gradient(
                180deg,
                rgba(217, 173, 87, .1),
                rgba(217, 173, 87, .03)
            );

        border-color: rgba(245, 220, 152, .5);

        transform: none;
    }

    /*
     * ========================================================
     * Mobile menu button
     * ========================================================
     */

    .menu-toggle {
        order: 2;

        display: inline-flex;

        flex: 0 0 46px;

        margin: 0;

        touch-action: manipulation;
    }

    /*
     * ========================================================
     * Mobile navigation panel
     * ========================================================
     */

    .main-nav {
        position: fixed;

        z-index: 1001;

        inset-block-start: 78px;
        inset-inline: 14px;

        display: grid;

        gap: 7px;

        max-height: calc(100vh - 94px);
        max-height: calc(100dvh - 94px);

        margin: 0;
        padding: 12px;

        overflow-x: hidden;
        overflow-y: auto;

        overscroll-behavior: contain;

        background:
            radial-gradient(
                circle at 85% 0,
                rgba(217, 173, 87, .1),
                transparent 38%
            ),
            rgba(8, 8, 8, .985);

        border: 1px solid rgba(217, 173, 87, .34);
        border-radius: 20px;

        box-shadow:
            0 28px 70px rgba(0, 0, 0, .56),
            0 0 28px rgba(217, 173, 87, .055),
            inset 0 1px 0 rgba(255, 255, 255, .035);

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform:
            translateY(-12px)
            scale(.985);

        transform-origin: top center;

        transition:
            opacity .26s ease,
            visibility .26s ease,
            transform .34s var(--ease-luxury);
    }

    .site-header.scrolled .main-nav {
        inset-block-start: 74px;
    }

    /*
     * Open menu state
     */

    .main-nav.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform:
            translateY(0)
            scale(1);
    }

    /*
     * ========================================================
     * Mobile navigation links
     * ========================================================
     */

    .main-nav a {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 11px;

        min-height: 52px;

        padding: 11px 16px;

        color: #e9e1d4;

        background: rgba(255, 255, 255, .018);

        border: 1px solid transparent;
        border-radius: 13px;

        font-size: .98rem;
        font-weight: 750;
        line-height: 1.4;

        text-shadow: none;

        touch-action: manipulation;

        transition:
            color .25s ease,
            background-color .25s ease,
            border-color .25s ease,
            box-shadow .25s ease,
            transform .25s var(--ease-luxury);
    }

    /*
     * Remove desktop underline
     */

    .main-nav a::after {
        display: none;
    }

    /*
     * Active-page indicator
     */

    .main-nav a::before {
        content: "";

        width: 7px;
        height: 7px;

        flex: 0 0 7px;

        background: rgba(217, 173, 87, .28);

        border: 1px solid rgba(245, 220, 152, .24);
        border-radius: 50%;

        transition:
            background-color .25s ease,
            border-color .25s ease,
            box-shadow .25s ease,
            transform .25s var(--ease-luxury);
    }

    .main-nav a:hover {
        color: var(--gold-light);

        background: rgba(217, 173, 87, .065);

        border-color: rgba(217, 173, 87, .22);

        transform: translateY(-1px);

        text-shadow: none;
    }

    .main-nav a:hover::before {
        background: var(--gold);

        border-color: var(--gold-light);

        transform: scale(1.12);
    }

    .main-nav a.active,
    .main-nav a[aria-current="page"] {
        color: var(--gold-light);

        background:
            linear-gradient(
                90deg,
                rgba(217, 173, 87, .135),
                rgba(217, 173, 87, .045)
            );

        border-color: rgba(245, 220, 152, .34);

        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .025),
            0 10px 24px rgba(0, 0, 0, .16);

        text-shadow:
            0 0 14px rgba(217, 173, 87, .15);
    }

    .main-nav a.active::before,
    .main-nav a[aria-current="page"]::before {
        background: var(--gold-light);

        border-color: rgba(255, 244, 211, .76);

        box-shadow:
            0 0 12px rgba(217, 173, 87, .48);

        transform: scale(1.15);
    }

    /*
     * ========================================================
     * Mobile menu scrollbar
     * ========================================================
     */

    .main-nav {
        scrollbar-width: thin;
        scrollbar-color:
            rgba(217, 173, 87, .46)
            transparent;
    }

    .main-nav::-webkit-scrollbar {
        width: 6px;
    }

    .main-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .main-nav::-webkit-scrollbar-thumb {
        background: rgba(217, 173, 87, .42);

        border-radius: 999px;
    }
}

/*
 * ============================================================
 * Small mobile
 * Maximum width: 560px
 * ============================================================
 */

@media (max-width: 560px) {
    /*
     * Header dimensions
     */

    .nav-wrap,
    .site-header.scrolled .nav-wrap {
        min-height: 70px;

        gap: 8px;
    }

    /*
     * Brand logo
     */

    .brand-logo,
    .site-header.scrolled .brand-logo {
        height: 54px;
        max-width: 86px;
    }

    /*
     * Language switch
     */

    .language-link {
        min-height: 42px;

        padding-inline: 9px;

        border-radius: 12px;

        font-size: .82rem;
    }

    /*
     * Menu toggle
     */

    .menu-toggle {
        width: 44px;
        height: 44px;

        flex-basis: 44px;

        border-radius: 12px;
    }

    .menu-toggle span:not(.sr-only) {
        inset-inline-start: 9px;

        width: 24px;
    }

    .menu-toggle span:nth-child(1) {
        top: 13px;
    }

    .menu-toggle span:nth-child(2) {
        top: 20px;
    }

    .menu-toggle span:nth-child(3) {
        top: 27px;
    }

    .menu-toggle[aria-expanded="true"] span:nth-child(1),
    .menu-toggle[aria-expanded="true"] span:nth-child(3) {
        top: 20px;
    }

    /*
     * Mobile navigation panel
     */

    .main-nav,
    .site-header.scrolled .main-nav {
        inset-block-start: 70px;
        inset-inline: 12px;

        max-height: calc(100vh - 82px);
        max-height: calc(100dvh - 82px);

        padding: 10px;

        border-radius: 17px;
    }

    /*
     * Mobile navigation links
     */

    .main-nav a {
        min-height: 50px;

        padding: 10px 14px;

        border-radius: 12px;

        font-size: .95rem;
    }
}