/* ---------------------------------------------------------------
   Simoledger — design tokens
   Ledger / deed-book aesthetic: warm paper page, dark ink text,
   brass "stamp" rank badges as the one signature element. Everything
   else stays quiet: hairline rules, tabular numerals, no gradients,
   no drop shadows, no rounded-pill defaults.
------------------------------------------------------------------*/
:root {
  --paper:        #F6F1E3;  /* page background */
  --paper-panel:  #EFE8D4;  /* row hover / chip background */
  --rule:         #DCD4BC;  /* hairline rules */
  --ink:          #2B2820;  /* primary text */
  --ink-dim:      #75705E;  /* secondary / label text */
  --brass:        #8F7414;  /* the one accent — stamps, labels, badges (darkened for light bg) */
  --brass-bright: #C9A227;  /* brass fills — selected chip background */
  --brass-dim:    #BCA65C;  /* brass at rest / borders */
  --negative:     #9A5B44;  /* overpriced / negative value score, muted clay, used sparingly */

  --font-display: "IBM Plex Serif", Georgia, serif;
  --font-ui:      "IBM Plex Sans", -apple-system, sans-serif;
  --font-data:    "IBM Plex Mono", ui-monospace, monospace;

  --radius: 2px;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Header / masthead ---------------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 26px 0 18px;
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  color: var(--brass);
  flex: none;
  /* a hint of stamp texture: slightly rotated, like it was pressed by hand */
  transform: rotate(-3deg);
  transition: transform 0.25s ease;
}
.brand:hover .brand-mark { transform: rotate(0deg); }
.masthead h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 27px;
  letter-spacing: 0.01em;
  margin: 0;
}
.masthead .tagline {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------------- Tabs (top-level Buy/Rent + neighborhood pills) ---------------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--rule);
  margin: 28px 0 0;
}
.tab {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  background: none;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--brass);
}

/* Single-row scrolling strip — full-coverage metros have ~90 zips, and a
   wrapped grid of pills would push the rankings below the fold. */
.subtabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 16px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  -webkit-overflow-scrolling: touch;
}
.subtabs::-webkit-scrollbar { height: 4px; }
.subtabs::-webkit-scrollbar-track { background: transparent; }
.subtabs::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }
.subtabs::-webkit-scrollbar-thumb:hover { background: var(--brass-dim); }
.subtab {
  flex: none;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--ink-dim);
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  padding: 5px 11px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.subtab:hover { color: var(--ink); border-color: var(--brass-dim); }
.subtab[aria-selected="true"] {
  color: var(--ink);
  background: var(--brass-bright);
  border-color: var(--brass-bright);
}

/* ---------------- Home page ---------------- */
.home-hero {
  padding: 44px 24px 8px;
}
.lede {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.55;
  max-width: 640px;
  margin: 0;
  color: var(--ink);
}
.index-label {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
}

.metro-index {
  padding: 36px 24px 72px;
}
.metro-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.metro-row:hover { background: var(--paper-panel); }
.metro-row:hover .metro-name { color: var(--brass); }
.metro-ident {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.metro-name {
  font-family: var(--font-display);
  font-size: 21px;
  transition: color 0.15s ease;
}
.metro-cbsa {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}
.metro-meta {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.metro-arrow {
  display: inline-block;
  margin-left: 10px;
  color: var(--brass);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.metro-row:hover .metro-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ---------------- City page layout ---------------- */
.methodology-note {
  font-family: var(--font-data);
  font-size: 11.5px;
  color: var(--ink-dim);
  border-left: 2px solid var(--brass-dim);
  padding: 8px 0 8px 12px;
  margin: 20px 0 8px;
  max-width: 640px;
}

.panels {
  max-width: 860px;
  padding: 24px 0 72px;
}

.panel h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 14px;
}
.panel h2 .heading-note {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
}

/* ---------------- Ledger rows (the listing tables) ---------------- */
.ledger { display: flex; flex-direction: column; }
.ledger-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s ease;
}
.ledger-row:hover { background: var(--paper-panel); }
.stamp {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--brass);
  border: 1px solid var(--brass-dim);
  border-radius: var(--radius);
  width: 30px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-info { min-width: 0; }
.listing-address {
  /* block, not inline — ellipsis only truncates block-level boxes, and an
     inline span overflows straight into the figure column */
  display: block;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.listing-address a { text-decoration: none; }
.listing-address a:hover { color: var(--brass); }
.listing-address .ext {
  font-size: 11px;
  color: var(--ink-dim);
}
.row-cta {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--brass);
  text-decoration: none;
  border: 1px solid var(--brass-dim);
  border-radius: var(--radius);
  padding: 2px 8px;
}
.row-cta:hover { background: var(--brass-bright); color: var(--ink); border-color: var(--brass-bright); }
/* chips stay side by side both on desktop and when the figure column
   stacks vertically on narrow screens */
.listing-figure .ctas { display: flex; gap: 6px; }
.listing-sub {
  display: block;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--ink-dim);
}
.listing-sub .sub-price {
  color: var(--ink);
}
.listing-figure {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-family: var(--font-data);
  font-size: 14px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* fixed-width amount keeps the badge column aligned down the ledger */
.figure-amount {
  min-width: 92px;
  color: var(--ink);
}
@media (max-width: 560px) {
  /* figure block drops below the listing info as its own wrapping row —
     badge, monthly and CTA chips can't share a 375px line with the address */
  .ledger-row { grid-template-columns: 34px 1fr; row-gap: 6px; }
  .listing-figure {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .figure-amount { min-width: 0; }
}
.listing-figure .unit {
  color: var(--ink-dim);
  font-size: 11px;
}
.value-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--brass);
  border: 1px solid var(--brass-dim);
  border-radius: var(--radius);
}

.empty-state {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--ink-dim);
  padding: 24px 0;
}

footer.site-footer {
  border-top: 1px solid var(--rule);
  padding: 24px 0 40px;
  font-family: var(--font-data);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-dim);
}
.footer-grid {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer-ident { display: flex; flex-direction: column; }
.footer-brand {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--brass); }

/* ---------------- Info pages (FAQ / contact / sponsor) ---------------- */
.page {
  padding: 40px 24px 72px;
}
/* cap line length while keeping the left edge aligned with the masthead */
.page > * { max-width: 680px; }
.page .back {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--ink-dim);
  text-decoration: none;
}
.page .back:hover { color: var(--brass); }
.page-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  margin: 18px 0 28px;
}
.qa { margin-bottom: 28px; }
.qa h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 8px;
}
.a {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}
.contact-block { margin: 0 0 6px; }
.cname {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 2px;
}
.cmail { margin: 0; font-family: var(--font-data); font-size: 13px; }
.cmail a, .sponsor-cta a { color: var(--brass); }
.contact-note {
  font-size: 14px;
  color: var(--ink-dim);
  margin: 10px 0 24px;
}
.cform { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.cform input, .cform textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 9px 12px;
}
.cform input:focus, .cform textarea:focus {
  outline: none;
  border-color: var(--brass-dim);
}
.cform-send {
  align-self: flex-start;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--brass-bright);
  border: 1px solid var(--brass-bright);
  border-radius: var(--radius);
  padding: 9px 20px;
  cursor: pointer;
}
.cform-send:hover { background: var(--brass); border-color: var(--brass); color: var(--paper); }
.cform-hint {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--ink-dim);
  margin: 2px 0 0;
}
.sponsor-cta {
  font-size: 14.5px;
  line-height: 1.65;
  margin-top: 20px;
}
