.masonry {
  column-count: 4;
  column-gap: 16px;
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}
.masonry-item img {
  width: 100%;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
}
.masonry-item:hover img {
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 1200px) {
  .masonry {
    column-count: 3;
  }
}
@media (max-width: 768px) {
  .masonry {
    column-count: 2;
  }
}
@media (max-width: 480px) {
  .masonry {
    column-count: 1;
  }
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px); /* background blur for cool effect */
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 99999;
  pointer-events: none;
}
.lightbox-overlay.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
    margin-top:10%;
  max-width: 90vw;
  max-height: 400px;
  object-fit: contain;  /* maintain aspect ratio */
  border-radius: 10px;
  /*box-shadow: 0 0 40px rgba(255, 255, 255, 0.7);*/
  cursor: zoom-out;
  animation: zoomIn 0.3s ease forwards;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Close button */
.lightbox-close {
  position: fixed;
  top: 110px;
  right: 30px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  font-weight: 900;
  z-index: 100000;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}
.lightbox-close:hover {
  color: #ddd;
}


/* Smaller image on tablets */
@media (max-width: 768px) {
  .lightbox-image {
    max-height: 300px;
  }
}

/* Even smaller on mobiles */
@media (max-width: 480px) {
  .lightbox-image {
    max-width: 80vw;
    max-height: 400px;
  }
}
