/* Lightweight image lightbox (front + admin) */

.js-lightbox {
  cursor: zoom-in;
}

html.lightbox-open,
html.lightbox-open body {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 28, 0.84);
  cursor: zoom-out;
}

.lightbox__figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.35rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.lightbox__close {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.65rem, env(safe-area-inset-right));
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #12233f;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
  background: #fff;
  outline: 2px solid #4d8dff;
  outline-offset: 2px;
}

@media (max-width: 576px) {
  .lightbox__figure {
    max-width: 100%;
    max-height: 88vh;
  }

  .lightbox__img {
    max-width: 100%;
    max-height: 88vh;
    width: 100%;
    object-fit: contain;
  }
}
