.image-lightbox {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 64px 88px;
  background: rgba(1, 1, 2, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.image-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 128px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.55);
  user-select: none;
}

.image-lightbox__close,
.image-lightbox__arrow {
  position: absolute;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  color: #ffffff;
  background: rgba(8, 11, 22, 0.72);
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.image-lightbox__close:hover,
.image-lightbox__arrow:hover {
  color: #8dbbff;
  background: rgba(16, 25, 50, 0.92);
}

.image-lightbox__close:active,
.image-lightbox__arrow:active {
  transform: scale(0.92);
}

.image-lightbox__close:focus-visible,
.image-lightbox__arrow:focus-visible {
  outline: 3px solid #7ea4f5;
  outline-offset: 3px;
}

.image-lightbox__close {
  top: 24px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font: 300 38px/1 Arial, sans-serif;
}

.image-lightbox__arrow {
  top: 50%;
  width: 52px;
  height: 72px;
  border-radius: 8px;
  transform: translateY(-50%);
}

.image-lightbox__arrow:active {
  transform: translateY(-50%) scale(0.92);
}

.image-lightbox__arrow img {
  display: block;
  width: 30px;
  height: 30px;
}

.image-lightbox__arrow--previous {
  left: 20px;
}

.image-lightbox__arrow--next {
  right: 20px;
}

.image-lightbox__arrow[hidden] {
  display: none;
}

body.image-lightbox-open {
  overflow: hidden;
}

@media (min-width: 1200px) {
  .image-lightbox {
    padding:
      calc(64px * var(--browser-layout-scale, 1))
      calc(88px * var(--browser-layout-scale, 1));
  }

  .image-lightbox__image {
    max-height: calc(100vh - (128px * var(--browser-layout-scale, 1)));
    border-radius: calc(8px * var(--browser-layout-scale, 1));
  }

  .image-lightbox__close {
    top: calc(24px * var(--browser-layout-scale, 1));
    right: calc(28px * var(--browser-layout-scale, 1));
    width: calc(48px * var(--browser-layout-scale, 1));
    height: calc(48px * var(--browser-layout-scale, 1));
    font-size: calc(38px * var(--browser-layout-scale, 1));
  }

  .image-lightbox__arrow {
    width: calc(52px * var(--browser-layout-scale, 1));
    height: calc(72px * var(--browser-layout-scale, 1));
    border-radius: calc(8px * var(--browser-layout-scale, 1));
  }

  .image-lightbox__arrow img {
    width: calc(30px * var(--browser-layout-scale, 1));
    height: calc(30px * var(--browser-layout-scale, 1));
  }

  .image-lightbox__arrow--previous {
    left: calc(20px * var(--browser-layout-scale, 1));
  }

  .image-lightbox__arrow--next {
    right: calc(20px * var(--browser-layout-scale, 1));
  }
}

@media (max-width: 767px) {
  .image-lightbox {
    padding: 64px 16px 80px;
  }

  .image-lightbox__image {
    max-height: calc(100vh - 144px);
    border-radius: 4px;
  }

  .image-lightbox__close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .image-lightbox__arrow {
    top: auto;
    bottom: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transform: none;
  }

  .image-lightbox__arrow:active {
    transform: scale(0.92);
  }

  .image-lightbox__arrow--previous {
    left: calc(50% - 60px);
  }

  .image-lightbox__arrow--next {
    right: calc(50% - 60px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-lightbox,
  .image-lightbox__close,
  .image-lightbox__arrow {
    transition: none;
  }
}
