/* ===== Auto-scrolling gallery: slides 386 x 212 ===== */
.gal-sec {
  overflow: hidden;
}

.gal-car {
  position: relative;
  margin-top: 36px;
}

/* soft fade on both edges */
.gal-vp {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
}

.gal-track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  /* ~4 s per slide; the second copy makes the loop seamless */
  animation: galScroll calc(var(--n, 6) * 4s) linear infinite;
  will-change: transform;
}

.gal-track li {
  flex: 0 0 auto;
  margin: 0 16px 0 0; /* margin (not gap) so the loop is exactly -50% */
}

.gal-track figure {
  position: relative;
  margin: 0;
  width: min(600px, 82vw);
  height: 400px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f4d3a, #6b4a2e);
}

.gal-track img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gal-track figure:hover img {
  transform: scale(1.05);
}

.gal-track figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 14px 10px;
  text-align: left;
  font:
    600 12px Montserrat,
    sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f8f6ef;
  background: linear-gradient(0deg, rgba(8, 40, 30, 0.85), transparent);
  pointer-events: none;
}

/* pause on hover, keyboard focus, or via the button */
.gal-car:hover .gal-track,
.gal-car:focus-within .gal-track,
.gal-car.is-paused .gal-track {
  animation-play-state: paused;
}

.gal-pause {
  display: block;
  margin: 22px auto 0;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--green, #0f4d3a);
  background: transparent;
  color: var(--green, #0f4d3a);
  font:
    600 12px Montserrat,
    sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s;
}

.gal-pause:hover {
  background: var(--green, #0f4d3a);
  color: #f8f6ef;
}

@keyframes galScroll {
  to {
    transform: translateX(-50%);
  }
}

/* Reduced motion: no animation, the gallery becomes a swipeable strip */
@media (prefers-reduced-motion: reduce) {
  .gal-track {
    animation: none;
  }

  .gal-vp {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .gal-track li[aria-hidden='true'],
  .gal-pause {
    display: none;
  }
}
