.houses {
  background-color: var(--color-bg);
  padding-bottom: clamp(48px, 8vw, 92px);
}

#houses-heading {
  scroll-margin-top: 96px;
}

.houses__slider {
  position: relative;
  container-type: inline-size;
}

.houses__swiper {
  position: relative;
  overflow: hidden;
}

.houses__swiper .swiper-slide {
  height: auto;
}

.houses__card {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 20px);
  min-width: 0;
  height: 100%;
  color: inherit;
}

.houses__media-wrap {
  position: relative;
  min-width: 0;
}

.houses__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 286 / 360;
  text-decoration: none;
  color: inherit;
}

.houses__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.6s ease;
}

.houses__media:hover .houses__image,
.houses__card:focus-within .houses__image {
  transform: scale(1.04);
}

.houses__decor {
  position: absolute;
  z-index: 2;
  right: clamp(10px, 1.4vw, 18px);
  bottom: clamp(10px, 1.4vw, 18px);
  display: block;
  width: clamp(52px, 7vw, 72px);
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  filter: brightness(0) invert(1);
  opacity: 0.92;
  transform: translate(0, 0) rotate(0deg);
  transition:
    opacity 0.2s ease,
    transform 0.52s cubic-bezier(0.22, 0.8, 0.28, 1);
  will-change: transform, opacity;
}

.houses__decor-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.houses__decor.is-running {
  transform: translate(var(--rabbit-run-x, 120px), var(--rabbit-run-y, -60px)) rotate(12deg);
  opacity: 0;
  pointer-events: none;
}

.houses__decor.is-gone {
  visibility: hidden;
}

.houses__decor:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 4px;
}

.houses__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1.8vw, 1.375rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.houses__title-link {
  color: inherit;
  text-decoration: none;
}

.houses__nav {
  position: absolute;
  z-index: 2;
  display: flex;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  top: calc(100cqi * 360 / 286 / 2);
}

.houses__nav img {
  display: block;
  width: clamp(36px, 4vw, 40px);
  height: auto;
}

.houses__nav--prev {
  left: clamp(8px, 1.2vw, 16px);
}

.houses__nav--next {
  right: clamp(8px, 1.2vw, 16px);
}

.houses__nav:hover {
  transform: translateY(-50%) scale(1.05);
}

.houses__nav:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.houses__nav.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  transform: translateY(-50%);
}

.houses__pagination.swiper-pagination {
  position: static;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: clamp(28px, 4vw, 40px);
  line-height: 0;
}

.houses__pagination .swiper-pagination-bullet {
  margin: 0 !important;
  border: 1px solid #2D495E;
  border-radius: 50%;
  background-color: transparent;
  box-sizing: border-box;
  opacity: 1;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.houses__pagination .swiper-pagination-bullet-active {
  background-color: #2D495E;
  transform: scale(1.15);
}

@media (min-width: 601px) {
  .houses__nav {
    top: calc((100cqi / 2) * 360 / 286 / 2);
  }
}

@media (min-width: 901px) {
  .houses__nav {
    top: calc((100cqi / 3) * 360 / 286 / 2);
  }
}
