/* ============================================================
   GALLERY PAGE — two rolling carousels (People + Projects)
   Manifest-driven: /gallery/gallery.json → /js/gallery.js.
   Reuses base.css tokens; only adds the carousel.
   ============================================================ */

.gallery-section { overflow: hidden; }

/* Mount point holds the JS-built carousel (or an empty-state message). */
.gallery-carousel { margin-top: 2.5rem; }

.gallery-empty {
  margin-top: 2.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--gray-mid);
  font-size: 1rem;
  background: var(--gray-light);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
/* On the navy section, lighten the empty state to suit. */
.section--navy .gallery-empty,
.gallery-section--dark .gallery-empty {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
}

/* ── CAROUSEL SHELL ──────────────────────────────────────────── */
.carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy-dark);
  box-shadow: 0 24px 60px rgba(10, 22, 40, 0.22);
}

/* The track scroll-snaps one full-width slide at a time. Scrollbar hidden. */
.carousel__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }

.carousel__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  margin: 0;
  scroll-snap-align: center;
}

.carousel__media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--navy-dark);
}
.carousel__media picture,
.carousel__media img {
  width: 100%;
  height: 100%;
}
/* `contain` so nobody in a group/line-up photo is ever cropped out; the navy
   matte fills any letterbox and reads as deliberate against the brand. */
.carousel__media img { object-fit: contain; object-position: center; }

/* ── CAPTION LABEL (overlaid on a legibility scrim) ──────────── */
.carousel__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3.5rem 1.75rem 1.5rem;
  color: var(--white);
  background: linear-gradient(
    to top,
    rgba(10, 22, 40, 0.92) 0%,
    rgba(10, 22, 40, 0.72) 45%,
    rgba(10, 22, 40, 0) 100%
  );
}

.carousel__date {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.carousel__title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.carousel__text {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  /* Use the full image width — long, many-name captions then spread sideways
     instead of stacking tall and climbing up over the photo. */
  max-width: none;
  text-wrap: pretty;
}

/* ── PREV / NEXT BUTTONS ─────────────────────────────────────── */
.carousel__btn {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(10, 22, 40, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--white);
  transition: background var(--ease), border-color var(--ease), transform 160ms var(--ease-out);
}
.carousel__btn:hover { background: rgba(10, 22, 40, 0.8); border-color: var(--white); }
.carousel__btn:active { transform: translateY(-50%) scale(0.94); }
.carousel__btn--prev { left: 1rem; }
.carousel__btn--next { right: 1rem; }

/* ── PAUSE / PLAY TOGGLE (top-left) ──────────────────────────── */
.carousel__playpause {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(10, 22, 40, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--white);
  transition: background var(--ease), border-color var(--ease), transform 160ms var(--ease-out);
}
.carousel__playpause:hover { background: rgba(10, 22, 40, 0.85); border-color: var(--white); }
.carousel__playpause:active { transform: scale(0.94); }

/* ── DOTS ────────────────────────────────────────────────────── */
.carousel__dots {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  gap: 0.45rem;
}
.carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  transition: background var(--ease), transform var(--ease);
}
.carousel__dot:hover { background: rgba(255, 255, 255, 0.7); }
.carousel__dot.is-active { background: var(--gold); transform: scale(1.25); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .carousel__caption { padding: 3rem 1.25rem 1.25rem; }
  .carousel__text {
    font-size: 0.875rem;
    /* Keep long group-photo captions from swallowing the image on phones. */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .carousel__btn { width: 40px; height: 40px; }
  .carousel__btn--prev { left: 0.6rem; }
  .carousel__btn--next { right: 0.6rem; }
}
