/* The controls and the persistent contact button each get their own space. */
:root {
  --wa-width: 136px;
  --wa-edge: 24px;
  --wa-safe-edge: env(safe-area-inset-right, 0px);
}
html[dir="rtl"] {
  --wa-safe-edge: env(safe-area-inset-left, 0px);
}
.floating-whatsapp,
html[dir] .floating-whatsapp {
  left: auto;
  right: auto;
  inset-inline-end: calc(var(--wa-edge) + var(--wa-safe-edge));
  inline-size: var(--wa-width);
}
.page-hero .hero-bottom {
  inset-inline-start: var(--gutter);
  inset-inline-end: max(var(--gutter), calc(var(--wa-width) + var(--wa-edge) + var(--wa-safe-edge) + 14px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.7vw, 24px);
}
.page-hero .hero-photo-caption {
  max-width: none;
  margin: 0;
  text-align: end;
}
.page-hero .hero-navigation {
  margin: 0;
}

/* Keep both lines of the residence title and the control rail in view. */
.page-hero.hero-residence {
  min-height: 100svh;
  padding-block: calc(var(--header) + clamp(26px, 5.5svh, 54px)) clamp(86px, 12svh, 122px);
}
.hero-residence .hero-content {
  width: min(100%, 930px);
  max-width: none;
}
.page-hero.hero-residence .hero-content h1 {
  font-size: clamp(40px, min(5.4vw, 10svh), 78px);
  line-height: 1.03;
}
html[dir="rtl"] .hero-residence .hero-content h1 {
  line-height: 1.22;
}
.hero-residence .hero-content .eyebrow {
  margin-bottom: clamp(12px, 2svh, 19px);
}
.hero-residence .hero-description {
  max-width: 430px;
  margin-block: clamp(14px, 2.5svh, 22px) clamp(18px, 3svh, 26px);
}

/* Let the residence sections follow their content instead of filling a screen each. */
main:has(> .hero-residence) > :is(.residence-story, .request-scene, .questions-scene),
main:has(> .hero-residence) > #collection > .featured {
  min-height: 0;
  padding-block: clamp(38px, 5.6svh, 60px);
}
.residence-story .residence-story-photo {
  height: clamp(300px, 48svh, 520px);
}

@media (max-width: 700px) {
  :root {
    --wa-width: 54px;
    --wa-edge: 16px;
  }
  .page-hero {
    min-height: 100svh;
    padding-block: calc(var(--header) + clamp(24px, 5svh, 48px)) clamp(96px, 15svh, 122px);
  }
  .page-hero .hero-bottom {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
  }
  .page-hero .hero-photo-caption {
    grid-column: 1 / -1;
    text-align: start;
  }
  .page-hero .scroll-cue {
    white-space: normal;
  }
  .hero-flight .hero-value strong {
    white-space: normal;
  }
  .page-hero.hero-residence .hero-content h1 {
    font-size: clamp(32px, 8.5vw, 58px);
  }
  .page-hero.hero-residence {
    padding-block-end: clamp(96px, 15svh, 122px);
  }
  .residence-story .residence-story-photo {
    height: clamp(245px, 72vw, 360px);
  }
}

@media (max-width: 700px) and (max-height: 690px) {
  .page-hero:is(.hero-flight, .hero-hotel) .hero-content h1 {
    font-size: clamp(34px, min(10.5vw, 9svh), 60px);
  }
  .hero-flight .hero-value {
    margin-top: 18px;
  }
  .hero-flight .hero-value strong {
    font-size: 28px;
  }
}
