/* =============================================================
   MOBILE OVERHAUL — comprehensive responsive fixes
   Appended to the Intellimark design system.
   ============================================================= */

/* --- Prevent horizontal overflow globally --- */
@media (max-width: 880px) {
  html, body { overflow-x: hidden; }
  .wrap {
    padding-left: clamp(16px, 4vw, 40px) !important;
    padding-right: clamp(16px, 4vw, 40px) !important;
  }
}

/* --- Tablet range (641px–880px) --- */
@media (min-width: 641px) and (max-width: 880px) {
  .home-stat-strip { grid-template-columns: repeat(2, 1fr) !important; }
  .section { padding: clamp(56px, 8vw, 96px) 0; }
}

/* --- Mobile (≤640px) --- */
@media (max-width: 640px) {
  /* Section spacing */
  .section { padding: clamp(44px, 8vw, 64px) 0; }
  .section--tight { padding: clamp(32px, 6vw, 48px) 0; }

  /* Section heads */
  .s-head { margin-bottom: clamp(28px, 5vw, 40px); }
  .s-head__title { font-size: clamp(26px, 7.5vw, 38px); }
  .s-head__sub { font-size: 15px; }

  /* Buttons — full width, stacked */
  .btn { width: 100%; justify-content: center; }
  .btn--lg { padding: 16px 24px; font-size: 16px; }
  .hero-btns {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  /* Stat strip — 2 cols */
  .home-stat-strip { grid-template-columns: repeat(2, 1fr) !important; gap: 2px !important; }

  /* Ruled cards */
  .ruled { padding: 24px 18px !important; }

  /* CTA block */
  .cta-block { padding: clamp(44px, 8vw, 64px) 0; }
  .cta-block__title { font-size: clamp(24px, 7.5vw, 34px); }
  .cta-block__sub { font-size: 15px; }

  /* FAQ */
  .faq-item summary { font-size: 15px; padding: 18px 8px; }
  .faq-body { font-size: 15px; }

  /* Footer */
  .footer { padding-top: 44px; }
  .footer__inner { padding-bottom: 36px; }
  .footer__meta { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Ghost numbers */
  .fx-ghost-num__digit { font-size: 130px !important; }

  /* Nav CTA in mobile menu */
  .nav[data-mobile-open="true"] .nav__cta {
    width: calc(100% - 48px) !important;
    text-align: center;
    justify-content: center;
  }

  /* Photo grid */
  .photo-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .photo-placeholder { min-height: 240px !important; }

  /* Tile cards */
  .tile { min-width: 0; min-height: auto; padding: 24px 20px; }
  .tile__body { max-width: 100%; }
  .tile__title { font-size: clamp(22px, 6vw, 30px); }

  /* Marquee */
  .fx-marquee__item { font-size: 12px; }

  /* Day/night toggle */
  .fx-dn { bottom: 12px; right: 12px; }
}

@media (max-width: 400px) {
  .fx-dn__label { display: none; }
  .fx-dn { padding: 6px 10px 6px 6px; }
}

/* --- Photo grid (homepage) --- */
@media (max-width: 780px) {
  .photo-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .photo-placeholder { min-height: 240px !important; }
}
