/* ==========================================================
   SSPKM – mobile menu as a right-side slide-in drawer
   (replaces the small dropdown box; markup is extended by modern-drawer.js)
   ========================================================== */
@keyframes drawerItemIn {
    from {
        opacity: 0;
        transform: translateX(26px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width:767px) {

    html.menu-open,
    html.menu-open body {
        overflow: hidden !important;
    }

    /* dark backdrop */
    header .mobile-ul .mobile-li>.menu-overlay {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 4;
        background: rgba(5, 15, 30, .58);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .4s var(--ease), visibility 0s .4s;
    }

    header .mobile-ul .mobile-li.open>.menu-overlay {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s;
    }

    /* the drawer */
    header .mobile-ul .mobile-li>ul.mobile-nav {
        display: block !important;
        visibility: hidden;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        bottom: 0 !important;
        width: min(84vw, 330px);
        height: 100vh;
        height: 100dvh;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 0 30px !important;
        z-index: 5;
        border-radius: 26px 0 0 26px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: linear-gradient(170deg, #0a1c33 0%, #123461 62%, #1a4a82 100%) !important;
        box-shadow: -26px 0 60px rgba(0, 0, 0, .4);
        transform: translateX(104%);
        animation: none !important;
        transition: transform .5s var(--ease), visibility 0s .5s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav {
        visibility: visible;
        transform: none;
        transition: transform .5s var(--ease), visibility 0s;
    }

    header .mobile-ul .mobile-li:hover>ul.mobile-nav {
        display: block !important;
    }

    /* header row of the drawer */
    header .mobile-nav li.drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 20px 16px 16px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, .12) !important;
    }

    header .mobile-nav .dh-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        min-width: 0;
    }

    header .mobile-nav .dh-brand img {
        width: 46px;
        height: 46px;
        padding: 3px;
        background: #fff;
        border-radius: 50%;
        flex: 0 0 46px;
    }

    header .mobile-nav .dh-brand b {
        display: block;
        color: #fff;
        font-size: 17px;
        letter-spacing: .05em;
        line-height: 1.1;
    }

    header .mobile-nav .dh-brand small {
        display: block;
        color: #a9bbd3;
        font-size: 10px;
        line-height: 1.25;
        margin-top: 3px;
    }

    header .mobile-nav .drawer-close {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        border: 0;
        border-radius: 50%;
        cursor: pointer;
        background: rgba(255, 255, 255, .12);
        color: #fff;
        font-size: 16px;
        line-height: 1;
        padding: 0;
        transition: background .25s, transform .35s var(--ease);
    }

    header .mobile-nav .drawer-close:hover,
    header .mobile-nav .drawer-close:active {
        background: var(--accent);
        transform: rotate(90deg);
    }

    /* items: staggered slide-in */
    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:not(.drawer-head) {
        animation: drawerItemIn .5s var(--ease) both;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(2) {
        animation-delay: .10s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(3) {
        animation-delay: .14s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(4) {
        animation-delay: .18s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(5) {
        animation-delay: .22s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(6) {
        animation-delay: .26s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(7) {
        animation-delay: .30s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(8) {
        animation-delay: .34s;
    }

    header .mobile-ul .mobile-li.open>ul.mobile-nav>li:nth-child(9) {
        animation-delay: .38s;
    }

    header .mobile-nav li {
        border-bottom: 1px solid rgba(255, 255, 255, .07) !important;
    }

    header .mobile-nav li>a {
        padding: 15px 22px !important;
    }

    header .mobile-nav li.submenu>ul {
        background: rgba(0, 0, 0, .18) !important;
    }

    /* Student Login = button at the bottom */
    header .mobile-nav>li:last-child {
        border: 0 !important;
        padding: 18px 20px 0;
    }

    header .mobile-nav>li:last-child>a {
        text-align: center;
        border-radius: 50px !important;
        padding: 13px 20px !important;
        background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
        color: #fff !important;
        box-shadow: 0 10px 22px rgba(249, 88, 60, .38);
    }

    header .mobile-nav>li:last-child>a:hover {
        color: #fff !important;
        background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    }

    /* menu button reflects the open state */
    .mobile-li.open .menu-btn {
        background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    }
}

@media (prefers-reduced-motion:reduce) {
    header .mobile-ul .mobile-li.open>ul.mobile-nav>li {
        animation: none !important;
    }
}