/* ============================================================
   Complete Home Refresh — Global Mobile Responsiveness
   Applied to all pages via <link href="/mobile.css">
   ============================================================ */

/* Prevent horizontal overflow on all pages */
html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* ── Headings: scale down large text on small screens ── */
@media (max-width: 640px) {

  /* Section headings (h2 text-5xl / text-4xl) */
  h1, h2 {
    font-size: clamp(1.6rem, 7vw, 2.25rem) !important;
    line-height: 1.15 !important;
    word-break: break-word;
  }

  h3 {
    font-size: clamp(1.1rem, 5vw, 1.5rem) !important;
    line-height: 1.2 !important;
  }

  /* Prevent any single word from overflowing */
  * {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* ── Fixed-height photo containers: scale down ── */
  [style*="height:200px"] { height: 130px !important; }
  [style*="height:220px"] { height: 130px !important; }
  [style*="height:240px"] { height: 140px !important; }
  [style*="height:270px"] { height: 150px !important; }
  [style*="height:300px"] { height: 160px !important; }
  [style*="height:400px"] { height: 180px !important; }

  /* ── Grid: collapse 3-col grids to single column ── */
  .grid-cols-3,
  [class*="grid-cols-3"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Hero image: hide on small screens ── */
  .hero-img-wrap { display: none !important; }

  /* ── Services / card sections ── */
  .grid-cols-2.md\:grid-cols-3,
  .md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* ── Pricing cards: stack vertically ── */
  .lg\:grid-cols-3,
  .md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* ── Before/after grids: keep 2-col but reduce height ── */
  .grid-cols-2 {
    width: 100%;
  }

  /* ── Padding adjustments ── */
  section, .section-pad {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* ── Stat numbers / large display text ── */
  .text-5xl, .text-6xl {
    font-size: 2rem !important;
  }
  .text-4xl {
    font-size: 1.75rem !important;
  }

  /* ── Service cards: stack icon above text on mobile ── */
  .service-card {
    padding: 1.25rem !important;
  }
  .service-card > div.flex {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .service-card .flex-shrink-0 {
    width: 3rem !important;
    height: 3rem !important;
  }
  .service-card .flex-shrink-0 i {
    font-size: 1.1rem !important;
  }

  /* ── All flex rows: allow wrapping on mobile ── */
  .flex.items-start.gap-6,
  .flex.items-start.gap-8 {
    flex-wrap: wrap;
    gap: 0.75rem !important;
  }

  /* ── Page hero sections on subpages ── */
  .page-hero {
    padding: 5rem 1rem 2rem !important;
  }

  /* ── Max-width containers: ensure full width ── */
  .max-w-5xl, .max-w-4xl, .max-w-3xl, .max-w-2xl {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}
