.gallery--stack {
  display: grid;
  gap: 1px;
}

.gallery-item,
.gallery-item img {
  width: 100%;
}

.gallery--mosaic {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: clamp(14rem, 28vw, 32rem);
  gap: var(--spacing-grid-column-gap);
}

.gallery--mosaic .gallery-item {
  min-width: 0;
  overflow: hidden;
}

.gallery--mosaic .gallery-item img {
  height: 100%;
  object-fit: cover !important;
}

.gallery--mosaic .gallery-item:nth-child(6n + 1),
.gallery--mosaic .gallery-item:nth-child(6n + 4) {
  grid-column: span 4;
}

.gallery--mosaic .gallery-item:nth-child(6n + 2),
.gallery--mosaic .gallery-item:nth-child(6n + 3) {
  grid-column: span 2;
}

.gallery--mosaic .gallery-item:nth-child(6n + 5),
.gallery--mosaic .gallery-item:nth-child(6n + 6) {
  grid-column: span 3;
}

@media (max-width: 1023px) {
  .gallery--mosaic {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    /* Stacked on mobile the 12px mosaic gap reads as too much dead space between
       full-width images; tighten it to a hairline. */
    gap: 4px;
  }

  .gallery--mosaic .gallery-item:nth-child(n) {
    grid-column: 1 / -1;
  }

  .gallery--mosaic .gallery-item img {
    height: auto;
    object-fit: contain !important;
  }
}

/* ---- Carousel ---------------------------------------------------------- */
.gallery-carousel {
  position: relative;
}

.gallery--carousel {
  display: flex;
  gap: var(--spacing-grid-column-gap, 12px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery--carousel::-webkit-scrollbar {
  display: none;
}

.gallery--carousel .gallery-item {
  flex: 0 0 auto;
  width: min(85%, 68rem);
  scroll-snap-align: start;
  margin: 0;
}

.gallery--carousel .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.gallery-carousel__btn:hover {
  background: rgba(0, 0, 0, 0.82);
}

.gallery-carousel__btn--prev { left: 1rem; }
.gallery-carousel__btn--next { right: 1rem; }

@media (max-width: 767px) {
  .gallery--carousel .gallery-item { width: 88%; }
  .gallery-carousel__btn { display: none; }
}

/* ---- Fade gallery (crossfade + dots) ----------------------------------- */
.gallery-fade {
  position: relative;
}

.gallery-fade__stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0d0d0d;
}

.gallery-fade__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.gallery-fade__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-fade__slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.gallery-fade__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.gallery-fade__btn:hover {
  background: rgba(0, 0, 0, 0.82);
}

.gallery-fade__btn--prev { left: 1rem; }
.gallery-fade__btn--next { right: 1rem; }

.gallery-fade__dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.gallery-fade__dot {
  width: 0.6rem;
  height: 0.6rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.gallery-fade__dot:hover { opacity: 0.75; }

.gallery-fade__dot.is-active {
  background: currentColor;
  opacity: 1;
}

@media (max-width: 767px) {
  .gallery-fade__btn { display: none; }
}

/* ---- Fade gallery: click-zones, directional cursor, framed on L/XL ------ */
.gallery-fade__zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 4;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
/* Directional cursor = NSYNK link-pill arrow (white arrow on CTA-blue circle) */

/* Zone positioning + directional cursor = NSYNK link-pill arrow (cached SVG files, no flicker) */
.gallery-fade__zone--prev { left: 0; cursor: url("../temple-cursor-left.svg") 20 20, w-resize; }
.gallery-fade__zone--next { right: 0; cursor: url("../temple-cursor-right.svg") 20 20, e-resize; }
