/* Casa Udo gallery — a photographic layer above the existing variant stack. */

.hero-gallery-stage {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-gallery-slide {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: translate3d(-100%, 0, 0);
  transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hero-gallery-slide.is-off-left {
  transform: translate3d(-100%, 0, 0);
}

.hero-gallery-slide.is-active {
  transform: translate3d(0, 0, 0);
}

.hero-gallery-slide.is-off-right {
  transform: translate3d(100%, 0, 0);
}

.hero-gallery-slide.is-repositioning {
  transition: none !important;
}

.moment-image[data-hero-ui="v8"] .hero-gallery-slide picture,
.moment-image[data-hero-ui="v8"] .hero-gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.moment-image[data-hero-ui="v8"] .hero-gallery-slide img {
  object-fit: cover;
  object-position: 50% 50%;
  animation: none;
}

.hero-gallery-rail {
  position: absolute;
  z-index: 5;
  top: 45%;
  right: 0;
  display: flex;
  margin: 0;
  padding: 10px 8px 10px 10px;
  border: 1px solid rgba(255, 253, 248, 0.24);
  border-right: 0;
  border-radius: 18px 0 0 18px;
  flex-direction: column;
  gap: 8px;
  background: rgba(8, 24, 18, 0.43);
  box-shadow: 0 18px 42px rgba(4, 13, 10, 0.18);
  backdrop-filter: blur(12px) saturate(112%);
  transform: translateY(-50%);
}

.hero-gallery-thumb {
  position: relative;
  display: block;
  width: clamp(76px, 5vw, 96px);
  aspect-ratio: 1.5;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 248, 0.26);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.08);
  box-shadow: none;
  opacity: 0.68;
  cursor: pointer;
  transform: translateZ(0);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.hero-gallery-thumb::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 55%, rgba(7, 18, 14, 0.24));
  content: "";
  pointer-events: none;
}

.hero-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: none !important;
}

.hero-gallery-thumb:hover,
.hero-gallery-thumb:focus-visible {
  border-color: rgba(255, 253, 248, 0.78);
  opacity: 1;
  transform: scale(1.045);
}

.hero-gallery-thumb[aria-pressed="true"] {
  border-color: #fffdf8;
  box-shadow:
    0 0 0 2px rgba(255, 253, 248, 0.2),
    0 9px 24px rgba(4, 13, 10, 0.24);
  opacity: 1;
  transform: scale(1.045);
}

.hero-gallery-mobile-cue {
  display: none;
}

@media (max-width: 760px) and (orientation: portrait) {
  .hero-gallery-rail {
    display: none;
  }

  .hero-gallery-slide {
    transition-duration: 620ms;
  }

  .moment-image[data-hero-ui="v8"] .hero-gallery-slide picture {
    width: 100%;
    height: 100dvh;
  }

  .moment-image[data-hero-ui="v8"] .hero-gallery-slide img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
  }

  .hero-gallery-mobile-cue {
    position: absolute;
    z-index: 5;
    display: block;
    top: 37%;
    right: 0;
    left: 0;
    height: 66px;
    pointer-events: auto;
  }

  .hero-gallery-mobile-swipe-label {
    pointer-events: none;
  }

  .hero-gallery-mobile-arrow {
    position: absolute;
    top: 0;
    display: grid;
    width: 32px;
    height: 42px;
    border: 1px solid rgba(255, 253, 248, 0.25);
    padding: 0;
    place-items: center;
    color: rgba(255, 253, 248, 0.82);
    background: rgba(7, 23, 17, 0.22);
    box-shadow: 0 9px 24px rgba(4, 13, 10, 0.1);
    backdrop-filter: blur(7px);
    opacity: 0.68;
    cursor: pointer;
    pointer-events: auto;
    transition:
      border-color 180ms ease,
      background 180ms ease,
      opacity 260ms ease,
      transform 180ms ease;
  }

  .hero-gallery-mobile-arrow::after {
    position: absolute;
    inset: -1px;
    border: 1px solid rgba(255, 253, 248, 0.5);
    border-radius: inherit;
    content: "";
    opacity: 0;
    pointer-events: none;
    animation: gallery-arrow-pulse 9s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  }

  .hero-gallery-mobile-arrow svg {
    width: 17px;
    height: 17px;
  }

  .hero-gallery-mobile-arrow-left {
    left: 0;
    border-left: 0;
    border-radius: 0 999px 999px 0;
  }

  .hero-gallery-mobile-arrow-left::after {
    animation-delay: 2.8s;
  }

  .hero-gallery-mobile-arrow-right {
    right: 0;
    border-right: 0;
    border-radius: 999px 0 0 999px;
  }

  .hero-gallery-mobile-arrow-right::after {
    animation-delay: 3.05s;
  }

  .hero-gallery-mobile-arrow:active,
  .hero-gallery-mobile-arrow:focus-visible {
    border-color: rgba(255, 253, 248, 0.62);
    background: rgba(7, 23, 17, 0.44);
    opacity: 1;
    transform: scale(0.94);
  }

  .hero-gallery-mobile-swipe-label {
    position: absolute;
    top: 49px;
    left: 50%;
    color: rgba(255, 253, 248, 0.64);
    font-family: var(--sans);
    font-size: 0.5rem;
    font-weight: 690;
    letter-spacing: 0.14em;
    line-height: 1;
    text-shadow: 0 2px 12px rgba(4, 13, 10, 0.4);
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(-50%);
    transition: opacity 320ms ease;
  }

  .moment-image.gallery-has-swiped .hero-gallery-mobile-arrow {
    opacity: 0.56;
  }

  .moment-image.gallery-has-swiped .hero-gallery-mobile-swipe-label {
    opacity: 0;
  }
}

@keyframes gallery-arrow-pulse {
  0%, 76%, 100% {
    opacity: 0;
    transform: scale(1);
  }
  79% {
    opacity: 0.44;
  }
  86% {
    opacity: 0;
    transform: scale(1.55, 1.38);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-gallery-slide {
    transition-duration: 1ms;
  }

  .hero-gallery-mobile-arrow::after {
    animation: none;
  }

}
