.rental-gallery figure {
  cursor: zoom-in;
}

.rental-gallery figure:focus-visible {
  outline: 3px solid #0b6b53;
  outline-offset: 3px;
}

.rental-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-columns: minmax(44px, 1fr) minmax(0, auto) minmax(44px, 1fr);
  grid-template-rows: minmax(44px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  justify-items: center;
  padding: 58px 72px 44px;
  color: #fff;
  background: rgba(4, 14, 11, .94);
}

.rental-lightbox[hidden] { display: none; }

.rental-lightbox__stage {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
}

.rental-lightbox__image {
  display: block;
  width: auto;
  max-width: min(92vw, 1600px);
  height: auto;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 36px rgba(0, 0, 0, .38);
}

.rental-lightbox__image[hidden] { display: none; }

.rental-lightbox__caption {
  max-width: min(92vw, 960px);
  margin-top: 12px;
  text-align: center;
  line-height: 1.5;
}

.rental-lightbox__error {
  padding: 24px;
  color: #fff;
  text-align: center;
}

.rental-lightbox__original {
  margin-top: 8px;
  color: #fff;
  font-size: 14px;
  text-underline-offset: 3px;
}

.rental-lightbox__original:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.rental-lightbox__button {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .48);
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.rental-lightbox__button:hover,
.rental-lightbox__button:focus-visible {
  background: #0b6b53;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.rental-lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}

.rental-lightbox__previous { grid-column: 1; grid-row: 2; justify-self: start; }
.rental-lightbox__next { grid-column: 3; grid-row: 2; justify-self: end; }

@media (max-width: 700px) {
  .rental-lightbox {
    padding: 58px 12px max(18px, env(safe-area-inset-bottom));
  }

  .rental-lightbox__image {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 145px);
  }

  .rental-lightbox__previous,
  .rental-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .rental-lightbox__previous { left: 12px; }
  .rental-lightbox__next { right: 12px; }

  .rental-lightbox__button {
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rental-lightbox * { scroll-behavior: auto !important; }
}
