/* =========================================================================
   MCDC — Responsive layer
   The site's blocks are built with fixed-pixel inline styles (desktop-only).
   Rather than rewrite every block, this file targets those inline values
   directly via attribute selectors and overrides them per breakpoint.
   Loaded after style.css/cms.css so its !important rules win where needed.
   ========================================================================= */

/* ---------- Tablet & below (<=1239px) ---------- */
@media (max-width: 1239px) {
  html, body { overflow-x: hidden; }

  /* Fixed-width content containers become fluid */
  [style*="width: 1160px"],
  [style*="width: 900px"],
  [style*="width: 880px"],
  [style*="width: 860px"],
  [style*="width: 760px"] {
    width: 100% !important;
  }

  /* Wide grids drop to 2 columns on tablets */
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns:repeat(5"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Footer: 4 link columns + brand column -> 2 columns */
  [style*="grid-template-columns: repeat(4, 1fr) 1.1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    row-gap: 36px !important;
  }
}
@media (max-width: 560px) {
  [style*="grid-template-columns: repeat(4, 1fr) 1.1fr"] {
    grid-template-columns: 1fr !important;
  }
  .mc-foot-bottom {
    flex-direction: column !important; align-items: flex-start !important; gap: 14px !important;
  }
}

/* ---------- Phones (<=640px) ---------- */
@media (max-width: 640px) {
  /* Every remaining grid collapses to a single column */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Two-column image+text rows: image above, text below, no forced min-height */
  [style*="grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr)"] {
    gap: 28px !important;
  }

  /* Section side padding: 40px -> 18px everywhere */
  [style*="px 40px"] {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  /* Section vertical padding: scale big desktop breathing room down */
  [style*="padding: 100px 40px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  [style*="padding: 130px 40px 100px"] { padding-top: 60px !important; padding-bottom: 52px !important; }
  [style*="padding: 80px 40px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  [style*="padding: 86px 40px"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  [style*="padding: 90px 40px"] { padding-top: 52px !important; padding-bottom: 52px !important; }
  [style*="padding: 96px 40px 110px"] { padding-top: 52px !important; padding-bottom: 60px !important; }
  [style*="padding: 96px 40px"] { padding-top: 52px !important; padding-bottom: 52px !important; }
  [style*="padding: 76px 40px 0"] { padding-top: 44px !important; }

  /* Headings scale down so they don't wrap awkwardly or overflow */
  [style*="font-size: 62px"] { font-size: 32px !important; }
  [style*="font-size: 54px"] { font-size: 34px !important; }
  [style*="font-size: 52px"] { font-size: 30px !important; }
  [style*="font-size: 46px"] { font-size: 28px !important; }
  [style*="font-size: 44px"] { font-size: 27px !important; }
  [style*="font-size: 42px"] { font-size: 26px !important; }
  [style*="font-size: 40px"] { font-size: 25px !important; }
  [style*="font-size: 38px"] { font-size: 24px !important; }
  [style*="font-size: 36px"] { font-size: 23px !important; }
  [style*="font-size: 30px"] { font-size: 20px !important; }
  [style*="font-size: 76px"] { font-size: 44px !important; }
  [style*="font-size: 26px; font-weight: 700; letter-spacing: -.01em"] { font-size: 20px !important; }

  /* Fixed-height image containers: shorter on phones */
  [style*="height: 620px"] { height: auto !important; min-height: 0 !important; }
  [style*="height: 420px"] { height: 240px !important; }
  [style*="height: 360px"] { height: 220px !important; }
  [style*="height: 340px"] { height: 220px !important; }
  [style*="height: 240px"] { height: 200px !important; }
  [style*="height: 220px"] { height: 190px !important; }
  [style*="height: 210px"] { height: 190px !important; }
  [style*="height: 260px"] { height: 200px !important; }

  /* Fixed-width small cards/badges that would overflow a narrow phone */
  [style*="width: 420px"] { width: 100% !important; }
  [style*="width: 560px"] { width: 100% !important; max-width: 100% !important; }
}

/* ---------- Header / nav ---------- */
@media (max-width: 1239px) {
  .mc-topbar { flex-wrap: wrap !important; row-gap: 14px !important; padding: 16px 20px !important; }
  /* Contact info stays fully visible — it just reflows to its own full-width row
     below the logo instead of squeezing into the same line. */
  .mc-topbar-contact {
    width: 100%; order: 3; flex-direction: column !important; align-items: flex-start !important;
    gap: 14px !important; padding-top: 14px !important; margin-top: 2px; border-top: 1px solid #eef0f2;
  }
  .mc-topbar-contact > div { padding-right: 0 !important; border-right: none !important; }
  .mc-hamburger { display: flex !important; }
}
@media (max-width: 420px) {
  .mc-logo-group img { height: 48px !important; }
  .mc-logo-divider { height: 34px !important; }
}
@media (max-width: 1239px) {

  .mc-navbar { flex-wrap: nowrap !important; position: relative; }
  .mc-navbar .mc-nav-items {
    display: none !important;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #0000ff; flex-direction: column; z-index: 90;
    max-height: calc(100vh - 60px); overflow-y: auto;
    box-shadow: 0 18px 30px rgba(0,0,0,.2);
  }
  .mc-navbar.mc-nav-open .mc-nav-items { display: flex !important; }
  .mc-navbar .mc-nav-link,
  .mc-navbar .mc-dropdown-trigger {
    padding: 18px 22px !important; width: 100%; box-sizing: border-box;
    border-bottom: 1px solid rgba(255,255,255,.15);
  }
  .mc-navbar .mc-dropdown { width: 100%; }
  .mc-navbar .mc-dropdown-menu {
    position: static !important; box-shadow: none !important; display: none !important;
    background: rgba(0,0,0,.15) !important; width: 100%; padding: 0 !important;
  }
  .mc-navbar .mc-dropdown.mc-dropdown-open .mc-dropdown-menu { display: flex !important; }
  .mc-navbar .mc-dropdown:hover .mc-dropdown-menu { display: none; }
  .mc-navbar .mc-dropdown.mc-dropdown-open .mc-dropdown-menu { display: flex !important; }
  .mc-dropdown-menu a { color: #fff !important; padding: 14px 34px !important; border-bottom: 1px solid rgba(255,255,255,.1) !important; }
  .mc-dropdown-menu a:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }
  .mc-nav-contact-btn { margin: 16px 22px !important; align-self: flex-start; }
}
@media (min-width: 1240px) {
  .mc-hamburger { display: none !important; }
}

/* ---------- Ticker ---------- */
@media (max-width: 640px) {
  .mc-ticker-badge { padding: 0 14px !important; font-size: 11px !important; }
}

/* ---------- Quick actions floating widget: collapsed FAB, bottom-right, pops up on tap ---------- */
@media (max-width: 1239px) {
  .mc-quick-actions {
    top: auto !important; bottom: 18px; right: 18px; transform: none !important;
    flex-direction: column-reverse !important; align-items: flex-end; gap: 12px !important;
  }
  .mc-quick-fab { border-radius: 50%; box-shadow: 0 6px 16px rgba(0,0,0,.28); }
  .mc-quick-fab svg { transform: rotate(-90deg); }
  .mc-quick-actions.mc-qa-open .mc-quick-fab svg { transform: rotate(90deg); }
  .mc-quick-panel {
    transform: translateY(16px) scale(.92); transform-origin: bottom right;
    align-items: flex-end;
  }
  .mc-quick-actions.mc-qa-open .mc-quick-panel { max-height: 220px; }
  .mc-quick-action { border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
}

/* ---------- Locations modal ---------- */
@media (max-width: 640px) {
  .mc-locations-modal-panel { padding: 22px !important; width: 100% !important; max-height: 85vh; }
}

/* ---------- Stats counter: drop the desktop column dividers once stacked ---------- */
@media (max-width: 1239px) {
  .mc-stat-item { border-right: none !important; padding: 10px 0 !important; }
}
@media (max-width: 640px) {
  .mc-stat-item:not(:first-child) { border-top: 1px solid rgba(255,255,255,.28) !important; }
}

/* ---------- Download CTA: icon + text + button row wraps instead of overflowing ---------- */
@media (max-width: 1239px) {
  .mc-download-item { flex-wrap: wrap !important; padding: 24px !important; }
  .mc-download-item a.mc-btn-o { white-space: normal !important; width: 100%; text-align: center; }
}

/* ---------- Feature grid: reset the desktop divided-table borders/padding on mobile ---------- */
@media (max-width: 1239px) {
  .mc-feature-item {
    border-right: none !important;
    border-left: none !important;
    padding: 28px 0 !important;
    border-top: 1px solid #e8eaec !important;
  }
  .mc-feature-item:first-child { border-top: none !important; }
}

/* ---------- Hero: let text/tiles flow normally instead of overlaying/absolute ---------- */
@media (max-width: 1239px) {
  .mc-hero-wrap { height: auto !important; padding-bottom: 40px; }
  .mc-hero-media { position: relative !important; height: 320px !important; }
  .mc-hero-overlay { display: none !important; }
  .mc-hero-textbox {
    position: relative !important; inset: auto !important; padding: 36px 20px 0 !important;
    justify-content: flex-start !important; background: #fff; pointer-events: auto !important;
  }
  .mc-hero-textbox .mc-hero { max-width: 100% !important; }
  .mc-hero-dots { display: none !important; }
  .mc-hero-tiles {
    position: relative !important; left: auto !important; bottom: auto !important; transform: none !important;
    margin-top: 28px; gap: 16px !important;
  }
}
@media (max-width: 640px) {
  .mc-tile { padding: 24px 22px 30px !important; flex-direction: column !important; gap: 12px !important; }
  .mc-tile .mc-tile-arrow { display: none !important; }
}

/* ---------- Admission process tabs: allow wrap on very small phones ---------- */
@media (max-width: 420px) {
  .mc-tab-row { flex-wrap: wrap !important; }
  .mc-tab-btn { flex: 1 1 auto; text-align: center; }
}

/* ---------- Contact form card: full width, no absolute background bleed ---------- */
@media (max-width: 1239px) {
  .mc-contact-row { justify-content: center !important; }
  .mc-contact-card { width: 100% !important; max-width: 460px; }
}

/* ---------- House profile: image / intro / leaders row stacks on smaller screens ---------- */
@media (max-width: 1023px) {
  .mc-house-row { flex-direction: column !important; }
  .mc-house-image { width: 100% !important; height: 200px; }
  .mc-house-leaders { width: 100% !important; border-left: none !important; border-top: 1px solid #e2e5e7; flex-direction: row !important; flex-wrap: wrap; justify-content: center !important; }
}
@media (max-width: 480px) {
  .mc-house-leaders { flex-direction: column !important; }
}
