/* ========================================================================
   Nova Buzz Mobile-Friendly Overrides (added 2026-06-15)
   Loaded AFTER styles.min.css so rules win specificity battles.
   Target: iPhone (375-430px viewports) + small Android (360px+).
   Strategy: single-column stack, touch-friendly tap targets (48px+),
   16px input font-size (kills iOS zoom-on-focus), fluid type scaling.
   ======================================================================== */

/* Kill horizontal overflow site-wide */
html, body { max-width: 100vw; overflow-x: hidden; }

/* iPhone-style image rendering */
img, video, svg { max-width: 100%; height: auto; }

/* Touch devices — hide the custom desktop cursor that confuses iOS */
@media (hover: none), (pointer: coarse) {
  .custom-cursor { display: none !important; }
  body { cursor: auto !important; }
}

/* ---------- TABLET + iPHONE LANDSCAPE (≤ 900px) ---------- */
@media (max-width: 900px) {
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  h1 { font-size: clamp(2rem, 6vw, 2.8rem) !important; line-height: 1.18 !important; }
  h2 { font-size: clamp(1.7rem, 5vw, 2.3rem) !important; line-height: 1.22 !important; }
}

/* ---------- iPHONE / SMALL PHONE (≤ 768px) ---------- */
@media (max-width: 768px) {
  /* Universal container fluid padding */
  .container, main, .main-wrap { padding-left: 16px !important; padding-right: 16px !important; }

  /* Compact vertical section padding */
  .section, section { padding-top: 48px !important; padding-bottom: 48px !important; }

  /* Fluid heading scale */
  h1 { font-size: clamp(1.85rem, 8vw, 2.6rem) !important; line-height: 1.15 !important; letter-spacing: -0.01em !important; }
  h2 { font-size: clamp(1.55rem, 6.5vw, 2.1rem) !important; line-height: 1.2 !important; }
  h3 { font-size: clamp(1.15rem, 5vw, 1.5rem) !important; line-height: 1.3 !important; }
  h4 { font-size: 1rem !important; }
  p  { font-size: 1rem !important; line-height: 1.6 !important; }

  /* All grids → single column */
  .footer-grid,
  .contact-grid,
  .services-grid,
  .stats-grid,
  .values-grid,
  .cards-grid,
  .work-grid,
  .blog-grid,
  .form-row,
  [class*="grid"] { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Form rows: single column + roomy gap */
  .form-row { gap: 16px !important; display: flex !important; flex-direction: column !important; }
  .form-group { width: 100% !important; }

  /* Form controls — 48px touch height, 16px font (no iOS zoom) */
  input, select, textarea {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
  }
  textarea { min-height: 120px !important; }
  label { font-size: 0.95rem !important; margin-bottom: 6px !important; display: block !important; }

  /* Buttons — full width stacked, 48px touch height */
  .btn, button {
    min-height: 48px !important;
    padding: 14px 20px !important;
    font-size: 1rem !important;
  }
  .cta-buttons, .hero-buttons, .header-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .cta-buttons .btn, .hero-buttons .btn { width: 100% !important; }

  /* Header — collapse desktop nav, show simple icon menu */
  .header-nav,
  .nav-links,
  .header .nav { display: none !important; }
  .mobile-nav-toggle,
  .menu-toggle,
  .hamburger { display: block !important; }
  .header { padding: 12px 0 !important; }
  .logo, .brand { font-size: 1.1rem !important; }

  /* Contact page specific */
  .contact-info-item { padding: 16px 0 !important; }
  .contact-icon { width: 40px !important; height: 40px !important; font-size: 1.2rem !important; flex-shrink: 0 !important; }
  #contactForm { padding: 24px 18px !important; border-radius: 12px !important; }

  /* Stat cards — compact */
  .stat-card { padding: 24px 16px !important; }
  .stat-number { font-size: 2.2rem !important; }

  /* Value/service cards */
  .value-card, .service-card, .card { padding: 24px 18px !important; }

  /* Hero orbs / decorative — dial down on small screens */
  .hero-orb, .hero-orbs { opacity: 0.15 !important; }
  .hero-orb { width: 200px !important; height: 200px !important; }

  /* Footer */
  .footer { padding: 40px 0 24px !important; }
  .footer-col h4 { margin-bottom: 12px !important; }
  .footer-brand p { max-width: 100% !important; }
  .footer-social { gap: 12px !important; }

  /* Tap highlight */
  a, button { -webkit-tap-highlight-color: rgba(251, 171, 5, 0.18); }
}

/* ---------- ULTRA-SMALL (≤ 480px, iPhone SE) ---------- */
@media (max-width: 480px) {
  .container, main { padding-left: 14px !important; padding-right: 14px !important; }
  .section, section { padding-top: 36px !important; padding-bottom: 36px !important; }

  h1 { font-size: clamp(1.65rem, 8.5vw, 2.2rem) !important; }
  h2 { font-size: clamp(1.4rem, 7vw, 1.85rem) !important; }
  h3 { font-size: clamp(1.05rem, 5vw, 1.3rem) !important; }

  /* Generous tap padding for narrow phones */
  .btn, button { min-height: 50px !important; }

  #contactForm { padding: 20px 14px !important; }
  .stat-number { font-size: 1.9rem !important; }
}

/* ---------- SAFE-AREA INSETS (notched iPhones) ---------- */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .header, .footer {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}
