/* Gallery film strip on phones (D-33). One row of photos you swipe through; each snaps to the centre.
   Every slide shows its WHOLE photo (frame = photo shape, capped at 88% of the screen wide and just over half the
   screen tall); the first keeps the 4:3 lead frame from D-30. Wider screens keep the grid in sections.css. */

.gallery__count { display: none; }

@media (max-width: 700px) {
  .gallery__strip {
    --strip-h: min(56vh, 100vw);
    position: relative; /* slides' offsetLeft is measured from the strip (strip.js showSlide) */
    display: flex;
    align-items: center;
    gap: .75rem;
    height: var(--strip-h);
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 6vw;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  @supports (height: 1svh) { .gallery__strip { --strip-h: min(56svh, 100vw); } }
  .gallery__strip::-webkit-scrollbar { display: none; }
  .gallery__strip:focus-visible { outline-offset: -3px; }

  /* The two containers dissolve so all 15 buttons sit in the one row, in gallery order. */
  .gallery__strip > #galleryHero, .gallery__strip > #galleryGrid { display: contents; }

  .gallery__strip .gallery__hero-btn,
  .gallery__strip .gallery__item {
    flex: none;
    width: min(88vw, calc(var(--strip-h) * var(--r, .75)));
    height: auto;
    aspect-ratio: var(--r, .75);
    grid-row: auto;
    grid-column: auto;
    padding: 0;
    overflow: hidden;
    background: var(--sand);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    opacity: .55;
    transform: scale(.94);
    transition: opacity .35s ease, transform .35s ease;
  }
  .gallery__strip .is-current { opacity: 1; transform: none; }

  .gallery__strip img,
  .gallery__strip .gallery__hero {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    margin: 0;
    object-fit: cover;
  }
  .gallery__strip .gallery__item:hover img { transform: none; }

  .gallery__count {
    display: block;
    margin: 1rem 0 0;
    min-height: 1.6em;
    text-align: center;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--stone);
  }
  .gallery__count[hidden] { display: none; }
}

@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .gallery__strip { scroll-behavior: auto; }
  .gallery__strip .gallery__hero-btn, .gallery__strip .gallery__item { transition: none; transform: none; }
}
