  
  /* Light box CSS ------------------------------------------------------*/

  /* Masonry base you already have (example) */
.grid-sizer, .grid-item { width: 33.333%; }
.grid-item.pano { width: 100%; }
.grid-item img { display:block; width:100%; height:auto; border-radius:6px }

/* Lightbox overlay */
.lb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: grid;
  grid-template-rows: 1fr auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 9999;
}
.lb-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Image area */
.lb-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lb-img {
  max-width: 95vw;
  max-height: 85vh;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
  border-radius: 8px;
}

/* Controls */
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  top: 12px;
  background: rgba(0,0,0,.5);
  border: none;
  color: #fff;
  font: 600 16px/1 system-ui, sans-serif;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.lb-close { right: 12px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* Caption row */
.lb-caption {
  color: #eee;
  font: 500 14px/1.4 system-ui, sans-serif;
  padding: 10px 16px 16px;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 1.4em; /* space even if no caption */
}

/* Tappable areas for swipe/backdrop close */
.lb-backdrop {
  position: absolute;
  inset: 0;
}
@media (hover:hover) {
  .lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(0,0,0,.7); }
}

/* Keep your widths as before */
.grid-sizer,
.grid-item { width: 33.333%; }

/* Make anchor items behave like blocks and remove weird spacing */
.grid-item {
  display: block;
  margin: 0 0 12px;
  text-decoration: none; /* optional: remove underline */
}

/* Full-width panos still span a row */
.grid-item.pano { width: 100%; }

/* Images fill their item */
.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px; /* if you like */
}