/* ================================================================
   ARAM HUB — Responsive Fixes
   Targets: mobile (<768px), tablet (768–991px), desktop (992px+)
================================================================ */

/* ── 1. Typography — Scale down large headings on mobile ── */
@media (max-width: 767px) {
    .inh1  { font-size: 28px !important; line-height: 1.3 !important; }
    .inh1h { font-size: 24px !important; line-height: 1.3 !important; }
    .inh2  { font-size: 22px !important; line-height: 1.3 !important; }
    .inh3  { font-size: 20px !important; }
    .inh4  { font-size: 16px !important; }
    .inp1p { font-size: 15px !important; line-height: 1.6 !important; }
    p[style*="font-size: 27px"],
    p[style*="font-size:27px"] { font-size: 17px !important; line-height: 1.6 !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
    .inh1  { font-size: 36px !important; }
    .inh2  { font-size: 30px !important; }
}

/* ── 2. Navbar margins ── */
@media (max-width: 991px) {
    .navbar { margin: 0 !important; padding-left: 16px !important; padding-right: 16px !important; }
    /* Zero out container-fluid inner padding so total stays 16px (not 28px) */
    .navbar .container-fluid { padding-left: 0 !important; padding-right: 0 !important; }
}

/* ── 3. Partner logos — swipe carousel (rebuilt via JS on mobile) ── */
@media (max-width: 991px) {
    /* Base fallback if JS hasn't run yet */
    .container-fluid.web-m .row {
        height: auto !important;
        flex-wrap: wrap !important;
        padding: 16px 0 !important;
    }
    /* Desktop: hide carousel dots */
}

/* ── 3b. Mobile hero image — full bleed to right edge ── */
@media (max-width: 990px) {
    /* Container holds the mobile hero; remove right padding so image bleeds to edge */
    .program-m.container {
        max-width: 100% !important;
        padding-right: 0 !important;
    }
    /* Image fills full column width */
    .program-m .col-12:last-child {
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 100%;
        max-width: 100% !important;
    }
    .program-m .col-12:last-child img {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
    }
}

/* ── 3b. Hero sections — remove fixed heights ── */
@media (max-width: 991px) {
    .program-w[style*="height: 690px"],
    .program-w[style*="height:690px"] {
        height: auto !important;
        min-height: 320px !important;
        padding: 40px 20px !important;
        overflow: visible !important;
    }
    .index-ws1.program-w {
        height: auto !important;
        min-height: 400px !important;
        padding-top: 40px !important;
        margin-top: 0 !important;
    }
}
@media (max-width: 767px) {
    /* Collapse all fixed-height rows */
    div[style*="height: 600px"],
    div[style*="height: 720px"],
    div[style*="height: 700px"],
    div[style*="height: 712px"] { height: auto !important; min-height: unset !important; }

    div[style*="height: 690px"] { height: auto !important; min-height: 200px !important; }

    /* Large horizontal padding */
    div[style*="padding:0px 130px"],
    div[style*="padding: 0 0 0 104px"],
    div[style*="padding:0 0 0 104px"] { padding: 30px 16px !important; }

    /* 1360px containers */
    div[style*="max-width: 1360px"],
    div[style*="max-width:1360px"] { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ── 4. Sidebar (social icons column) — hide on mobile ── */
@media (max-width: 767px) {
    .col-1[style*="padding-left: 42px"],
    .col-1[style*="padding-left:42px"] { display: none !important; }
}

/* ── 5. Fixed-width cards (.indexoo, .indexio) ── */
@media (max-width: 767px) {
    .indexoo { max-width: 100% !important; width: 100% !important; }
    .indexio { max-width: 100% !important; width: 100% !important; }
    .indexwq { flex-direction: column !important; }
    .indexwq .col { width: 100% !important; max-width: 100% !important; text-align: center !important; }
}

/* ── 6. Course/Program info sidebar (.inh5di, .inh5diqq) ── */
@media (max-width: 991px) {
    .inh5di, .inh5diqq {
        width: 100% !important;
        height: auto !important;
        margin: 24px 0 0 0 !important;
        text-align: center !important;
    }
    .inh5di button, .inh5diqq button,
    .inh5di a, .inh5diqq a { margin-left: 0 !important; }
}

/* ── 7. Contact form (.qwe) ── */
@media (max-width: 991px) {
    .qwe { width: 100% !important; padding: 0 20px !important; }
}
@media (max-width: 767px) {
    /* Remove hardcoded max-width on form fields */
    .qwe .col-md-6[style*="max-width: 324px"],
    .qwe .col-md-6[style*="max-width:324px"] { max-width: 100% !important; }
    div[style*="width: 63px"] { display: none !important; }
}

/* ── 8. Courses section (.indextyy) ── */
@media (max-width: 991px) {
    .indextyy { width: 100% !important; padding: 0 16px !important; }
    .indexroo { flex-direction: column !important; }
    .indexroo .col { max-width: 100% !important; }
}

/* ── 9. Programs page cards (large fixed-size cards) ── */
@media (max-width: 991px) {
    div[style*="max-width: 406px"] { max-width: 100% !important; width: 100% !important; }
    div[style*="height: 341px"]    { height: auto !important; min-height: 200px !important; }
    div[style*="width: 985px"],
    div[style*="width:985px"]      { width: 100% !important; }
    div[style*="height: 558px"],
    div[style*="height:558px"]     { height: auto !important; }
}

/* ── 10. Spacer divs — shrink on mobile ── */
@media (max-width: 767px) {
    div[style*="height: 100px"] { height: 40px !important; }
    div[style*="height: 80px"]  { height: 80px !important; }
    div[style*="height: 68.7px"]{ height: 24px !important; }
    div[style*="height: 54px"]  { height: 20px !important; }
    div[style*="height: 50px"]  { height: 20px !important; }
    div[style*="height: 45px"]  { height: 20px !important; }
    div[style*="height: 40px"]  { height: 16px !important; }
    div[style*="height: 36px"]  { height: 14px !important; }
    div[style*="height: 30px"]  { height: 12px !important; }
    div[style*="height: 117px"] { height: 40px !important; }
}

/* ── 11. Hero images — constrain on mobile ── */
@media (max-width: 767px) {
    .col[style*="text-align: end"] img,
    .col[style*="text-align:end"]  img { max-width: 100% !important; padding-top: 20px !important; }
}

/* ── 12. Package/Course cards homepage ── */
@media (max-width: 767px) {
    div[style*="width: 290px"] { width: 100% !important; max-width: 320px !important; margin: 0 auto !important; }
    .indexwq { justify-content: center !important; }
}

/* ── 13. Event detail — row buttons ── */
@media (max-width: 767px) {
    .idexwe { flex-direction: column !important; gap: 12px !important; }
    .idexwe .col { text-align: center !important; }
    .indexplm { flex-direction: column !important; gap: 8px !important; }
    .indexplm .col { margin-bottom: 6px !important; }
}

/* ── 14. col-7 → full width on mobile ── */
@media (max-width: 767px) {
    .col-7 { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
}

/* ── 15. Footer columns — stack on mobile ── */
@media (max-width: 991px) {
    .fo-w .col-3 { flex: 0 0 100%; max-width: 100%; text-align: center; margin-top: 20px; }
    .fo-w .col   { flex: 0 0 50%;  max-width: 50%; }
    .fo-w .col-4 { flex: 0 0 100%; max-width: 100%; }
    .fo-w .row .col-6 { flex: 0 0 100%; max-width: 100%; text-align: center !important; }
}
@media (max-width: 767px) {
    .fo-w { padding: 0 16px !important; }
    .fo-w .col { flex: 0 0 100% !important; max-width: 100% !important; }
}

/* ── 16. Search overlay on mobile ── */
@media (max-width: 767px) {
    #search-overlay { padding-top: 20px !important; align-items: flex-start !important; }
    #search-overlay > div { padding: 0 16px !important; }
    #search-overlay-form input { font-size: 15px !important; }
    #search-live-results { max-height: 60vh !important; }
}

/* ── 17. Search results page ── */
@media (max-width: 767px) {
    .sr-bar input   { font-size: 14px !important; }
    .sr-card        { flex-wrap: nowrap; padding: 12px 14px; }
    .sr-card-title  { font-size: 14px !important; }
    .sr-tabs        { gap: 6px; }
    .sr-tab         { padding: 6px 12px; font-size: 12px; }
}

/* ── 18. All-events page margins ── */
@media (max-width: 991px) {
    div[style*="margin: 0 90px"],
    div[style*="margin: 0 80px"] { margin: 0 16px !important; }
}

/* ── 19. Nav collapse spacing ── */
@media (max-width: 991px) {
    .navbar-collapse { padding: 12px 0; border-top: 1px solid #f0f0f0; margin-top: 8px; }
    .navbar-nav .nav-item { margin: 4px 0; }
    .navbar-collapse .btn-group { margin: 8px 0 !important; width: 100%; }
}

/* ── 20. All images responsive by default ── */
img { max-width: 100%; }

/* ══════════════════════════════════════════════════════════════
   21. Footer — fix gap at 991px (new.css gap between
       max-width:990px and min-width:992px breakpoints)
══════════════════════════════════════════════════════════════ */

/* At exactly 991px — force mobile footer, hide desktop footer */
@media (min-width: 991px) and (max-width: 991px) {
    .fo-w { display: none !important; }
    .fo-m {
        display: block !important;
        background: url('../img/index/oo112233.svg') center/cover !important;
        height: auto !important;
        min-height: 450px;
        padding-bottom: 30px !important;
    }
}

/* ── 22. Mobile footer — remove fixed height to prevent content overflow ── */
@media (max-width: 990px) {
    .fo-m {
        height: auto !important;
        min-height: 450px;
        padding-bottom: 30px !important;
        background-size: cover !important;
    }
}

/* ── 23. Prevent horizontal scroll on mobile ── */
@media (max-width: 767px) {
    body { overflow-x: hidden; }
}

/* ── 24. Search button text — hidden on desktop, visible on mobile ── */
.search-btn-text { display: none; }

/* ── 25. Navbar mobile — full menu redesign ── */
@media (max-width: 991px) {

    /* ── Collapse container ── */
    .navbar-collapse {
        background: #ffffff !important;
        border-radius: 14px !important;
        box-shadow: 0 6px 24px rgba(0,0,0,.09) !important;
        border: 1px solid #eef0f3 !important;
        margin: 8px 4px 0 !important;
        padding: 8px 0 12px !important;
    }

    /* ── Nav links ── */
    .navbar-collapse .navbar-nav {
        padding: 0 10px;
        gap: 2px;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 8px;
        margin-bottom: 4px;
    }
    .navbar-collapse .nav-item {
        margin: 0 !important;
    }
    .navbar-collapse .nav-link {
        padding: 10px 14px !important;
        border-radius: 10px;
        font-size: 15px !important;
        font-weight: 600;
        color: #185b33 !important;
        text-align: left !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link.active {
        background: #f0faf5 !important;
        color: #185b33 !important;
    }
    .navbar-collapse .nav-link.active {
        color: #E4AF47 !important;
    }

    /* ── Events dropdown inside menu ── */
    .navbar-collapse .dropdown-menu {
        position: static !important;
        float: none !important;
        border: none !important;
        box-shadow: none !important;
        background: #f7faf8 !important;
        border-radius: 10px !important;
        padding: 4px 8px !important;
        margin: 4px 14px !important;
        width: auto !important;
    }
    .navbar-collapse .dropdown-menu .dropdown-item {
        font-size: 14px;
        border-radius: 8px;
        padding: 8px 12px !important;
    }
    .navbar-collapse .dropdown-menu .dropdown-item:hover {
        background: #e8f5ed;
    }

    /* ── Separator ── */
    .navbar-collapse .nav-separator {
        border-top: 1px solid #f0f0f0;
        margin: 8px 14px;
    }

    /* ── Guest: login + signup side by side ── */
    .auth-btns-wrap {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 10px 14px;
        border-top: 1px solid #f0f0f0;
        margin-top: 4px;
    }
    .auth-btns-wrap > a:first-child {
        display: inline-flex !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    /* ── Login button: match line-height to Sign up ── */
    .auth-btns-wrap .element {
        padding: 7px 22px !important;
        line-height: 1.4 !important;
    }

    /* Sign up — same shape as Login but green */
    .auth-signup-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: linear-gradient(to bottom, #185b33, #2d8a54) !important;
        color: #fff !important;
        padding: 7px 22px !important;
        border-radius: 12px !important;
        border: solid 2px #185b33 !important;
        font-size: 15px !important;
        font-weight: 700;
        text-decoration: none !important;
        transition: all .3s;
        margin: 0 !important;
        white-space: nowrap;
        line-height: 1.4 !important;
    }
    .auth-signup-btn:hover {
        background: #fff !important;
        color: #185b33 !important;
    }

    /* ── Auth area — authenticated user dropdown ── */
    .navbar-collapse .btn-group {
        display: flex !important;
        justify-content: center;
        width: 100%;
        padding: 8px 14px;
        margin: 4px 0 0 !important;
        border-top: 1px solid #f0f0f0;
    }
    .navbar-collapse .btn-group .btn {
        min-width: 120px;
    }

    /* ── Mobile inline search form ── */
    .mobile-search-form {
        padding: 8px 14px 4px;
    }
    .mobile-search-wrap {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #f9f9f9;
        border: 1.5px solid #e5e7eb;
        border-radius: 10px;
        padding: 8px 10px;
        transition: border-color .2s, background .2s;
    }
    .mobile-search-wrap:focus-within {
        border-color: #185b33;
        background: #fff;
    }
    .mobile-search-input {
        flex: 1;
        border: none;
        background: transparent;
        outline: none;
        font-size: 14px;
        color: #0e1726;
        font-family: 'Josefin Sans', sans-serif;
        min-width: 0;
    }
    .mobile-search-input::placeholder {
        color: #adb5bd;
    }
    .mobile-search-submit {
        background: #185b33;
        border: none;
        border-radius: 7px;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background .2s;
    }
    .mobile-search-submit:hover {
        background: #2d8a54;
    }
}

/* ── 26. auth-btns-wrap — preserve desktop layout ── */
@media (min-width: 992px) {
    .auth-btns-wrap {
        display: inline-flex;
        align-items: center;
        vertical-align: middle;
    }
    /* Sign up on desktop stays as text link (existing .signup style from new.css) */
    .auth-signup-btn {
        display: inline !important;
        background: none !important;
        color: #E4AF47 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        font-size: 16px !important;
        font-weight: 400;
    }
}

/* ── 27. Feature cards section — tablet bottom spacing ── */
@media (min-width: 768px) and (max-width: 1024px) {
    .home-features {
        padding-bottom: 40px;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   28. AUDIENCE TABS SECTION — Mobile & Tablet
   Fixes: tab overflow, fixed heights, inconsistent spacing
══════════════════════════════════════════════════════════════════════ */

/* ── Outer wrapper ── */
@media (max-width: 991px) {
    .program-w-s1  { overflow-x: hidden; width: 100%; }
    .program-w-s11 {
        max-width: 100% !important;
        margin: 32px auto !important;
        padding: 0 16px !important;
    }
}

/* ── Mobile tabs (≤ 991px) — 2 per row, original link style ── */
@media (max-width: 991px) {
    .program-m-s111 {
        display: block;
        overflow-x: hidden;
        width: 100%;
        margin-top: 20px !important;
    }
    .program-m-s111 ul.navbar-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none;
        gap: 0 !important;
    }
    /* Each tab: exactly 50% → 2 per row */
    .program-m-s111 .nav-item {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin: 0 !important;
        text-align: center;
        padding: 6px 4px !important;
    }
    /* Keep original link style — no button shape */
    .program-m-s111 .nav-link1 {
        font-size: 16px !important;
        padding: 6px 8px !important;
        color: #185b33 !important;
        display: block;
        text-align: center;
        font-weight: 600;
        text-decoration: none;
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        line-height: 1.4;
    }
    .program-m-s111 .nav-link1.active {
        color: #E4AF47 !important;
        background: none !important;
        border: none !important;
        font-weight: 700;
    }
    .program-m-s111 .nav-link1:hover {
        color: #E4AF47 !important;
        background: none !important;
    }
}

/* ── Tab swipe: smoother fade transition on mobile ── */
@media (max-width: 991px) {
    #myTabContent .tab-pane.fade {
        transition: opacity .3s ease !important;
    }
    /* Dots: hide on desktop (built by JS but safety net) */
    #tab-swipe-dots { display: flex; }
}
@media (min-width: 992px) {
    #tab-swipe-dots { display: none !important; }
}

/* ── Tab content — Mobile (< 768px): stacked layout ── */
@media (max-width: 767px) {
    .indexss {
        height: auto !important;
        min-height: unset !important;
        padding: 28px 0 36px !important;
        overflow: visible !important;
        background-size: cover !important;
    }
    .indexww {
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 20px;
    }
    .indexww .col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        align-self: auto !important;
        text-align: center !important;
        padding: 0 !important;
    }
    .indeximm {
        max-width: 280px !important;
        margin: 0 auto;
        display: block;
    }
    .indexinh2 {
        font-size: 26px !important;
        line-height: 1.35 !important;
        text-align: center !important;
        padding: 0 16px;
    }
    .indexpp {
        padding: 0 20px !important;
        text-align: center !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .indexpm { text-align: center !important; }
    .indexhh1, .indexhh2 { height: 10px !important; }
}

/* ── Tab content — Tablet (768–991px): side-by-side layout ── */
@media (min-width: 768px) and (max-width: 991px) {
    .indexss {
        height: auto !important;
        padding: 32px 24px 40px !important;
        overflow: visible !important;
    }
    .indexww {
        height: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0;
    }
    .indexww .col {
        flex: 1 !important;
        align-self: center !important;
    }
    .indexww .col:first-child {
        max-width: 45% !important;
        text-align: center !important;
    }
    .indexww .col:last-child {
        max-width: 55% !important;
        padding-left: 28px !important;
    }
    .indeximm { max-width: 90% !important; }
    .indexinh2 {
        font-size: 30px !important;
        line-height: 1.3 !important;
        text-align: left !important;
    }
    .indexpp {
        text-align: left !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    .indexpm { text-align: left !important; }
    .indexhh1, .indexhh2 { height: 14px !important; }
}

/* ── Footer mobile — link spacing ── */
@media (max-width: 990px) {
    .fo-m li {
        margin: 6px 0;
    }
    .fo-m .co11 {
        margin-top: 4px;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   29. HORIZONTAL PADDING CONSISTENCY
   Standard: Mobile 20px | Tablet 28px | Desktop untouched
   Ensure no element touches screen edges on any section.
══════════════════════════════════════════════════════════════════════ */

/* ── Footer mobile container: Bootstrap default is 12px — fix to 20px/28px ── */
@media (max-width: 767px) {
    .fo-m .container-fluid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}
@media (min-width: 768px) and (max-width: 990px) {
    .fo-m .container-fluid {
        padding-left: 28px !important;
        padding-right: 28px !important;
    }
}

/* ── Search results page: fix Bootstrap container 12px → 20px on mobile ── */
@media (max-width: 767px) {
    .sr-page > .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .sr-page > .container {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
}
