/* ==========================================================================
   Gallery carousel — one photo at a time, with arrows and dots.
   Driven by gallery-carousel.js, which toggles the hidden attribute and
   the is-active class.
   ========================================================================== */

.gallery-carousel {
  position: relative;
  min-height: calc(100vh - 72px);
  padding: clamp(36px, 6vw, 76px) clamp(64px, 8vw, 120px);
  background: #102d14;
}

.gallery-stage {
  display: grid;
  place-items: center;
}

/* Slides ------------------------------------------------------------------ */

.gallery-frame {
  display: grid;
  place-items: center;
  width: 100%;
  margin: 0;
  animation: gallery-fade 300ms ease;
}

.gallery-frame[hidden] {
  display: none;
}

.gallery-frame img {
  display: block;
  width: min(100%, 880px);
  max-height: 76vh;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.gallery-frame figcaption {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: min(100%, 880px);
  margin-top: 24px;
  color: #f8f5ed;
}

/* The slide number, e.g. "03". */
.gallery-frame figcaption > span {
  color: #b5c6b1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.gallery-frame figcaption strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.gallery-frame figcaption p {
  margin: 6px 0 0;
  color: #c5d2c2;
  line-height: 1.5;
}

@keyframes gallery-fade {
  from {
    opacity: 0;
    transform: translateX(14px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Controls ---------------------------------------------------------------- */

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 880px);
  margin: 30px auto 0;
}

/* The arrows are pulled out of the flex row and pinned beside the photo,
   which is capped at 880px wide and centred. */
.gallery-arrow {
  position: absolute;
  top: 45%;
  z-index: 2;
  width: fit-content;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(16, 45, 20, 0.88);
  color: #f8f5ed;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  transform: translateY(-50%);
}

.gallery-arrow:first-child {
  left: max(12px, calc(50% - 520px));
}

.gallery-arrow:last-child {
  right: max(12px, calc(50% - 520px));
}

.gallery-arrow:hover {
  border-color: #d3ad55;
  background: #d3ad55;
  color: #153819;
}

.gallery-arrow:focus-visible,
.gallery-dot:focus-visible {
  outline: 3px solid var(--focus-on-dark);
  outline-offset: 4px;
}

.gallery-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid #d8e2d5;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: width 180ms ease, border-radius 180ms ease, background-color 180ms ease;
}

/* The active dot stretches into a gold pill. */
.gallery-dot.is-active {
  width: 28px;
  border-color: #d3ad55;
  border-radius: 999px;
  background: #d3ad55;
}

/* Responsive -------------------------------------------------------------- */

/* The arrows shrink to circles and their labels become screen-reader only. */
@media (max-width: 600px) {
  .gallery-carousel {
    min-height: auto;
    padding-inline: 20px;
  }

  .gallery-arrow {
    top: 43%;
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .gallery-arrow:first-child {
    left: 8px;
  }

  .gallery-arrow:last-child {
    right: 8px;
  }

  .gallery-arrow span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .gallery-frame img {
    max-height: 62vh;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-dot {
    transition: none;
  }

  .gallery-frame {
    animation: none;
  }
}
