/* =========================================================
   Responsive layer — desktop → tablet → phone
   Breakpoints: 1180 / 1024 / 860 / 640 / 400
   ========================================================= */

/* ---------- Large desktop ---------- */
@media (min-width: 1600px) {
  :root { --container: 1280px; --container-wide: 1480px; }
}

/* ---------- Small desktop / large tablet ---------- */
@media (max-width: 1180px) {
  .main-nav ul { gap: .9rem; }
  .main-nav a { font-size: .88rem; }
  .header-actions .btn span { display: none; }
  .header-actions .btn { padding-inline: .9rem; }

  .services-layout { grid-template-columns: minmax(0, 215px) minmax(0, 1fr); }
  /* 10 specialties: 2 columns keeps the grid complete with no empty cells */
  .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 74px; }

  .main-nav { display: none; }
  .nav-toggle { display: block; }

  .pattern-overlay::before { background-size: 74px 74px; opacity: .3; }
  .header-actions .btn { min-height: 44px; width: 44px; padding: 0; }

  .hero { min-height: min(100svh, 800px); }
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 2rem; }
  .hero-emblem { min-height: 0; }
  .hero-emblem img { width: min(130%, 340px); }
  .hero h1 { max-width: 17ch; }

  .masthead--split .masthead-grid,
  .masthead--rail .masthead-grid { grid-template-columns: minmax(0, 1fr); }
  .masthead-mark { max-width: 300px; margin-inline: auto; }

  .editorial { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .split { grid-template-columns: minmax(0, 1fr); gap: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); }
  .split-aside { position: static; }
  .split-aside p { max-width: var(--measure-lead); }

  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar:nth-child(3n + 1) { border-inline-start: 1px solid var(--line); padding-inline-start: clamp(1.25rem, .4rem + 2vw, 2.5rem); }
  .pillar:nth-child(3n) { padding-inline-end: clamp(1.25rem, .4rem + 2vw, 2.5rem); }
  .pillar:nth-child(2n + 1) { border-inline-start: 0; padding-inline-start: 0; }

  .banner--split .banner-grid { grid-template-columns: minmax(0, 1fr); }
  .banner-seal { max-width: 340px; margin-inline: auto; }

  .cta-band-grid { grid-template-columns: minmax(0, 1fr); }

  .services-layout { grid-template-columns: minmax(0, 1fr); }
  .services-index { position: static; }
  .services-index ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }

  .contact-layout { grid-template-columns: minmax(0, 1fr); }

}

/* ---------- Large phone / small tablet ---------- */
@media (max-width: 860px) {
  body { line-height: 1.85; }

  /* Phones: the emblem leads, the type follows — recomposed, not stacked */
  .hero { min-height: auto; }
  .hero-inner { padding-block: 2.25rem 3.25rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-emblem { order: -1; margin-bottom: 2.25rem; }
  .hero-emblem img { width: min(64%, 260px); }
  .hero-emblem::before {
    inset-block: auto;
    inset-inline: 22%;
    bottom: -1.1rem;
    width: auto;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--gold-line), transparent);
  }
  .hero-content { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero .eyebrow { justify-content: center; }
  .hero h1 { max-width: 100%; }
  .hero p { max-width: 42ch; }
  .hero .btn-row { margin-top: 1.9rem; justify-content: center; }
  .hero .btn-row .btn { flex: 1 1 100%; }

  .credential-strip ul { grid-template-columns: minmax(0, 1fr); }
  .credential-strip li { border-inline-start: 0; border-top: 1px solid var(--line-dark); padding: 1.15rem 0; }
  .credential-strip li:first-child { border-top: 0; }
  .credential-strip .container { width: min(100% - (var(--gutter) * 2), var(--container)); }

  .accreditation { grid-template-columns: minmax(0, 1fr); }
  .accredited { border-inline-start: 0; padding-inline: 0; }

  .team-member { grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; }
  .member-mark { font-size: 1.5rem; }

  .service-row { grid-template-columns: 44px minmax(0, 1fr); row-gap: 1rem; }
  .service-row .service-cta { grid-column: 2; justify-self: start; }
  .service-row:hover { padding-inline: 0; background: transparent; }


  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2.2rem; }
  .footer-brand { text-align: center; }
  .footer-brand img { margin-inline: auto; }
  .footer-brand p { margin-inline: auto; max-width: 42ch; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .map-frame,
  .map-plate { aspect-ratio: 4 / 3; }

  /* comfortable tap areas for the dense text links */
  .footer-col a, .footer-col dd { display: inline-block; padding-block: .35rem; }
  .footer-col li + li { margin-top: .15rem; }
  .breadcrumb a, .breadcrumb span { display: inline-block; padding-block: .3rem; }
  .drawer-meta a, .drawer-meta span { padding-block: .3rem; }

  /* the floating button owns the WhatsApp CTA at this size */
  .header-actions .btn--wa,
  .header-actions .btn--wa-line { display: none; }
  .wa-float { display: flex; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  :root { --header-h: 66px; --gutter: 1.15rem; }

  .brand img { width: 34px; }
  .site-header.is-scrolled .brand img { width: 31px; }
  .brand-name { font-size: .95rem; }
  .brand-tag { font-size: .55rem; letter-spacing: .09em; }

  .header-actions .btn { min-height: 42px; width: 42px; }
  .nav-toggle { width: 42px; height: 42px; }

  .pattern-overlay::before { background-size: 62px 62px; opacity: .26; }

  .mobile-nav li a { font-size: 1.15rem; padding: .95rem .1rem; }

  .hero p { font-size: 1rem; }
  .masthead p { font-size: 1rem; }

  .pillars { grid-template-columns: minmax(0, 1fr); }
  .pillar,
  .pillar:nth-child(3n + 1),
  .pillar:nth-child(3n) { border-inline-start: 0; padding-inline: 0; }
  .pillar p { max-width: var(--measure-lead); }

  .feature-row { grid-template-columns: 40px minmax(0, 1fr); gap: 1rem; }
  .feature-row .feature-icon svg { width: 34px; height: 34px; }

  .form-row { grid-template-columns: minmax(0, 1fr); }

  .btn-row .btn { flex: 1 1 100%; }



  .spec-grid { grid-template-columns: minmax(0, 1fr); }

  .audience li { border-inline-start: 0; }

  .services-index ol { grid-template-columns: minmax(0, 1fr); }


  .contact-item dd[dir="ltr"] { text-align: start; }
}

/* ---------- Small phone (iPhone SE and similar) ---------- */
@media (max-width: 400px) {
  :root { --gutter: .95rem; }

  .brand-text { display: none; }
  .brand img { width: 36px; }

  .btn { padding-inline: 1.2rem; font-size: .9rem; }
  .eyebrow { letter-spacing: .1em; }
  .eyebrow::before { width: 22px; }

  .credential-strip dd { font-size: 1.12rem; }
  .credential dd { font-size: 1.22rem; }

  .team-member { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .member-mark { width: 64px; aspect-ratio: 1; justify-self: center; }
  .team-member div { justify-self: stretch; text-align: start; }


  .wa-float { width: 52px; height: 52px; inset-inline-end: .85rem; bottom: .85rem; }
  .wa-float svg { width: 25px; height: 25px; }
}

/* ---------- Landscape phones: keep the hero from filling the screen ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 2.5rem); }
  .mobile-nav li a { font-size: 1.05rem; padding: .7rem .1rem; }
}

/* ---------- Coarse pointers: no hover-dependent affordances ---------- */
@media (hover: none) {
  .service-row:hover { background: transparent; padding-inline: 0; }
  .pillar:hover { background: transparent; }
}
