/* ==========================================================================
   Peerage Residence project page — scoped styles.

   Loaded ONLY by /projects/peerage-residence/. Every class is namespaced
   `pr-` so nothing here can affect any other page on the site. Brand tokens
   (--ink, --muted, --line, --paper, --soft, --accent, --accent-strong,
   --shadow) and the global .button styles come from /styles.css.
   ========================================================================== */

.pr-page {
  --pr-header-h: 84px;
  --pr-subnav-h: 56px;
  --pr-gutter: clamp(20px, 6vw, 92px);
  --pr-section-y: clamp(52px, 7vw, 112px);
}

/* Typography is inherited from the site body font in styles.css
   (Avenir / Montserrat). This page introduces no font of its own. */

.pr-page main {
  overflow-x: clip;
}

.pr-section {
  padding: var(--pr-section-y) var(--pr-gutter);
  scroll-margin-top: calc(var(--pr-header-h) + var(--pr-subnav-h) + 8px);
}

.pr-section-soft {
  background: var(--soft);
  border-block: 1px solid var(--line);
}

.pr-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.pr-kicker {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.pr-h2 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.1;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.pr-lede {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.75;
}

.pr-head {
  max-width: 780px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

/* ---------- Hero ---------- */

.pr-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(78vh, 720px);
  padding: calc(var(--pr-header-h) + 40px) var(--pr-gutter) clamp(40px, 5vw, 72px);
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}

/* Stacking order is kept positive: a negative z-index would be painted
   behind the `overflow-x: clip` ancestor and disappear. */
.pr-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pr-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Weighted toward the lower half, where the headline and CTAs sit, so the
     copy stays legible over the bright sky in the render. */
  background: linear-gradient(
    184deg,
    rgba(34, 27, 25, 0.34) 0%,
    rgba(34, 27, 25, 0.3) 26%,
    rgba(34, 27, 25, 0.6) 56%,
    rgba(34, 27, 25, 0.82) 82%,
    rgba(34, 27, 25, 0.92) 100%
  );
}

.pr-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.pr-hero-eyebrow {
  margin: 0 0 18px;
  color: #ffdfd7;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.pr-hero h1 {
  margin: 0 0 14px;
  max-width: 12ch;
  font-size: clamp(42px, 6.6vw, 96px);
  line-height: 1;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.pr-hero-sub {
  margin: 0 0 30px;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(15px, 1.7vw, 19px);
  line-height: 1.65;
}

.pr-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pr-hero-actions .button.primary {
  border-color: #fff;
  background: #fff;
  color: var(--ink);
}

.pr-hero-actions .button.primary:hover {
  background: #fff;
}

.pr-hero-actions .button.secondary {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.pr-hero-actions .button.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- Sticky in-page nav ---------- */

.pr-subnav {
  position: sticky;
  top: var(--pr-header-h);
  z-index: 9;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 252, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.pr-subnav-scroll {
  display: flex;
  gap: 4px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--pr-gutter);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.pr-subnav-scroll::-webkit-scrollbar {
  display: none;
}

.pr-subnav a {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--pr-subnav-h);
  padding: 0 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 200ms ease;
}

.pr-subnav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--accent-strong);
  transform: scaleX(0);
  transition: transform 220ms ease;
}

.pr-subnav a:hover,
.pr-subnav a:focus-visible {
  color: var(--ink);
}

.pr-subnav a.is-active {
  color: var(--ink);
}

.pr-subnav a.is-active::after {
  transform: scaleX(1);
}

/* ---------- Snapshot ---------- */

.pr-snapshot {
  padding: clamp(28px, 3.4vw, 44px) var(--pr-gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.pr-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: 1240px;
  margin: 0 auto;
  background: var(--line);
  border: 1px solid var(--line);
}

.pr-snap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  background: var(--paper);
}

.pr-snap dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pr-snap dd {
  margin: 0;
  color: var(--ink);
  font-size: clamp(19px, 1.9vw, 26px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.pr-snap dd small {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------- Story / overview ---------- */

.pr-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.pr-story-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.8;
}

.pr-story-copy p:last-of-type {
  margin-bottom: 0;
}

.pr-story-media {
  position: relative;
  border: 1px solid var(--line);
  background: var(--soft);
}

.pr-story-media img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.pr-note {
  margin-top: 28px;
  padding: 18px 20px;
  border-inline-start: 2px solid var(--accent);
  background: var(--soft);
}

.pr-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pr-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

/* ---------- Residence types ---------- */

.pr-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.pr-type {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.pr-type strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.pr-type span {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.pr-type em {
  margin-top: auto;
  padding-top: 12px;
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pr-beds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 0;
  list-style: none;
}

.pr-beds-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pr-bed {
  padding: 9px 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.pr-bed small {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Travel times ---------- */

.pr-travel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 26px 0 30px;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}

.pr-travel li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--paper);
}

.pr-travel strong {
  color: var(--ink);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.01em;
}

.pr-travel span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Amenities ---------- */

.pr-amenity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 26px);
}

.pr-amenity {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.pr-amenity-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--soft);
}

.pr-amenity-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.pr-amenity:hover .pr-amenity-media img {
  transform: scale(1.04);
}

.pr-amenity-media h3 {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 30px 18px 14px;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: linear-gradient(0deg, rgba(30, 24, 22, 0.8), transparent);
}

.pr-amenity ul {
  flex: 1;
  margin: 0;
  padding: 18px 20px 22px;
  list-style: none;
  display: grid;
  gap: 9px;
}

.pr-amenity li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.pr-amenity li::before {
  content: "";
  flex: none;
  width: 4px;
  height: 4px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Gallery ---------- */

.pr-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
}

.pr-shot {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--soft);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
}

.pr-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.pr-shot:hover img,
.pr-shot:focus-visible img {
  transform: scale(1.045);
}

.pr-gallery.is-collapsed .pr-shot[data-extra] {
  display: none;
}

.pr-gallery-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(22px, 3vw, 34px);
}

.pr-gallery.is-expanded .pr-gallery-more {
  display: none;
}

/* ---------- Location ---------- */

.pr-location-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: center;
}

.pr-nearby {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 30px;
  padding: 0;
  list-style: none;
}

.pr-nearby li {
  padding: 9px 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.pr-map {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--soft);
}

/* ---------- Master plan ---------- */

.pr-plan-frame {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: zoom-in;
  overflow: hidden;
}

/* Intrinsic ratio is reserved up front so the lazy image cannot collapse the
   container to zero height and shift the layout when it loads. */
.pr-plan-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1800 / 1073;
}

.pr-plan-frame span {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 10px 16px;
  background: rgba(255, 253, 252, 0.94);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Interactive master plan / find your unit ---------- */

.pr-units-head {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: clamp(26px, 3.4vw, 40px);
}

.pr-units-head > div {
  max-width: 640px;
}

.pr-plan {
  border: 1px solid var(--line);
  background: var(--paper);
}

.pr-plan-media {
  position: relative;
  display: block;
  line-height: 0;
}

/* Same here: the overlaid SVG derives its scale from this image's box, so a
   collapsed height would break the building polygons' viewBox mapping. */
.pr-plan-media > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3248 / 1936;
}

.pr-zones {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pr-zone {
  cursor: pointer;
  outline: none;
}

.pr-zone polygon {
  fill: rgba(201, 100, 85, 0.001);
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 3;
  transition: fill 200ms ease, stroke 200ms ease;
}

.pr-zone text {
  fill: #fff;
  font-family: Avenir, "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-size: 58px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(36, 28, 26, 0.55);
  stroke-width: 8;
  pointer-events: none;
  opacity: 0.92;
}

.pr-zone:hover polygon,
.pr-zone:focus-visible polygon {
  fill: rgba(201, 100, 85, 0.42);
  stroke: #fff;
}

.pr-zone.is-selected polygon {
  fill: rgba(201, 100, 85, 0.6);
  stroke: #fff;
}

.pr-zone.has-no-units polygon {
  stroke: rgba(255, 255, 255, 0.32);
}

.pr-zone.has-no-units:hover polygon,
.pr-zone.has-no-units:focus-visible polygon {
  fill: rgba(78, 69, 69, 0.34);
}

.pr-zone.has-no-units text {
  opacity: 0.55;
}

.pr-plan-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}

.pr-plan-status strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.pr-plan-status span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13.5px;
}

.pr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}

.pr-chip {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.pr-chip small {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pr-chip:hover {
  border-color: var(--accent);
}

.pr-chip.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.pr-chip.is-selected small {
  color: rgba(255, 255, 255, 0.72);
}

.pr-chip.has-no-units {
  opacity: 0.5;
}

/* ---------- Partners ---------- */

.pr-partner-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.pr-partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  background: var(--paper);
  text-align: center;
}

.pr-partner img {
  width: auto;
  max-width: 100%;
  height: 34px;
  object-fit: contain;
}

.pr-partner span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------- Final CTA ---------- */

.pr-cta {
  text-align: center;
}

.pr-cta .pr-h2 {
  margin-inline: auto;
  max-width: 18ch;
}

.pr-cta .pr-lede {
  margin: 0 auto 30px;
  max-width: 58ch;
}

.pr-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.pr-form-band {
  padding: 0 var(--pr-gutter) clamp(64px, 8vw, 120px);
  scroll-margin-top: calc(var(--pr-header-h) + var(--pr-subnav-h) + 8px);
}

/* ---------- Reveal ---------- */

.pr-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.3, 1), transform 700ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.pr-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1080px) {
  .pr-partner-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .pr-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pr-story-grid,
  .pr-location-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pr-story-media {
    order: -1;
  }

  .pr-amenity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pr-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pr-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pr-page {
    --pr-subnav-h: 50px;
  }

  .pr-page .site-header {
    position: sticky;
    top: 0;
  }

  .pr-page main {
    overflow-x: visible;
  }

  .pr-hero {
    min-height: min(72vh, 560px);
  }

  /* Shorter hero packs the copy tighter against the image, so the scrim needs
     to carry more of the contrast. */
  .pr-hero::after {
    background: linear-gradient(
      184deg,
      rgba(34, 27, 25, 0.42) 0%,
      rgba(34, 27, 25, 0.4) 22%,
      rgba(34, 27, 25, 0.68) 50%,
      rgba(34, 27, 25, 0.88) 80%,
      rgba(34, 27, 25, 0.95) 100%
    );
  }

  .pr-hero h1 {
    max-width: 100%;
  }

  .pr-amenity-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pr-amenity-media {
    aspect-ratio: 2 / 1;
  }

  .pr-partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pr-travel {
    grid-template-columns: minmax(0, 1fr);
  }

  .pr-type {
    padding: 16px;
  }

  /* Give the label its own line so it doesn't crowd the first chip. */
  .pr-beds-label {
    flex: 1 0 100%;
    margin-bottom: -2px;
  }

  .pr-plan-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pr-plan-bar .button {
    width: 100%;
  }

  .pr-hero-actions .button,
  .pr-cta-actions .button {
    width: 100%;
  }

  .pr-map {
    aspect-ratio: 1 / 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pr-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pr-amenity-media img,
  .pr-shot img {
    transition: none;
  }

  .pr-page :where(a, button) {
    scroll-behavior: auto;
  }
}
