/* Mobile / small-screen overrides. Loaded last so it wins over the
   per-page desktop refinements in each page's <style> block. */
@media (max-width: 820px) {
  :root {
    --space-7: 1.25rem;
    --space-8: 2rem;
    --space-9: 2.75rem;
    --space-10: 3rem;
    --space-11: 3.5rem;
    --header-h: auto;
  }

  img, iframe { max-width: 100%; }

  /* every two/three-column grid becomes a single column */
  [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }

  /* heading + button rows wrap instead of squeezing */
  [style*="justify-content:space-between"],
  [style*="justify-content: space-between"] { flex-wrap: wrap; }

  /* header: logo on one row, nav wrapping beneath */
  header {
    height: auto !important;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.5rem;
    padding: 0.75rem 1rem !important;
  }
  header img { height: 58px !important; }
  header nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.1rem !important;
    row-gap: 0.5rem;
  }
  header nav a { font-size: 12px !important; }

  h1 { font-size: clamp(2rem, 8.5vw, 3rem) !important; line-height: 1.1; }
  h2 { font-size: clamp(1.55rem, 6.5vw, 2.1rem) !important; }

  iframe { height: 260px !important; }
}
