﻿/* ============================================================
   MPSP — responsive.css
   Media query breakpoint overrides ONLY
   Breakpoints (Bootstrap 5 aligned):
     xs  < 576px   — mobile portrait
     sm  576–767px — mobile landscape / small tablet
     md  768–991px — tablet
     lg  992–1199px — small desktop
     xl  ≥1200px   — desktop (full layout; style.css handles this)
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   < 1200px  (lg and below)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1199.98px) {

  .hero-title        { font-size: clamp(26px, 4vw, 42px); }
  .hero-main-img     { height: 420px; }
  .about-img-wrap img { height: 400px; }

  .mpsp-navbar .nav-link { padding: 10px 12px !important; font-size: 14.5px; }

  .identity-name { font-size: clamp(18px, 2.5vw, 30px); }
}

/* ══════════════════════════════════════════════════════════════
   < 992px  (md and below — tablet)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {

  /* --- Topbar --- */
  .topbar-left  { gap: 10px; font-size: 12px; }
  .topbar-right { justify-content: flex-end; }
  .topbar-divider { display: none; }

  /* --- Identity bar: hide left logo col, compress center --- */
  .identity-logo-left  { display: none; }
  .identity-logo-right { justify-content: center; }
  .identity-center     { text-align: center; padding: 6px 0; }
  .identity-name       { font-size: clamp(17px, 3.5vw, 26px); }
  .identity-parent     { font-size: 12px; }
  .identity-affiliation { font-size: 12px; }

  /* --- Navbar --- */
  .mpsp-navbar {
    padding: 10px 0;
  }

  /* Mobile nav menu spacing */
  .mpsp-navbar .navbar-collapse {
    background:    #fff;
    border-top:    1px solid var(--border);
    padding:       16px;
    margin-top:    10px;
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
  }

  .mpsp-navbar .nav-link::after { display: none; }

  .mpsp-navbar .nav-link {
    padding:       10px 8px !important;
    border-bottom: 1px solid var(--border);
    font-size:     14px;
  }

  .mpsp-navbar .nav-link:last-child { border-bottom: none; }

  .mpsp-navbar .dropdown-menu {
    box-shadow: none;
    border:     none;
    border-top: 2px solid var(--accent);
    padding:    6px 0 6px 16px;
    margin:     0;
  }

  .mpsp-navbar .btn-apply {
    margin-top: 12px;
    width:      100%;
    text-align: center;
  }

  /* --- Hero --- */
  .mpsp-hero {
    min-height: auto;
    padding:    70px 0 60px;
    text-align: center;
  }

  .mpsp-hero .row { flex-direction: column-reverse; }

  .hero-title    { font-size: clamp(26px, 5vw, 38px); }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-buttons  { justify-content: center; }

  .hero-quote-card {
    margin:     0 auto;
    max-width:  340px;
    text-align: left;
  }

  .hero-main-img {
    height:        300px;
    margin-bottom: 36px;
  }

  .hero-shape-1 { width: 80px; height: 80px; }
  .hero-shape-2 { width: 55px; height: 55px; }

  /* --- About --- */
  .about-img-wrap    { margin-bottom: 48px; }
  .about-img-wrap img { height: 340px; }

  .about-exp-badge {
    bottom: -15px;
    right:  10px;
  }

  /* --- Stats --- */
  .stat-divider { display: none; }
  .stat-item    { margin-bottom: 32px; }

  /* --- Programs --- */
  .programs-tabs { gap: 8px; }
  .programs-tabs .nav-link { padding: 8px 16px !important; font-size: 13px; }

  /* --- Apply --- */
  .apply-video-wrap img { height: 320px; }

  /* --- Facilities --- */
  .facilities-img-wrap { margin-top: 36px; }
  .facilities-img-wrap img { height: 360px; }

  /* --- Map CTA --- */
  .map-cta-card { padding: 28px; }

  /* --- Footer --- */
  .mpsp-footer          { padding: 60px 0 0; }
  .mpsp-footer .col-lg-3 { margin-bottom: 36px; }
  .footer-bottom          { text-align: center; }
  .footer-bottom .text-end { text-align: center !important; margin-top: 8px; }

  /* --- Section spacing --- */
  .mpsp-section { padding: 70px 0; }
  .mpsp-testimonials { padding: 70px 0 90px; }
}

/* ══════════════════════════════════════════════════════════════
   < 768px  (sm and below — mobile landscape / small tablet)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

  /* --- Topbar: stack vertically on very small --- */
  .mpsp-topbar .d-flex.justify-content-between {
    flex-direction: column;
    align-items:    flex-start;
    gap:            8px;
  }

  .topbar-right { width: 100%; justify-content: flex-start; }

  /* --- Identity bar: center everything, hide right logo --- */
  .identity-logo-right { display: none; }

  .mpsp-identity-bar .row {
    flex-direction: column;
    align-items:    center;
  }

  .identity-center   { width: 100%; text-align: center; padding: 4px 0; }
  .identity-name     { font-size: clamp(16px, 4.5vw, 24px); }
  .identity-parent   { font-size: 11.5px; }
  .identity-affiliation { font-size: 11.5px; }

  /* --- Section labels (all heading boxes) --- */
  .section-title    { font-size: clamp(22px, 5.5vw, 30px); padding-bottom: 12px; margin-bottom: 22px; }
  .section-subtitle { font-size: 15px; max-width: 100%; }

  /* Left-aligned heading box on tablet: stay left, tighter spacing */
  .section-label   { margin-bottom: 10px; }

  /* Centered heading box on tablet */
  .text-center .section-title    { padding-bottom: 18px; margin-bottom: 10px; }
  .text-center .section-subtitle { max-width: 100%; margin-bottom: 0; }

  /* --- Program cards: 2 columns --- */
  .program-card-col { flex: 0 0 50%; max-width: 50%; }

  /* --- Clinical training cards: full width --- */
  .clinical-card { height: 280px; }

  /* --- Events: single col --- */
  .event-img-wrap { height: 200px; }

  /* --- Testimonial card --- */
  .testimonial-card { padding: 16px 20px 32px; }
  .testimonial-quote { font-size: 15px; }

  /* --- Page banner — keep compact (base is 20px in style.css) --- */
  .banner-title { font-size: clamp(20px, 6vw, 30px); }

  /* --- Gallery grid: 2 columns --- */
  .gallery-grid-item { height: 160px; }

  /* --- Enquiry form card padding --- */
  .mpsp-form-card { padding: 28px 20px; }

  /* --- Map CTA --- */
  .map-cta-card { padding: 24px 20px; }
  .map-cta-card h4 { font-size: 18px; }

  /* --- Footer newsletter --- */
  .footer-newsletter .input-group { flex-direction: column; border-radius: var(--radius); }
  .footer-newsletter .form-control { border-radius: var(--radius-sm) !important; border: none; }
  .footer-newsletter .btn-subscribe {
    border-radius: var(--radius-sm) !important;
    padding:       12px 16px;
    width:         100%;
  }
}

/* ══════════════════════════════════════════════════════════════
   < 576px  (xs — mobile portrait)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 575.98px) {

  /* --- Topbar: single line on xs — hide 2nd phone, email, hours --- */
  .mpsp-topbar .d-flex.justify-content-between {
    flex-direction: row;          /* back to row on xs */
    align-items:    center;
  }
  .topbar-hours      { display: none; }
  .topbar-left a:not(:first-child) { display: none; } /* keep only 1st phone */
  .topbar-left .topbar-divider     { display: none; } /* hide remaining divider */
  .topbar-left  { gap: 6px; font-size: 11.5px; flex-wrap: nowrap; }
  .topbar-right { width: auto; flex-wrap: nowrap; gap: 6px; }

  /* --- Identity bar: name + parent only, compact --- */
  .mpsp-identity-bar    { padding: 12px 0; overflow: hidden; }
  .identity-name        { font-size: clamp(14px, 5vw, 20px); margin: 4px 0; }
  .identity-parent      { font-size: 10.5px; margin-bottom: 3px; }
  .identity-affiliation { display: none; }

  /* --- Inner page banner: remove override, stay at base 20px --- */

  /* --- Notice bar: smaller font --- */
  .mpsp-notice-bar { font-size: 12.5px; }

  /* --- Hero: tight --- */
  .mpsp-hero    { padding: 50px 0 46px; }
  .hero-title    { font-size: clamp(22px, 7vw, 30px); }
  .hero-subtitle { font-size: 14.5px; }
  .hero-badge    { font-size: 11.5px; padding: 5px 14px; }

  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 280px; }

  .hero-main-img { height: 230px; }

  .hero-quote-card { max-width: 100%; }
  .hero-quote-card p { font-size: 12.5px; }

  /* --- About --- */
  .about-img-wrap img { height: 260px; }

  .about-exp-badge {
    right:   6px;
    bottom: -12px;
    padding: 14px 16px;
  }

  .about-exp-badge .h2 { font-size: 28px; }

  .about-mini-box { padding: 14px; }

  /* --- Stats: 2 per row --- */
  .mpsp-stats .col-6 { margin-bottom: 28px; }
  .stat-number { font-size: clamp(30px, 8vw, 44px); }

  /* --- Programs: 1 column --- */
  .program-card-col { flex: 0 0 100%; max-width: 100%; }
  .programs-tabs .nav-link { padding: 7px 14px !important; font-size: 12.5px; }
  .program-img-wrap { height: 200px; }

  /* --- Apply steps --- */
  .apply-step { flex-direction: column; gap: 10px; }
  .apply-cta-row { flex-direction: column; }
  .apply-cta-row .btn { width: 100%; }
  .apply-video-wrap img { height: 230px; }

  /* --- Clinical cards: full width --- */
  .clinical-card { height: 240px; }

  /* --- Events --- */
  .event-img-wrap { height: 180px; }

  /* --- Facilities --- */
  .facility-item { flex-direction: column; gap: 10px; }
  .facilities-img-wrap img { height: 260px; }

  /* --- Testimonials --- */
  .testimonial-quote { font-size: 14px; }
  .testimonial-card  { padding: 12px 12px 28px; }
  .testimonial-quote::before { font-size: 56px; top: 20px; left: -4px; }

  /* --- Map CTA --- */
  .map-cta-card { margin: 0 12px; }

  /* --- Footer --- */
  .mpsp-footer   { padding: 48px 0 0; }
  .footer-heading { font-size: 15px; }
  .footer-bottom  { padding: 16px 0; }

  /* --- Inner page banner (xs) --- */
  .banner-title { font-size: clamp(18px, 7vw, 26px); }

  /* --- Gallery album grid: 2 columns --- */
  .gallery-album-card { height: 180px; }
  .gallery-grid-item  { height: 130px; }

  /* --- Downloads table: compact --- */
  .downloads-table td,
  .downloads-table th { font-size: 13px; padding: 10px 8px; }

  /* --- Faculty card image --- */
  .faculty-card img { height: 200px; }

  /* --- Section spacing --- */
  .mpsp-section      { padding: 50px 0; }
  .mpsp-testimonials { padding: 50px 0 70px; }
  .mpsp-stats        { padding: 50px 0; }
  .mpsp-partners     { padding: 44px 0; }

  /* --- General --- */
  .container { padding-left: 16px; padding-right: 16px; }

  /* Left-aligned heading box on xs mobile */
  .section-label {
    font-size:      11px;
    letter-spacing: 1.5px;
    margin-bottom:  8px;
  }
  .section-title {
    font-size:      clamp(20px, 6vw, 26px);
    padding-bottom: 12px;
    margin-bottom:  18px;
  }
  .section-subtitle {
    font-size:    13.5px;
    max-width:    100%;
    margin-bottom: 20px;
  }

  /* Centered heading box on xs mobile — overrides above */
  .text-center .section-label {
    font-size:      11px;
    letter-spacing: 1.5px;
    margin-bottom:  10px;
  }
  .text-center .section-title {
    font-size:      clamp(20px, 6.5vw, 26px);
    padding-bottom: 16px;
    margin-bottom:  6px;
  }
  .text-center .section-subtitle {
    font-size:     13.5px;
    max-width:     100%;
    margin-bottom: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL — AOS horizontal-shift overflow clip
   Prevents fade-left / fade-right from expanding body scrollWidth.
   Applied at section level so position:sticky navbar is unaffected.
   ══════════════════════════════════════════════════════════════ */
.mpsp-section,
.mpsp-hero,
.mpsp-stats,
.mpsp-notice-bar,
.mpsp-cta-band,
.mpsp-map,
.mpsp-partners,
.mpsp-topbar,
.mpsp-identity-bar,
.mpsp-page-banner,
.mpsp-footer { overflow-x: hidden; }

/* Slick track must not bleed outside its carousel wrapper */
.slick-slider { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   CONTACT PAGE — sidebar responsive fixes
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .contact-sidebar { width: 100%; max-width: 100%; box-sizing: border-box; }
  .contact-sidebar .btn { min-height: 44px; padding: 10px 20px; }
}

/* ══════════════════════════════════════════════════════════════
   ≥ 992px  (lg — enforce identity bar 3-column)
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 992px) {

  /* Ensure identity bar shows all 3 columns */
  .identity-logo-left,
  .identity-logo-right { display: flex; }

  /* Hide hamburger on desktop */
  .mpsp-navbar .navbar-toggler { display: none; }

  /* Hide navbar brand on desktop — identity bar provides branding */
  .mpsp-navbar .navbar-brand { display: none; }

  /* Full-width justified menu — override Bootstrap justify-content-end utility */
  #mpspNavMenu {
    justify-content: flex-start !important;
    flex: 1;
  }
  #mpspNavMenu .navbar-nav {
    width:           100%;
    justify-content: space-evenly;
    gap:             0 !important;
    margin-right:    0 !important;
  }

  /* Identity bar — desktop sizing */
  .identity-name { font-size: clamp(22px, 2.8vw, 36px); }

  /* ── Dropdown hover: position + flicker fix ─────────────────
     Root causes fixed:
     1. display:none/block toggle creates a gap → flicker; replaced
        with opacity+visibility so element stays in DOM always.
     2. Bootstrap 5 only adds top:100% via [data-bs-popper] (Popper JS),
        never on CSS hover alone → menu appeared at wrong position.
     3. fadeInUp started at translateY(30px) below → visible jump.
     ──────────────────────────────────────────────────────────── */

  /* Force correct position for CSS hover (no Popper running) */
  .mpsp-navbar .dropdown-menu {
    position:       absolute !important;
    top:            100% !important;
    left:           0 !important;
    margin-top:     0 !important;        /* no gap → no hover dead-zone */
    /* Always block so Popper can calculate if JS-clicked */
    display:        block !important;
    /* Hidden via opacity — no gap, no reflow, no flicker */
    opacity:        0;
    visibility:     hidden;
    pointer-events: none;
    transform:      translateY(-6px);
    transition:     opacity     0.22s ease,
                    visibility  0s   linear 0.22s,
                    transform   0.22s ease;
  }

  /* Invisible hover bridge — spans the visual offset between the toggle
     and the menu so the cursor never crosses an un-hovered gap (the #1
     cause of submenu flicker). It only intercepts the pointer while the
     menu is open. */
  .mpsp-navbar .dropdown > .dropdown-menu::before {
    content:  '';
    position: absolute;
    top:      -10px;
    left:     0;
    right:    0;
    height:   10px;
    background: transparent;
  }

  /* Show on hover OR when Bootstrap JS adds .show (click / keyboard) */
  .mpsp-navbar .dropdown:hover > .dropdown-menu,
  .mpsp-navbar .dropdown-menu.show {
    opacity:        1;
    visibility:     visible;
    pointer-events: auto;
    transform:      translateY(0);
    animation:      none;          /* cancel old fadeInUp */
    transition:     opacity     0.22s ease,
                    visibility  0s   linear 0s,
                    transform   0.22s ease;
  }

  /* Hero min-height only on desktop */
  .mpsp-hero { min-height: 680px; }
}

/* ══════════════════════════════════════════════════════════════
   ≥ 1200px  (xl — max container width)
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 1200px) {
  .container { max-width: 1320px; }
}

/* ══════════════════════════════════════════════════════════════
   h2/h5/h6 fw-bold mb-3 — course page headings
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  h2.fw-bold.mb-3 { font-size: clamp(20px, 4vw, 28px); padding-bottom: 12px; }
  h2.fw-bold.mb-3::after { width: 44px; }
  h5.fw-bold.mb-3:not(.text-white) { font-size: 14.5px; padding-left: 9px; }
}

@media (max-width: 767.98px) {
  h2.fw-bold.mb-3 { font-size: clamp(19px, 5vw, 25px); padding-bottom: 10px; margin-bottom: 16px !important; }
  h2.fw-bold.mb-3::after { width: 38px; height: 2.5px; }
  h5.fw-bold.mb-3:not(.text-white) { font-size: 14px; }
}

@media (max-width: 575.98px) {
  h2.fw-bold.mb-3 { font-size: clamp(18px, 5.5vw, 22px); padding-bottom: 8px; margin-bottom: 12px !important; }
  h2.fw-bold.mb-3::after { width: 32px; }
  h5.fw-bold.mb-3:not(.text-white) { font-size: 13.5px; padding-left: 8px; border-left-width: 2px; }
}

/* ══════════════════════════════════════════════════════════════
   fw-bold text-primary heading — course quick-stats & downloads
   ══════════════════════════════════════════════════════════════ */

/* Tablet (< 992px) */
@media (max-width: 991.98px) {
  .course-quick-stats h5.fw-bold.text-primary {
    font-size: 15px;
    padding: 14px 16px 12px;
  }

  .container > h4.fw-bold.text-primary {
    font-size: clamp(16px, 3vw, 20px);
    margin-bottom: 16px !important;
    padding-left: 12px;
    padding-bottom: 10px;
  }
}

/* Mobile landscape / small tablet (< 768px) */
@media (max-width: 767.98px) {
  .course-quick-stats h5.fw-bold.text-primary {
    font-size: 14.5px;
    padding: 12px 14px 10px;
  }

  .container > h4.fw-bold.text-primary {
    font-size: clamp(15px, 4vw, 18px);
    margin-bottom: 14px !important;
    padding-left: 10px;
    padding-bottom: 8px;
  }
}

/* Mobile portrait (< 576px) */
@media (max-width: 575.98px) {
  .course-quick-stats h5.fw-bold.text-primary {
    font-size: 14px;
    padding: 12px 12px 10px;
    letter-spacing: 0;
  }

  .container > h4.fw-bold.text-primary {
    font-size: 15px;
    margin-bottom: 12px !important;
    padding-left: 10px;
    border-left-width: 3px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Print styles
   ══════════════════════════════════════════════════════════════ */
@media print {
  .mpsp-topbar,
  .mpsp-identity-bar,
  .mpsp-navbar,
  .mpsp-notice-bar,
  .mpsp-footer,
  .mpsp-partners,
  .mpsp-map,
  #welcomeModal { display: none !important; }

  body { font-size: 12pt; color: #000; }

  a[href]::after { content: ' (' attr(href) ')'; font-size: 10pt; }
}
