body.is-lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.lightbox[aria-hidden="false"] {
  display: block;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 70px;
  box-sizing: border-box;
}

.lightbox__figure {
  max-width: min(100%, 1000px);
  max-height: 100%;
  margin: 0;
  text-align: center;
}

.lightbox__image {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  vertical-align: bottom;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.lightbox__image.is-loading {
  opacity: 0.4;
}

.lightbox__caption {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
}

.lightbox__close,
.lightbox__nav {
  appearance: none;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 32px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 64px;
  transform: translateY(-50%);
  border-radius: 4px;
  font-size: 48px;
}

.lightbox__nav--prev {
  left: 20px;
}

.lightbox__nav--next {
  right: 20px;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.25);
}

@media screen and (max-width: 767px) {
  .lightbox__inner {
    padding: 50px 20px;
  }

  .lightbox__image {
    max-height: calc(100vh - 130px);
  }

  .lightbox__nav {
    width: 40px;
    height: 52px;
    font-size: 40px;
  }

  .lightbox__nav--prev {
    left: 8px;
  }

  .lightbox__nav--next {
    right: 8px;
  }

  .lightbox__close {
    top: 12px;
    right: 12px;
  }
}