/* ==========================================================================
   TAEGLOBALEDU RESPONSIVE ENHANCEMENTS FOR ALL SCREENS & DEVICES
   Monitors (4K, UltraWide, QHD), Laptops, Tablets, and Smartphones
   ========================================================================== */

/* Global Viewport & Container Safeguards */
html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    overflow-x: hidden;
    min-width: 320px;
    position: relative;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* 1. Ultra-Wide & 4K Monitors (min-width: 1921px) */
@media (min-width: 1921px) {
    .container {
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 32px;
        padding-right: 32px;
    }
    .hero-slide-bg {
        background-size: cover;
    }
    .hero-title {
        font-size: clamp(3rem, 3.5vw, 4.5rem);
    }
    .hero-para {
        font-size: 1.25rem;
        max-width: 750px;
    }
    .mega-menu {
        max-width: 1200px;
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }
}

/* 2. 2K / QHD Monitors (1441px to 1920px) */
@media (min-width: 1441px) and (max-width: 1920px) {
    .container {
        max-width: 1360px;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 3. Standard Desktop & Laptops (1025px to 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .container {
        max-width: 1180px;
    }
    .nav-menu {
        gap: 20px;
    }
    .mega-countries {
        width: 860px;
    }
}

/* 4. Small Laptops & Tablets in Landscape (992px to 1024px) */
@media (min-width: 992px) and (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding-left: 20px;
        padding-right: 20px;
    }
    .nav-menu {
        gap: 14px;
    }
    .nav-link {
        font-size: 0.88rem;
    }
    .mega-courses {
        width: 600px;
    }
    .mega-countries {
        width: 720px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 5. Tablets in Portrait & Large Mobiles (768px to 991px) */
@media (max-width: 991px) {
    .top-bar {
        padding: 8px 0;
    }
    .nav-menu {
        display: none;
    }
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    .lightbox-img-stage {
        height: 55vh;
    }
}

/* 6. Standard Smartphones (481px to 767px) */
@media (max-width: 767px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    .top-bar-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .top-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .page-banner h1 {
        font-size: 2.2rem;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-filter-wrap {
        gap: 8px;
    }
    .gallery-filter-btn {
        padding: 8px 16px;
        font-size: 0.84rem;
        width: 100%;
        justify-content: center;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    .lightbox-dialog {
        max-height: 96vh;
    }
    .lightbox-img-stage {
        height: 48vh;
    }
    .lightbox-caption-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
    }
    .lightbox-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }
    .lightbox-arrow.prev { left: 8px; }
    .lightbox-arrow.next { right: 8px; }
}

/* 7. Small & Foldable Smartphones (320px to 480px) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .logo-text {
        font-size: 1.1rem;
    }
    .logo-img {
        height: 42px;
    }
    .nav-actions .btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    .mobile-sidebar {
        width: 85vw;
        max-width: 320px;
    }
}

/* 8. Touch Accessible Targets */
button, .btn, .nav-link, .gallery-filter-btn, .mobile-nav-link {
    touch-action: manipulation;
}
@media (hover: none) and (pointer: coarse) {
    .gallery-card:hover {
        transform: none;
    }
    .gallery-zoom-overlay {
        opacity: 0 !important;
    }
}

/* 9. Universal Centered Page & Section Headings */
.page-banner,
.page-banner .container,
.page-title,
.section-header .section-title,
.section-header .section-subtitle,
.section-header .section-desc,
.section-header {
    text-align: center !important;
}

.page-banner h1,
.page-title,
.section-header .section-title,
.section-header .section-desc,
.section-header {
    margin-left: auto !important;
    margin-right: auto !important;
}

.section-header .section-subtitle {
    display: table !important;
    margin: 0 auto 14px auto !important;
}

/* 10. Course Layout & 2-Column Content Left-Alignment Fixes */
.main-content-container .section-title {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.main-content-container .section-subtitle {
    text-align: left !important;
    display: inline-table !important;
    margin: 0 0 14px 0 !important;
    padding: 0 18px !important;
}

.main-content-container .about-desc {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.course-layout {
    display: grid !important;
    grid-template-columns: 1.5fr 0.5fr !important;
    gap: 36px !important;
    align-items: start !important;
}

@media (max-width: 992px) {
    .course-layout {
        grid-template-columns: 1fr !important;
        gap: 36px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .sidebar-container {
        order: 2 !important;
        position: static !important;
    }
    .main-content-container {
        order: 1 !important;
    }
}


