/* ==========================================================================
   EA Cleaning Services — responsive layer
   Loaded after style.css on every page.

   The hand-authored .dc pages (index, about, contact, gallery, services)
   lay out with inline `style="display: grid; grid-template-columns: ..."`,
   so collapsing those to a single column needs !important. That is the
   reason for the [style*=...] rules below, not carelessness.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Laptop / small desktop
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .footer-grid > :last-child { grid-column: span 2; }

  .page-title { font-size: 42px; }
  .h2, .cta-title { font-size: 32px; }

  .step-list { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .split { gap: 40px; }
  .cta-band__inner { gap: 40px; }

  .section, .section--alt { padding: 72px 24px; }
}

/* --------------------------------------------------------------------------
   Tablet — collapse the nav into a toggle
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .site-nav { position: relative; }

  .nav-toggle-label { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(11, 30, 58, 0.08);
    box-shadow: 0 18px 36px rgba(11, 30, 58, 0.12);
  }

  .nav-toggle:checked ~ .nav-links { display: flex; }

  .nav-links .nav-link,
  .nav-links .nav-link--active {
    padding: 14px 4px;
    border-bottom: 1px solid rgba(11, 30, 58, 0.06);
    font-size: 16px;
  }

  .nav-links .btn-cta { margin-top: 16px; text-align: center; }

  .nav-logo { height: 46px; }
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .topbar { gap: 10px 18px; font-size: 13px; padding: 10px 16px; }
  .topbar-item--muted { display: none; }

  .page-hero { padding: 40px 20px 48px; }
  .page-title { font-size: 34px; max-width: none; }
  .page-tagline { font-size: 17px; }

  .section, .section--alt { padding: 56px 20px; }
  .section-head { margin-bottom: 36px; }
  .h2, .cta-title { font-size: 27px; }

  /* Generated pages */
  .split,
  .check-list,
  .step-list,
  .card-grid--3,
  .cta-band__inner { grid-template-columns: 1fr; }

  .step-list { gap: 26px; }
  .cta-band { padding: 56px 20px; }
  .quote-form { padding: 22px; }
  .chip-row { justify-content: flex-start; }

  .prose p, .prose li { font-size: 16px; }
  .prose h2 { font-size: 23px; margin-top: 34px; }

  .media-frame--tall { aspect-ratio: 4/3.4; }

  .btn { width: 100%; }
  .cta-band .btn--ghost { width: auto; }

  /* Hand-authored .dc pages: force every inline grid to a single column */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  [style*="padding: 88px"],
  [style*="padding: 80px"],
  [style*="padding: 96px"] { padding: 48px 20px !important; }

  [style*="font-size: 58px"] { font-size: 34px !important; }
  [style*="font-size: 42px"] { font-size: 27px !important; }
  [style*="aspect-ratio"] { aspect-ratio: 4/3 !important; }

  /* Floating hero badges overflow on narrow screens */
  [style*="position: absolute"][style*="left: -28px"],
  [style*="position: absolute"][style*="right: -18px"] {
    position: static !important;
    margin-top: 14px;
  }

  /* Fixed call / quote bar */
  .mobile-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #FFFFFF;
    border-top: 1px solid rgba(11, 30, 58, 0.1);
    box-shadow: 0 -8px 24px rgba(11, 30, 58, 0.12);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .mobile-bar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 58px;
    padding: 14px 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #0B1E3A;
    border-right: 1px solid rgba(11, 30, 58, 0.1);
  }
  .mobile-bar__btn:active { background: #F5F8FA; }

  .mobile-bar__btn--cta {
    background: #1DA654;
    color: #FFFFFF;
    border-right: 0;
  }
  .mobile-bar__btn--cta:hover,
  .mobile-bar__btn--cta:active { color: #FFFFFF; background: #189249; }

  /* Keep the bar from covering the last line of the footer. */
  body { padding-bottom: 58px; }

  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 28px !important; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .site-footer { padding: 48px 20px 28px; }

  .gallery-showcase { padding: 64px 20px 72px; }
  .gallery-intro { grid-template-columns: 1fr; gap: 18px; margin-bottom: 34px; }
  .gallery-intro-copy { font-size: 16px; max-width: 520px; }
  .gallery-toolbar { margin-bottom: 20px; }
  .gallery-count { flex-basis: 100%; margin: 4px 0 0; }
  .gallery-grid { grid-auto-rows: 150px; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-tile, .gallery-tile--tall { grid-row: span 2; }
  .gallery-tile--wide { grid-column: span 2; }
  .gallery-tile-label { bottom: 12px; left: 12px; }
  .gallery-tile-plus { display: none; }
  .gallery-note { align-items: flex-start; font-size: 13px; line-height: 1.5; text-align: left; }
}

/* --------------------------------------------------------------------------
   Small phones
   -------------------------------------------------------------------------- */
@media (max-width: 460px) {
  .page-title { font-size: 29px; }
  .h2, .cta-title { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .card { padding: 22px; }
  .review-card { padding: 22px; }
  .faq-item summary { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   Motion + print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .topbar, .site-header, .cta-band, .site-footer, .btn,
  .mobile-bar { display: none !important; }
  .section, .section--alt { padding: 12px 0; background: #FFFFFF; }
  .faq-item { break-inside: avoid; }
  .faq-item p { display: block !important; }
}
