/* ------------------------------------------------------------------
   Luxury single-property listing — quiet-luxury editorial direction.
   Ivory & charcoal, one restrained gold. Self-contained: system fonts
   only (Didot/Baskerville display, Optima/Gill Sans labels, Georgia prose).
   ------------------------------------------------------------------ */

:root {
  --ivory: #f6f1e7;
  --ivory-deep: #ede5d3;
  --charcoal: #232019;
  --charcoal-soft: #2c2822;
  --ink: #33302a;
  --ink-soft: #6b645a;
  --gold: #a2884f;
  --gold-bright: #c3a768;
  --hairline: rgba(52, 46, 36, 0.18);
  --hairline-light: rgba(246, 241, 231, 0.22);

  --font-display: "Didot", "Bodoni 72", "Baskerville", "Palatino", "Times New Roman", serif;
  --font-label: "Optima", "Seravek", "Candara", "Gill Sans", "Trebuchet MS", sans-serif;
  --font-prose: "Charter", "Georgia", "Palatino", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-prose);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ---------- shared primitives ---------- */

.measure { max-width: 42rem; margin: 0 auto; padding: 0 1.5rem; }
.measure--wide { max-width: 64rem; }

.eyebrow {
  font-family: var(--font-label);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 2.2rem;
}

.eyebrow::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--hairline);
  transform: translateY(-0.2em);
}

.eyebrow__numeral {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.section--area .eyebrow::after { border-top-color: var(--hairline-light); }
.section--area .eyebrow__numeral { color: rgba(246, 241, 231, 0.55); }

.rule {
  display: block;
  width: 3.5rem;
  height: 1px;
  background: var(--gold-bright);
  position: relative;
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  background: var(--gold-bright);
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--charcoal);
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-drift 18s ease-out forwards;
}

@keyframes hero-drift {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(20, 18, 14, 0.35) 0%,
      rgba(20, 18, 14, 0.05) 35%,
      rgba(20, 18, 14, 0.72) 82%,
      rgba(20, 18, 14, 0.88) 100%);
}

.hero--plain .hero__scrim {
  background: radial-gradient(120% 90% at 50% 10%,
    var(--charcoal-soft) 0%, var(--charcoal) 70%);
}

.hero__content {
  position: relative;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1.5rem 5.5rem;
  color: var(--ivory);
}

.hero__address {
  font-family: var(--font-label);
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(246, 241, 231, 0.82);
  margin-bottom: 1.4rem;
}

.rule--hero { margin-bottom: 1.8rem; }

.hero__headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.06;
  letter-spacing: 0.01em;
  max-width: 16em;
  text-wrap: balance;
}

.hero__price {
  margin-top: 1.6rem;
  font-family: var(--font-label);
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

/* staggered hero reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal 1.1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.reveal:nth-child(1) { animation-delay: 0.15s; }
.reveal:nth-child(2) { animation-delay: 0.3s; }
.reveal:nth-child(3) { animation-delay: 0.45s; }
.reveal:nth-child(4) { animation-delay: 0.65s; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

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

/* ---------- sections ---------- */

.section { padding: 6rem 0; }

.section--residence {
  background:
    linear-gradient(180deg, var(--ivory) 0%, var(--ivory-deep) 140%);
  text-align: left;
}

.lede {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.5;
  color: var(--ink);
}

.lede::first-letter {
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding: 0.06em 0.12em 0 0;
  color: var(--gold);
}

/* ---------- structured PDF particulars ---------- */

.particulars__section + .particulars__section {
  margin-top: 2.8rem;
}

.particulars__heading {
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.1rem;
  padding-top: 0.2rem;
  border-top: 1px solid var(--hairline);
}

.particulars__section:first-child .particulars__heading {
  border-top: none;
  padding-top: 0;
}

.particulars__para {
  font-family: var(--font-prose);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
}

.particulars__para + .particulars__para {
  margin-top: 1rem;
}

.particulars .lede + .particulars__para,
.particulars .lede {
  margin-bottom: 0;
}

/* ---------- features ---------- */

.section--features { padding-top: 2rem; }

.features {
  list-style: none;
  columns: 2;
  column-gap: 4rem;
}

.features__item {
  break-inside: avoid;
  font-family: var(--font-prose);
  font-size: 1.05rem;
  padding: 0.9rem 0 0.9rem 1.6rem;
  border-bottom: 1px solid var(--hairline);
  position: relative;
}

.features__item::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 1.45rem;
  width: 6px; height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
}

@media (max-width: 40rem) {
  .features { columns: 1; }
}

/* ---------- gallery ---------- */

.section--gallery { padding-bottom: 7rem; }

.gallery-head { margin-bottom: 0; }

/* Before/After segmented switch — quiet, label-face small caps, gold active */

.gallery-switch {
  margin: -0.9rem 0 2rem;
}

.gallery-toggle {
  display: inline-flex;
  border: 1px solid var(--hairline);
  background: transparent;
}

.gallery-toggle__option {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-label);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em; /* optically recentre tracked-out caps */
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.6rem 1.5rem 0.55rem;
  transition: color 0.35s ease, background-color 0.35s ease;
}

.gallery-toggle__option + .gallery-toggle__option {
  border-left: 1px solid var(--hairline);
}

.gallery-toggle__option:hover { color: var(--gold); }

.gallery-toggle__option:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.gallery-toggle__option--active {
  background: var(--gold);
  color: var(--ivory);
}

.gallery-toggle__option--active:hover { color: var(--ivory); }

.gallery-switch__caption {
  margin-top: 0.7rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* Floating Current/Potentials pill — stays onscreen while the gallery
   section intersects the viewport (see the IntersectionObserver at the
   bottom of property.html.j2). Hidden by default so a no-JS visit simply
   degrades to the static Potentials gallery below. */

.gallery-toggle-float {
  position: fixed;
  left: 50%;
  bottom: calc(1.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 0.6rem);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.gallery-toggle-float--visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0s;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-toggle-float {
    transition: visibility 0s linear;
    transform: translate(-50%, 0);
  }
  .gallery-toggle-float--visible { transition: visibility 0s linear; }
}

.gallery-toggle-float .gallery-toggle {
  border-radius: 999px;
  background: rgba(246, 241, 231, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0.6rem 2rem rgba(30, 26, 18, 0.22), 0 0.1rem 0.4rem rgba(30, 26, 18, 0.12);
  overflow: hidden;
}

.gallery-toggle-float .gallery-toggle__option:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
  padding-left: 1.7rem;
}

.gallery-toggle-float .gallery-toggle__option:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  padding-right: 1.7rem;
}

@media (max-width: 30rem) {
  .gallery-toggle-float { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); }
  .gallery-toggle-float .gallery-toggle__option {
    font-size: 0.64rem;
    padding: 0.55rem 1.1rem 0.5rem;
  }
  .gallery-toggle-float .gallery-toggle__option:first-child { padding-left: 1.3rem; }
  .gallery-toggle-float .gallery-toggle__option:last-child { padding-right: 1.3rem; }
}

.gallery {
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.9rem;
}

.gallery__item {
  position: relative;
  overflow: hidden;
  background: var(--ivory-deep);
  grid-column: span 2;
  aspect-ratio: 4 / 3;
  min-width: 0;
  min-height: 0;
}

/* editorial rhythm: alternate wide + tall panels */
.gallery__item:nth-child(6n + 1) { grid-column: span 4; aspect-ratio: 16 / 9; }
.gallery__item:nth-child(6n + 5) { grid-column: span 3; }
.gallery__item:nth-child(6n + 6) { grid-column: span 3; }

.gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.19, 1, 0.22, 1);
}

.gallery__item:hover img { transform: scale(1.04); }

@media (max-width: 48rem) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .gallery__item,
  .gallery__item:nth-child(6n + 1),
  .gallery__item:nth-child(6n + 5),
  .gallery__item:nth-child(6n + 6) { grid-column: span 2; aspect-ratio: 4 / 3; }
}

/* ---------- floor plan / EPC (full, uncropped) ---------- */

.section--plan { padding-top: 2rem; }

.plan-image {
  background: var(--ivory-deep);
  border: 1px solid var(--hairline);
}

.plan-image__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.plan-image__img + .plan-image__img {
  border-top: 1px solid var(--hairline);
}

/* ---------- the area ---------- */

.section--area {
  background:
    radial-gradient(140% 120% at 85% -10%, var(--charcoal-soft) 0%, var(--charcoal) 60%);
  color: var(--ivory);
  padding: 7rem 0;
}

.eyebrow--gold { color: var(--gold-bright); }

.area__district {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  margin-bottom: 3rem;
}

.area__columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 4rem;
}

@media (max-width: 48rem) {
  .area__columns { grid-template-columns: 1fr; gap: 3rem; }
}

.area__heading {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(246, 241, 231, 0.65);
  border-bottom: 1px solid var(--hairline-light);
  padding-bottom: 0.9rem;
  margin-bottom: 1.6rem;
}

.amenities__group + .amenities__group { margin-top: 1.9rem; }

.amenities__label {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--gold-bright);
  margin-bottom: 0.6rem;
}

.amenities__list, .crime { list-style: none; }

.amenities__place, .crime__row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.35rem 0;
  font-size: 0.98rem;
}

.amenities__dots {
  flex: 1;
  border-bottom: 1px dotted rgba(246, 241, 231, 0.28);
  transform: translateY(-0.25em);
  min-width: 1.5rem;
}

.amenities__distance, .crime__count {
  font-family: var(--font-label);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: rgba(246, 241, 231, 0.72);
  white-space: nowrap;
}

.area__crime-total {
  font-size: 0.98rem;
  margin-bottom: 1rem;
  color: rgba(246, 241, 231, 0.85);
}

.area__crime-total strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--gold-bright);
  padding-right: 0.15rem;
}

.area__empty {
  font-style: italic;
  color: rgba(246, 241, 231, 0.6);
  font-size: 0.95rem;
}

/* ---------- footer ---------- */

.footer {
  background: var(--charcoal);
  border-top: 1px solid rgba(195, 167, 104, 0.35);
  color: rgba(246, 241, 231, 0.75);
  padding: 4rem 0 4.5rem;
  text-align: center;
}

.footer__address {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--ivory);
}

.footer__price {
  font-family: var(--font-label);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-top: 0.5rem;
}

.rule--footer { margin: 1.8rem auto; }

.footer__disclosure {
  font-size: 0.85rem;
  max-width: 34rem;
  margin: 0 auto 0.8rem;
  color: rgba(246, 241, 231, 0.6);
}

.footer__meta {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(246, 241, 231, 0.42);
}
