/* Wolfbrook stocklist — Wolfbrook Design System v4 (shared with the calculator).
   Restrained palette, square corners, dense, number-hero. Tokens mirror
   VANTAGE_STYLE_GUIDE.md and public/calc/styles.css so both products match. */
:root {
  --bg: #F5F4F1; --bg2: #ECEAE6; --bg3: #E2E0DB; --white: #FFFFFF; --panel: #FAF9F7;
  --charcoal: #2A2927; --dark: #3D3B38; --mid: #6B6966; --muted: #9B9894; --light: #C5C2BE;
  --border: #D6D3CE; --border2: #C2BFB9;
  --wb-gold: #e4b611; --wb-gold-light: #f5d95c; --wb-gold-dark: #8a6e0a;
  --navy-dark2: #151413;
  --green: #28724A; --green2: #1E5C3A; --green-bg: #EDF5F0; --green-border: #A8D4B8;
  --orange: #C84B11; --red: #C0392B;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --content-width: 1140px;
  --shadow: 0 1px 8px rgba(42,41,39,0.06);
  --shadow-md: 0 4px 24px rgba(42,41,39,0.10);
  /* Back-compat aliases (older inline refs) */
  --wb-navy: #2A2927; --wb-navy-deep: #1f1e1c; --wb-bg: #F5F4F1; --wb-card: #FFFFFF;
  --wb-border: #D6D3CE; --wb-text: #2A2927; --wb-muted: #6B6966;
  --wb-green: #28724A; --wb-green-soft: #EDF5F0; --wb-red: #C0392B; --wb-red-soft: #FBE9E0;
  --wb-warn: #8a6e0a; --wb-warn-soft: #FBF3DE;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--dark);
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Centre every band at the canonical content width with 36px gutters. */
.stats, .filters, main#regions, .map-view, .site-footer {
  max-width: var(--content-width); margin-inline: auto;
  padding-left: 36px; padding-right: 36px;
}

/* Header — charcoal bar with the white Wolfbrook logo + 3px gold accent.
   Shared treatment with the calculator so the two products read as one. */
.site-header { background: var(--charcoal); border-bottom: 3px solid var(--wb-gold); position: sticky; top: 0; z-index: 300; }
.site-header-inner {
  max-width: var(--content-width); margin: 0 auto; padding: 14px 36px; min-height: 84px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 34px; width: auto; max-width: 210px; display: block; object-fit: contain; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.brand-mark { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 0.2px; }
.brand-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); }
.brand-sub { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--wb-gold); }
.brand-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wb-gold); display: inline-block; }

.meta { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-block; padding: 4px 10px; border-radius: 2px;
  font-size: 11px; font-weight: 600; color: #E8E6E2;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
}
.pill-warn { background: rgba(228,182,17,0.16); color: var(--wb-gold-light); border-color: rgba(228,182,17,0.4); }

/* Stat tiles — number-hero result cards. */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 16px; }
.tile {
  background: var(--white); border: 1px solid var(--border); border-radius: 3px;
  padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.tile-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--mid); font-weight: 700; }
.tile-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--charcoal); font-variant-numeric: tabular-nums; }

/* Filters */
.filters { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--mid); font-weight: 700; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--mid); font-weight: 700; }
.num-input, .select, .search {
  height: 38px; padding: 0 12px; border: 1px solid var(--border2); border-radius: 2px;
  background: var(--white); font-family: inherit; font-size: 14px; color: var(--dark);
  font-variant-numeric: tabular-nums;
}
.num-input { width: 100px; }
.num-input:focus, .select:focus, .search:focus { outline: 2px solid var(--wb-gold); outline-offset: 1px; border-color: var(--wb-gold); }
.search { flex: 1 1 260px; min-width: 200px; }
.btn-clear {
  height: 38px; padding: 0 16px; border: 1px solid var(--border2); border-radius: 2px;
  background: var(--white); font-family: inherit; font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--mid); cursor: pointer;
}
.btn-clear:hover { background: var(--bg2); color: var(--charcoal); }
.results-summary { font-size: 12px; font-weight: 600; color: var(--mid); min-height: 16px; transition: color .12s ease; }

/* Chips / toggles — square pills, charcoal-active (gold text). */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border2); background: var(--white); border-radius: 2px;
  padding: 7px 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; cursor: pointer; color: var(--mid); transition: all .15s ease;
}
.chip:hover { background: var(--bg2); color: var(--charcoal); }
.chip[aria-pressed="true"] { background: var(--charcoal); color: var(--wb-gold); border-color: var(--charcoal); }
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Map */
.map-view { padding-top: 14px; padding-bottom: 28px; position: relative; }
.map { height: 60vh; min-height: 380px; border-radius: 3px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.map-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; padding: 12px 16px; max-width: 320px; text-align: center;
  background: var(--white); border: 1px solid var(--border); border-radius: 3px;
  box-shadow: var(--shadow-md); color: var(--mid); font-size: 13px; z-index: 500;
}
.map-empty code { background: var(--bg2); padding: 1px 5px; border-radius: 2px; font-size: 12px; }
.leaflet-popup-content { font-family: var(--font-body); font-size: 12px; line-height: 1.45; }
.leaflet-popup-content strong { font-family: var(--font-display); }

/* Region + development cards */
main#regions { padding-top: 16px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 8px; }
.region { background: var(--white); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; box-shadow: var(--shadow); }
.region-header {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  cursor: pointer; user-select: none; background: var(--panel); border-bottom: 1px solid var(--border);
}
.region-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--charcoal); }
.region-stats { color: var(--mid); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.region-caret { font-size: 13px; color: var(--muted); margin-left: 12px; }
.region[aria-expanded="false"] .region-body { display: none; }
.region[aria-expanded="false"] .region-caret::after { content: '▸'; }
.region[aria-expanded="true"] .region-caret::after { content: '▾'; }
.region-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 14px; }

.dev-card { border: 1px solid var(--border); border-radius: 3px; padding: 12px; background: var(--white); }
.dev-card-head { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; margin-bottom: 8px; }
.dev-thumb { display: block; width: 96px; height: 64px; border-radius: 2px; overflow: hidden; background: var(--bg2); border: 1px solid var(--border); flex-shrink: 0; }
.dev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dev-thumb-placeholder { background: linear-gradient(135deg, #ECEAE6 0%, #E2E0DB 100%); }
.dev-info { min-width: 0; }
.dev-name { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; line-height: 1.25; color: var(--charcoal); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-status { display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; background: var(--wb-gold); color: var(--charcoal); padding: 2px 8px; border-radius: 2px; }
.dev-status-est { background: var(--green-bg); color: var(--green2); }
.dev-address { color: var(--mid); font-size: 12px; margin-top: 2px; }
.dev-stats { font-size: 12px; color: var(--mid); font-weight: 600; margin-top: 4px; }
.dev-stats strong { color: var(--charcoal); }
.dev-meta { font-size: 11px; color: var(--mid); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 14px; }
.dev-meta .dev-meta-k { color: var(--dark); font-weight: 600; }
.dev-note { font-size: 11px; color: var(--dark); background: var(--panel); border-left: 3px solid var(--wb-gold); padding: 5px 8px; margin-top: 6px; border-radius: 0 2px 2px 0; }
.dev-note .dev-meta-k { color: var(--charcoal); font-weight: 700; }
.dev-note-info { background: var(--bg2); border-left-color: var(--mid); }
.dev-other { font-size: 11px; color: var(--mid); margin-top: 4px; }
.dev-other summary { cursor: pointer; color: var(--charcoal); font-weight: 600; }
.dev-other ul { margin: 4px 0 0 16px; padding: 0; }
.dev-other li { margin: 2px 0; }

/* Buttons */
.btn-brochure {
  display: inline-block; background: var(--wb-gold); color: var(--charcoal); font-weight: 700;
  padding: 6px 12px; border-radius: 2px; text-decoration: none; font-size: 11px;
  letter-spacing: 0.3px; white-space: nowrap; transition: background .15s ease;
}
.btn-brochure:hover { background: var(--wb-gold-light); }
.btn-model {
  display: inline-block; background: var(--charcoal); color: var(--wb-gold); font-weight: 700;
  padding: 6px 10px; border-radius: 2px; text-decoration: none; font-size: 10px;
  letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; transition: background .15s ease;
}
.btn-model:hover { background: var(--navy-dark2); }

/* Units table — charcoal header, zebra body (matches the v4 stocklist table). */
table.units { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: auto; box-shadow: var(--shadow); }
table.units th, table.units td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.units td.num, table.units th:nth-child(2), table.units th:nth-child(3),
table.units th:nth-child(5), table.units th:nth-child(6), table.units th:nth-child(7),
table.units th:nth-child(8), table.units th:nth-child(9) { text-align: right; }
table.units tr:last-child td { border-bottom: 0; }
table.units thead th {
  font-weight: 700; color: var(--wb-gold); text-transform: uppercase; font-size: 9px;
  letter-spacing: 1px; background: var(--charcoal); border-bottom: 0; position: sticky; top: 84px;
}
table.units tbody tr:nth-child(even) { background: var(--panel); }
table.units tbody tr:hover { background: var(--bg2); }

/* Status tags */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.status-available { background: var(--green-bg); color: var(--green2); }
.status-available::before { background: var(--green); }
.status-under_offer { background: #FBE9E0; color: var(--orange); }
.status-under_offer::before { background: var(--orange); }
.status-unknown { background: var(--bg2); color: var(--mid); }
.status-unknown::before { background: var(--muted); }
.status-sold { background: var(--bg2); color: var(--muted); }
.status-sold::before { background: var(--light); }

.dev-empty { color: var(--mid); font-size: 12px; margin: 4px 2px 2px; }
.empty-state { padding: 28px 20px; text-align: center; color: var(--mid); font-size: 14px; }
.load-error { padding: 20px; color: var(--red); }
.btn-calc-link {
  display: inline-block; background: var(--wb-gold); color: var(--charcoal); font-weight: 700;
  font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; text-decoration: none;
  padding: 7px 14px; border-radius: 2px; white-space: nowrap; transition: background .15s ease;
}
.btn-calc-link:hover { background: var(--wb-gold-light); }

.site-footer { padding-top: 24px; padding-bottom: 32px; text-align: center; }
.footer-disclaimer { max-width: 800px; margin: 0 auto 8px; font-size: 11px; line-height: 1.5; color: var(--mid); }
.footer-credit { margin: 0; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.footer-credit strong { color: var(--mid); }

/* Motion — single fadeUp keyframe, reduced-motion safe. */
@keyframes wb-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.region { animation: wb-fade-up 160ms ease both; }
.region-body .dev-card { animation: wb-fade-up 200ms ease both; }
.empty-state { animation: wb-fade-up 160ms ease both; }
.region-body .dev-card:nth-child(2) { animation-delay: 30ms; }
.region-body .dev-card:nth-child(3) { animation-delay: 60ms; }
.region-body .dev-card:nth-child(4) { animation-delay: 90ms; }
.region-body .dev-card:nth-child(n+5) { animation-delay: 120ms; }
@media (prefers-reduced-motion: reduce) {
  .region, .region-body .dev-card, .empty-state { animation: none; }
  .results-summary { transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .site-header { position: static; }
  .site-header-inner { min-height: 0; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  .stats, .filters, main#regions, .map-view, .site-footer { padding-left: 16px; padding-right: 16px; }
  .dev-card-head { grid-template-columns: 64px 1fr; }
  .dev-card-head .btn-brochure { grid-column: 1 / -1; justify-self: start; }
  .dev-thumb { width: 64px; height: 48px; }
  table.units { display: block; overflow-x: auto; }
  table.units thead th { position: static; }
}
