/* San Pasqual Valley Life — design system
   Palette drawn from the valley: golden hills, vineyard green, evening sky. */

:root {
  --ink: #2b2620;
  --ink-soft: #5d554a;
  --ink-faint: #8a8073;
  --paper: #faf7f1;
  --paper-raised: #ffffff;
  --paper-sunken: #f1ece2;
  --line: #e3dccd;
  --gold: #c98a2c;
  --gold-deep: #a86f1a;
  --green: #4a6741;
  --green-deep: #35502e;
  --sky: #3d5a80;
  --clay: #b05b3b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(43, 38, 32, .06), 0 8px 24px rgba(43, 38, 32, .07);
  --shadow-lift: 0 2px 4px rgba(43, 38, 32, .08), 0 14px 34px rgba(43, 38, 32, .12);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; height: 66px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; }
.brand-mark .accent { color: var(--gold-deep); }
.brand-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-faint); }
nav.primary { display: flex; gap: 4px; flex-wrap: wrap; }
nav.primary a {
  font-size: .88rem; font-weight: 500; color: var(--ink-soft);
  padding: 8px 12px; border-radius: 999px;
}
nav.primary a:hover { background: var(--paper-sunken); text-decoration: none; color: var(--ink); }
nav.primary a.active { background: var(--green); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 11px; font-size: 1rem; cursor: pointer; color: var(--ink); }

@media (max-width: 900px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; }
  .nav-toggle { display: block; margin-left: auto; }
  nav.primary { display: none; width: 100%; flex-direction: column; padding-bottom: 6px; }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 10px 12px; border-radius: var(--radius-sm); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(620px 320px at 82% 18%, rgba(244, 201, 128, .38), transparent 65%),
    radial-gradient(1200px 500px at 85% -10%, rgba(201, 138, 44, .30), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(74, 103, 65, .30), transparent 60%),
    linear-gradient(175deg, #2c3d2d 0%, #3c5136 45%, #59683f 78%, #8a7a3f 100%);
  color: #f6f2e8;
}
.hero::before {
  content: ""; position: absolute; right: 8%; top: 52px; width: 120px; height: 120px;
  border-radius: 50%; background: radial-gradient(circle, #fbe7b6 0%, rgba(251,231,182,.45) 55%, transparent 72%);
  pointer-events: none;
}
@media (max-width: 700px) { .hero::before { width: 80px; height: 80px; right: 5%; top: 30px; } }
.hero .wrap { padding: 84px 22px 92px; position: relative; }
.hero .kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .74rem; color: #e9d9ae; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 17ch; color: #fdfaf2; }
.hero p.lede { margin-top: 16px; max-width: 56ch; font-size: 1.06rem; color: #e8e3d3; }
.hero .cta-row { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-hills { position: absolute; left: 0; right: 0; bottom: -2px; width: 100%; height: auto; pointer-events: none; }

.btn {
  display: inline-block; font-weight: 600; font-size: .92rem;
  padding: 11px 20px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(43,38,32,.18); }
.btn:focus-visible, nav.primary a:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.btn-gold { background: var(--gold); color: #241a05; }
.btn-gold:hover { background: #d99a3d; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fdfaf2; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-deep); }
.btn-line { background: transparent; color: var(--green-deep); border: 1px solid var(--green); }
.btn-line:hover { background: rgba(74,103,65,.08); }

/* ---------- Page header (interior pages) ---------- */
.page-head {
  background: linear-gradient(170deg, #37492f, #4a6741 70%, #5d7247);
  color: #f4f0e5;
}
.page-head .wrap { padding: 46px 22px 40px; }
.page-head .kicker { text-transform: uppercase; letter-spacing: .2em; font-size: .72rem; color: #dcc98f; margin-bottom: 10px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: #fdfaf2; }
.page-head p { margin-top: 10px; max-width: 64ch; color: #e2ddca; }

/* ---------- Sections ---------- */
section.band { padding: 54px 0; }
section.band.sunken { background: var(--paper-sunken); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.65rem; }
.section-head .more { font-size: .88rem; font-weight: 600; white-space: nowrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--gold-deep); font-weight: 700; margin-bottom: 8px; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.13rem; margin-bottom: 8px; }
.card p { font-size: .92rem; color: var(--ink-soft); }
.card .card-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-deep); font-weight: 700; margin-bottom: 6px; }
a.card { color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
a.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.icon-dot {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 14px; background: var(--paper-sunken);
}

/* ---------- Ticker / today strip ---------- */
.today-strip { background: #2b2620; color: #e9e2d2; font-size: .87rem; }
.today-strip .wrap { display: flex; gap: 26px; padding: 9px 22px; overflow-x: auto; white-space: nowrap; align-items: center; scrollbar-width: none; }
.today-strip .wrap::-webkit-scrollbar { display: none; }
.today-strip .label { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
.today-strip a { color: #e9e2d2; }
.today-strip .dot { color: var(--gold); }

/* ---------- Listings ---------- */
.listing-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.listing-tabs button {
  font-family: var(--font-body); font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink-soft);
}
.listing-tabs button.active { background: var(--green); border-color: var(--green); color: #fff; }
.listing-tabs button .count { opacity: .7; font-weight: 500; }

.listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .listing-grid { grid-template-columns: 1fr; } }

.listing-card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.listing-card { transition: transform .12s ease, box-shadow .12s ease; }
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.listing-photo { aspect-ratio: 4 / 2.7; position: relative; display: flex; align-items: flex-end; background-size: cover; background-position: center; }
.listing-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 62%, rgba(30,26,18,.22)); pointer-events: none; }
.listing-photo .status-chip { position: absolute; top: 12px; left: 12px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 5px 11px; border-radius: 999px; color: #fff; }
.status-active .status-chip { background: var(--green); }
.status-pending .status-chip { background: var(--gold-deep); }
.status-closed .status-chip { background: var(--sky); }
.listing-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.listing-price .sub { font-family: var(--font-body); font-size: .78rem; font-weight: 500; color: var(--ink-faint); }
.listing-addr { font-size: .93rem; font-weight: 600; }
.listing-hood { font-size: .78rem; color: var(--gold-deep); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.listing-specs { display: flex; gap: 14px; font-size: .84rem; color: var(--ink-soft); margin-top: 4px; flex-wrap: wrap; }
.listing-note { font-size: .82rem; color: var(--ink-faint); margin-top: 6px; }

.demo-banner {
  background: #fdf3e0; border: 1px solid #ecd9b0; color: #7a5a1d; border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: .86rem; margin-bottom: 22px;
}

/* ---------- Listings map ---------- */
.re-map-wrap { position: relative; }
#re-map {
  height: 440px; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: var(--shadow); z-index: 1;
}
@media (max-width: 700px) { #re-map { height: 340px; } }
.map-legend {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; font-size: .84rem; color: var(--ink-soft);
}
.map-legend .key { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.map-legend .swatch { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.swatch.active { background: #16c452; }
.swatch.pending { background: #ff9500; }
.swatch.closed { background: #2f80ff; }
.map-tabs { margin-bottom: 14px; }
.map-popup { font-family: var(--font-body); font-size: .85rem; line-height: 1.45; }
.map-popup .p-price { font-weight: 700; font-size: 1rem; }
.map-popup .p-status { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.map-popup .p-status.active { color: #0e9440; }
.map-popup .p-status.pending { color: #d97a00; }
.map-popup .p-status.closed { color: #2465d6; }

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 800px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--green-deep); }
.stat .lbl { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.stat .src { font-size: .7rem; color: var(--ink-faint); margin-top: 6px; }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split h2 { font-size: 1.7rem; margin-bottom: 12px; }
.split p { color: var(--ink-soft); margin-bottom: 12px; }
.split ul { margin: 12px 0 18px 18px; color: var(--ink-soft); font-size: .94rem; }
.split ul li { margin-bottom: 7px; }

.photo-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift); border: 1px solid var(--line); background: var(--paper-raised); }
.photo-frame svg, .photo-frame img { display: block; width: 100%; height: auto; }
.photo-credit { font-size: .72rem; color: var(--ink-faint); padding: 8px 14px; background: var(--paper-raised); }
.card .photo-credit { padding: 6px 0 0; background: none; }
.card-photo { width: calc(100% + 44px); margin: -22px -22px 0; border-radius: var(--radius) var(--radius) 0 0; display: block; }

#school-map { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 1; }
@media (max-width: 700px) { #school-map { height: 360px; } }

.event-row.event-more { justify-content: center; font-weight: 600; color: var(--green-deep); font-size: .9rem; }

/* ---------- Fact tables ---------- */
.fact-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fact-table th, .fact-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.fact-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); font-weight: 700; }
.fact-table td:first-child { font-weight: 600; white-space: nowrap; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }

/* ---------- Market table ---------- */
a.listing-card { color: inherit; }
a.listing-card:hover { text-decoration: none; }
.market-table td, .market-table th { white-space: nowrap; }
.market-table .taddr a { font-weight: 600; }
.market-table .thood { display: block; font-size: .7rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; }
.market-table .tprice { font-weight: 700; font-family: var(--font-display); font-size: 1rem; }
.tstatus { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 3px 10px; border-radius: 999px; color: #fff; }
.tstatus.active { background: #16c452; }
.tstatus.pending { background: #ff9500; }
.tstatus.closed { background: #2f80ff; }

/* ---------- Callouts ---------- */
.callout { border-radius: var(--radius); padding: 20px 24px; font-size: .93rem; border: 1px solid; }
.callout.alert { background: #fbeee7; border-color: #eccdb9; color: #6e3a22; }
.callout.info { background: #eaf0f6; border-color: #ccd9e6; color: #2e4763; }
.callout.good { background: #edf2e9; border-color: #d2ddc8; color: #35502e; }
.callout h3 { margin-bottom: 6px; font-size: 1.05rem; }
.callout a { font-weight: 600; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 22px 32px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--line); }
.timeline .t-year { font-weight: 700; font-family: var(--font-display); font-size: 1.02rem; }
.timeline p { font-size: .92rem; color: var(--ink-soft); }

/* ---------- Newsletter ---------- */
.newsletter { background: linear-gradient(160deg, #33452c, #4a6741); border-radius: var(--radius); color: #f2eedd; padding: 40px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: center; }
@media (max-width: 760px) { .newsletter { grid-template-columns: 1fr; padding: 28px; } }
.newsletter h2 { color: #fdfaf2; font-size: 1.6rem; margin-bottom: 8px; }
.newsletter p { color: #dcd6bf; font-size: .95rem; }
.newsletter form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input[type="email"] {
  flex: 1; min-width: 200px; padding: 12px 16px; border-radius: 999px; border: none; font-size: .95rem;
  font-family: var(--font-body); background: #fdfaf2; color: var(--ink);
}
.newsletter .fine { font-size: .74rem; color: #bdb89f; margin-top: 10px; }

/* ---------- Events board ---------- */
.events-board { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.event-row { display: flex; gap: 18px; padding: 15px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; color: inherit; }
.event-row:last-child { border-bottom: none; }
a.event-row:hover { text-decoration: none; background: var(--paper-sunken); }
.event-when {
  flex: 0 0 128px; font-size: .74rem; font-weight: 700; color: var(--gold-deep);
  text-transform: uppercase; letter-spacing: .06em; padding-top: 3px;
}
.event-main { display: block; min-width: 0; }
.event-tag {
  display: inline-block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  padding: 2px 9px; border-radius: 999px; margin-right: 8px; vertical-align: 2px;
  background: var(--paper-sunken); color: var(--ink-soft);
}
.event-tag.ev-school { background: #e6ecf9; color: #2b4a8f; }
.event-tag.ev-safari { background: #e4f0e2; color: #2e6b34; }
.event-tag.ev-community { background: #f6e8cf; color: #8a5a12; }
.event-tag.ev-golf { background: #e2efe9; color: #1f6b50; }
.event-tag.ev-town { background: #f0e6f2; color: #6d3f79; }
.event-tag.ev-news { background: #fbe4e0; color: #9c3b26; }
.event-tag.ev-winery { background: #f3e3ec; color: #8f2f63; }
.event-tag.ev-drive { background: #e0eef2; color: #14606f; }
.event-tabs { margin-bottom: 14px; }
.event-tabs button { font-size: .82rem; padding: 7px 14px; }
.event-title { font-weight: 700; font-size: .96rem; }
.event-detail { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: 2px; }
@media (max-width: 620px) {
  .event-row { flex-direction: column; gap: 4px; }
  .event-when { flex-basis: auto; }
}

/* ---------- Contact form ---------- */
.contact-form label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 14px; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form select, .contact-form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 13px; font-size: .93rem;
  font-family: var(--font-body); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green);
}

/* ---------- News list ---------- */
.news-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-date { min-width: 86px; font-size: .78rem; color: var(--ink-faint); font-weight: 600; padding-top: 3px; }
.news-body h3 { font-size: 1.02rem; margin-bottom: 3px; }
.news-body p { font-size: .88rem; color: var(--ink-soft); }
.news-tag { display: inline-block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 3px 9px; border-radius: 999px; background: var(--paper-sunken); color: var(--ink-soft); margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: #241f1a; color: #b9b09e; margin-top: 70px; }
.site-footer .wrap { padding: 46px 22px 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; border-bottom: 1px solid #3a332a; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #e8e0cd; font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; }
.site-footer a { color: #b9b09e; font-size: .88rem; }
.site-footer a:hover { color: #e8e0cd; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; color: #fdfaf2; margin-bottom: 8px; }
.footer-note { font-size: .8rem; line-height: 1.7; }
.footer-legal { padding-top: 22px; font-size: .74rem; color: #877e6c; line-height: 1.7; }

/* ---------- Utility ---------- */
.muted { color: var(--ink-faint); }
.small { font-size: .84rem; }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 34px; }
.mb-2 { margin-bottom: 20px; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--paper-sunken); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.pill.green { background: #e4ecdf; color: var(--green-deep); }
.pill.gold { background: #f6e8cf; color: var(--gold-deep); }
