/* ==========================================================================
   GALLERY — responsive grid + lightbox
   ========================================================================== */

/* ---------------------------------- Category section --------------------- */
.gallery-section { margin-bottom: var(--space-7); }
.gallery-section:last-of-type { margin-bottom: 0; }

.gallery-section__heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-lg);
  border-bottom: 2px solid var(--color-gold);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
}
.gallery-section__heading svg {
  width: 26px;
  height: 26px;
  color: var(--color-gold);
  flex-shrink: 0;
}
.gallery-section__count {
  margin-left: auto;
  font-family: var(--font-label);
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  letter-spacing: 0.06em;
}

/* ---------------------------------- Photo grid --------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  background: var(--color-cream-deep);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
  display: block;
}

.photo-item:hover img { transform: scale(1.06); }

/* Caption overlay on hover */
.photo-item__caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, rgba(6,46,34,0.88), transparent);
  color: var(--color-cream);
  font-size: 0.82rem;
  padding: var(--space-4) var(--space-3) var(--space-2);
  transform: translateY(100%);
  transition: transform 300ms ease;
}
.photo-item:hover .photo-item__caption { transform: translateY(0); }

/* Zoom icon indicator */
.photo-item::after {
  content: "";
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  background: rgba(250,245,234,0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B4A38' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35M11 8v6M8 11h6'/%3E%3C/svg%3E") center/18px no-repeat;
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--transition);
}
.photo-item:hover::after { opacity: 1; }

@media (max-width: 600px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .photo-item__caption { display: none; }
}

/* ---------------------------------- Lightbox ---------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(6, 46, 34, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__inner {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lightbox__caption {
  color: rgba(250, 245, 234, 0.85);
  font-size: 0.9rem;
  text-align: center;
  max-width: 60ch;
}

.lightbox__counter {
  font-family: var(--font-label);
  font-size: 0.78rem;
  color: rgba(250, 245, 234, 0.55);
  letter-spacing: 0.08em;
}

/* Nav buttons */
.lightbox__btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(250, 245, 234, 0.12);
  border: 1px solid rgba(250, 245, 234, 0.25);
  color: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 901;
}
.lightbox__btn:hover { background: rgba(250, 245, 234, 0.25); }
.lightbox__btn svg { width: 22px; height: 22px; }
.lightbox__btn--prev { left: var(--space-4); }
.lightbox__btn--next { right: var(--space-4); }

.lightbox__close {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(250, 245, 234, 0.12);
  border: 1px solid rgba(250, 245, 234, 0.25);
  color: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 901;
  transition: background var(--transition);
}
.lightbox__close:hover { background: rgba(250, 245, 234, 0.25); }
.lightbox__close svg { width: 20px; height: 20px; }

@media (max-width: 600px) {
  .lightbox__btn--prev { left: var(--space-2); }
  .lightbox__btn--next { right: var(--space-2); }
  .lightbox__btn { width: 40px; height: 40px; }
}
