/* Dream Greener – mobile layout overrides (load AFTER styles.css).
   Goal: less vertical scrolling on phones.
   - Services, reviews and gallery become swipeable rows (CSS scroll-snap, no library).
   - "How can we help?" quote cards sit side by side.
   - "Why choose us" features become a compact 2 x 2 grid.
   Desktop/tablet layouts are untouched (everything is inside max-width:640px). */

@media (max-width: 640px) {

  /* ---------- Shared swipe row ---------- */
  body .swipe {
    display: flex !important;
    grid-template-columns: none !important;
    columns: auto !important;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    margin-bottom: 0;
  }
  body .swipe::-webkit-scrollbar { display: none; }
  body .swipe > * {
    flex: 0 0 84%;            /* next card peeks in so people know to swipe */
    max-width: 84%;
    scroll-snap-align: start;
    margin: 0 !important;
    break-inside: auto;
  }

  /* ---------- Services (image 1) ---------- */
  body .grid-4.swipe > .service-card { flex-basis: 78%; max-width: 78%; display: flex; flex-direction: column; }
  body .grid-4.swipe .service-card__img img { aspect-ratio: 4 / 3; height: auto; width: 100%; object-fit: cover; }
  body .grid-4.swipe .service-card__body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
  body .grid-4.swipe .service-card__body h3 { margin: 0 0 6px; }
  body .grid-4.swipe .service-card__body p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
  body .grid-4.swipe .service-card__body .text-link { margin-top: auto; }

  /* ---------- Gallery (image 2): featured, full-bleed-style photo swiper ---------- */
  body .gallery.swipe > figure {
    flex-basis: 88%; max-width: 88%;
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
  }
  body .gallery.swipe img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
  body .section--paper .section-head .lead { font-size: 16px; }

  /* ---------- Reviews (home + testimonial page) ---------- */
  body .grid-3.swipe > .review,
  body .masonry.swipe > .review { flex-basis: 86%; max-width: 86%; display: flex; flex-direction: column; }
  body .swipe > .review blockquote { flex: 1; }

  /* ---------- Swipe dots (added by mobile.js) ---------- */
  .swipe-dots { display: flex; justify-content: center; gap: 8px; margin: 14px 0 0; padding: 0; }
  .swipe-dots button {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px;
    background: currentColor; opacity: .25; cursor: pointer;
    transition: width .2s ease, opacity .2s ease;
  }
  /* bigger invisible tap target without changing the look */
  .swipe-dots button { position: relative; }
  .swipe-dots button::after { content: ""; position: absolute; inset: -10px -6px; }
  .swipe-dots button[aria-current="true"] { width: 22px; opacity: .9; }

  /* ---------- "How can we help?" – side by side (image 3) ---------- */
  body .grid-2.paths {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px;
  }
  body .paths .path-card {
    padding: 16px 12px;
    border-radius: 16px;
    display: flex; flex-direction: column;
  }
  body .paths .path-card h3 { font-size: 17px; line-height: 1.2; margin: 0 0 6px; }
  body .paths .path-card p  { font-size: 13px; line-height: 1.45; margin: 0 0 12px; flex: 1; }
  body .paths .path-card .btn {
    width: 100%;
    white-space: normal;
    font-size: 13.5px;
    line-height: 1.25;
    padding: 11px 10px;
    min-height: 48px;
    text-align: center;
    justify-content: center;
  }
  body .section--dark .section-head .lead { font-size: 15px; }

  /* ---------- "Why choose us" – compact 2 x 2 ---------- */
  body .grid-4.features {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px;
  }
  body .features .feature { padding: 14px 12px; }
  body .features .feature__icon { width: 36px; height: 36px; margin-bottom: 8px; }
  body .features .feature__icon svg { width: 20px; height: 20px; }
  body .features .feature h3 { font-size: 15px; line-height: 1.25; margin: 0 0 4px; }
  body .features .feature p  { font-size: 13px; line-height: 1.45; margin: 0; }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  body .swipe { scroll-behavior: auto; }
}
