/* Residences — match PPTX mockup: wide cinematic banners + left text overlays */

.room-residences {
  position: relative;
  background: var(--color-canvas);
  color: #ffffff;
}

.chapter {
  position: relative;
  /* PPTX banners ~1900×620 → wide, shorter than old 72svh chapters */
  min-height: clamp(20rem, 42vw, 34rem);
  isolation: isolate;
  overflow: hidden;
  margin-bottom: clamp(1.75rem, 4vw, 3.25rem);
}

.chapter:last-child {
  margin-bottom: 0;
}

.chapter__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.chapter__edge {
  display: none;
}

.chapter__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Focal points from PPTX crops */
.chapter--malibu .chapter__media img {
  /* Kitchen island + artichokes + view */
  object-position: 58% 48%;
}

.chapter--jacksonville .chapter__media img {
  /* Millwork wall + hydrangeas + chairs */
  object-position: 62% 42%;
}

.chapter--urban .chapter__media img {
  /* Red sofa alcove + tulips + bouclé chairs */
  object-position: 48% 45%;
}

.chapter__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Malibu: soft bright — white type sits on light kitchen wall */
.chapter--malibu .chapter__veil {
  background: linear-gradient(
    90deg,
    rgba(28, 25, 23, 0.28) 0%,
    rgba(28, 25, 23, 0.08) 42%,
    rgba(28, 25, 23, 0.05) 100%
  );
}

/* Jacksonville: frosted left column like mockup */
.chapter--jacksonville .chapter__veil {
  background: linear-gradient(
    90deg,
    rgba(250, 247, 242, 0.55) 0%,
    rgba(250, 247, 242, 0.32) 34%,
    rgba(250, 247, 242, 0.08) 55%,
    rgba(28, 25, 23, 0.06) 100%
  );
}

/* 995 5th: darker left wash for white type */
.chapter--urban .chapter__veil {
  background: linear-gradient(
    90deg,
    rgba(28, 25, 23, 0.55) 0%,
    rgba(28, 25, 23, 0.22) 40%,
    rgba(28, 25, 23, 0.12) 100%
  );
}

/* PPTX does not show floating support cards on these banners */
.chapter__support-wrap {
  display: none !important;
}

.chapter__meta {
  position: relative;
  z-index: 2;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 4.5rem);
  max-width: min(36rem, 48%);
}

.chapter__meta::before {
  display: none;
}

.chapter--jacksonville .chapter__meta {
  max-width: min(38rem, 46%);
}

.chapter__kicker,
.chapter__title,
.chapter__narrative,
.chapter__link {
  text-shadow: 0 1px 18px rgba(28, 25, 23, 0.35);
}

.chapter__kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ffffff;
}

.chapter__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 6.5vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.chapter__narrative {
  margin: 0 0 1.35rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.45;
  max-width: 28ch;
  color: #ffffff;
}

.chapter__link {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
  padding-bottom: 0.28rem;
  align-self: flex-start;
  transition: opacity 0.25s ease;
}

.chapter__link:hover,
.chapter__link:focus-visible {
  opacity: 0.85;
  color: #ffffff;
}

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

@media (max-width: 767px) {
  .chapter {
    min-height: clamp(22rem, 70vw, 28rem);
  }

  .chapter__meta {
    max-width: none;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: clamp(2rem, 6vh, 3rem);
    background: linear-gradient(
      180deg,
      transparent 0%,
      rgba(28, 25, 23, 0.45) 100%
    );
  }

  .chapter--jacksonville .chapter__meta {
    max-width: none;
    background: linear-gradient(
      180deg,
      rgba(250, 247, 242, 0.15) 0%,
      rgba(28, 25, 23, 0.4) 100%
    );
  }

  .chapter__title {
    font-size: clamp(2.4rem, 12vw, 3.25rem);
  }

  .chapter__narrative {
    max-width: 34ch;
  }
}

/* Keep chapters visible without GSAP when JS reduces motion / editor */
.js .chapter__meta > * {
  opacity: 1;
}

.no-js .chapter__meta > * {
  opacity: 1;
}
