/* --- MASONRY GRID (uncomment for masonry) --- */
.gallery {
  column-count: 9;
  /* column-gap: 16px; */
  /* padding: 20px; */
}

@media (max-width: 1100px) { .gallery { column-count: 7; } }
@media (max-width: 900px)  { .gallery { column-count: 5; } }
@media (max-width: 600px)  { .gallery { column-count: 3; } }

.gallery img {
  margin: 0px 0px 0px 0px; 
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transform-origin: center;
  transition: 
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
  margin-bottom: 14px;
}

.gallery img:hover {
  /* transform: scale(1.03); */
  box-shadow: 0 8px 8px rgba(0,0,0,0.25);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 999;
}

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

/* Container ensures images fit nicely in viewport */
.lightbox-content {
  position: relative;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
}

/* Lightbox image scaling */
#lightbox-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  /* border-radius: 10px; */
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: block;
  margin: auto;
}

#lightbox-img.loaded {
  opacity: 1;
  transform: scale(1);
}

/* ===== Navigation Buttons ===== */
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.0);
  border: none;
  color: #fff;
  font-size: 34px;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
  user-select: none;
}

.nav:hover {
  background: rgba(0,0,0,0.6);
}

.nav.left { left: -70px; }
.nav.right { right: -70px; }

@media (max-width: 600px) {
  .nav.left { left: -45px; }
  .nav.right { right: -45px; }
}