/* ===========================================================
   Mobile-fixes — overflow + typography fixes for NAFSA
   Defensive @media rules. Desktop (>=900px) untouched.
   =========================================================== */

/* Universal overflow guard on mobile */
@media (max-width: 899px) {
  html, body { overflow-x: hidden; }
  /* Allow long words/URLs to break */
  h1, h2, h3, h4, p, a, span, li, td, th { overflow-wrap: break-word; word-wrap: break-word; }
}

/* ---------- HOME PAGE — known overflow blocks ---------- */
@media (max-width: 600px) {
  /* Hero banner — H1 "Study in Italy. Learn Without Borders." */
  .uc-banner { padding-left: 16px !important; padding-right: 16px !important; }
  .uc-banner__container { max-width: 100% !important; padding: 0 !important; }
  .uc-banner__h {
    font-size: 32px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
    overflow-wrap: break-word;
  }

  /* Intro — "Find the right program" */
  .uc-intro { padding-left: 16px !important; padding-right: 16px !important; }
  .uc-intro__container { max-width: 100% !important; }
  .uc-intro__h { font-size: 28px !important; line-height: 1.2 !important; }
  .uc-intro__sub { font-size: 16px !important; line-height: 1.5 !important; }

  /* Why Unicollege — "An Italian university built for international partnerships." */
  .uc-why__title { font-size: 24px !important; line-height: 1.25 !important; padding: 0 16px; }

  /* 3As Model */
  .uc-3a__title { font-size: 24px !important; line-height: 1.25 !important; padding: 0 16px; }

  /* Voice — "Hear it from our partner students." */
  .uc-voice__title { font-size: 24px !important; line-height: 1.25 !important; padding: 0 16px; }

  /* Stats — numbers + labels */
  .uc-stats { padding-left: 16px !important; padding-right: 16px !important; }
  .uc-stats__grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px 16px !important;
  }
  .uc-stats__item { min-width: 0 !important; }
  .uc-stats__num {
    font-size: 40px !important;
    line-height: 1 !important;
  }
  .uc-stats__lbl {
    font-size: 13px !important;
    line-height: 1.3 !important;
    overflow-wrap: break-word;
    white-space: normal !important;
  }

  /* Footer — copyright + brand-tag overflow */
  .uc-footer { padding: 36px 18px 22px !important; }
  .uc-footer__copy {
    font-size: 11.5px !important;
    line-height: 1.5 !important;
    flex-direction: column !important;
    gap: 6px !important;
    align-items: flex-start !important;
  }
  .uc-footer__copy span { display: block !important; }

  /* Pinfo grid (card programs) — single column on small screens */
  .uc-pinfo__grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .uc-pinfo { padding-left: 16px !important; padding-right: 16px !important; }
  .uc-pinfo__card { min-width: 0 !important; }
}

/* ---------- ALL pages — generic overflow guards ---------- */
@media (max-width: 600px) {
  /* Page title */
  .uc-page-title {
    font-size: 28px !important;
    line-height: 1.2 !important;
    padding: 0 16px;
    margin: 28px auto 32px !important;
  }
  .uc-container { padding-left: 16px !important; padding-right: 16px !important; }

  /* Section eyebrow + h2 in main content */
  .uc-sec h2 { font-size: 24px !important; line-height: 1.25 !important; }
  .uc-sec h3 { font-size: 18px !important; line-height: 1.3 !important; }
  .uc-sec p { font-size: 16px !important; line-height: 1.55 !important; }
  .uc-lead { font-size: 18px !important; line-height: 1.5 !important; padding: 0 16px; }

  /* Pagewrap mobile padding */
  .uc-pagewrap { padding: 24px 16px !important; gap: 24px !important; }

  /* Tables (admissions, italian-he, culinary) */
  .uc-table-wrap { margin-left: -16px !important; margin-right: -16px !important; }
  .uc-table { font-size: 14px !important; }
  .uc-table thead th, .uc-table tbody th, .uc-table tbody td { padding: 12px 14px !important; }

  /* Keyfacts strip */
  .uc-keyfacts { grid-template-columns: repeat(2, 1fr) !important; }
  .uc-keyfact .value { font-size: 28px !important; }
  .uc-keyfact .label { font-size: 11px !important; }

  /* Learn more grid → 1 column */
  .uc-learnmore { padding: 28px 18px !important; margin: 40px 0 30px !important; }
  .uc-learnmore__grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .uc-learnmore__title { font-size: 22px !important; margin: 0 0 22px !important; }

  /* Breadcrumb wraps cleanly */
  .uc-breadcrumb { padding: 36px 16px 8px !important; font-size: 12px !important; }
  .uc-breadcrumb a, .uc-breadcrumb .current { padding: 0 6px !important; }

  /* Related-in bar mobile-friendly */
  .related-in-inner { padding: 0 16px !important; gap: 8px !important; }
  .related-in-label { font-size: 11px !important; flex-basis: 100%; }
  .related-in-links { font-size: 13px !important; }
  .related-in-links li:not(:last-child)::after { margin: 0 8px !important; }
}
