.bws-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.bws-lightbox::backdrop {
  background: rgb(0 0 0 / 0.88);
}

.bws-lightbox__panel {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: clamp(1rem, 3vw, 3rem);
  box-sizing: border-box;
}

.bws-lightbox__figure {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}

.bws-lightbox__image {
  display: block;
  width: auto;
  max-width: min(94vw, 1800px);
  height: auto;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
  box-shadow: 0 1rem 4rem rgb(0 0 0 / 0.35);
}

.bws-lightbox__caption {
  max-width: min(90vw, 70ch);
  color: #fff;
  text-align: center;
  line-height: 1.5;
}

.bws-lightbox__caption[hidden] {
  display: none;
}

.bws-lightbox__close {
  position: fixed;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.bws-lightbox__close:hover,
.bws-lightbox__close:focus-visible {
  background: rgb(255 255 255 / 0.24);
}

html.bws-lightbox-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .bws-lightbox[open] .bws-lightbox__image {
    animation: bws-lightbox-in 160ms ease-out;
  }

  @keyframes bws-lightbox-in {
    from { opacity: 0; transform: scale(0.985); }
    to { opacity: 1; transform: scale(1); }
  }
}
