/* ==========================================================================
   Property Preview — Slideshow
   Full-screen image/video slideshow overlay with navigation, thumbnails,
   and slide transition animations.
   ========================================================================== */

body.property-preview-slideshow-open {
  overflow: hidden;
}

.property-preview-slideshow {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(8, 15, 31, 0.92);
  backdrop-filter: blur(2px);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 5vw, 4rem) clamp(3.5rem, 6vh, 5rem);
  gap: clamp(1.25rem, 3vw, 2rem);
  z-index: 1080;
}

.property-preview-slideshow[hidden] {
  display: none;
}

.property-preview-slideshow__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(1200px, 90vw);
  max-height: calc(100vh - 220px);
  z-index: 1;
}

.property-preview-slideshow__picture {
  display: flex;
  align-items: center;
  justify-content: center;
}

.property-preview-slideshow__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 90vw);
  max-height: 100%;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  will-change: transform;
}

/* Video in slideshow */
.property-preview-slideshow__stage video[data-slideshow-video] {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 90vw);
  max-height: calc(100vh - 220px);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  background-color: #000;
}

.property-preview-slideshow__stage[data-transition='next'] .property-preview-slideshow__image {
  animation: property-preview-slideshow-slide-next 0.45s ease both;
}

.property-preview-slideshow__stage[data-transition='prev'] .property-preview-slideshow__image {
  animation: property-preview-slideshow-slide-prev 0.45s ease both;
}

.property-preview-slideshow__caption {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.82) 100%);
  backdrop-filter: blur(2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
  line-height: 1.4;
}

.property-preview-slideshow__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.24s ease, background-color 0.24s ease;
  z-index: 3;
}

.property-preview-slideshow__nav .material-icons-outlined {
  font-size: 2.125rem;
}

.property-preview-slideshow__nav--prev {
  left: clamp(1rem, 5vw, 3.5rem);
}

.property-preview-slideshow__nav--next {
  right: clamp(1rem, 5vw, 3.5rem);
}

.property-preview-slideshow__nav:hover,
.property-preview-slideshow__nav:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.08);
  outline: none;
}

.property-preview-slideshow__close {
  position: fixed;
  top: clamp(1rem, 4vw, 2.5rem);
  right: clamp(1rem, 4vw, 2.5rem);
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.24s ease, background-color 0.24s ease;
  z-index: 3;
}

.property-preview-slideshow__close:hover,
.property-preview-slideshow__close:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
  outline: none;
}

.property-preview-slideshow__thumbnails {
  position: fixed;
  bottom: clamp(1.5rem, 4vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  max-width: min(90vw, 960px);
  overflow-x: auto;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 1rem;
  z-index: 2;
}

.property-preview-slideshow__thumbnails::-webkit-scrollbar {
  height: 6px;
}

.property-preview-slideshow__thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.property-preview-slideshow__thumb {
  border: 0;
  padding: 0;
  width: 64px;
  height: 64px;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.property-preview-slideshow__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video thumbnail styling */
.property-preview-slideshow__thumb-video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(87, 166, 96, 0.25), rgba(30, 64, 175, 0.25));
  position: relative;
}

.property-preview-slideshow__thumb-video .material-icons-outlined {
  font-size: 2rem;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.property-preview-slideshow__thumb:hover,
.property-preview-slideshow__thumb:focus-visible {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.45);
  outline: none;
}

.property-preview-slideshow__thumb.is-active {
  border-color: var(--gf-color-primary, #22c55e);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

@keyframes property-preview-slideshow-slide-next {
  0% {
    transform: translate3d(6%, 0, 0) scale(0.995);
    opacity: 0;
  }

  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@keyframes property-preview-slideshow-slide-prev {
  0% {
    transform: translate3d(-6%, 0, 0) scale(0.995);
    opacity: 0;
  }

  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .property-preview-slideshow__stage[data-transition] .property-preview-slideshow__image {
    animation: none;
  }
}

@media (max-width: 575.98px) {
  .property-preview-slideshow {
    padding-bottom: clamp(2.75rem, 9vh, 4.5rem);
  }

  .property-preview-slideshow__nav {
    width: 48px;
    height: 48px;
  }

  .property-preview-slideshow__thumb {
    width: 56px;
    height: 56px;
  }
}
