.lightbox {
  width: min(96vw, 72rem);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 1.5rem);
  margin: auto;
  padding: var(--space-md);
  border: 0;
  background: rgb(10 16 28 / 0.96);
}

.lightbox::backdrop {
  background: rgb(10 16 28 / 0.72);
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 6rem);
  width: auto;
  height: auto;
  margin: 0 auto;
}

.lightbox__close {
  position: absolute;
  top: calc(var(--safe-top) + var(--space-sm));
  right: var(--space-sm);
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--color-text-on-dark);
  font-size: 1.75rem;
}

@supports (-webkit-touch-callout: none) {
  .lightbox {
    max-height: calc(100svh - var(--safe-top) - var(--safe-bottom) - 1.5rem);
  }

  .lightbox__image {
    max-height: calc(100svh - 7rem);
  }
}
