.house-gallery {
  --card-width: min(64vw, 390px);
  --card-step: clamp(18px, 4.5vw, 50px);
  width: 100%;
  margin-inline: auto;
}
.house-gallery-stage {
  width: var(--card-width);
  margin-inline: auto;
}
.house-slide { margin: 0 0 24px; }
.house-slide img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.house-gallery.is-ready .house-gallery-stage {
  position: relative;
  aspect-ratio: 3 / 4;
  perspective: 900px;
  touch-action: pinch-zoom;
  cursor: grab;
}
.house-gallery.is-ready .house-gallery-stage::before {
  content: '';
  position: absolute;
  inset: 0 calc(-1 * var(--card-step)) 0 0;
}
.house-gallery.is-ready .house-gallery-stage:active { cursor: grabbing; }
.house-gallery.is-ready .house-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(var(--card-step) * 2)) scale(.78);
  transition: transform .44s cubic-bezier(.2,.7,.25,1), opacity .32s ease, filter .32s ease;
}
.house-gallery.is-ready .house-slide[data-depth="2"] {
  z-index: 1;
  opacity: .42;
  filter: blur(1.4px);
}
.house-gallery.is-ready .house-slide[data-depth="1"] {
  z-index: 2;
  opacity: .76;
  filter: blur(.8px);
  transform: translateX(var(--card-step)) rotateY(-9deg) scale(.9);
}
.house-gallery.is-ready .house-slide[data-depth="0"] {
  z-index: 3;
  opacity: 1;
  transform: translateX(var(--drag-x, 0px));
}
.house-gallery.is-ready figcaption { display: none; }
.house-gallery-controls:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}
.house-gallery-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 25px;
  cursor: pointer;
}
.house-gallery-controls button:hover { background: #e7e3d8; }
.house-gallery-count { min-width: 48px; text-align: center; font-size: 12px; }
.house-gallery-caption, .house-slide figcaption {
  margin-top: 14px;
  text-align: center;
}
.house-gallery-caption strong, .house-slide figcaption strong {
  display: block;
  font-size: 18px;
}
.house-gallery-caption span, .house-slide figcaption span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: var(--muted);
}
.house-gallery-description {
  max-width: 540px;
  margin: 30px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
@media (prefers-reduced-motion: reduce) {
  .house-gallery.is-ready .house-slide { transition: none; }
}


.house-gallery.is-ready .house-slide img {
  box-shadow: 0 4px 10px #231c1722, 0 17px 31px -9px #231c1763;
}

.house-gallery.is-ready .house-gallery-stage.is-dragging .house-slide[data-depth="0"] {
  transition: none;
}

.house-gallery.is-ready .house-gallery-stage.is-dragging-back .house-slide.is-preview {
  z-index: 2;
  opacity: .76;
  filter: blur(.8px);
  transform: translateX(var(--card-step)) rotateY(-9deg) scale(.9);
}

.house-gallery-controls button { touch-action: manipulation; }

.house-gallery.is-ready .is-dragging-back .house-slide:not([data-depth="0"]):not(.is-preview) {
  visibility: hidden;
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .house-gallery.is-ready .house-slide {
    transition: transform .46s cubic-bezier(.22, .61, .36, 1),
      opacity .4s ease, filter .4s ease;
  }
}
