.residence-page { background: var(--paper); }

.residence-hero {
  min-height: min(800px, calc(100svh - 82px));
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(520px, 1.18fr);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.residence-hero-copy {
  padding: clamp(4.5rem, 8vw, 7.5rem) max(4vw, calc((100vw - var(--content)) / 2 + 1.5rem));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-bottom: 2.6rem;
  color: rgba(23, 26, 24, .58);
  font-size: .72rem;
}
.breadcrumb a { padding-bottom: .15rem; border-bottom: 1px solid rgba(23, 26, 24, .32); }
.breadcrumb span[aria-current="page"] { color: var(--ink); }

.residence-hero h1 {
  max-width: 10ch;
  margin-bottom: 1.2rem;
  font-family: var(--serif);
  font-size: clamp(3.8rem, 6vw, 6.6rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .94;
}
.residence-location { margin-bottom: 1.7rem; color: var(--clay); font-size: .73rem; font-weight: 780; letter-spacing: .13em; line-height: 1.5; text-transform: uppercase; }
.residence-intro { max-width: 620px; margin-bottom: 2rem; color: rgba(23, 26, 24, .72); font-size: 1.05rem; line-height: 1.75; }
.residence-rate-note { max-width: 590px; margin: 2rem 0 0; padding-top: 1.15rem; border-top: 1px solid var(--line); color: rgba(23, 26, 24, .6); font-size: .76rem; line-height: 1.65; }

.residence-hero-media { min-height: 620px; position: relative; margin: 0; overflow: hidden; background: var(--stone); }
.residence-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 56%, rgba(8, 22, 17, .62)); pointer-events: none; }
.residence-hero-media img { height: 100%; object-fit: cover; filter: saturate(.88) contrast(1.03) sepia(.035); }
.residence-hero-media figcaption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  padding: 1.6rem 2rem;
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.15rem;
}
.residence-hero-media small { display: block; margin-bottom: .3rem; font-family: var(--sans); font-size: .7rem; font-weight: 760; letter-spacing: .11em; text-transform: uppercase; }

.residence-facts {
  width: min(calc(100% - 3rem), var(--content));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: -2.1rem auto 0;
  position: relative;
  z-index: 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.residence-facts div { min-height: 112px; padding: 1.35rem 1.5rem; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); }
.residence-facts div:last-child { border-right: 0; }
.residence-facts dt { margin-bottom: .45rem; color: rgba(23, 26, 24, .52); font-size: .69rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.residence-facts dd { margin: 0; font-family: var(--serif); font-size: 1.1rem; }

.residence-overview {
  padding: clamp(6rem, 10vw, 9rem) max(4vw, calc((100vw - var(--content)) / 2 + 1.5rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, .42fr);
  gap: clamp(4rem, 9vw, 9rem);
  align-items: start;
}
.overview-copy { max-width: 830px; }
.overview-copy > h2,
.gallery-heading h2,
.tour-copy h2,
.related-heading h2 {
  max-width: 12ch;
  margin-bottom: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(3rem, 4.8vw, 5rem);
  font-weight: 400;
  letter-spacing: -.032em;
  line-height: .98;
}
.overview-copy > .lead { max-width: 760px; margin-bottom: 3rem; color: rgba(23, 26, 24, .7); font-size: 1.02rem; line-height: 1.78; }
.amenity-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.amenity-columns h3 { margin-bottom: .9rem; font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; }
.amenity-columns ul { margin: 0; padding: 0; list-style: none; }
.amenity-columns li { padding: .8rem 0; border-bottom: 1px solid var(--line); color: rgba(23, 26, 24, .7); font-size: .9rem; line-height: 1.5; }

.booking-card {
  position: sticky;
  top: 108px;
  padding: 1.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}
.booking-card .property-number { color: var(--clay); }
.booking-card h2 { margin-bottom: 1.4rem; font-family: var(--serif); font-size: 2rem; font-weight: 400; }
.booking-rates { margin: 0 0 1.4rem; padding: 0; }
.booking-rates div { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.booking-rates dt { color: rgba(23, 26, 24, .56); font-size: .72rem; }
.booking-rates dd { margin: 0; font-family: var(--serif); font-size: 1.03rem; text-align: right; }
.booking-card .button { width: 100%; }
.booking-card .text-link { margin: 1rem auto 0; }
.booking-card-note { margin: 1.3rem 0 0; color: rgba(23, 26, 24, .58); font-size: .71rem; line-height: 1.65; }

.residence-gallery {
  padding: clamp(6rem, 9vw, 8rem) max(4vw, calc((100vw - var(--content)) / 2 + 1.5rem));
  background: var(--green-deep);
  color: var(--white);
}
.gallery-heading { width: min(100%, var(--content)); display: grid; grid-template-columns: 1fr .58fr; gap: 6vw; align-items: end; margin: 0 auto 3rem; }
.gallery-heading > p:last-child { margin: 0; color: rgba(255, 255, 255, .68); line-height: 1.7; }
.gallery-grid {
  width: min(100%, var(--content));
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, minmax(250px, 31vw));
  gap: .9rem;
  margin-inline: auto;
}
.gallery-grid figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius-md); background: #0a1712; }
.gallery-grid figure:nth-child(1) { grid-column: 1 / 8; grid-row: 1 / 3; }
.gallery-grid figure:nth-child(2) { grid-column: 8 / 13; grid-row: 1; }
.gallery-grid figure:nth-child(3) { grid-column: 8 / 13; grid-row: 2; }
.gallery-grid figure:nth-child(4) { grid-column: 1 / 7; grid-row: 3; }
.gallery-grid figure:nth-child(5) { grid-column: 7 / 13; grid-row: 3; }
.gallery-grid-four figure:nth-child(4) { grid-column: 1 / 13; }
.gallery-grid img { height: 100%; object-fit: cover; filter: saturate(.88) contrast(1.03) sepia(.035); transition: transform .55s cubic-bezier(.2, .7, .2, 1); }
.gallery-grid figure:hover img { transform: scale(1.018); }
.gallery-grid figcaption { position: absolute; right: .75rem; bottom: .75rem; left: .75rem; width: fit-content; padding: .5rem .65rem; border-radius: 999px; background: rgba(8, 22, 17, .76); color: rgba(255, 255, 255, .9); font-size: .7rem; backdrop-filter: blur(8px); }

.residence-tour {
  padding: clamp(6rem, 9vw, 8rem) max(4vw, calc((100vw - var(--content)) / 2 + 1.5rem));
  display: grid;
  grid-template-columns: .55fr 1.15fr;
  gap: 8vw;
  align-items: center;
  background: var(--paper);
}
.tour-copy > p:last-child { max-width: 510px; color: rgba(23, 26, 24, .68); line-height: 1.75; }
.tour-frame { padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-soft); }
.tour-frame video { width: 100%; max-height: 700px; display: block; border-radius: calc(var(--radius-lg) - 8px); background: var(--ink); object-fit: contain; }

.related-residences {
  padding: clamp(6rem, 9vw, 8rem) max(4vw, calc((100vw - var(--content)) / 2 + 1.5rem));
  background: var(--white);
}
.related-heading { width: min(100%, var(--content)); display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin: 0 auto 2.7rem; }
.related-heading h2 { margin-bottom: 0; }
.related-grid { width: min(100%, var(--content)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-inline: auto; }
.related-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); transition: transform .2s ease, background .2s ease; }
.related-card:hover { transform: translateY(-3px); background: var(--white); }
.related-card span { display: block; margin-bottom: 2.8rem; color: var(--clay); font-size: .7rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.related-card h3 { margin-bottom: .45rem; font-family: var(--serif); font-size: 1.55rem; font-weight: 400; }
.related-card p { margin-bottom: 1.2rem; color: rgba(23, 26, 24, .63); font-size: .78rem; line-height: 1.55; }

.residence-cta {
  min-height: 500px;
  padding: clamp(5.5rem, 8vw, 7rem) max(4vw, calc((100vw - var(--content)) / 2 + 1.5rem));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--clay);
  color: var(--white);
  text-align: center;
}
.residence-cta h2 { max-width: 12ch; margin-bottom: 1.3rem; font-family: var(--serif); font-size: clamp(3rem, 5.2vw, 5.5rem); font-weight: 400; letter-spacing: -.035em; line-height: .96; }
.residence-cta > p:not(.eyebrow) { max-width: 620px; margin-bottom: 2rem; color: rgba(255, 255, 255, .82); line-height: 1.7; }
.residence-cta .closing-actions { justify-content: center; }

.terrace-113-page .residence-hero-media img { object-position: 54% center; }
.monroe-page .residence-hero-media img { object-position: center 58%; }
.madison-page .residence-hero-media img { object-position: center 58%; }

@media (max-width: 1180px) {
  .residence-hero { grid-template-columns: 1fr 1fr; }
  .residence-facts { grid-template-columns: repeat(3, 1fr); }
  .residence-facts div:nth-child(3) { border-right: 0; }
  .residence-facts div:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .residence-overview { grid-template-columns: minmax(0, 1fr) 330px; gap: 4rem; }
}

@media (max-width: 820px) {
  .residence-hero { min-height: auto; grid-template-columns: 1fr; }
  .residence-hero-copy { padding: 4.6rem 1.25rem 3.5rem; }
  .residence-hero h1 { font-size: clamp(3.2rem, 14vw, 5rem); }
  .residence-hero .button { width: 100%; }
  .residence-hero-media { min-height: min(65svh, 500px); }
  .residence-hero-media figcaption { padding: 1.2rem 1.25rem; font-size: 1rem; }
  .residence-facts { width: calc(100% - 1.5rem); grid-template-columns: repeat(2, 1fr); margin-top: -1.35rem; }
  .residence-facts div { min-height: 102px; padding: 1rem; border-top: 1px solid var(--line); }
  .residence-facts div:nth-child(odd) { border-right: 1px solid var(--line); }
  .residence-facts div:nth-child(even) { border-right: 0; }
  .residence-facts div:last-child { grid-column: 1 / -1; }
  .residence-overview,
  .residence-gallery,
  .residence-tour,
  .related-residences,
  .residence-cta { padding-inline: 1.25rem; }
  .residence-overview { grid-template-columns: 1fr; gap: 3rem; }
  .booking-card { position: static; }
  .amenity-columns { grid-template-columns: 1fr; gap: 2rem; }
  .gallery-heading { grid-template-columns: 1fr; gap: .5rem; }
  .gallery-grid,
  .gallery-grid-four { display: grid; grid-template-columns: 1fr; grid-template-rows: none; gap: .75rem; }
  .gallery-grid figure,
  .gallery-grid-four figure,
  .gallery-grid figure:nth-child(n) { grid-column: auto; grid-row: auto; min-height: 320px; }
  .gallery-grid figure:first-child { min-height: 450px; }
  .residence-tour { grid-template-columns: 1fr; gap: 2.5rem; }
  .related-heading { align-items: start; flex-direction: column; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card span { margin-bottom: 1.8rem; }
  .residence-cta .closing-actions { width: min(100%, 430px); align-items: stretch; }
  .residence-cta .button { width: 100%; }
}

@media (max-width: 540px) {
  .residence-hero h1 { font-size: clamp(3rem, 15vw, 4.25rem); }
  .residence-hero-media { min-height: 430px; }
  .residence-hero-media figcaption { flex-direction: column; align-items: start; gap: .65rem; }
  .overview-copy > h2,
  .gallery-heading h2,
  .tour-copy h2,
  .related-heading h2,
  .residence-cta h2 { font-size: clamp(2.7rem, 13vw, 4rem); }
  .gallery-grid figure,
  .gallery-grid-four figure,
  .gallery-grid figure:nth-child(n) { min-height: 260px; }
  .gallery-grid figure:first-child { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-grid img,
  .related-card { transition: none; }
}
