/* Hand-authored responsive layer. Loaded AFTER global.css so it wins.
   The design mockups used fixed multi-column inline styles; these rules add the
   mobile behavior they were missing (grid stacking, a real mobile nav, fluid type). */

/* ---------- header: desktop base + mobile hamburger ---------- */
.nav-toggle { display: none; }
.nav-burger { display: none; }
.nav-menu { flex: 1; display: flex; align-items: center; justify-content:  flex-start; gap: 24px; }
.page-root { overflow-x: clip; }

@media (max-width: 900px) {
  /* show the burger, collapse the menu into a dropdown */
  .nav-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto; flex: none; cursor: pointer;
    border: 1px solid #E3EAF2; border-radius: 10px; background: #fff; padding: 0 11px;
  }
  .nav-burger span { display: block; height: 2px; width: 100%; background: #103E73; border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }

  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 6px 24px 18px; border-top: 1px solid #EEF3F8;
    box-shadow: 0 16px 30px rgba(16,62,115,.12); display: none;
  }
  #nav-toggle:checked ~ .nav-menu { display: flex; }

  .nav-links { flex-direction: column !important; align-items: stretch !important; gap: 0 !important; }
  .nav-links a { padding: 13px 2px; border-bottom: 1px solid #F1F5FA; }
  .nav-actions { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; margin-top: 14px; }
  .nav-actions a { text-align: center; }

  /* burger -> X when open */
  #nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  #nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  #nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- collapse multi-column grids ---------- */
@media (max-width: 980px) {
  .acards-3 { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 760px) {
  .ahero-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
  .acards-3, .acards-2 { grid-template-columns: 1fr !important; }
  .est-grid { grid-template-columns: 1fr !important; }
  .lp-split, .lp-3, .lp-cta { grid-template-columns: 1fr !important; }
  .afoot { grid-template-columns: 1fr 1fr !important; gap: 28px !important; }

  /* disable the desktop 1.15 zoom that amplifies overflow on phones */
  .page-root { zoom: 1 !important; }

  /* fluid headings (override oversized inline px) */
  h1 { font-size: clamp(28px, 7.6vw, 42px) !important; line-height: 1.08 !important; }
  h2 { font-size: clamp(24px, 6vw, 34px) !important; line-height: 1.14 !important; }

  /* contact modal: stack the 2-up field rows */
  #idw-contact-form > div { grid-template-columns: 1fr !important; }
}

@media (max-width: 460px) {
  .afoot { grid-template-columns: 1fr !important; }
}
