/* ==========================================================================
   Responsive behaviour.

   IMPORTANT — this is an ORIGINAL adaptation, not a reproduction.
   The Wix original serves its mobile layout by user-agent sniffing, not by
   viewport width: loading the live site in a 375px-wide same-origin iframe
   returns the full 980px desktop structure unchanged. The phone layout is
   therefore not observable from a desktop browser and has not been copied.
   Below 1000px this file re-flows the measured desktop design instead.

   Rules override TOKENS wherever possible rather than restating layout.
   ========================================================================== */

/* ---------- < 1000px: leave the fixed canvas, become fluid ------------ */
@media (max-width: 999px) {
  :root {
    --canvas: 100%;
    --fs-h1: 30px;   --lh-h1: 38px;
    --fs-body: 19px; --lh-body: 29px;
    --gap-blank: 26px;
    --gap-para: 22px;
  }

  .shell { width: 100%; padding: 0 24px; }

  /* header: absolute -> flow */
  .site-header {
    height: auto;
    padding: 18px 0 0;
    text-align: center;
  }
  .site-header__logo {
    position: static;
    display: block;            /* it is an <a>: width is inert while inline */
    width: min(380px, 80%);
    height: auto;
    margin: 0 auto;
  }
  .site-header__logo img { width: 100%; height: auto; }

  .site-header__contact {
    position: static;
    width: auto;
    margin: 14px auto 0;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: normal;
  }

  .btn-quote {
    position: static;
    margin: 16px auto 0;
    width: min(240px, 70%);
    height: 44px;              /* 44px min touch target */
  }

  /* nav: strip -> disclosure menu */
  .site-nav {
    position: static;
    width: auto;
    height: auto;
    margin-top: 18px;
    background: var(--nav-bg);
  }
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    background: var(--nav-active);
    color: #fff;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .04em;
    cursor: pointer;
  }
  .nav-toggle__bars {
    position: relative;
    width: 20px; height: 2px;
    background: currentColor;
  }
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    position: absolute; left: 0;
    width: 20px; height: 2px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }
  .nav-toggle__bars::before { top: -6px; }
  .nav-toggle__bars::after  { top:  6px; }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { transform: translateY(-6px) rotate(-45deg); }

  .site-nav__list {
    display: block;
    height: auto;
  }
  .site-nav__list[data-open="false"] { display: none; }

  .site-nav__item { width: 100%; }
  .site-nav__link {
    height: auto;
    min-height: 46px;
    padding: 0 16px;
    justify-content: flex-start;
    border-left: 0;
    border-top: 1px solid #dcdcdc;
    letter-spacing: normal;
  }

  /* content */
  .page-title {
    margin-top: 26px;
    height: auto;
    white-space: normal;
    text-align: center;
  }

  .hero { height: 210px; margin-top: 18px; }
  .hero__img { width: 1200px; height: 210px; }

  .copy {
    width: 100%;
    margin: 26px 0 0;
  }
  .copy__badge {
    float: none;
    display: block;
    width: 180px; height: auto;
    margin: 22px auto;
    shape-outside: none;
  }
  .services-list { padding-left: 26px; }
  .services-list li { height: auto; padding: 3px 0; }
  .services-list li::before { top: 14px; left: -16px; }

  .site-footer { height: auto; margin-top: 30px; padding: 18px 0 26px; }
  .site-footer .shell { height: auto; padding-top: 0; }
  .site-footer__text {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  /* ---- inner pages ---------------------------------------------------- */
  .page-title--about,
  .page-title--careers,
  .page-title--quote,
  .page-title--contact {
    width: auto;
    margin-left: 0;
    height: auto;
    text-align: center;
  }
  .page-title--about   { font-size: 22px; line-height: 28px; margin-top: 24px; }
  .page-title--careers { font-size: 24px; line-height: 30px; margin-top: 26px; }
  .page-title--quote   { font-size: 25px; line-height: 31px; margin-top: 26px; }
  .page-title--contact { font-size: 22px; line-height: 28px; margin-top: 26px; }

  .prose { margin-left: 0; width: 100%; font-size: 16px; line-height: 24px; }
  .prose h2 { font-size: 22px; line-height: 28px; }
  .prose p + h2 { margin-top: 34px; }

  .prose--careers { margin-left: 0; width: 100%; font-size: 18px; line-height: 27px; }
  .prose--careers p + p { margin-top: 24px; }

  .quote-intro { margin-left: 0; width: 100%; font-size: 17px; line-height: 25px; }
  .quote-intro p + p { margin-top: 22px; }
  .quote-form  { margin: 26px 0 0; width: 100%; }

  /* contact: absolute grid -> stacked flow */
  .contact-grid { height: auto; display: flex; flex-direction: column; gap: 26px; }
  .contact-grid__detail,
  .contact-grid__form,
  .map-panel {
    position: static;
    width: 100%;
  }
  .map-panel { height: auto; order: 3; padding: 22px 20px; }
  .contact-grid__detail { order: 1; }
  .contact-grid__form   { order: 2; }
  .contact-grid__email  { margin-top: 10px; }
  .contact-grid__prompt { margin-top: 18px; font-size: 20px; line-height: 27px; }

  .form__field  { height: 46px; font-size: 16px; }   /* 46px touch target */
  textarea.form__field { height: 150px; }
  .form__submit { min-height: 46px; padding: 6px 20px; }
  .form__actions { flex-direction: column; align-items: stretch; }

  /* services: two columns -> stacked rows */
  .services { margin-top: 22px; }
  .service-row {
    display: block;
    min-height: 0;
    margin-bottom: 34px;
  }
  .service-row__media img { width: 100%; height: auto; }
  .service-row__body { margin-top: 14px; }
  .service-row__title { font-size: 27px; line-height: 34px; }
  .service-row__title br { display: none; }
  .service-row__list { padding-left: 22px; font-size: 21px; line-height: 29px; }
  .services__heading { margin: 28px 0 22px; font-size: 24px; line-height: 30px; }
  .services__closing { margin-left: 0; }
  .services__closing .lead { font-size: 27px; line-height: 34px; }
  .services__closing .sub  { font-size: 19px; line-height: 26px; }

  .restricted { margin: 26px 0 0; width: 100%; padding: 22px 20px; font-size: 17px; }
  .restricted h1 { font-size: 23px; line-height: 29px; }

  /* the desktop min-heights exist only to place the footer on the original's
     Y; on a phone they would just leave dead space */
  .page--careers,
  .page--quote,
  .page--reports { min-height: 0; }

  /* the quote intro's 430px measure is a desktop reproduction detail */
  .quote-intro p { max-width: none; }
}


/* ---------- < 600px ---------------------------------------------------- */
@media (max-width: 599px) {
  :root {
    --fs-h1: 25px;   --lh-h1: 32px;
    --fs-body: 18px; --lh-body: 28px;
  }
  .shell { padding: 0 18px; }
  .hero { height: 160px; }
  .hero__img { width: 860px; height: 160px; }
}

/* ---------- < 360px (320px reference device) --------------------------- */
@media (max-width: 359px) {
  :root { --fs-h1: 22px; --lh-h1: 29px; --fs-body: 17px; --lh-body: 27px; }
  .shell { padding: 0 14px; }
  .hero { height: 132px; }
  .hero__img { width: 700px; height: 132px; }
  .site-header__contact { font-size: 15px; }
}

/* ---------- print ------------------------------------------------------ */
@media print {
  .site-bg, .site-nav, .nav-toggle, .btn-quote { display: none !important; }
  body { background: #fff; }
  .shell { width: 100%; }
}
