/* ==========================================================================
   DESIGN TOKENS — "Land Registry" system — NewProp brand palette
   Palette:
     --teal       #0B4F4F  dark turquoise (brand primary)
     --paper      #EEE9DE  stone paper
     --paper-dim  #E1DACB  paper shadow / card fill
     --burnt      #C2571E  burnt orange (brand accent — CTAs, price)
     --slate      #5C6B73  slate (secondary text, rules)
     --gold       #9C7A3C  survey-gold (data labels, neutral third accent)
   Type:
     Display: 'Fraunces' (characterful serif, used sparingly for titles)
     Body:    'IBM Plex Sans' (clean, technical-adjacent)
     Data/Mono: 'IBM Plex Mono' (specs, prices, erf numbers — spec-sheet feel)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --teal: #0B4F4F;
  --teal-70: rgba(11, 79, 79, 0.7);
  --paper: #EEE9DE;
  --paper-dim: #E1DACB;
  --burnt: #C2571E;
  --burnt-dim: #9c451a;
  --slate: #5C6B73;
  --gold: #9C7A3C;
  --line: rgba(11, 79, 79, 0.14);
  --line-strong: rgba(11, 79, 79, 0.3);

  --font-display: 'Fraunces', serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 2px;
  --container: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--teal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Utility label / eyebrow (drafting annotation style) ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand span { color: var(--burnt); }
.site-nav {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  gap: 28px;
}
.site-nav a { border-bottom: 1px solid transparent; padding-bottom: 2px; }
.site-nav a:hover { border-color: var(--burnt); }

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--line-strong);
  padding: 64px 0 48px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: end;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.04;
  margin: 14px 0 18px;
  max-width: 15ch;
}
.hero p {
  color: var(--teal-70);
  max-width: 46ch;
  font-size: 16px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-strong);
}
.hero-stats div {
  padding: 18px 16px;
  border-left: 1px solid var(--line-strong);
}
.hero-stats div:first-child { border-left: none; }
.hero-stats b {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
}
.hero-stats small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ---------- Filter bar ---------- */
.filters {
  background: var(--teal);
  color: var(--paper);
  padding: 20px 0;
}
.filters .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filters select,
.filters input {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  background: transparent;
  border: 1px solid rgba(238, 233, 222, 0.35);
  color: var(--paper);
  padding: 10px 12px;
  border-radius: var(--radius);
  min-width: 130px;
}
.filters select option { color: var(--teal); }
.filters input::placeholder { color: rgba(238, 233, 222, 0.5); }
.filters .result-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 233, 222, 0.6);
}
.filters button.reset {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--burnt);
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Listing grid ---------- */
.listings {
  padding: 48px 0 80px;
}
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
@media (max-width: 900px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .listing-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease;
}
.card:hover { background: var(--paper-dim); }

.card-media {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-bottom: 1px solid var(--line-strong);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.card-tags-right {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.card-tag {
  background: var(--teal);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
}
.card-tag--featured {
  background: var(--gold);
}
.card-tag--status {
  background: var(--burnt);
}
.card-showday {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: var(--teal);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 7px 8px;
}
.card.is-unavailable .card-media img {
  opacity: 0.55;
  filter: grayscale(35%);
}
.card.is-unavailable .card-price {
  color: var(--slate);
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-loc {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 12px;
  line-height: 1.2;
}
.card-specs {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal-70);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-price {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 500;
  color: var(--burnt);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--slate);
  grid-column: 1 / -1;
  background: var(--paper);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-strong);
  padding: 32px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   PROPERTY DETAIL PAGE
   ========================================================================== */

.dossier-header {
  border-bottom: 1px solid var(--line-strong);
  padding: 36px 0 28px;
}
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--burnt); }
.dossier-header h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  margin: 0 0 8px;
}
.dossier-header .loc {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--slate);
  text-transform: uppercase;
}
#statusBanner {
  display: none;
  margin-top: 12px;
  background: var(--burnt);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
}
#showdayBanner {
  display: none;
  background: var(--teal);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 10px 12px;
  margin-bottom: 16px;
}

/* Corner-bracket framed gallery, like a technical drawing crop mark */
.gallery {
  position: relative;
  padding: 32px 0;
}
.gallery-main {
  position: relative;
  aspect-ratio: 16/9;
  border: 1px solid var(--line-strong);
  overflow: hidden;
  margin-bottom: 10px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--burnt);
  border-style: solid;
  border-width: 0;
  z-index: 2;
  pointer-events: none;
}
.corner.tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.gallery-thumbs img {
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  opacity: 0.65;
  transition: opacity 0.15s ease;
}
.gallery-thumbs img:hover,
.gallery-thumbs img.active { opacity: 1; }

.dossier-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
}

.spec-sheet {
  border: 1px solid var(--line-strong);
  margin-bottom: 32px;
}
.spec-sheet .eyebrow { padding: 14px 18px 0; }
.spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-strong);
  margin-top: 14px;
}
.spec-item {
  background: var(--paper);
  padding: 14px 18px;
}
.spec-item b {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}
.spec-item small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
}

.description { margin-bottom: 32px; }
.description h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 12px;
}
.description p { color: var(--teal-70); margin-bottom: 12px; }
.description p:last-child { margin-bottom: 0; }
.description strong { color: var(--teal); font-weight: 600; }

.map-frame {
  border: 1px solid var(--line-strong);
  aspect-ratio: 16/10;
  margin-bottom: 12px;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* Optional media sections — hidden by default, shown by media-sections.js
   only when the property's data block actually has floorPlan/video3d set */
.media-section {
  margin-top: 32px;
  display: none;
}
.floorplan-frame {
  border: 1px solid var(--line-strong);
  background: var(--paper-dim);
  padding: 12px;
}
.floorplan-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.video-frame {
  border: 1px solid var(--line-strong);
  aspect-ratio: 16/9;
}
.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

#relatedListings {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line-strong);
  display: none;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.related-card {
  display: block;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  transition: background 0.15s ease;
}
.related-card:hover { background: var(--paper-dim); }
.related-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line-strong);
}
.related-card > div { padding: 10px 12px; }
.related-loc {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 4px;
}
.related-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
}
@media (max-width: 620px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* Sidebar / enquiry card */
.enquiry-card {
  border: 1px solid var(--line-strong);
  padding: 24px;
  position: sticky;
  top: 100px;
  height: fit-content;
}
.enquiry-price {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--burnt);
  margin-bottom: 4px;
}
.enquiry-card .listing-type {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 20px;
}
.enquiry-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.enquiry-card input,
.enquiry-card textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  border-radius: var(--radius);
  color: var(--teal);
}
.enquiry-card textarea { resize: vertical; min-height: 90px; }
.enquiry-card button {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--burnt);
  color: var(--paper);
  border: none;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.enquiry-card button:hover { background: var(--burnt-dim); }
.form-note {
  font-size: 11px;
  color: var(--slate);
  margin-top: 6px;
}
.form-status {
  font-family: var(--font-mono);
  font-size: 12px;
  display: none;
  padding: 10px;
  margin-top: 4px;
}
.form-status.ok { display: block; background: rgba(92,107,115,0.12); }
.form-status.err { display: block; background: rgba(166,83,47,0.12); color: var(--burnt); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .dossier-content { grid-template-columns: 1fr; }
  .enquiry-card { position: static; }
  .gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
}
