/* Tablet and phone layout. Loaded last on every page.
   This file must contain only @media (max-width: ...) blocks, so desktop
   rendering above 900px is unchanged. No !important: where an existing rule
   is more specific, the override repeats that rule's selector. */

/* ---- TABLET (900px and below) ---- */
@media (max-width: 900px) {
  .nav,
  .hero,
  .what-section,
  .testimonial-section,
  .services-section,
  .process-section,
  .expertise-section,
  .contact-section,
  .scan-section,
  .thanks,
  .not-found,
  .text-page,
  .guardrail,
  .cta-strip,
  .footer {
    padding-left: 28px;
    padding-right: 28px;
  }

  /* Home hero H1 is 54px; the consulting and protect hero H1s are 46px. */
  .hero-h1 { font-size: 36px; }
  .hero-eyebrow + .hero-h1 { font-size: 40px; }
  .contact-h1,
  .scan-h1 { font-size: 36px; }
  .section-h2 { font-size: 30px; }
  .prose h1 { font-size: 36px; }

  .services-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .process-step:nth-child(odd) { border-left: none; }

  .what-grid,
  .contact-section,
  .scan-section {
    grid-template-columns: 1fr;
  }
  .contact-section,
  .scan-section {
    gap: 48px;
  }
}

/* ---- WIDE TABLET (601px to 900px), /protect/ only ---- */
@media (min-width: 601px) and (max-width: 900px) {
  /* /protect/ is the only page whose process steps follow the hero and whose cards follow
     the expertise list. Both grids hold three items: three columns, no orphan. */
  .hero + .process-section .process-grid,
  .expertise-section + .services-section .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero + .process-section .process-step:nth-child(3) { border-left: 1px solid var(--border); }

  /* /protect/ hero lead (label, H1, lead, button): keep it in the left half of the hero,
     clear of the wave, which covers the right 50%. */
  .section-label + .hero-h1 + .hero-body:nth-last-child(2) { max-width: calc(50vw - 52px); }
}

/* ---- HEADER (700px and below) ---- */
/* With three nav links the one-row header no longer fits below ~680px, so the two-row
   header starts here rather than at 600px. Only header rules belong in this block. */
@media (max-width: 700px) {
  /* Nav: logo and Call Now on the first row, links centered on the second. */
  .nav {
    flex-wrap: wrap;
    height: auto;
    column-gap: 12px;
    padding-top: 10px;
  }
  .nav-logo { flex: 1 1 0; min-width: 0; }
  .nav-logo-text { min-width: 0; }
  .nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    flex-shrink: 0;
  }
  .nav-links {
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 24px;
  }
  .nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* ---- PHONE (600px and below) ---- */
@media (max-width: 600px) {
  .nav,
  .hero,
  .what-section,
  .testimonial-section,
  .services-section,
  .process-section,
  .expertise-section,
  .contact-section,
  .scan-section,
  .thanks,
  .not-found,
  .text-page,
  .guardrail,
  .cta-strip,
  .footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .wave-bg { display: none; }
  .hero-h1,
  .hero-eyebrow + .hero-h1,
  .contact-h1,
  .scan-h1 {
    font-size: 32px;
  }
  .section-h2 { font-size: 26px; }
  .prose h1 { font-size: 30px; }
  .what-card-title,
  .cta-strip-text {
    font-size: 20px;
  }
  .testimonial-quote { font-size: 18px; }

  .services-grid,
  .process-grid,
  .expertise-list,
  .form-row {
    grid-template-columns: 1fr;
  }
  .process-step { border-left: none; }

  .what-card,
  .form-card {
    padding: 24px;
  }

  .hero .btn,
  .hero .btn-outline,
  .cta-strip .btn-white {
    display: block;
    width: 100%;
    text-align: center;
  }
  .cta-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px;
    padding: 12px 14px;
  }

  .contact-item { min-height: 44px; }

  .footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
