
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 4.5rem 3rem 2rem;

  background: rgba(0, 0, 0, 0.94);
  color: #fff;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


.lightbox-figure {
  display: flex;
  flex-direction: column;

  align-items: center;

  width: 100%;
  height: 100%;

  margin: 0;

  min-width: 0;
  min-height: 0;
}



.lightbox-image {
  flex: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;

  min-width: 0;
  min-height: 0;
}

.lightbox-image img {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: 100%;

  object-fit: contain;

  user-select: none;
  -webkit-user-drag: none;
}



.lightbox-caption {
  flex: 0 0 auto;

  width: 100%;
  max-width: 900px;

  padding-top: 1rem;

  color: rgba(255, 255, 255, 0.75);

  font-size: var(--text-sm);
  line-height: 1.4;

  text-align: left;
}

.lightbox-caption[hidden] {
  display: none;
}


.lightbox-controls {
  position: absolute;

  top: 1rem;
  right: 1rem;

  z-index: 2;

  display: flex;
  align-items: center;

  gap: 0.25rem;
}


.lightbox-prev,
.lightbox-next,
.lightbox-close {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 3rem;
  height: 3rem;

  padding: 0;
  margin: 0;

  border: 0;

  background: transparent;
  color: #fff;

  font-family: inherit;
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;

  opacity: 0.7;

  transition: opacity 0.15s ease;
}


.lightbox-close {
  font-size: 2rem;
}


.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  opacity: 1;
}


.lightbox-prev:focus-visible,
.lightbox-next:focus-visible,
.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}



@media (max-width: 600px) {

  .lightbox {
    padding:
      4rem
      1rem
      1.25rem;
  }


  .lightbox-controls {
    top: 0.5rem;
    right: 0.5rem;
  }


  .lightbox-prev,
  .lightbox-next,
  .lightbox-close {
    width: 3rem;
    height: 3rem;
  }


  .lightbox-prev,
  .lightbox-next {
    font-size: 2.5rem;
  }


  .lightbox-close {
    font-size: 2.5rem;
  }


  .lightbox-caption {
    padding-top: 0.75rem;

    font-size: var(--text-sm);
  }

}