/* ============================================================
   PEAK — INSIGHTS / LOCAL PAGES
   Shared styling for the town pages (/explore/<town>/) and the
   blog (/blog/). Loaded AFTER styles.css; adds only new classes
   so nothing on the existing site changes.
   ============================================================ */

:root {
  --ink:      #1a1a1a;
  --ink-2:    #4a4a4a;
  --ink-3:    #767676;
  --rule:     #e6e2da;
  --paper:    #faf8f4;
  --gold-dk:  #a07840;
  --sage-dk:  #5c7c60;
}

/* ─── SHELL ───────────────────────────────────────────────── */
.ins-wrap    { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.ins-narrow  { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.ins-section { padding: 64px 0; }
.ins-section--tight { padding: 40px 0; }
.ins-section--paper { background: var(--paper); }

/* ─── HERO ────────────────────────────────────────────────── */
.ins-hero {
  padding-top: 72px;
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ins-hero::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--accent) 100%);
}
.ins-hero-inner { max-width: 1140px; margin: 0 auto; padding: 64px 24px 52px; }
.ins-crumb {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.55); margin-bottom: 20px;
}
.ins-crumb a { color: var(--gold); }
.ins-crumb a:hover { color: #fff; }
.ins-crumb span { margin: 0 8px; opacity: .5; }
.ins-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.12; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 16px; max-width: 18ch;
}
.ins-hero--article h1 { max-width: 24ch; }
.ins-hero p.ins-lede {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: rgba(255,255,255,.78); max-width: 62ch; line-height: 1.65;
}
.ins-tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ins-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 100px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.14);
}
.ins-chip--gold { background: rgba(201,169,110,.16); border-color: rgba(201,169,110,.4); color: var(--gold); }
.ins-chip--sage { background: rgba(122,158,126,.16); border-color: rgba(122,158,126,.42); color: #9dc0a1; }

/* ─── STAT TILES ──────────────────────────────────────────── */
.ins-stats {
  display: grid; gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 40px;
}
.ins-stats--3 { grid-template-columns: repeat(3, 1fr); }
.ins-stat { background: #fff; padding: 22px 20px 18px; }
.ins-stat dt {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
}
.ins-stat dd { margin: 0; }
.ins-stat .ins-stat-val {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 700;
  color: var(--ink); line-height: 1.1; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.ins-stat .ins-stat-val.is-muted { color: #b8b2a6; font-weight: 400; }
.ins-stat .ins-stat-note { display: block; font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.ins-stat .ins-stat-note b { color: var(--gold-dk); font-weight: 700; }

/* on dark hero */
.ins-hero .ins-stats { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.14); }
.ins-hero .ins-stat { background: rgba(255,255,255,.04); }
.ins-hero .ins-stat dt { color: rgba(255,255,255,.55); }
.ins-hero .ins-stat .ins-stat-val { color: #fff; }
.ins-hero .ins-stat .ins-stat-val.is-muted { color: rgba(255,255,255,.4); }
.ins-hero .ins-stat .ins-stat-note { color: rgba(255,255,255,.5); }
.ins-hero .ins-stat .ins-stat-note b { color: var(--gold); }

/* ─── SOURCE / PROVENANCE ─────────────────────────────────── */
.ins-source {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.6;
  border-left: 2px solid var(--rule); padding-left: 14px; margin-top: 18px;
}
.ins-source strong { color: var(--ink-2); font-weight: 700; }
.ins-badge-est {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-dk); background: #fdf6e8;
  border: 1px solid #ecd9b0; border-radius: 3px; padding: 1px 6px; vertical-align: 2px;
}

/* ─── SECTION HEADINGS ────────────────────────────────────── */
.ins-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-dk); margin-bottom: 12px;
}
.ins-h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 700; letter-spacing: -.01em;
  color: var(--ink); line-height: 1.25; margin-bottom: 14px;
}
.ins-h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 28px 0 8px; }
.ins-sub { font-size: 1rem; color: var(--ink-2); line-height: 1.75; max-width: 66ch; }

/* ─── BAR COMPARISON ──────────────────────────────────────── */
.ins-bars { margin-top: 26px; display: grid; gap: 12px; }
.ins-bar-row { display: grid; grid-template-columns: 132px 1fr 92px; align-items: center; gap: 14px; }
.ins-bar-label { font-size: 13.5px; color: var(--ink-2); }
.ins-bar-label a { color: var(--ink-2); border-bottom: 1px solid transparent; }
.ins-bar-label a:hover { color: var(--gold-dk); border-bottom-color: var(--gold); }
.ins-bar-track { background: #efece6; border-radius: 3px; height: 22px; overflow: hidden; }
.ins-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; }
.ins-bar-fill.is-this { background: var(--accent); }
.ins-bar-fill.is-county { background: #cfc8ba; }
.ins-bar-val { font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.ins-bar-row.is-muted .ins-bar-val { color: #b8b2a6; font-weight: 400; }

/* ─── TABLE ───────────────────────────────────────────────── */
.ins-table-wrap { overflow-x: auto; margin-top: 24px; border: 1px solid var(--rule); border-radius: 6px; }
table.ins-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14.5px; }
table.ins-table th, table.ins-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--rule); }
table.ins-table thead th {
  background: var(--paper); font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
table.ins-table td.num, table.ins-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ins-table tbody tr:last-child td { border-bottom: 0; }
table.ins-table tbody tr:hover { background: #fcfbf8; }
table.ins-table td .is-muted { color: #b8b2a6; }
table.ins-table a { color: var(--ink); border-bottom: 1px solid var(--rule); }
table.ins-table a:hover { color: var(--gold-dk); border-bottom-color: var(--gold); }

/* A wide data table inside an article breaks out of the reading column so all
   its columns fit — on narrow screens it stays put and scrolls instead. */
@media (min-width: 900px) {
  .ins-article .ins-table-wrap {
    width: min(1040px, calc(100vw - 48px));
    margin-left: calc((100% - min(1040px, calc(100vw - 48px))) / 2);
  }
  .ins-article table.ins-table { font-size: 14px; }
}

/* ─── CARDS ───────────────────────────────────────────────── */
.ins-grid { display: grid; gap: 20px; margin-top: 28px; }
.ins-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ins-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ins-card {
  background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 24px;
  transition: border-color .18s, transform .18s;
}
a.ins-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.ins-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; line-height: 1.35; }
.ins-card p { font-size: .92rem; color: var(--ink-2); line-height: 1.7; }
.ins-card .ins-card-meta {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-dk); margin-bottom: 10px;
}
.ins-card-more { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--gold-dk); }

/* pill list (neighborhoods) */
.ins-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ins-pill {
  font-size: 13.5px; color: var(--ink-2); background: #fff;
  border: 1px solid var(--rule); border-radius: 100px; padding: 5px 14px;
}

/* ─── EVENTS ──────────────────────────────────────────────── */
.ins-events { margin-top: 24px; display: grid; gap: 10px; }
.ins-event {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.ins-event:last-child { border-bottom: 0; }
.ins-event-when {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gold-dk); padding-top: 3px; line-height: 1.5;
}
.ins-event-name { font-weight: 700; color: var(--ink); font-size: .97rem; }
.ins-event-det { font-size: .88rem; color: var(--ink-3); line-height: 1.6; margin-top: 3px; }
.ins-event-next {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--sage-dk);
  background: #eef4ef; border-radius: 3px; padding: 1px 7px; margin-left: 6px; vertical-align: 1px;
}
.ins-note {
  background: var(--paper); border-left: 3px solid var(--gold);
  padding: 18px 22px; border-radius: 0 4px 4px 0; margin-top: 22px;
  font-size: .93rem; color: var(--ink-2); line-height: 1.7;
}
.ins-note strong { color: var(--ink); }

/* ─── CALCULATOR ──────────────────────────────────────────── */
.ins-calc {
  border: 1px solid var(--rule); border-radius: 8px; background: #fff;
  padding: 26px; margin: 32px 0;
}
.ins-calc h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.ins-calc .ins-calc-hint { font-size: .86rem; color: var(--ink-3); margin-bottom: 20px; line-height: 1.6; }
.ins-calc-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ins-field label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px;
}
.ins-field input, .ins-field select {
  width: 100%; font-family: inherit; font-size: .98rem; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--rule); border-radius: 4px; background: #fff;
}
.ins-field input:focus, .ins-field select:focus { border-color: var(--gold); outline-offset: 1px; }
.ins-calc-out {
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 28px; align-items: baseline;
}
.ins-calc-out .ins-out-block { min-width: 130px; }
.ins-calc-out .ins-out-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.ins-calc-out .ins-out-val {
  font-size: 1.6rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2;
}
.ins-calc-out .ins-out-val.accent { color: var(--sage-dk); }
.ins-calc-foot { font-size: 12px; color: var(--ink-3); margin-top: 16px; line-height: 1.6; }

/* ─── ARTICLE BODY ────────────────────────────────────────── */
.ins-article { font-size: 1.05rem; color: var(--ink-2); line-height: 1.8; }
.ins-article > p { margin-bottom: 22px; }
.ins-article > p:first-of-type { font-size: 1.15rem; color: var(--ink); }
.ins-article h2 {
  font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 700; color: var(--ink);
  margin: 52px 0 14px; letter-spacing: -.01em; line-height: 1.3; scroll-margin-top: 90px;
}
.ins-article h3 { font-size: 1.08rem; font-weight: 700; color: var(--ink); margin: 32px 0 10px; }
.ins-article ul, .ins-article ol { margin: 0 0 22px 0; padding-left: 0; }
.ins-article ul li {
  position: relative; padding-left: 22px; margin-bottom: 10px; list-style: none;
}
.ins-article ul li::before {
  content: ""; position: absolute; left: 2px; top: .68em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
}
.ins-article ol { counter-reset: ins; }
.ins-article ol li {
  position: relative; padding-left: 30px; margin-bottom: 12px; list-style: none; counter-increment: ins;
}
.ins-article ol li::before {
  content: counter(ins); position: absolute; left: 0; top: .1em;
  font-size: 12px; font-weight: 700; color: var(--gold-dk);
  width: 20px; height: 20px; border: 1px solid var(--rule); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ins-article strong { color: var(--ink); font-weight: 700; }
.ins-article a { color: var(--gold-dk); border-bottom: 1px solid #e5d3ae; }
.ins-article a:hover { border-bottom-color: var(--gold-dk); }
.ins-pull {
  border-left: 3px solid var(--accent); padding: 6px 0 6px 24px; margin: 32px 0;
  font-size: 1.15rem; color: var(--ink); line-height: 1.6;
}
.ins-byline {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  font-size: 13px; color: var(--ink-3); padding-bottom: 26px; margin-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}
.ins-byline b { color: var(--ink-2); font-weight: 700; }

/* table of contents */
.ins-toc { background: var(--paper); border-radius: 6px; padding: 22px 26px; margin-bottom: 40px; }
.ins-toc p {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.ins-toc ol { margin: 0; counter-reset: toc; }
.ins-toc li { list-style: none; margin-bottom: 6px; padding-left: 0; }
.ins-toc a { font-size: .94rem; color: var(--ink-2); border-bottom: 1px solid transparent; }
.ins-toc a:hover { color: var(--gold-dk); border-bottom-color: var(--gold); }

/* ─── CTA ─────────────────────────────────────────────────── */
.ins-cta {
  background: var(--ink); border-radius: 8px; padding: 44px 40px; margin-top: 56px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.ins-cta h3 { font-size: 1.35rem; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.3; }
.ins-cta p { font-size: .95rem; color: rgba(255,255,255,.7); max-width: 52ch; line-height: 1.7; }
.ins-cta .ins-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ins-btn {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 13px 26px; border-radius: 4px; transition: all .18s;
}
.ins-btn--gold { background: var(--gold); color: #1a1a1a; }
.ins-btn--gold:hover { background: #d8bb84; }
.ins-btn--ghost { border: 1px solid rgba(255,255,255,.3); color: #fff; }
.ins-btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.07); }
.ins-btn--line { border: 1px solid var(--rule); color: var(--ink); }
.ins-btn--line:hover { border-color: var(--gold); color: var(--gold-dk); }

/* ─── NEARBY / NEXT ───────────────────────────────────────── */
.ins-nearby { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ins-nearby a {
  font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--rule); border-radius: 100px; padding: 7px 16px; background: #fff;
  transition: all .18s;
}
.ins-nearby a:hover { border-color: var(--gold); color: var(--gold-dk); }

/* ─── LISTINGS SLOT ───────────────────────────────────────── */
.ins-listing-empty {
  border: 1px dashed var(--rule); border-radius: 6px; padding: 28px;
  font-size: .93rem; color: var(--ink-3); text-align: center; line-height: 1.7; margin-top: 24px;
}
.ins-listing-price { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.ins-listing-type {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--sage-dk); background: #eef4ef; border-radius: 3px; padding: 2px 8px;
  display: inline-block; margin-bottom: 10px;
}

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .ins-stats, .ins-stats--3 { grid-template-columns: repeat(2, 1fr); }
  .ins-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .ins-calc-fields { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ins-section { padding: 44px 0; }
  .ins-hero-inner { padding: 44px 20px 40px; }
  .ins-grid--2, .ins-grid--3 { grid-template-columns: 1fr; }
  .ins-calc-fields { grid-template-columns: 1fr; }
  .ins-calc { padding: 20px; }
  .ins-cta { padding: 32px 24px; }
  .ins-bar-row { grid-template-columns: 104px 1fr 76px; gap: 10px; }
  .ins-bar-label { font-size: 12.5px; }
  .ins-event { grid-template-columns: 1fr; gap: 4px; }
  .ins-event-when { padding-top: 0; }
  .ins-article { font-size: 1rem; }
}
