/* Mobile photo slider (Swiper) for the home page gallery and /gallery. Hidden until the controller mounts
   it on narrow screens, so the grid remains the fallback without JavaScript and on wider screens. Photos
   keep their own proportions (no letterboxing) and run edge to edge; tap a photo to open the full-screen
   viewer. On the home page it replaces three stacked photographs with one swipeable row. */
.gallery-slider { display: none; }

@media (max-width: 767px) {
  .gallery-slider.is-active {
    display: block;
    position: relative;
    margin-inline: calc(var(--gutter, 1rem) * -1);
    --swiper-navigation-size: 18px;
    --swiper-navigation-color: #ffffff;
  }
  .gallery:has(.gallery-slider.is-active) .gallery__grid { display: none; }

  .gallery-slider__slide { height: auto; }
  .gallery-slider__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
  .gallery-slider__image { display: block; width: 100%; height: auto; }
  .gallery-slider__caption {
    margin: 0;
    padding: 0.6rem 1rem 0;
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-muted, #555);
  }
  .gallery-slider__counter.swiper-pagination-fraction {
    top: 0.6rem;
    bottom: auto;
    left: auto;
    right: 0.6rem;
    width: auto;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: var(--font-ui, var(--font-body));
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }
  .gallery-slider__nav { display: none; }
  .gallery--curated .gallery-slider__caption { padding-inline: var(--gutter, 1rem); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-slider .swiper-wrapper { transition-duration: 0ms !important; }
}

.gallery__count { margin: 0 0 1rem; font-size: 0.9rem; color: var(--color-muted); }

@media (max-width: 767px) {
  /* One scrollable row of filter chips instead of several wrapped rows. */
  .gallery--full .gallery__filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter, 1rem) * -1); padding-inline: var(--gutter, 1rem); -webkit-overflow-scrolling: touch; }
  .gallery--full .gallery__filters::-webkit-scrollbar { display: none; }
  .gallery--full .gallery__filters .chip { flex: none; }
  .gallery--full .gallery__count { margin-bottom: 0.6rem; }
}

@media (max-width: 767px) {
  .section:has(.gallery--full) { padding-top: 1.25rem; }
}
