/* Lightbox overlay */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.9);
  padding: 2rem;
}
.lb-overlay.open { display: flex; }
.lb-overlay[aria-hidden="true"] { display: none; }

.lb-figure {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: .75rem;
}
.lb-img {
  max-width: 95vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,.4);
  background: #111; /* placeholder while loading */
}
.lb-caption {
  color: #fff;
  text-align: center;
  font-size: .95rem;
  line-height: 1.4;
  word-break: break-word;
}

/* Controls */
.lb-btn {
  position: absolute;
  appearance: none;
  border: none;
  background: rgba(0,0,0,.35);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  transition: background .15s ease, transform .15s ease;
}
.lb-btn:hover { background: rgba(0,0,0,.55); transform: scale(1.04); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-btn:focus { outline: 2px solid #fff; outline-offset: 2px; }

/* Icon glyphs */
.lb-close::before { content: "×"; font-size: 30px; line-height: 1; }
.lb-prev::before { content: "‹"; font-size: 36px; line-height: 1; }
.lb-next::before { content: "›"; font-size: 36px; line-height: 1; }

/* Make gallery thumbnails show zoom cursor */
.gallery-grid img { cursor: zoom-in; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .lb-btn { transition: none; }
}