/* ── GALLERY PAGE STYLES ── */

/* ── GRID ── */
#gallery {
  background: var(--cream);
  padding: 64px 32px 96px;
}

.masonry-grid {
  columns: 3;
  column-gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  cursor: pointer;
  overflow: hidden;
  background: var(--taupe-mid);
}

.masonry-item img {
  width: 100%;
  display: block;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.masonry-item:hover img {
  transform: scale(1.03);
  opacity: 0.88;
}

/* ── LIGHTBOX ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(20, 15, 12, 0.96);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.lightbox.active {
  display: flex;
}

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 82vh;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 82vh;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 64px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  transition: color 0.2s;
}

.lightbox-close:hover { color: var(--white); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 2.2rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}

.lightbox-counter {
  font-family: 'Lato', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .masonry-grid { columns: 2; }
}

@media (max-width: 540px) {
  .masonry-grid { columns: 1; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
