/* ===== Lightbox ===== */

.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: opacity;
  touch-action: none;
  cursor: zoom-out;
}

.lb-overlay.is-open {
  opacity: 1;
}

.lb-img-wrap {
  display: inline-flex;
  max-width: 90vw;
  max-height: 90dvh;
  transform-origin: center center;
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform, opacity;
  cursor: default;
}

.lb-overlay.is-open .lb-img-wrap {
  transform: scale(1);
  opacity: 1;
}

.lb-img-wrap img {
  display: block;
  max-width: 90vw;
  max-height: 90dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.lb-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lb-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lb-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.wp-block-image img {
  cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
  .lb-overlay,
  .lb-img-wrap {
    transition: none;
  }
}
