/**
 * CodeNameDojo — global mobile responsiveness (loads after theme CSS).
 */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

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

.container,
.container-fluid {
    padding-left: clamp(12px, 4vw, 15px);
    padding-right: clamp(12px, 4vw, 15px);
}

/* Prevent wide content from forcing horizontal scroll */
section,
main,
.header-area,
.footer-area {
    max-width: 100%;
}

/* Tables */
.table-responsive,
.cnd-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.eTable,
table.table {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .eTable,
    .ol-body-content table,
    section .table:not(.table-responsive .table) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Modals & video */
.modal-dialog {
    margin: 0.75rem auto;
    max-width: calc(100% - 1.5rem);
}

#promoVideo .modal-dialog,
#promoVideo .modal-body {
    max-width: 100%;
}

#promoVideo iframe,
.plyr__video-embed iframe {
    width: 100%;
    min-height: 220px;
    height: min(56vw, 420px);
}

/* Header */
@media (max-width: 991.98px) {
    .header-area .header-menu,
    .header-area .nav-menu > .primary-menu.main-menu-ul {
        display: none !important;
    }

    .header-area > .container > .row {
        flex-wrap: wrap;
        align-items: center;
        row-gap: 0.35rem;
    }

    .header-area .logo-image img {
        max-height: 46px;
        width: auto;
    }

    .header-area .primary-end {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem;
    }

    .header-area .Esearch_entry {
        margin-left: 0 !important;
        margin-top: 0.25rem !important;
    }

    .offcanvas-body .primary-menu.main-menu-ul {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    .offcanvas-body .primary-menu.main-menu-ul > li {
        width: 100%;
    }

    .offcanvas-body .primary-menu.main-menu-ul a {
        width: 100%;
        padding: 0.65rem 0.5rem;
    }
}

/* Hero & CTAs */
@media (max-width: 767.98px) {
    .banner-title,
    .hero-banner-content h1,
    .home1-banner-content h1 {
        font-size: clamp(1.45rem, 6vw, 2rem) !important;
        line-height: 1.25 !important;
    }

    .learn-btn,
    .eBtn.learn-btn,
    .gradient-border-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        max-width: 100%;
    }

    .gradient-border2 {
        width: 100% !important;
        max-width: 100%;
    }

    .gradient-border-btn {
        width: 100% !important;
    }
}

/* Feature cards swiper (homepage) */
@media (max-width: 991.98px) {
    .home-features-section {
        overflow: hidden;
    }

    .home-feature-card {
        min-height: 100%;
    }
}

/* Footer */
@media (max-width: 767.98px) {
    .footer-area .row > [class*='col-'] {
        margin-bottom: 1.25rem;
    }

    .footer-content .f-socials {
        flex-wrap: wrap;
    }

    .newslater-form {
        flex-direction: column;
        gap: 0.5rem;
    }

    .newslater-form .eBtn,
    .newslater-form .form-control {
        width: 100%;
    }
}

/* Course & blog grids */
@media (max-width: 575.98px) {
    .course-card,
    .blog-card,
    .Ecard {
        margin-bottom: 1rem;
    }
}

/* Forms */
@media (max-width: 767.98px) {
    .form-control,
    .ol-form-control,
    .nice-select,
    .select2-container {
        max-width: 100%;
    }

    .btn,
    .eBtn {
        white-space: normal;
    }
}

/* Touch-friendly controls */
@media (max-width: 767.98px) {
    .btn,
    .eBtn,
    .nav-link,
    .offcanvas-body a {
        min-height: 44px;
    }
}

/* Utility */
.cnd-hide-mobile {
    display: none !important;
}

@media (min-width: 768px) {
    .cnd-hide-mobile {
        display: initial !important;
    }

    .cnd-hide-desktop {
        display: none !important;
    }
}
