/* =========================================================
   responsive.css — SJCC
   Loaded LAST (end of <head> in menu.php) so it overrides
   main.css, Bootstrap and the inline <style> in menu.php.

   Breakpoints
   ≥1600  large desktop
   1200–1599  laptop / small desktop
   992–1199   tablet landscape (hamburger menu from here down)
   768–991    tablet portrait
   576–767    large phone
   ≤575       phone
   ≤380       small phone
   ========================================================= */

/* ---------- Global safety net ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

img, video, svg, canvas { max-width: 100%; }
img, video { height: auto; }
iframe { max-width: 100%; }                 /* height left alone: the map sets its own */
#bg-video { height: 100%; }                 /* keep hero video filling its box */

section, .parallax, footer { overflow-x: clip; }

.container { width: 100%; padding-left: 15px; padding-right: 15px; }

/* long words / URLs never force a sideways scroll */
h1, h2, h3, h4, h5, h6, p, a, li, .section-title, .section-sub { overflow-wrap: break-word; }

/* nicer tap targets & no blue flash on mobile */
a, button { -webkit-tap-highlight-color: transparent; }

/* mobile toggle / close button reset (they are <button>s now) */
.mobile-toggle, .close-btn {
  background: none; border: 0; line-height: 1; padding: 6px 8px;
}
.mobile-toggle { color: #fff; font-size: 1.8rem; }
.close-btn { color: #fff; }

/* mega menu opened by tap on touch screens */
.main-header .dropdown.open .mega-menu { visibility: visible; opacity: 1; pointer-events: auto; }

/* =========================================================
   PRINCIPAL'S MESSAGE CARD — self-contained, zoom-proof
   Matches the original look: navy outer card, photo in a white
   frame sticking out top-left, heading to its right, light card
   with the message, navy "Read More" bottom-right.
   Everything is sized from --ph (photo size) so the heading can
   never slide under the photo at 110 / 125 / 150 % zoom.
   ========================================================= */
.why-grid > .card {
  height: auto !important; max-height: none !important;
  background: #fff; border: 0; border-radius: 18px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.principal-message-section {
  --ph: 150px;                 /* photo size   */
  --lift: 40px;                /* how far the photo rises above the light card */
  --pad: 26px;                 /* light-card padding */
  position: relative; overflow: hidden;
  height: auto !important; max-height: none !important;
  padding: 24px 24px 28px !important;
  border-radius: 14px;
  background: linear-gradient(160deg, #0b2b6c 0%, #061840 55%, #041030 100%) !important;
}
/* decorative circle top-right */
.principal-message-section::after {
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.07); pointer-events: none;
}
.principal-message-section .col-xl-12 { width: 100%; max-width: 100%; flex: 0 0 100%; padding: 0 !important; }

.principal-message-section .message-wrapper {
  position: relative !important; z-index: 1;
  display: block !important;
  height: auto !important; max-height: none !important;
  padding: var(--lift) 0 0 0 !important; margin: 0 !important;
  container-type: inline-size; container-name: pcard;
}
.principal-message-section .principal-profile-container {
  position: absolute !important; top: 0 !important; left: 8px !important;
  right: auto !important; bottom: auto !important; transform: none !important;
  width: var(--ph) !important; height: var(--ph) !important; margin: 0 !important;
  border: 4px solid #fff; border-radius: 4px; overflow: hidden;
  background: #fff; z-index: 3; box-shadow: 0 6px 18px rgba(0,0,0,.25) !important;
}
.principal-message-section .principal-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }

.principal-message-section .message-content-card {
  position: relative !important; z-index: 2;
  width: 100% !important; max-width: none !important;
  height: auto !important; max-height: none !important; min-height: 0 !important;
  margin: 0 !important; padding: var(--pad) !important;
  background: rgba(214, 223, 240, .88) !important;
  border-radius: 10px !important; border: 0 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
  overflow: visible !important;
}
/* heading sits beside the photo, bottom-aligned with it */
.principal-message-section .header-block {
  position: static !important; transform: none !important;
  display: flex; align-items: flex-end;
  margin: 0 0 22px calc(var(--ph) - var(--pad) + 26px) !important;
  min-height: calc(var(--ph) - var(--lift) - var(--pad) + 4px);
  padding: 0 !important; text-align: left !important;
}
.principal-message-section .title-heading {
  margin: 0 !important; color: #0b0f1a !important;
  font-family: 'DM Sans', sans-serif; font-weight: 600;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem) !important; line-height: 1.2 !important;
}
.principal-message-section .message-body-text {
  height: auto !important; max-height: none !important; overflow: visible !important;
  color: #3a4150; font-size: 0.92rem; line-height: 1.7;
}
.principal-message-section .salutation,
.principal-message-section .salutation b { color: #1d2230; }
.principal-message-section .message-body-text .prog-link {
  display: table; margin: 18px 0 0 auto !important;
  background: #061840 !important; color: #f2b233 !important;
  padding: 10px 14px !important; border-radius: 2px; font-size: 0.8rem; font-weight: 600; text-decoration: none;
}

/* The card measures its own width (container query), so this also
   reacts to browser zoom, not just to the device size. */
@container pcard (max-width: 400px) {       /* narrow: smaller photo, still side by side */
  .principal-message-section .principal-profile-container,
  .principal-message-section .header-block { --ph: 104px; }
  .principal-message-section .title-heading { font-size: 1.3rem !important; }
}
@container pcard (max-width: 270px) {       /* very narrow: heading moves under the photo */
  .principal-message-section .header-block {
    margin-left: 0 !important; min-height: 0;
    padding-top: calc(var(--ph) - var(--lift) - var(--pad) + 14px) !important;
  }
}

/* smaller photo on smaller screens (the design stays the same) */
@media (max-width: 991.98px) { .principal-message-section { --ph: 140px; } }
@media (max-width: 575.98px) {
  .principal-message-section { --lift: 30px; --pad: 18px; padding: 16px 14px 20px !important; }
}

/* the rest of the "Welcome" block never clips either */
.why, .why .container, .why-grid { height: auto !important; max-height: none !important; }

/* fixed-background parallax only where it works (desktop w/ real hover) */
@media (hover: hover) and (min-width: 1200px) {
  .bg-fixed-desktop { background-attachment: fixed !important; }
}

/* =========================================================
   ≥1600 — large desktop
   ========================================================= */
@media (min-width: 1600px) {
  .container { max-width: 1400px; }
}

/* =========================================================
   1200–1599 — laptops: shrink the header so both nav halves
   and the logo fit without colliding
   ========================================================= */
@media (min-width: 1200px) and (max-width: 1599.98px) {
  .nav-link { font-size: 0.78rem; padding: 10px 5px; }
  .brand-container img { width: clamp(260px, 26vw, 450px); }
  .scrolled .brand-container img { width: clamp(220px, 22vw, 457px); }
  .dropdown-menu.mega-menu { padding: 32px 36px; }
  .apply-btn img { width: 24px; }
}

@media (max-width: 1440px) {
  section { padding: 70px clamp(24px, 4vw, 48px); }
}

/* =========================================================
   ≤1199 — tablet landscape and below
   ========================================================= */
@media (max-width: 1199.98px) {
  .canvas-container { width: 100%; max-width: 1200px; }
  .prog-grid { grid-template-columns: repeat(2, 1fr); }
  .collab-grid { grid-template-columns: repeat(3, 1fr); }
  .ranks-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: repeat(2, 1fr); }

  /* Our Story + Principal's message: one column so neither gets squeezed */
  .why-grid { grid-template-columns: 1fr !important; display: grid !important; gap: 32px; }
  .why-grid > .card { max-width: 760px; width: 100%; margin: 0 auto; }

  /* header: logo left, hamburger right */
  .nav-wrapper { justify-content: space-between; }
  .nav-links-container { margin-left: auto; }
  .brand-container { top: auto !important; left: auto !important; }
  .brand-container img { width: 150px !important; max-height: 54px; object-fit: contain; }
  .mobile-toggle { margin-right: 0 !important; }

  /* full-screen menu */
  .full-page-overlay { padding: 70px 20px 40px; -webkit-overflow-scrolling: touch; }
  .full-page-overlay .row.mt-5 { margin-top: 0 !important; }
  .close-btn { top: 14px; right: 16px; font-size: 2rem; }
  .mega-header1 { font-size: 1.15rem; margin-bottom: 12px; }
  .mega-cat-title1 { padding: 10px 0; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.08) !important; }
  .list-unstyled li, .list-unstyled1 li, .menu-links li { padding: 4px 0; }

  /* hero sits under the 70px fixed header */
  .video-hero { height: 100vh; height: 100svh; }

  /* recruiters stats cards */
  .stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-left: 20px; padding-right: 20px; }
}

/* =========================================================
   ≤991 — tablet portrait
   ========================================================= */
@media (max-width: 991.98px) {
  section { padding: 60px 24px; }
  .topbar { padding: 8px 20px; flex-wrap: wrap; }
  .quicklinks { padding: 20px 0; }
  .ql-inner { grid-template-columns: repeat(4, 1fr); }

  .why-grid, .ann-layout { grid-template-columns: 1fr !important; display: grid !important; gap: 32px; }
  .why-visual { grid-template-columns: 1fr; }
  .parallax, .bg-1, .bg-2, .bg-3, .why { background-attachment: scroll !important; }
  .sjcc-title { font-size: clamp(2rem, 6vw, 3.8rem); }

  /* hero: 16:9 video, shorter box so less of it is cropped */
  .video-hero { height: 70vh; height: 70svh; min-height: 420px; margin-top: 70px; }
  .hero-bg { background: linear-gradient(to bottom, rgba(4,16,52,.55), rgba(4,16,52,.15) 60%, transparent); }

  /* quick-link cards: 3 per row on tablets */
  .quick-links-section .row > [class*="col-"] { flex: 0 0 33.333%; max-width: 33.333%; }

  /* announcements + events stack */
  .events-column { margin-top: 8px; }

  /* ethos boxes */
  .ethos-row > [class*="col-"] { margin-bottom: 20px; }
  .ethos-box.middle { border-left: 0 !important; border-right: 0 !important; }

  /* rankings strip wraps */
  .accreditation-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .accred-badge { flex: 1 1 160px; }

  /* International collaborations: turn the orbit into a grid */
  .collab-grid { display: block; }
  .canvas-container {
    position: relative; height: auto !important; min-height: 0 !important; aspect-ratio: auto !important;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 10px 0;
  }
  .canvas-container .center-inner-ring { display: none; }
  .canvas-container .center-hub {
    position: relative !important; inset: auto !important; transform: none !important;
    grid-column: 1 / -1; margin: 0 auto 10px; width: 200px !important; height: 200px !important;
  }
  .canvas-container .partner-wrapper {
    position: relative !important; inset: auto !important; top: auto !important; left: auto !important;
    right: auto !important; bottom: auto !important; transform: none !important;
    display: flex; flex-direction: column; align-items: center; text-align: center; animation: none !important;
  }
  .canvas-container .logo-circle { width: 110px !important; height: 110px !important; margin: 0 auto; }
  .canvas-container .logo-circle img[width="100"], .canvas-container .logo-circle img[width="150"] { width: 72px; }
  .canvas-container .info-text-block {
    position: static !important; transform: none !important; opacity: 1 !important; visibility: visible !important;
    margin-top: 8px; white-space: normal;
  }
  .node-name { font-size: 0.85rem; }

  /* footer */
  footer .footer-inner { padding-top: 40px; padding-bottom: 20px; }
  .footer-brand-col { text-align: center; }
  .footer-brand-col .footer-contact { justify-content: center; }
  .footer-brand-logo { margin: 0 auto; display: block; }
  .footer-links-row { margin-top: 10px; }
}

/* =========================================================
   ≤767 — large phones
   ========================================================= */
@media (max-width: 767.98px) {
  .topbar-left, .topbar-right { width: 100%; justify-content: center; flex-wrap: wrap; }
  .prog-grid, .why-pillars { grid-template-columns: 1fr; }
  .ql-inner { grid-template-columns: repeat(3, 1fr); }
  .footer-top { grid-template-columns: 1fr; text-align: center; }
  .footer-bottom { text-align: center; }
  .event-card { flex: 0 0 100%; }
  .tcard { width: 260px; }

  /* announcements ticker */
  .ticker { display: flex; align-items: stretch; }
  .ticker-inner { font-size: 13px; }
  .ticker-badge { font-size: 11px; padding: 8px 10px; white-space: nowrap; flex-shrink: 0; }
  .ticker-close-btn { flex-shrink: 0; border: 0; }

  /* hero */
  .video-hero { height: 56vh; height: 56svh; min-height: 300px; }
  .scroll-indicator { bottom: 18px; }

  /* quick links: 2 per row */
  .quick-links-section { padding-top: 32px !important; padding-bottom: 32px !important; }
  .quick-links-section .row > [class*="col-"] { flex: 0 0 50%; max-width: 50%; }
  .quick-card1 { padding: 16px 10px; }
  .quick-card1 svg, .quick-card1 i { width: 32px; height: 32px; font-size: 1.6rem !important; }
  .quick-card1 h6 { font-size: 0.85rem; margin-top: 8px; }

  /* "Our story" card */
  .why-text > div[style] { padding: 20px 18px !important; }
  .why-text .prog-link[style*="float"] { float: none !important; display: inline-block; margin-top: 12px; }


  /* ethos */
  .ethos-header h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .ethos-header h4, .ethos-footer h4 { font-size: 1rem; letter-spacing: .5px; }
  .ethos-box { padding: 24px 18px; }

  /* announcements */
  .view-all-link { display: block; margin-top: 8px; }
  .ann-item { gap: 12px; padding: 14px; }
  .ann-date { min-width: 56px; }
  .ann-body h4 { font-size: 0.95rem; }
  .ann-body p { font-size: 0.85rem; }

  /* rankings */
  .rank-card { padding: 22px 16px; }
  .rank-num { font-size: 2.2rem; }

  /* placements stats */
  .stats-grid { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
  .divider-header { gap: 12px; }

  /* alumni / recruiters marquee */
  .alumni-scroll-wrapper { margin-top: 28px !important; }
  .alumni-card { width: 200px; }
  .recruiter-logo-card { width: 130px; height: 70px; padding: 10px; }
  .recruiter-logo-card img { max-height: 44px; object-fit: contain; }

  /* collaborations: 2 per row */
  .canvas-container { grid-template-columns: repeat(2, 1fr); }
  .canvas-container .center-hub { width: 160px !important; height: 160px !important; }

  /* testimonials */
  .tcard-footer br { display: none; }        /* inline <br> spacers push content around on small cards */
  .tcard-footer { padding-top: 12px; }

  /* social strip: icons only, smaller */
  .social-bar a { width: 150px; height: 40px; transform: translateX(110px); }
  .social-bar a i { width: 40px; font-size: 16px; }

  /* footer */
  footer h5 { font-size: 1rem; margin-top: 18px; }
  footer ul { padding-left: 0; list-style: none; }
  footer li { padding: 3px 0; }
  .footer-institutions { columns: 2; column-gap: 20px; }
  .footer-institutions li { break-inside: avoid; }
  .footer-map { height: 220px !important; }
  .footer-legal a { display: inline-block; padding: 6px 4px; }
}

/* =========================================================
   ≤575 — phones
   ========================================================= */
@media (max-width: 575.98px) {
  section { padding: 48px 16px; }
  .ql-inner { grid-template-columns: repeat(2, 1fr); }
  .hero h1, .section-title, .sjcc-title { font-size: clamp(1.5rem, 7vw, 2.1rem) !important; }
  .section-sub { font-size: 0.95rem; }

  .brand-container img { width: 130px !important; }
  .main-header { height: 64px; }
  .video-hero { margin-top: 64px; height: 42vh; height: 42svh; min-height: 240px; }

  .ranks-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .rank-num { font-size: 1.8rem; }
  .rank-num[style] { font-size: 1.3rem !important; }
  .rank-desc { font-size: 0.8rem; }

  .accred-badge { flex: 1 1 45%; }

  .canvas-container { gap: 12px; }
  .canvas-container .logo-circle { width: 92px !important; height: 92px !important; }
  .canvas-container .logo-circle img[width="100"], .canvas-container .logo-circle img[width="150"] { width: 60px; }

  .tcard { width: 82vw; max-width: 300px; }

  .footer-institutions { columns: 1; }
  footer .col-6 { flex: 0 0 50%; max-width: 50%; }
  footer .footer-inner .row > .col-12 { text-align: left; }
}

/* =========================================================
   ≤430 / ≤380 / ≤320 — small phones
   ========================================================= */
@media (max-width: 430px) {
  .ql-inner { grid-template-columns: 1fr 1fr; }
  .topbar { font-size: 11px; }
  .ticker-badge { font-size: 0; padding: 8px; }        /* keep the badge, hide the word */
  .ticker-badge::before { content: "\f0a1"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 14px; }
}

@media (max-width: 380px) {
  .btn-gold, .btn-ghost { padding: 12px 18px; font-size: 13px; }
  body { font-size: 14px; }
  .ranks-grid { grid-template-columns: 1fr; }
  .canvas-container { grid-template-columns: 1fr 1fr; }
  .quick-card1 h6 { font-size: 0.78rem; }
}

@media (max-width: 320px) {
  section { padding: 40px 12px; }
  footer .col-6 { flex: 0 0 100%; max-width: 100%; }
}

/* =========================================================
   Phones in landscape — don't let the hero eat the screen
   ========================================================= */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 991.98px) {
  .video-hero { height: 85vh; height: 85svh; min-height: 0; }
  .full-page-overlay { padding-top: 56px; }
}

/* Respect users who turn animations off */
@media (prefers-reduced-motion: reduce) {
  .alumni-track, .recruiter-track, .testimonials-track, .ticker-inner { animation-duration: 120s !important; }
  * { scroll-behavior: auto !important; }
}
