/* ═══════════════════════════════════════════════════
gallery.css — photo grid + lightbox
═══════════════════════════════════════════════════ */

.gallery {
  padding: var(--space-xl) 0;
  background: var(--cream);
}

.gal-intro {
  max-width: 620px;
  margin: 0 0 var(--space-md);
  text-align: left;
  color: var(--teak-warm);
}

.gal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}

.gal-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--linen);
}

.gal-item:nth-child(5n+1) {
  grid-row: span 2;
  aspect-ratio: 4/6.2;
}

.gal-item:nth-child(6n+2) { transition-delay: 60ms; }
.gal-item:nth-child(6n+3) { transition-delay: 120ms; }
.gal-item:nth-child(6n+4) { transition-delay: 180ms; }
.gal-item:nth-child(6n+5) { transition-delay: 240ms; }
.gal-item:nth-child(6n+6) { transition-delay: 300ms; }

.gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s var(--ease-out, ease), filter .4s ease, opacity .5s ease;
  filter: saturate(.95);
  opacity: 0;
}

.gal-item img.loaded {
  opacity: 1;
}

.gal-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(21,13,4,.35) 0%, transparent 45%);
  opacity: 0;
  transition: opacity .3s ease;
}

.gal-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.05);
}

.gal-item:hover::after {
  opacity: 1;
}

.gal-note {
  margin-top: var(--space-md);
  text-align: left;
  color: var(--teak-warm);
}

.gal-note a {
  color: var(--saffron-deep);
  font-weight: 600;
  text-decoration: none;
}

.gal-note a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .gal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 620px) {
  .gal-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .5rem;
  }
  .gal-item:nth-child(5n+1) {
    grid-row: span 2;
    aspect-ratio: 4/6;
  }
}

/* ── Lightbox ───────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 2, .92);
  backdrop-filter: blur(4px);
  animation: lbFade .25s ease both;
}

.lightbox[hidden] {
  display: none;
}

@keyframes lbFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-img {
  max-width: min(90vw, 1100px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: rgba(245, 237, 224, .1);
  border: 1px solid rgba(245, 237, 224, .25);
  color: #f5ede0;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: rgba(245, 237, 224, .2);
}

.lb-close {
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
}

.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }

@media (max-width: 620px) {
  .lb-prev, .lb-next { width: 42px; height: 42px; font-size: 1.6rem; }
  .lb-close { width: 38px; height: 38px; font-size: 1.4rem; }
}