/* ==========================================================================
   Lightbox — galeria de fotos do imóvel em modal (viewport 16:9)
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: lightbox-in 0.25s ease both;
}
.lightbox[hidden] {
  display: none;
}
@keyframes lightbox-in {
  from {
    opacity: 0;
  }
}

/* Trava o scroll da página enquanto a modal está aberta */
body.lightbox-open {
  overflow: hidden;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  /* Sem backdrop-filter: sobre um overlay 88% escuro o blur é
     imperceptível e evita glitches de composição no Chrome. */
  background: rgba(10, 20, 32, 0.88);
  cursor: pointer;
}

.lightbox__panel {
  position: relative;
  width: min(1100px, 94vw, calc(78vh * 16 / 9));
  animation: lightbox-panel-in 0.3s ease both;
}
@keyframes lightbox-panel-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* ---- Viewport 16:9 ---- */
.lightbox__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-card);
  background: #060d15;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

/* Slides (crossfade, mesma mecânica do card) — imagem inteira, sem corte */
.lightbox__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox__slide.is-active {
  opacity: 1;
}

/* ---- Fechar ---- */
.lightbox__close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
.lightbox__close:hover {
  transform: scale(1.08);
}

/* ---- Contador "n / N" ---- */
.lightbox__counter {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  background: rgba(20, 37, 58, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font: 600 11px var(--font-head);
  padding: 5px 10px;
  border-radius: var(--r-pill);
}

/* ---- Setas ---- */
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: 21px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox__nav:hover {
  background: #fff;
}
.lightbox__nav--prev {
  left: 14px;
}
.lightbox__nav--next {
  right: 14px;
}

/* ---- Dots ---- */
.lightbox__dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  padding-top: 16px;
}
.lightbox__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.lightbox__dot.is-active {
  width: 22px;
  background: #fff;
}

/* Galeria com uma foto só: navegação não faz sentido */
.lightbox.is-single .lightbox__nav,
.lightbox.is-single .lightbox__dots,
.lightbox.is-single .lightbox__counter {
  display: none;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 14px;
  }
  .lightbox__close {
    top: -14px;
    right: -6px;
  }
  .lightbox__nav {
    width: 38px;
    height: 38px;
  }
  .lightbox__nav--prev {
    left: 8px;
  }
  .lightbox__nav--next {
    right: 8px;
  }
}
