/* ==========================================================================
   GLOBAL RESPONSIVE STYLESHEET
   Separates all media queries from global.css and page-specific styles.
   ========================================================================== */
@media (max-width: 1069px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.7rem;
    }
}


/* ==========================================================================
   1. BREAKPOINT: 1200px (Laptops / Small Desktops)
   ========================================================================== */
@media (max-width: 1200px) {
    .wrap {
        padding-inline: 24px;
    }

    /* Footer structure optimization */
    .footer-grid {
        grid-template-columns: 1.2fr 1fr 1fr 1fr;
        gap: 30px;
    }

    /* Gallery grids count-down */
    .gallery-grid,
    .gallery-grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   2. BREAKPOINT: 992px (Tablets Landscape / Drawer Menu Activation)
   ========================================================================== */
@media (max-width: 992px) {

    /* --- Scroll-lock when Drawer Menu is open --- */
    body.menu-open {
        overflow: hidden;
    }

    /* --- Navbar & Mobile Hamburger Drawer --- */
    .nav-toggle {
        display: block;
        z-index: 1001;
    }

    .btn-visibility {
        display: none !important;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -10px 0 40px rgba(14, 42, 92, 0.15);
        display: flex;
        flex-direction: column;
        padding: 90px 24px 40px;
        gap: 12px;
        z-index: 1000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .nav-links.mobile-open {
        right: 0;
    }

    .top-bar-item {
        display: block;
        margin-top: 24px;
        padding-top: 20px;
        border-top: 1px solid rgba(14, 42, 92, 0.12);
        width: 100%;
    }
    .top-bar-wrap {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .top-bar-wrap .left {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .top-bar-wrap .left a {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        color: var(--text, #1C2430) !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        border-bottom: none !important;
        padding: 4px 0 !important;
    }
    .top-bar-wrap .left a:hover {
        color: var(--blue) !important;
    }
    .top-bar-wrap .social {
        display: flex;
        gap: 18px;
        align-items: center;
        padding-top: 4px;
    }
    .top-bar-wrap .social a {
        font-size: 1.25rem !important;
        color: var(--text, #1C2430) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-bottom: none !important;
        padding: 0 !important;
    }
    .top-bar-wrap .social a:hover {
        color: var(--gold) !important;
    }

    .nav-links>li {
        width: 100%;
        margin: 0;
    }

    .nav-links>li>a {
        padding: 12px 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .nav-links>li>a:hover {
        color: var(--blue);
        border-color: var(--blue);
    }

    /* --- Mobile Accordion Dropdowns Inside Drawer --- */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 16px;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        columns: 1 !important;
        min-width: 0 !important;
        display: block;
    }

    .has-dropdown.open>.dropdown-menu {
        max-height: 500px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .has-dropdown>a {
        justify-content: space-between;
    }

    .site-nav .dropdown-menu a {
        color: #4a5568;
        padding: 8px 0;
        font-size: 0.9rem;
    }

    /* --- Topbar Adjustment --- */
    .top-bar .has-dropdown>.dropdown-menu {
        position: absolute;
        background: var(--blue-dark);
        border: 1px solid rgba(255, 255, 255, 0.1);
        opacity: 0;
        visibility: hidden;
        max-height: none;
    }

    .top-bar .has-dropdown:hover>.dropdown-menu {
        opacity: 1;
        visibility: visible;
    }

    /* --- Grid Systems Stacking --- */
    .why-grid,
    .leader-grid,
    .branch-grid,
    .facility-grid,
    .news-grid,
    .achieve-grid,
    .media-grid-view,
    .alumni-grid-view,
    .faculty-grid-view {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }

    .about-grid,
    .contact-grid,
    .contact-inner-grid,
    .branch-details-grid {
        grid-template-columns: 1fr !important;
        gap: 36px;
    }

    /* Alternating Facility Rows reset to standard top-to-bottom stack */
    .facility-row {
        grid-template-columns: 1fr !important;
        gap: 24px;
        direction: ltr !important;
    }

    /* Footer structure optimization */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 36px;
    }
}

/* ==========================================================================
   3. BREAKPOINT: 768px (Tablets Portrait / Large Mobile)
   ========================================================================== */
@media (max-width: 768px) {

    /* Floating Bar Space */
    body {
        padding-bottom: 64px;
    }

    .mobile-bar {
        display: block;
    }

    /* Hero sliders responsive heading */
    .hero-slider h1 {
        font-size: clamp(2rem, 5vw, 2.8rem);
    }

    .hero-slider p {
        font-size: 0.95rem;
    }

    /* Stats Band values spacing */
    .stats-band .wrap {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .stat-item {
        width: 100%;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        padding-bottom: 20px;
    }

    .stat-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Trust badges responsive row scroll */
    .trust-badges .wrap {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-start;
        gap: 24px;
        padding-bottom: 10px;
    }

    .trust-badges .wrap::-webkit-scrollbar {
        display: none;
    }

    .badge-item {
        flex-shrink: 0;
    }

    /* Tab Buttons Scrollable Overflow */
    .tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
        gap: 8px;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    /* Academics tabs grid stacking */
    .academics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Gallery layouts counts */
    .gallery-grid,
    .gallery-grid-view {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Top Bar dynamic scroll */
    .top-bar .left {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .top-bar .left::-webkit-scrollbar {
        display: none;
    }

    /* Beyond Academics Marquee Mobile Scale */
    .marquee-card {
        width: 240px !important;
        border-width: 3px !important;
    }

    .marquee-track {
        gap: 12px !important;
    }

    .achievement-slider-container {
        margin: 0px;
    }
}

/* ==========================================================================
   4. BREAKPOINT: 576px (Mobiles Large / Medium)
   ========================================================================== */
@media (max-width: 576px) {

    /* Hide top bar right elements to prioritize mobile headers */
    .top-bar .right {
        display: none;
    }

    /* Hero details alignment */
    .hero-slider {
        padding: 100px 0 50px;
        text-align: center;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .hero-ctas .btn {
        width: 55%;
        justify-content: center;
        padding: 14px 20px;
        margin: 0px auto;
    }

    /* Stacking grids down to 1 column */
    .why-grid,
    .leader-grid,
    .branch-grid,
    .facility-grid,
    .news-grid,
    .achieve-grid,
    .media-grid-view,
    .alumni-grid-view,
    .faculty-grid-view {
        grid-template-columns: 1fr !important;
    }

    /* Achievement Highlight Grid Stack */
    .achievement-grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
        justify-items: center;
    }

    .achievement-text-content {
        padding-left: 0 !important;
        text-align: center !important;
    }

    .achievement-text-content .section-head {
        text-align: center !important;
    }

    /* Trust section columns stack */
    .trust-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    /* Form Fields columns stack */
    .form-row,
    .contact-form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Footer details */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }
}

/* ==========================================================================
   5. BREAKPOINT: 400px (Small Mobiles / Extra Small Screen sizes)
   ========================================================================== */
@media (max-width: 400px) {

    /* Ensure no text overflows on tiny width viewports */
    .section-head h2 {
        font-size: 1.5rem;
    }

    .hero-slider h1 {
        font-size: 1.8rem;
    }

    .gallery-grid,
    .gallery-grid-view {
        grid-template-columns: 1fr;
    }

    /* Minimize spacings slightly to fit elements */
    .wrap {
        padding-inline: 16px;
    }

    .intro-image-container {
        width: 319px;
    }

    .intro-content-container {
        padding-inline: 14px;
    }

    .footer-bottom {
        font-size: 0.72rem;
    }

    .achievement-slider-container {

        margin: 0px;

    }
}

/* ==========================================================================
   6. BREAKPOINT: 768px (Mobiles Portrait / Small Tablets)
   ========================================================================== */
@media (max-width: 768px) {

    /* Reposition scroll-to-top button higher on mobile to clear the bottom floating bar if active */
    .scroll-top-btn {
        bottom: 80px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   7. BREAKPOINT: 993px (Desktop viewports - Pull Top Info Bar to visual top)
   ========================================================================== */
@media (min-width: 993px) {
    .site-nav {
        padding-top: 38px;
        transition: padding-top 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .site-nav.scrolled {
        padding-top: 0;
    }
    
    .top-bar-item {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 38px;
        background: var(--blue-dark);
        z-index: 10;
        display: block;
        transition: opacity 0.2s ease, visibility 0.2s;
    }
    .site-nav.scrolled .top-bar-item {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    
    .top-bar-wrap {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 24px;
        height: 100%;
    }
    .top-bar-wrap .left,
    .top-bar-wrap .social {
        display: flex;
        gap: 18px;
        align-items: center;
    }
    .top-bar-wrap a {
        color: #cfd9ec !important;
        font-size: 0.78rem !important;
        font-weight: 500 !important;
        font-family: 'Manrope', sans-serif !important;
        padding: 0 !important;
        border-bottom: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
    }
    .top-bar-wrap a:hover {
        color: var(--gold) !important;
        border-color: transparent !important;
    }
    .top-bar-wrap .social a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 22px !important;
        height: 22px !important;
        font-size: 0.9rem !important;
    }
}

/* ==========================================================================
   8. BREAKPOINT: 480px (Small Mobiles Width Override)
   ========================================================================== */
@media (max-width: 480px) {
    .top-bar-wrap .left a {
        font-size: 0.88rem !important;
    }
    .top-bar-wrap .social {
        gap: 14px;
    }
}