
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  background-color: var(--color-bg--overlay-dark);
}

.lightbox--navigable {
  .lightbox__previous,
  .lightbox__next {
    display: inherit;
  }
}

.lightbox__close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 12;
}

.lightbox__previous,
.lightbox__next {
  display: none;
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  z-index: 2;

  @media (min-width: 40em) {
    top: calc(50% - 2rem);
    bottom: auto;
  }
}

.lightbox__next {
  left: auto;
  right: 1rem;
}

.lightbox__wrapper {
  cursor: zoom-out;
}

.lightbox__content {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100vh;
  max-height: 75vw;
  width: 100vw;
  max-width: 100vw;
  transform: translate(-50%, -50%);

  @media (min-width: 40em) {
    padding: 5rem 5.5rem 6rem;
  }

  .spinner {
    display: inherit;
    position: absolute;
    top: calc(50% - 3.5rem);
    left: calc(50% - 3.5rem);
  }

  img,
  iframe {
    opacity: 0;
  }

  img {
    width: auto;
    max-height: 100%;
    max-width: 100%;
  }

  iframe {
    display: none;
    height: 100%;
    width: 100%;
  }

  &:focus {
    outline: none;
  }
}

.lightbox__content--loaded {
  img,
  iframe {
    transition: opacity 0.33s ease;
    opacity: 1;
  }

  .spinner { display: none; }
}

.lightbox__content--pdf {
  iframe { display: block; }
  img { display: none; }
}

.lightbox__download {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  z-index: 1;
  text-align: center;
}
