/* ── Mobile Polish Overrides ── */
/* Loaded AFTER the Tailwind build CSS to refine the mobile experience */

/* ─── 1. HERO SECTION (HOMEPAGE) ─── */
@media (max-width: 639px) {
  /* Don't force full-viewport hero */
  [class*="min-h-[calc(100vh"] {
    min-height: auto !important;
  }

  /* Tighten hero vertical padding */
  .diagonal-bottom .section-shell {
    padding-top: 3rem !important;
    padding-bottom: 3.5rem !important;
  }

  /* H1 — from 3rem down to 2rem */
  .diagonal-bottom h1 {
    font-size: 2rem !important;
    line-height: 1.1 !important;
  }

  /* Accent sub-line under heading */
  .diagonal-bottom h1 .text-accent {
    margin-top: 0.25rem !important;
  }

  /* Hero body text */
  .diagonal-bottom .section-shell p {
    font-size: 0.95rem !important;
    line-height: 1.55 !important;
    margin-top: 0.75rem !important;
  }

  /* Pull CTA buttons closer to copy */
  .diagonal-bottom .section-shell .mt-10 {
    margin-top: 1.5rem !important;
  }

  /* Trust badges row */
  .diagonal-bottom .section-shell .mt-8 {
    margin-top: 1rem !important;
  }
}

/* ─── 2. INTERIOR HERO (about, services, contact, etc.) ─── */
@media (max-width: 639px) {
  .interior-hero {
    padding-top: 5rem !important;
    padding-bottom: 3rem !important;
  }

  .interior-hero h1 {
    font-size: 1.65rem !important;
    line-height: 1.15 !important;
  }

  .interior-hero p {
    font-size: 0.9rem !important;
    margin-top: 0.5rem !important;
  }

  .interior-hero nav[aria-label="Breadcrumb"] {
    margin-bottom: 0.75rem !important;
    font-size: 0.75rem !important;
  }
}

/* ─── 3. SECTION HEADINGS ─── */
@media (max-width: 639px) {
  /* H2 section titles — used across all pages */
  h2.font-display {
    font-size: 1.4rem !important;
    line-height: 1.2 !important;
  }

  /* H3 — footer columns, sub-sections */
  h3.font-display {
    font-size: 1.2rem !important;
  }

  /* Overline labels ("OUR SERVICES", "WHY CHOOSE US", etc.) */
  p[class*="uppercase"][class*="tracking-"] {
    font-size: 0.65rem !important;
  }
}

/* ─── 4. STAT COUNTERS (HOMEPAGE) ─── */
@media (max-width: 639px) {
  /* Giant counter numbers text-5xl → 2rem */
  [class*="text-5xl"][class*="font-bold"][class*="text-accent"] {
    font-size: 2rem !important;
  }

  /* Stat label text */
  [class*="text-5xl"][class*="font-bold"][class*="text-accent"] + p {
    font-size: 0.8rem !important;
  }
}

/* ─── 5. SECTION SPACING ─── */
@media (max-width: 639px) {
  .section-space {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Slightly more side breathing room */
  .section-shell {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* Tighten grid gaps */
  [class*="grid"][class*="gap-10"] {
    gap: 1.5rem !important;
  }

  [class*="grid"][class*="gap-12"] {
    gap: 1.5rem !important;
  }

  [class*="grid"][class*="gap-8"] {
    gap: 1.25rem !important;
  }
}

/* ─── 6. CARDS & SURFACES ─── */
@media (max-width: 639px) {
  .card-surface {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }

  .content-surface {
    border-radius: 16px !important;
  }

  .content-surface[class*="p-6"],
  .content-surface[class*="p-8"] {
    padding: 1.25rem !important;
  }

  [class*="rounded-[28px]"] {
    border-radius: 16px !important;
  }

  [class*="rounded-[20px]"] {
    border-radius: 12px !important;
  }
}

/* ─── 7. TRUST BAR ─── */
@media (max-width: 639px) {
  /* Wrap trust items instead of horizontal scroll */
  [class*="overflow-x-auto"] {
    overflow-x: visible !important;
  }

  [class*="overflow-x-auto"] [class*="min-w-max"] {
    min-width: 0 !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem 0.75rem !important;
  }

  [class*="overflow-x-auto"] [class*="min-w-max"] > div {
    font-size: 0.75rem !important;
  }
}

/* ─── 8. REVIEWS PAGE ─── */
@media (max-width: 639px) {
  /* Rating summary number */
  [class*="text-5xl"][class*="font-bold"] {
    font-size: 2.25rem !important;
  }

  /* Review cards */
  [class*="columns-1"] > div {
    padding: 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Star rating row */
  [class*="columns-1"] > div [class*="flex"][class*="gap-1"] svg {
    width: 1rem !important;
    height: 1rem !important;
  }
}

/* ─── 9. EMERGENCY BANNER ─── */
@media (max-width: 639px) {
  .emergency-stripes {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .emergency-stripes p {
    font-size: 1.05rem !important;
    line-height: 1.3 !important;
  }

  .emergency-stripes a {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.85rem !important;
  }
}

/* ─── 10. ABOUT PAGE PLACEHOLDER IMAGE ─── */
@media (max-width: 639px) {
  [class*="h-[440px]"] {
    height: 200px !important;
  }

  [class*="h-[440px]"] [class*="p-10"] {
    padding: 1.5rem !important;
  }

  /* Owner name circle */
  [class*="h-[440px]"] [class*="h-28"] {
    width: 4rem !important;
    height: 4rem !important;
    font-size: 1.25rem !important;
  }
}

/* ─── 11. FOOTER ─── */
@media (max-width: 639px) {
  footer > div:first-child {
    gap: 2rem !important;
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  footer h3 {
    font-size: 1.15rem !important;
  }

  footer h4 {
    font-size: 1rem !important;
    margin-top: 1.25rem !important;
  }

  footer ul {
    margin-top: 0.5rem !important;
  }

  footer ul li + li {
    margin-top: 0.25rem !important;
  }

  footer [class*="border-t"] .section-shell {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    font-size: 0.7rem !important;
  }

  /* Social icons in footer */
  footer [class*="flex"][class*="gap-4"] a {
    padding: 0.5rem !important;
  }

  /* Footer tagline */
  footer p[class*="text-2xl"] {
    font-size: 1.1rem !important;
  }

  /* Footer description */
  footer p[class*="leading-7"] {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }

  /* Footer map */
  footer iframe {
    height: 140px !important;
  }
}

/* ─── 12. TOP BAR ─── */
@media (max-width: 639px) {
  [class*="bg-primary"][class*="px-4"][class*="py-2"] {
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
  }

  [class*="bg-primary"][class*="px-4"][class*="py-2"] .section-shell {
    min-height: auto !important;
  }

  [class*="bg-primary"][class*="px-4"][class*="py-2"] a {
    font-size: 0.85rem !important;
  }
}

/* ─── 13. HEADER / NAV ─── */
@media (max-width: 639px) {
  .brand-logo-script {
    font-size: 1.5rem !important;
  }

  .brand-logo-block {
    font-size: 0.8rem !important;
    letter-spacing: 0.18em !important;
  }

  .brand-logo-mark {
    width: 36px !important;
    height: 36px !important;
  }

  header .section-shell {
    min-height: 60px !important;
    gap: 0.5rem !important;
  }
}

/* ─── 14. CTA BUTTONS ─── */
@media (max-width: 639px) {
  a[class*="rounded-pill"][class*="bg-accent"],
  button[class*="rounded-pill"][class*="bg-accent"] {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    min-height: 44px !important;
  }

  a[class*="rounded-pill"][class*="border"],
  button[class*="rounded-pill"][class*="border"] {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    min-height: 44px !important;
  }
}

/* ─── 15. FORM FIELDS ─── */
@media (max-width: 639px) {
  .field-input {
    font-size: 1rem !important;
    padding: 0.625rem 0.75rem !important;
  }

  form[class*="p-6"] {
    padding: 1rem !important;
  }

  /* Form labels */
  form label span {
    font-size: 0.8rem !important;
  }
}

/* ─── 16. FAQ ACCORDION ─── */
@media (max-width: 639px) {
  details summary {
    padding: 0.75rem 0 !important;
    font-size: 0.95rem !important;
  }

  details > div {
    padding-bottom: 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* ─── 17. SERVICE CARDS ─── */
@media (max-width: 639px) {
  /* Make service cards more compact */
  .card-surface h3 {
    font-size: 1.05rem !important;
  }

  .card-surface p {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }
}

/* ─── 18. CONTACT PAGE ─── */
@media (max-width: 639px) {
  /* Phone number display */
  a[class*="text-3xl"] {
    font-size: 1.65rem !important;
  }

  /* Map embeds */
  iframe[class*="h-[300px]"] {
    height: 180px !important;
  }

  iframe[class*="h-[220px]"] {
    height: 140px !important;
  }

  /* Contact info spacing */
  aside [class*="space-y-5"] {
    gap: 1rem !important;
  }

  aside [class*="space-y-5"] > * + * {
    margin-top: 0.75rem !important;
  }
}

/* ─── 19. GALLERY ─── */
@media (max-width: 479px) {
  [class*="grid"][class*="grid-cols-2"] {
    gap: 0.5rem !important;
  }
}

/* ─── 20. BODY TEXT ─── */
@media (max-width: 639px) {
  /* General paragraph text — slightly smaller */
  .section-space p[class*="leading-8"],
  .section-space p[class*="leading-7"] {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
  }

  /* "Why choose us" feature items */
  .card-surface [class*="font-semibold"] {
    font-size: 0.95rem !important;
  }
}

/* ─── 21. BLOG POSTS ─── */
@media (max-width: 639px) {
  article img {
    border-radius: 12px !important;
  }

  /* Blog post body */
  article [class*="prose"] {
    font-size: 0.9rem !important;
  }

  /* Blog card on listing page */
  article h2 a,
  article h3 a {
    font-size: 1.05rem !important;
  }
}

/* ─── 22. SERVICE AREA CITY PAGES ─── */
@media (max-width: 639px) {
  /* Service list on city pages */
  [class*="grid"][class*="gap-4"] a[class*="card-surface"] {
    padding: 1rem !important;
  }
}

/* ─── 23. CAREERS PAGE ─── */
@media (max-width: 639px) {
  /* Benefits/perks grid */
  [class*="grid"][class*="gap-6"] [class*="card-surface"] {
    padding: 1rem !important;
  }
}
