/* Sizes are Figma px / 10 in em. At the client's request the dialog is larger than the mockup with tighter
   paddings: it fills the viewport up to 2× the mockup scale. */

.house-modal__dialog {
  width: 103.9em;
  padding: 2.4em 3em 3em;
  font-size: min(2rem, calc((100vw - var(--scrollbar, 0px) - 8rem) / 103.9), calc((100vh - 6rem) / 48.1));
}

.house-modal__price {
  align-self: flex-end;
  margin-top: 0.6em;
  background-color: #000;
}

.house-modal__body {
  display: flex;
  height: 30.3em;
}

.house-modal__thumbs {
  flex-shrink: 0;
  width: 9.3em;
  height: 100%;
  margin: 0 1.1em 0 0;
}

.house-modal__thumb {
  height: 6.9em;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.house-modal__thumb.swiper-slide-thumb-active,
.house-modal__thumb:hover {
  opacity: 1;
}

.house-modal__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.house-modal__main {
  flex-shrink: 0;
  width: 48.1em;
  height: 100%;
  margin: 0;
  cursor: grab;
}

.house-modal__main:active {
  cursor: grabbing;
}

.house-modal__slide .house-modal__image {
  object-position: right center;
}

/* Floor plans are shown whole on white */
.house-modal__thumb .house-modal__image--plan,
.house-modal__slide .house-modal__image--plan {
  object-fit: contain;
  object-position: center;
  background-color: var(--color-white);
}

.house-modal__info {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 39.4em;
  padding: 5.4em 1.5em 1.6em 4.2em;
  color: #000;
  background-color: var(--color-beige);
}

/* Two lines high as in the design, so the parameters stay in place */
.house-modal__name {
  align-self: flex-end;
  min-height: 2.3333em;
  margin: 0.479em 0.625em 0 0;
  font-size: 4.8em;
  font-style: italic;
  font-weight: 400;
  line-height: 1.2083;
  text-align: right;
  text-transform: uppercase;
}

.house-modal__stats {
  gap: 1em 3.1em;
  margin-top: 2.5em;
}

.house-modal__stats .house-stats__item:last-child {
  margin-left: -1em;
}

.house-modal__footer {
  display: grid;
  grid-template-columns: 10.4em 48.1em 39.4em;
  align-items: center;
  margin-top: 0.95em;
}

.house-modal__dots {
  display: flex;
  grid-column: 2;
  justify-self: center;
  align-items: center;
  gap: 0.6em;
  height: 1.3em;
  padding: 0 0.7em;
  border: 1px solid #000;
  border-radius: 2.7em;
}

.house-modal__dots[hidden] {
  display: none;
}

.house-modal__dot {
  flex-shrink: 0;
  width: 0.5em;
  height: 0.5em;
  border: 0.05em solid #000;
  border-radius: 50%;
}

.house-modal__dot.is-active {
  background-color: #000;
}

.house-modal__cta {
  grid-column: 3;
  justify-self: end;
  font-size: 1.5em;
}

/* Tablet & mobile
   ========================================================================== */

@media (max-width: 1023.98px) {
  .house-modal {
    padding: 0;
  }

  .house-modal__dialog {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 2rem var(--gutter) 3.2rem;
    font-size: 1rem;
    box-shadow: none;
  }

  .house-modal__price {
    margin-top: 2rem;
    font-size: 1.8rem;
  }

  .house-modal__body {
    flex-direction: column;
    height: auto;
  }

  .house-modal__thumbs {
    display: none;
  }

  .house-modal__main {
    width: 100%;
    height: auto;
    aspect-ratio: 481 / 303;
  }

  .house-modal__info {
    width: 100%;
    padding: 2rem;
  }

  .house-modal__name {
    min-height: 0;
    margin: 1.2rem 0 0;
    font-size: 3.2rem;
  }

  .house-modal__stats .house-stats__item:last-child {
    margin-left: 0;
  }

  .house-modal__stats {
    justify-content: space-between;
    width: 100%;
    margin-top: 2.4rem;
    font-size: 0.8rem;
  }

  .house-modal__footer {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 2.4rem;
    margin-top: 2.4rem;
  }

  .house-modal__dots {
    grid-row: 1;
    grid-column: 1;
    font-size: 1.4rem;
  }

  .house-modal__cta {
    grid-column: 1;
    width: 100%;
    font-size: 1.3rem;
  }
}

.house-modal__meta {
  margin-top: 0.6em;
  font-size: 1.6em;
  font-weight: 500;
  line-height: 1.3;
}

.house-modal__meta:empty {
  display: none;
}

.house-modal__extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 1.4em;
  margin-top: 1.4em;
  font-size: 1.5em;
  font-weight: 300;
}

.house-modal__extra:empty {
  display: none;
}

.house-modal__name {
  min-height: auto;
}
