/* =========================================================================
   RESURE LUX — residence detail
   Loaded after main.css. Tokens, the bar, the footer and the brand rules all
   come from there; this file only adds what a detail page needs.

   The home page is two snapped screens. This is the opposite: a reading page,
   so it does not carry .has-snap and every section is sized by its content.
   ========================================================================= */

/* ------------------------------- hero ------------------------------- */

/* 84svh, not 100: a detail page has to show that it continues. A full-height
   hero on a page like this reads as the end of the document. */
.rd-hero {
  position: relative;
  height: 84svh; min-height: 30rem;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.rd-hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.rd-hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top,
      rgba(0,0,0,.94) 0%, rgba(0,0,0,.72) 26%, rgba(0,0,0,.24) 56%, rgba(0,0,0,.06) 78%),
    linear-gradient(to right,
      rgba(0,0,0,.8) 0%, rgba(0,0,0,.42) 38%, rgba(0,0,0,0) 72%);
}
.rd-hero__body {
  position: relative; z-index: 1;
  width: 100%;
  padding-block: clamp(2rem, 5vw, 4rem);
}
.rd-hero__index {
  font-family: var(--font-display);
  font-size: var(--ms-caption);
  font-weight: 500;
  letter-spacing: .42em; text-transform: uppercase;
  color: var(--ci-paper); opacity: .85;
}
.rd-hero h1 {
  margin-top: .5rem;
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 400; letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 4px 40px rgba(0,0,0,.85);
}
.rd-hero__tagline {
  max-width: 40ch;                 /* the skill's 65–75ch is for body copy; a
                                      standfirst wants to break sooner */
  margin-top: 1rem;
  font-size: clamp(.9375rem, 1.4vw, 1.125rem);
  color: var(--ci-paper); opacity: .88;
  text-shadow: 0 2px 18px rgba(0,0,0,.85);
}
.rd-hero__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .8rem;
  margin-top: 1.5rem;
  font-size: var(--ms-small); color: var(--ci-paper);
  text-shadow: 0 2px 18px rgba(0,0,0,.85);
}
.rd-hero__price { font-size: 1.0625rem; }

/* breadcrumb sits under the fixed bar, over the photograph */
.rd-crumb {
  position: absolute; z-index: 2; left: 0; right: 0;
  top: calc(var(--masthead-h, 5.75rem) + .75rem);
  font-size: var(--ms-caption);
  letter-spacing: .18em; text-transform: uppercase;
}
/* Inline on one line, so the tap area grows with a pseudo-element rather than
   padding — 44px of target without moving the crumb off its line. */
.rd-crumb a {
  position: relative; display: inline-block;
  color: var(--ci-paper); opacity: .8; text-decoration: none;
  transition: opacity var(--dur-sm) var(--ease-out);
}
.rd-crumb a::after { content: ''; position: absolute; inset: -15px -10px; }
.rd-crumb a:hover { opacity: 1; }
.rd-crumb span { color: var(--ci-paper); opacity: .5; }

/* ------------------------------ sections ------------------------------ */

.rd-section { padding-block: clamp(3rem, 7vw, 6rem); }
.rd-section + .rd-section { border-top: 1px solid var(--outline); }

.rd-head { margin-bottom: clamp(1.5rem, 3.5vw, 2.75rem); }
.rd-head h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.75rem);
  font-weight: 400; letter-spacing: .1em; text-transform: uppercase;
  margin-top: .5rem;
}

/* --------------------------- the facts strip --------------------------- */

.rd-facts {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  background: var(--outline);            /* the gap becomes the hairline grid */
  border-block: 1px solid var(--outline);
}
.rd-fact { background: var(--bg); padding: clamp(1rem, 2.2vw, 1.75rem); }
.rd-fact dt {
  font-family: var(--font-display);
  font-size: var(--ms-caption); font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--on-bg-muted);
}
.rd-fact dd { margin: .5rem 0 0; font-size: clamp(1rem, 1.6vw, 1.25rem); }

/* ------------------------------ narrative ------------------------------ */

.rd-story { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); grid-template-columns: 1fr; }
@media (min-width: 900px) { .rd-story { grid-template-columns: 1.1fr 1fr; } }
.rd-story__lead {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 400; line-height: 1.35; letter-spacing: .02em;
}
.rd-story__body { color: var(--on-bg-muted); max-width: 68ch; }
.rd-story__body p + p { margin-top: 1.1rem; }

/* ------------------------------- gallery ------------------------------- */

/* Two columns on desktop, the tall frame spanning both rows — an even grid of
   three makes three unrelated pictures; this makes a composition. */
.rd-gallery { display: grid; gap: clamp(.5rem, 1.2vw, 1rem); grid-template-columns: 1fr; }
.rd-gallery figure { position: relative; margin: 0; overflow: hidden; background: var(--surface); }
.rd-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Stacked on a phone: one ratio for all three. */
.rd-gallery figure { aspect-ratio: 4 / 3; }

/* These come after the base on purpose — a later rule of equal specificity wins,
   so the desktop overrides have to sit below, not above. */
@media (min-width: 760px) {
  .rd-gallery { grid-template-columns: 1fr 1fr; }
  .rd-gallery figure:nth-child(2) { aspect-ratio: 16 / 9; }
  .rd-gallery figure:nth-child(3) { aspect-ratio: 1 / 1; }
  /* The tall frame spans both rows, so its height comes from the two stacked
     beside it — a fixed ratio here leaves it short and opens a gap. */
  .rd-gallery figure:first-child { grid-row: span 2; aspect-ratio: auto; }
}

/* ----------------------------- unit types ----------------------------- */

.rd-units { display: grid; gap: clamp(1rem, 2vw, 1.5rem); grid-template-columns: 1fr; }
@media (min-width: 720px)  { .rd-units { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .rd-units { grid-template-columns: repeat(3, 1fr); } }

.rd-unit {
  display: flex; flex-direction: column;
  border: 1px solid var(--outline);
  background: var(--surface);
  box-shadow: var(--lift-1);
  transition: border-color var(--dur-md) var(--ease-out),
              box-shadow var(--dur-md) var(--ease-out),
              transform var(--dur-md) var(--ease-out);
}
.rd-unit:hover {
  border-color: var(--outline-strong);
  box-shadow: var(--lift-2);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .rd-unit:hover { transform: none; } }
.rd-unit__plan {
  padding: clamp(1rem, 2.4vw, 1.75rem);
  border-bottom: 1px solid var(--outline);
  background: var(--plum-900);
}
.rd-unit__plan svg { width: 100%; height: auto; color: var(--on-bg-muted); }
.rd-unit__body { padding: clamp(1rem, 2.4vw, 1.75rem); display: flex; flex-direction: column; gap: .55rem; }
.rd-unit h3 {
  font-size: 1.25rem; font-weight: 400;
  letter-spacing: .08em; text-transform: uppercase;
}
.rd-unit__spec { font-size: var(--ms-small); color: var(--on-bg-muted); }
.rd-unit__price { margin-top: .35rem; font-size: 1.0625rem; }
.rd-unit__note {
  font-size: var(--ms-caption); letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-bg-faint);
}

/* ----------------------------- two lists ----------------------------- */

.rd-cols { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); grid-template-columns: 1fr; }
@media (min-width: 900px) { .rd-cols { grid-template-columns: 1fr 1fr; } }

.rd-list { display: grid; gap: 0; }
.rd-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem;
  padding-block: .85rem;
  border-bottom: 1px solid var(--outline);
  font-size: var(--ms-small);
}
.rd-list li:first-child { border-top: 1px solid var(--outline); }
.rd-list b { font-weight: 400; color: var(--on-bg); }
.rd-list span { color: var(--on-bg-faint); text-align: right;
  font-family: var(--font-display); font-size: var(--ms-caption); letter-spacing: .14em; }

/* ------------------------------- enquire ------------------------------- */

.rd-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(1.25rem, 3vw, 2.5rem); flex-wrap: wrap;
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--outline);
  background:
    radial-gradient(80% 160% at 12% 0%, rgba(74,51,99,.5) 0%, rgba(8,6,12,0) 70%),
    var(--surface);
  box-shadow: var(--lift-1);
}
.rd-cta h2 { font-size: clamp(1.35rem, 2.6vw, 2.25rem); letter-spacing: .08em;
  text-transform: uppercase; font-weight: 400; }
.rd-cta p { margin-top: .6rem; color: var(--on-bg-muted); font-size: var(--ms-small); max-width: 44ch; }
.rd-actions { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.5rem); flex-wrap: wrap; }

.rd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding-inline: 1.75rem;
  font-family: var(--font-display);
  font-size: var(--ms-caption); font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none;
  transition: background var(--dur-sm) var(--ease-out),
              color var(--dur-sm) var(--ease-out),
              border-color var(--dur-sm) var(--ease-out);
}
.rd-btn--solid { background: var(--accent-fill); color: var(--ci-paper); }
.rd-btn--solid:hover { background: var(--accent-fill-hi); box-shadow: var(--glow-accent); }
.rd-btn--ghost { border: 1px solid var(--outline-strong); color: var(--on-bg); }
.rd-btn--ghost:hover { border-color: var(--accent); background: rgba(168,85,247,.14); }

/* ---------------------------- next residence ---------------------------- */

/* width:100% and no min-height on the ratio — a min-height beside an
   aspect-ratio drives the *width* instead, which blew this 523px wide inside a
   360px screen. The floor comes back only where the ratio can carry it. */
.rd-next {
  position: relative; display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden; text-decoration: none;
  border: 1px solid var(--outline);
  box-shadow: var(--lift-1);
  transition: box-shadow var(--dur-md) var(--ease-out),
              border-color var(--dur-md) var(--ease-out);
}
.rd-next:hover, .rd-next:focus-visible {
  box-shadow: var(--lift-2);
  border-color: var(--outline-strong);
}
@media (min-width: 760px) { .rd-next { aspect-ratio: 21 / 9; min-height: 14rem; } }
.rd-next img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);
  transition: transform 900ms var(--ease-out);
}
.rd-next:hover img, .rd-next:focus-visible img { transform: scale(1.09); }
.rd-next__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.9) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.15) 100%);
}
.rd-next__body {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.25rem, 3.6vw, 3rem);
  color: var(--ci-paper);
}
.rd-next__label {
  font-family: var(--font-display); font-size: var(--ms-caption); font-weight: 500;
  letter-spacing: .3em; text-transform: uppercase; opacity: .82;
}
.rd-next__name {
  margin-top: .4rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 3rem); font-weight: 400;
  letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 4px 30px rgba(0,0,0,.8);
}

/* The brand watermark, same rules as the home carousel — except the hero runs
   under the fixed bar, so it is dropped below it. At the carousel's own inset it
   landed on top of the nav. */
.rd-wm {
  position: absolute; z-index: 2;
  top: calc(var(--masthead-h, 5.75rem) + .85rem);
  right: clamp(1rem, 2.6vw, 2.25rem);
  height: clamp(22px, 4.5vh, 40px); aspect-ratio: 500 / 840;
  background: var(--ci-paper); opacity: .58;
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.75));
  pointer-events: none;
}

/* ----------------------------- responsive ----------------------------- */

@media (max-width: 720px) {
  .rd-hero { height: auto; min-height: 0; padding-top: calc(var(--masthead-h, 10.5rem) + 8rem); }
  .rd-crumb { top: calc(var(--masthead-h, 10.5rem) + .5rem); }
  .rd-cta { flex-direction: column; align-items: flex-start; }
  .rd-actions { width: 100%; }
  .rd-btn { flex: 1 1 auto; }
}
