/* EmanPix — gallery.css */
.masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 32px 80px;
  max-width: 1600px;
  margin: 0 auto;
}
.gallery-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
  display: block;
  transition: transform .3s ease, box-shadow .3s ease;
}
.gallery-item:hover { transform: scale(1.02); box-shadow: 0 8px 32px rgba(0,0,0,.15); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform .4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.93);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-img {
  max-width: 90vw;
  max-height: 87vh;
  object-fit: contain;
  display: block;
  animation: lb-in .3s ease;
}
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s;
  line-height: 1;
  z-index: 2;
}
.lb-close:hover { opacity: 1; }
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 56px;
  cursor: pointer;
  opacity: .5;
  transition: opacity .2s;
  padding: 16px;
  line-height: 1;
  z-index: 2;
}
.lb-arrow:hover { opacity: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  letter-spacing: .14em;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .masonry { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 0 16px 60px; }
  .gallery-item { aspect-ratio: 4/3; }
}
@media (max-width: 480px) {
  .masonry { grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 0 8px 48px; }
  .gallery-item { aspect-ratio: 1/1; }
}
