.czw-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 56px 24px 24px;
  background: rgba(3, 10, 17, .92);
  overscroll-behavior: contain;
  touch-action: pinch-zoom;
}

.czw-lightbox[hidden] { display: none; }

.czw-lightbox__figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.czw-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(94vw, 1500px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .55);
  touch-action: pinch-zoom;
}

.czw-lightbox__caption {
  max-width: min(90vw, 900px);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.czw-lightbox__caption:empty { display: none; }

.czw-lightbox__close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font: 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.czw-lightbox__close:focus-visible {
  outline: 3px solid #4fd8d0;
  outline-offset: 3px;
}

body.czw-lightbox-open { overflow: hidden; }

@media (max-width: 600px) {
  .czw-lightbox { padding: 62px 12px 18px; }
  .czw-lightbox__image {
    max-width: 96vw;
    max-height: calc(100vh - 104px);
  }
}
