
.custom-masonry-wrapper {
  display: flex;
  gap: var(--gap-d, 16px);
}
.masonry-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap-d, 16px);
  margin: 0;
  padding: 0;
}
.masonry-item {
  break-inside: avoid;
  margin: 0;
  padding: 0;
}
.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}
.masonry-item img:hover {
  transform: scale(1.05);
}

/* Lightbox */
#lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#lightbox-overlay img {
  max-width: 90%;
  max-height: 80%;
}
#lightbox-caption {
  color: white;
  margin-top: 1em;
  font-size: 1em;
  text-align: center;
  font-family: Arial, sans-serif;
}
.lightbox-nav {
  position: absolute;
  background: none;
  border: none;
  color: white;
  font-size: 2em;
  cursor: pointer;
  padding: 0.5em;
}
#lightbox-prev { left: 2%; top: 50%; transform: translateY(-50%); }
#lightbox-next { right: 2%; top: 50%; transform: translateY(-50%); }
#lightbox-close { top: 5%; right: 2%; }

@media (min-width: 981px) {
  .custom-masonry-wrapper {
    column-count: var(--columns-d, 3);
  }
}
@media (max-width: 980px) and (min-width: 768px) {
  .custom-masonry-wrapper {
    column-count: var(--columns-t, 2);
  }
}
@media (max-width: 767px) {
  .custom-masonry-wrapper {
    column-count: var(--columns-m, 1);
  }
}
