.gallery-section {
  background: var(--off-white);
  background-image: var(--bg-pattern);
  background-blend-mode: multiply;
  background-size: 1000px;
  background-position: center;
  background-repeat: repeat;
  padding-block: 6rem;
}

.gallery-index__intro {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 820px;
  margin-bottom: 2.5rem;
}

/* ── Grid ─────────────────────────────────────── */
.gallery-index__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .gallery-index__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .gallery-index__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Card ─────────────────────────────────────── */
.gallery-index-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-md);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.gallery-index-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* ── Image area ───────────────────────────────── */
.gallery-index-item__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy-pale);
  flex-shrink: 0;
}

.gallery-index-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
}

.gallery-index-item:hover .gallery-index-item__img-wrap img {
  transform: scale(1.06);
}

/* Hover overlay */
.gallery-index-item__pill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 85, 170, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-index-item:hover .gallery-index-item__pill {
  opacity: 1;
}

.gallery-index-item__pill span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.35rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.gallery-index-item__pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Image count badge — top right corner */
.gallery-index-item__badge {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(10, 22, 44, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.4;
}

.gallery-index-item__badge svg {
  width: 12px;
  height: 12px;
  opacity: 0.85;
}

/* ── Card body ────────────────────────────────── */
.gallery-index-item__body {
  padding: 1rem 1.25rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 2px solid var(--gold);
  flex: 1;
}

.gallery-index-item__caption {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--body-text);
  margin: 0;
  flex: 1;

  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Arrow indicator */
.gallery-index-item__arrow {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.gallery-index-item__arrow svg {
  width: 14px;
  height: 14px;
  color: var(--navy-mid);
  transition: color 0.25s ease;
}

.gallery-index-item:hover .gallery-index-item__arrow {
  background: var(--gold);
  transform: translateX(3px);
}

.gallery-index-item:hover .gallery-index-item__arrow svg {
  color: var(--navy);
}

/* ── Placeholder (no image) ─────────────────── */
.gallery-index-item__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-index-item__placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--navy-light);
  opacity: 0.25;
}

/* ── Empty state ─────────────────────────────── */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  opacity: 0.5;
}
/* ════════════════════════════════════════════════
   GALLERY DETAIL  –  card grid, no forced cropping
   ════════════════════════════════════════════════ */

.gallery-detail__intro {
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 820px;
  margin-bottom: 2.5rem;
}

/* ── Grid ─────────────────────────────────────── */
.gallery-detail__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  align-items: start; /* cards don't stretch to match tallest neighbour */
}

@media (max-width: 900px) {
  .gallery-detail__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .gallery-detail__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Card shell ───────────────────────────────── */
.gallery-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ── Image wrapper ────────────────────────────── */
.gallery-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy-pale);
  flex-shrink: 0;
}

.gallery-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center; /* keep faces in frame */
  display: block;
  transition: transform 0.55s ease;
}

.gallery-card:hover .gallery-card__img-wrap img {
  transform: scale(1.05);
}

/* Zoom icon — appears on hover */
.gallery-card__zoom {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 22, 44, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gallery-card:hover .gallery-card__zoom {
  opacity: 1;
}

.gallery-card__zoom svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

/* Caption overlay — fades in from bottom */
.gallery-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(17, 85, 170, 0.72) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-card:hover .gallery-card__overlay {
  opacity: 1;
}

.gallery-card__overlay-text {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ── Card footer ──────────────────────────────── */
.gallery-card__footer {
  padding: 0.85rem 1.1rem;
  border-top: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.gallery-card__caption {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--body-text);
  margin: 0;
  flex: 1;

  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Small index number badge */
.gallery-card__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy-pale);
  color: var(--navy-mid);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════ */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 15, 32, 0.96);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.lb-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.lb-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: block;
}

.lb-caption {
  margin-top: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  text-align: center;
  max-width: 640px;
  line-height: 1.5;
}

.lb-counter {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.lb-close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  line-height: 1;
  transition:
    color 0.2s,
    background 0.2s;
}
.lb-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.lb-close svg {
  width: 26px;
  height: 26px;
  display: block;
}

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
  z-index: 9001;
}
.lb-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lb-nav svg {
  width: 20px;
  height: 20px;
}
.lb-prev {
  left: 1rem;
}
.lb-next {
  right: 1rem;
}

@media (max-width: 600px) {
  .lb-nav {
    display: none;
  }
}

/* ── First card: split hero (image left, info right) ── */
.gallery-detail__grid > .gallery-card:first-child {
  grid-column: 1 / -1;
  flex-direction: row; /* side by side */
  min-height: 260px;
}

.gallery-detail__grid > .gallery-card:first-child .gallery-card__img-wrap {
  aspect-ratio: unset; /* let height be driven by the row */
  width: 380px;
  flex-shrink: 0;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.gallery-detail__grid > .gallery-card:first-child .gallery-card__footer {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  border-top: none;
  border-left: 3px solid var(--gold);
  flex: 1;
}

.gallery-detail__grid > .gallery-card:first-child .gallery-card__caption {
  font-size: 1.1rem;
  font-weight: 600;
  -webkit-line-clamp: 4;
  color: var(--body-text);
}

.gallery-detail__grid > .gallery-card:first-child .gallery-card__num {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
}

/* Date line inside the banner card */
.gallery-card__date {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.gallery-card__date svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Cover label badge */
.gallery-card__cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--navy-pale);
  color: var(--navy-mid);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.85rem;
}

@media (max-width: 700px) {
  .gallery-detail__grid > .gallery-card:first-child {
    flex-direction: column;
  }
  .gallery-detail__grid > .gallery-card:first-child .gallery-card__img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .gallery-detail__grid > .gallery-card:first-child .gallery-card__footer {
    border-left: none;
    border-top: 3px solid var(--gold);
  }
}
