/* ==========================================================================
   ISHT – Responsive overrides (mobile-first: base styles target phones,
   these media queries progressively enhance for larger screens)
   ========================================================================== */

/* Small phones */
@media (max-width: 379.98px) {
  .brand-logo { height: 40px; }
  .btn { padding: .65rem 1.15rem; }
  .hero-content .btn { width: 100%; }
}

/* Phones & small tablets (below lg): collapsed navigation */
@media (max-width: 991.98px) {
  .site-header .navbar-collapse {
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: .75rem 0 1.25rem;
    border-top: 1px solid var(--isht-border);
    margin-top: .4rem;
  }
  .navbar-nav .nav-link { padding: .75rem .5rem; border-bottom: 1px solid var(--isht-light-grey); }
  .navbar-nav .nav-link.active { background: var(--isht-light-blue); padding-left: .9rem; }
  .header-actions { flex-direction: column; align-items: stretch !important; gap: .75rem !important; margin-top: 1rem; }
  .header-actions .btn { width: 100%; }
  .hero-carousel .carousel-item { min-height: 600px; }
  .hero-carousel .hero-bg { object-position: 78% center; opacity: .55; }
  .hero-carousel .carousel-item::after { background: linear-gradient(180deg, rgba(16,45,112,.82) 0%, rgba(16,45,112,.9) 100%); }
  .hero-carousel .slide-2::after { background: linear-gradient(180deg, rgba(7,70,150,.85) 0%, rgba(5,60,135,.92) 100%); }
  .hero-content { padding: 56px 0 100px; }
  .hero-carousel .carousel-control-prev, .hero-carousel .carousel-control-next { display: none; }
  .page-hero-image::before { background: linear-gradient(180deg, rgba(16,45,112,.88), rgba(16,45,112,.92)); }
}

@media (max-width: 575.98px) {
  .section { padding: 52px 0; }
  .form-card { padding: 1.15rem; border-radius: 16px; }
  .cta-band { padding: 2.25rem 1.25rem; border-radius: 18px; }
  .stage-card { padding: 1.5rem; }
  .timeline li { padding-left: 64px; }
  .map-wrap iframe { height: 300px; }
  .whatsapp-float { width: 52px; height: 52px; right: 14px; bottom: 14px; font-size: 1.6rem; }
  .scroll-top { right: 18px; bottom: 76px; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: .5rem; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; scrollbar-width: thin; }
  .btn-filter { flex: 0 0 auto; }
}

/* Tablets and up */
@media (min-width: 576px) {
  .form-card { padding: 2rem; }
}

@media (min-width: 768px) {
  .section { padding: 80px 0; }
  .partner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cta-band { padding: 3.5rem 3rem; }
}

/* Desktop */
@media (min-width: 992px) {
  :root { --header-h: 84px; }
  .brand-logo { height: 56px; }
  .section { padding: 96px 0; }
  .hero-carousel .carousel-item { min-height: 620px; }
  .hero-content { padding: 110px 0 120px; }
  .navbar-nav .nav-link::after {
    content: ''; position: absolute; left: .75rem; right: .75rem; bottom: .25rem; height: 2px; border-radius: 2px;
    background: var(--isht-cyan); transform: scaleX(0); transition: transform .2s ease;
  }
  .navbar-nav .nav-link:hover::after, .navbar-nav .nav-link.active::after { transform: scaleX(1); }
  .page-hero { padding: 80px 0 72px; }
  .page-hero-image { padding: 120px 0; }
  .partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-card.sticky-lg { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* Large desktop: tighten nav spacing so all links fit */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .navbar-nav .nav-link { padding: .5rem .45rem; font-size: .9rem; }
  .navbar-nav .nav-link::after { left: .45rem; right: .45rem; }
  .header-call { display: none; }
  .brand-logo { height: 48px; }
}

@media (min-width: 1400px) {
  .hero-carousel .carousel-item { min-height: 660px; }
}

/* Touch devices: no hover lift */
@media (hover: none) {
  .feature-card:hover, .course-card:hover, .why-item:hover, .related-card:hover, a.contact-card:hover { transform: none; }
}

/* Keep nav items on one line; show the header phone only on wide screens (it is always in the top bar) */
.navbar-nav .nav-link, .header-actions .btn { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1399.98px) {
  .header-call { display: none; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .navbar-nav .nav-link { padding: .55rem .6rem; }
}

/* Photos */
@media (max-width: 991.98px) {
  .hero-carousel .hero-bg { opacity: 1; object-position: center; }
  .hero-carousel .carousel-item::after, .hero-carousel .slide-2::after, .hero-carousel .slide-3::after {
    background: linear-gradient(180deg, rgba(16,45,112,.62) 0%, rgba(16,45,112,.82) 55%, rgba(16,45,112,.92) 100%);
  }
  .page-hero-photo { aspect-ratio: 16 / 9; }
}
@media (max-width: 575.98px) {
  .stage-photo { margin: -1.5rem -1.5rem 1.25rem; height: 180px; }
}
@media (min-width: 768px) {
  .gallery-grid { grid-auto-rows: 210px; }
}
@media (min-width: 992px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 230px; gap: 1rem; }
  .hero-carousel .hero-bg { object-position: center; }
}

/* Desktop: open the Placement Support dropdown on hover */
@media (hover: hover) and (min-width: 992px) {
  .site-header .dropdown-menu { margin-top: 0; border-radius: 12px; padding: .5rem; min-width: 260px; }
  .site-header .dropdown-menu .dropdown-item { border-radius: 8px; padding: .6rem .9rem; font-family: 'Poppins', sans-serif; font-weight: 500; color: var(--isht-navy); }
  .site-header .dropdown-menu .dropdown-item:hover, .site-header .dropdown-menu .dropdown-item:focus { background: var(--isht-light-blue); color: var(--isht-blue); }
  .site-header .dropdown-menu .dropdown-item.active { background: var(--isht-blue); color: #fff; }
  .site-header .nav-item.dropdown::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 10px; } /* hover bridge */
}

@media (max-width: 991.98px) {
  .hero-video-wrap::after { background: linear-gradient(180deg, rgba(16,45,112,.8) 0%, rgba(16,45,112,.88) 60%, rgba(16,45,112,.94) 100%); }
}

/* ==========================================================================
   Mobile menu – dark panel, underlined items, +/− submenu toggle
   ========================================================================== */
.nav-plus { display: none; }
.navbar-toggler .bi-x-lg { display: none; }

@media (max-width: 991.98px) {
  .navbar-toggler[aria-expanded="true"] .bi-list { display: none; }
  .navbar-toggler[aria-expanded="true"] .bi-x-lg { display: inline-block; font-size: 1.35rem; }
  .navbar-toggler[aria-expanded="true"] { border-color: var(--isht-navy); background: var(--isht-navy); }
  .navbar-toggler[aria-expanded="true"] .bi { color: #fff; }

  .site-header .navbar-collapse {
    background: #0B1E4D;
    margin: .4rem calc(-.5 * var(--bs-gutter-x, 1.5rem)) -.4rem;
    padding: .25rem 22px 1.5rem;
    border-top: 3px solid var(--isht-cyan);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .site-header .navbar-nav .nav-link {
    display: flex; align-items: center; justify-content: space-between;
    color: #fff; font-size: 1.05rem; font-weight: 500;
    padding: .95rem 0; border-radius: 0; background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
  }
  .site-header .navbar-nav .nav-link:hover,
  .site-header .navbar-nav .nav-link:focus-visible { color: var(--isht-cyan); }
  .site-header .navbar-nav .nav-link.active { color: var(--isht-cyan); background: transparent; padding-left: 0; }

  /* + / − button for items with a submenu */
  .site-header .dropdown-toggle::after { display: none; }
  .nav-plus {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px; color: #fff; font-size: 1.05rem;
    background: rgba(255, 255, 255, .08);
  }
  .nav-plus::before { content: '\F64D'; font-family: 'bootstrap-icons'; }
  .dropdown-toggle[aria-expanded="true"] .nav-plus { background: var(--isht-cyan); color: var(--isht-navy); }
  .dropdown-toggle[aria-expanded="true"] .nav-plus::before { content: '\F63B'; }

  /* Submenu: white rounded card */
  .site-header .navbar-nav .dropdown-menu {
    background: #fff; border: 0; border-radius: 14px; box-shadow: none;
    margin: .75rem 0; padding: .35rem 1rem;
  }
  .site-header .navbar-nav .dropdown-item {
    color: var(--isht-navy); font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .95rem;
    padding: .75rem .1rem; border-bottom: 1px solid var(--isht-border); white-space: normal;
  }
  .site-header .navbar-nav .dropdown-menu li:last-child .dropdown-item { border-bottom: 0; }
  .site-header .navbar-nav .dropdown-item:hover,
  .site-header .navbar-nav .dropdown-item:focus { background: transparent; color: var(--isht-blue); }
  .site-header .navbar-nav .dropdown-item.active { background: transparent; color: var(--isht-blue); }

  /* Call + Enquire inside the dark panel */
  .site-header .header-actions { margin-top: 1.25rem; }
  .site-header .header-call { color: #fff; display: block; text-align: center; padding: .5rem 0; }
  .site-header .header-call .bi { color: var(--isht-cyan); }
  .site-header .header-actions .btn-isht {
    --bs-btn-bg: var(--isht-cyan); --bs-btn-border-color: var(--isht-cyan); --bs-btn-color: var(--isht-navy);
    --bs-btn-hover-bg: #3BD0D2; --bs-btn-hover-border-color: #3BD0D2; --bs-btn-hover-color: var(--isht-navy);
    box-shadow: none;
  }
}

/* ==========================================================================
   Nav submenus: arrow indicator (desktop) + Courses mega menu
   ========================================================================== */
.nav-caret { display: none; }
.site-header .dropdown-item .bi { color: var(--isht-cyan-dark); font-size: 1rem; width: 1.25rem; text-align: center; flex: 0 0 1.25rem; }
.site-header .dropdown-item { display: flex; align-items: center; gap: .6rem; }

@media (min-width: 992px) {
  /* Replace Bootstrap's caret with a chevron; keep the hover underline (::after) */
  .site-header .navbar-nav .dropdown-toggle::after { border: 0; margin: 0; vertical-align: 0; }
  .nav-caret { display: inline-block; font-size: .7rem; margin-left: .3rem; -webkit-text-stroke: .5px; transition: transform .2s ease; }
  .dropdown-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

  .site-header .dropdown-menu.dropdown-mega {
    display: none; width: 600px; padding: .6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: .25rem;
  }
  .site-header .dropdown-menu.dropdown-mega.show { display: grid; }
  .site-header .dropdown-mega .mega-all { grid-column: 1 / -1; border-bottom: 1px solid var(--isht-border); margin-bottom: .35rem; padding-bottom: .35rem; }
  .site-header .dropdown-mega .mega-all .dropdown-item { font-weight: 600; color: var(--isht-blue); }
  .site-header .dropdown-mega .dropdown-item { font-size: .9rem; padding: .5rem .7rem; white-space: normal; }
  .site-header .dropdown-menu .dropdown-item.active .bi { color: #fff; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-header .dropdown-menu.dropdown-mega { width: 540px; }
}

@media (max-width: 991.98px) {
  /* Long course list: keep the white card scrollable inside the panel */
  .site-header .navbar-nav .dropdown-mega { max-height: 55vh; overflow-y: auto; }
  .site-header .navbar-nav .dropdown-mega .mega-all .dropdown-item { color: var(--isht-blue); }
}

/* Full ISHT logo (with tagline) in the header */
.site-header .brand-logo { height: 58px; width: auto; }
@media (min-width: 992px) { .site-header .brand-logo { height: 70px; } }
@media (min-width: 992px) and (max-width: 1199.98px) { .site-header .brand-logo { height: 62px; } }
.site-header .navbar-brand { flex-shrink: 0; }
.site-header .brand-logo { max-width: none; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-header .navbar-brand { margin-right: .75rem !important; }
  .site-header .brand-logo { height: 58px; }
  .navbar-nav .nav-link { padding: .5rem .38rem; font-size: .88rem; }
  .site-header .header-actions .btn { padding: .55rem 1rem; font-size: .9rem; }
}

/* Social icons inside the dark mobile menu */
@media (max-width: 991.98px) {
  .site-header .mobile-social { display: flex; align-items: center; justify-content: center; gap: .6rem; padding-top: .5rem; color: rgba(255,255,255,.75); font-size: .9rem; }
  .site-header .mobile-social a { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); color: #fff; font-size: 1.1rem; }
  .site-header .mobile-social a:hover { background: var(--isht-cyan); color: var(--isht-navy); }
}
