.image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: #000;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.image-lightbox.is-open {
  display: flex;
}

.image-lightbox__close,
.image-lightbox__nav {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  cursor: pointer;
}

.image-lightbox__close {
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 12px;
}

.image-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.image-lightbox__nav--prev {
  left: 8px;
}

.image-lightbox__nav--next {
  right: 8px;
}

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

.image-lightbox__track {
  display: flex;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  cursor: grab;
}

.image-lightbox__track::-webkit-scrollbar {
  display: none;
}

.image-lightbox__track:active {
  cursor: grabbing;
}

.image-lightbox__slide {
  display: flex;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.image-lightbox__slide img,
.image-lightbox__slide iframe {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 0;
}

.image-lightbox__slide iframe {
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 80vh;
}

.image-lightbox__slide.is-portrait iframe {
  width: min(100%, calc(85vh * 9 / 16));
  max-width: 420px;
  aspect-ratio: 9 / 16;
  height: auto;
  max-height: 85vh;
}

.image-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 3;
  margin: 0;
  transform: translateX(-50%);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

img.image-lightbox-source,
.property-media-trigger {
  cursor: zoom-in;
}
