.lightbox-image-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.lightbox-image-link:focus-visible,
.figure__link[data-lightbox-trigger]:focus-visible {
  outline: 3px solid #1f66a6;
  outline-offset: 3px;
}

.figure__link[data-lightbox-trigger] {
  cursor: zoom-in;
}

.image-lightbox {
  width: min(96vw, 90rem);
  max-width: none;
  max-height: 96vh;
  max-height: 96dvh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #fff;
}

.image-lightbox::backdrop {
  background: rgb(0 0 0 / 0.92);
}

.image-lightbox__content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(3rem, 1fr) minmax(0, auto) minmax(3rem, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: center;
  max-height: 96vh;
  max-height: 96dvh;
}

.image-lightbox__image {
  grid-column: 2;
  grid-row: 1;
  display: block;
  max-width: 100%;
  max-height: 82vh;
  max-height: 82dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.image-lightbox__close,
.image-lightbox__navigation {
  z-index: 1;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 0.375rem;
  background: rgb(0 0 0 / 0.7);
  color: white;
  cursor: pointer;
  font: inherit;
}

.image-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.image-lightbox__navigation {
  grid-row: 1;
  justify-self: center;
  padding: 0.65rem 0.75rem;
}

.image-lightbox__previous {
  grid-column: 1;
}

.image-lightbox__next {
  grid-column: 3;
}

.image-lightbox__caption {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0.75rem 3.5rem 0;
  text-align: center;
}

.image-lightbox__credit {
  display: block;
  margin-top: 0.25rem;
  color: rgb(255 255 255 / 0.75);
  font-size: 0.875rem;
}

.image-lightbox__counter {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0.5rem 0 0;
  color: rgb(255 255 255 / 0.75);
  font-size: 0.875rem;
  text-align: center;
}

.image-lightbox button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 40rem) {
  .image-lightbox__content {
    grid-template-columns: minmax(2.5rem, 1fr) minmax(0, auto) minmax(2.5rem, 1fr);
  }

  .image-lightbox__image {
    max-height: 76vh;
    max-height: 76dvh;
  }

  .image-lightbox__navigation {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}
