/*
 * The school's public site on a phone: the header and the menu drawer.
 *
 * Until 2026-11 the page carried <meta name="viewport"> with a sentence of
 * marketing text in its content attribute, so phones fell back to a 980 px
 * layout and showed the whole site shrunk. With a real viewport the vendor's
 * mobile menu (BootstrapMade's .navbar-mobile, toggled by m-assets/js/main.js)
 * finally shows at phone width, and it was a grey sheet of plain links. This
 * turns it into a drawer from the reading side, in the brand's colours.
 * Loaded after every other stylesheet in frontEnd/home/front_master.blade.php.
 */
@media (max-width: 991px) {
    #header { padding: 10px 0; }
    #header .container { gap: 8px; }
    #header .logo { margin: 0; }
    #header .logo img { max-width: 140px !important; max-height: 46px; width: auto; height: auto; }
    #header .get-started-btn { margin: 0 !important; padding: 7px 14px; font-size: 13px; border-radius: 999px; }

    .mobile-nav-toggle {
        display: grid; place-items: center; width: 42px; height: 42px; margin: 0 4px;
        border-radius: 12px; background: #eaf5f2; color: #1f6162; font-size: 24px; line-height: 1;
    }

    /* The drawer: a dimmed page behind, the menu sliding in from the start side. */
    .navbar-mobile {
        background: rgba(11, 31, 47, .55);
        -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        animation: shams-nav-fade .2s ease-out;
    }
    .navbar-mobile > ul {
        top: 0 !important; bottom: 0 !important; margin: 0 !important;
        width: min(86vw, 360px); padding: 78px 0 28px !important;
        background: #fff; overflow-y: auto; box-shadow: 0 0 50px rgba(4, 14, 22, .35);
        animation: shams-nav-in-rtl .25s ease-out;
    }
    html[dir="rtl"] .navbar-mobile > ul { right: 0 !important; left: auto !important; border-radius: 24px 0 0 24px; }
    html[dir="ltr"] .navbar-mobile > ul { left: 0 !important; right: auto !important; border-radius: 0 24px 24px 0; animation-name: shams-nav-in-ltr; }

    /* A coloured band at the top of the drawer, under the close button. */
    .navbar-mobile > ul::before {
        content: ""; position: absolute; top: 0; left: 0; right: 0; height: 64px;
        background: linear-gradient(135deg, #123047, #1f6162);
    }
    .navbar-mobile .mobile-nav-toggle {
        position: absolute; top: 11px; z-index: 2; margin: 0;
        background: rgba(255, 255, 255, .14); color: #fff;
    }
    html[dir="rtl"] .navbar-mobile .mobile-nav-toggle { right: 14px; left: auto; }
    html[dir="ltr"] .navbar-mobile .mobile-nav-toggle { left: 14px; right: auto; }

    /* The links: large enough for a thumb, one per row. */
    .navbar-mobile li { position: static; }
    .navbar-mobile a, .navbar-mobile a:focus {
        justify-content: flex-start; gap: 10px; margin: 2px 12px; padding: 13px 16px !important;
        border-radius: 12px; font-size: 16px; font-weight: 600; color: #14232e; white-space: normal;
    }
    .navbar-mobile a:hover, .navbar-mobile .active, .navbar-mobile li:hover > a {
        background: #eaf5f2; color: #1f6162;
    }
    .navbar-mobile > ul > li + li { border-top: 1px solid #eef3f1; }

    /* Sub-menus open in place, indented, on a light panel. */
    .navbar-mobile ul ul {
        position: static !important; display: block !important; opacity: 1 !important; visibility: visible !important;
        top: auto; bottom: auto; width: auto; margin: 0 16px 8px; padding: 4px 0 !important;
        background: #f5faf8; border-radius: 12px; box-shadow: none; overflow: visible; animation: none;
    }
    .navbar-mobile ul ul::before { display: none; }
    .navbar-mobile ul ul a { font-size: 15px; font-weight: 500; margin: 0 6px; padding: 10px 14px !important; }

    /* The language picker is hidden on phones by d-none; inside the drawer it shows. */
    .navbar-mobile li.d-none {
        display: flex !important; align-items: stretch !important; padding: 16px 24px !important;
        margin-top: 10px; border-top: 1px solid #eef3f1;
    }
    .navbar-mobile li.d-none .nice-select { width: 100%; }
    .navbar-mobile li.d-none select {
        width: 100%; padding: 11px 14px; border: 1px solid #dde8e4; border-radius: 12px;
        background: #f5faf8; color: #14232e; font-size: 15px; font-weight: 600;
    }

    /* The page behind stays still while the drawer is open. */
    body:has(.navbar-mobile) { overflow: hidden; }
}

@media (max-width: 400px) {
    #header .logo img { max-width: 112px !important; }
    #header .get-started-btn { padding: 6px 11px; font-size: 12px; }
}

@keyframes shams-nav-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shams-nav-in-rtl { from { transform: translateX(100%); } to { transform: none; } }
@keyframes shams-nav-in-ltr { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .navbar-mobile, .navbar-mobile > ul { animation: none !important; }
}

/* The hero on a phone: the vendor pushes the paragraph into the left half of the
   banner (margin-left: 50%), which on a phone is a column a few words wide. */
@media (max-width: 768px) {
    #hero .container { padding-top: 92px; }
    #hero p { margin-left: 0 !important; margin-right: 0 !important; max-width: none; font-size: 15px; line-height: 1.9; }
    #hero .primary-btn {
        display: inline-block; margin-top: 18px; padding: 10px 22px; border-radius: 999px;
        background: #2D9885; color: #fff !important; font-size: 15px; font-weight: 700;
    }
}
