/* ─── Gallery Grid ───────────────────────────────────────────── */
.gallery-grid {
  padding: 0 0 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 0;
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
  background: #111;
  position: relative;
  aspect-ratio: 2 / 3;
}


.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms ease, transform 400ms ease, filter 300ms ease;
  will-change: opacity, transform;
}

.gallery-item.loaded img {
  opacity: 1;
  transform: none;
}

.gallery-item:hover img {
  filter: brightness(0.75);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity var(--transition, 200ms ease);
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-label {
  font-family: var(--font-display, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

/* ─── Lightbox ───────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lb-img-wrap {
  position: relative;
  max-width: calc(100vw - 6rem);
  max-height: calc(100vh - 6rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

#lb-img {
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  display: block;
  transition: opacity 180ms ease;
}

#lb-img.switching { opacity: 0; }

.lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 1.5rem;
  transition: color 150ms ease;
  user-select: none;
}

.lb-btn:hover { color: #fff; }

#lb-prev { left: 1rem; }
#lb-next { right: 1rem; }

#lb-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  font-size: 1.5rem;
  color: rgba(255,255,255,0.6);
  transition: color 150ms ease;
  z-index: 201;
}
#lb-close:hover { color: #fff; }

#lb-counter {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
}
