/* PiedWatch — clean, modern, responsive. No frameworks. */

:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --ink: #1a1d24;
  --ink-soft: #4b5563;
  --accent: #8c1d2f;
  --accent-soft: #f3e2e5;
  --line: #e5e7eb;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand-accent { color: var(--accent); }
.site-header nav a {
  margin-left: 1.1rem;
  color: var(--ink-soft);
  font-weight: 600;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.75rem;
}
.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 60ch;
}

.map-wrap { margin: 1.5rem 0; }
#map {
  height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}
.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.board h2 { font-size: 1.05rem; margin: 0.25rem 0 0.75rem; }
.board table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.board th, .board td {
  text-align: left;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--line);
}
.board th { color: var(--ink-soft); font-weight: 600; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }

.explainer { margin-top: 2.5rem; max-width: 75ch; }
.explainer h2 { font-size: 1.3rem; }
.explainer p { color: var(--ink-soft); }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 1.25rem;
  text-align: center;
}
.site-footer .legal {
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 70ch;
  margin: 0 auto 0.5rem;
}
.footer-links { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }

/* Property page */
.property-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.property-card h1 { margin: 0 0 0.4rem; font-size: clamp(1.4rem, 3.5vw, 2rem); }
.subtitle { color: var(--ink-soft); margin-top: 0; }

.property-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin: 1.25rem 0;
}
@media (max-width: 760px) {
  .property-grid { grid-template-columns: 1fr; }
}

.property-media figure { margin: 0; }
.property-media img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}
.property-media figcaption {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  background:
    linear-gradient(135deg, #eceff3 25%, #f5f7fa 50%, #eceff3 75%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-placeholder-label {
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0 1rem;
  text-align: center;
}
.mini-map {
  height: 220px;
  margin-top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.property-facts { margin: 0; display: grid; gap: 0.55rem; }
.property-facts > div { display: flex; justify-content: space-between; gap: 1rem; }
.property-facts dt { color: var(--ink-soft); font-size: 0.9rem; }
.property-facts dd { margin: 0; font-weight: 600; text-align: right; }
.property-facts .fmv { color: var(--accent); font-size: 1.15rem; }

.flags { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.flag {
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.flag-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: #c9ced6;
}
.flag-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.flag-on .flag-dot { background: var(--accent); }

/* Historic tax photos: own section below ownership; compact cover cards. */
.historic-photos {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.historic-photos h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.historic-photo-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.historic-photo-card { min-width: 0; }
.historic-photo-thumb {
  display: block;
  height: 190px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel);
  text-decoration: none;
}
.historic-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: filter 0.15s ease;
}
.historic-photo-thumb:hover {
  box-shadow: 0 2px 10px rgba(26, 29, 36, 0.1);
}
.historic-photo-thumb:hover img { filter: brightness(1.06); }
.historic-photo-caption {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
  line-height: 1.4;
}
.historic-photos-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0;
}
@media (max-width: 760px) {
  .historic-photo-grid { grid-template-columns: 1fr; }
  .historic-photo-thumb { height: 180px; }
}

.acris-link { margin-top: 1rem; font-weight: 600; }

/* Ownership records: ACRIS deed + HPD registration (property page) */
.ownership-records {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.ownership-records h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.ownership-records h3 { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
.deed-line { margin: 0 0 0.6rem; }
.deed-flow { display: block; color: var(--ink-soft); }

.ownership-contacts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ownership-contact {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.ownership-contact:last-child { border-bottom: none; }

/* Badge(s) + name on one left-aligned line (flex-start, 0.5rem gap — no
   fixed-width label column). Address is a block below, same left edge. */
.ownership-contact-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.5rem;
}
.ownership-role {
  display: inline-block;
  flex: 0 0 auto;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}
.ownership-desc {
  display: inline-block;
  flex: 0 0 auto;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.4;
}
.ownership-contact-name {
  font-weight: 500;
  font-size: 0.95rem;
  word-break: break-word;
  min-width: 0;
}
.ownership-contact-address {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 0.2rem;
  padding: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.ownership-framing {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0.75rem 0 0;
}

/* Flip bar (property-page prev/next through the list) */
.flip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.9rem;
}
.flip a { font-weight: 700; }
.flip-pos { color: var(--ink-soft); font-weight: 600; text-align: center; }
.flip-disabled { color: #c9ced6; font-weight: 700; }

/* Zip / street listing pages */
.listing-page h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin: 0.5rem 0 0.4rem; }
.listing-count { color: var(--ink-soft); margin-top: 0; }
.listing { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: 1rem; }
.listing-card {
  display: flex;
  gap: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.listing-photo { flex: 0 0 140px; }
.listing-photo img,
.listing-photo-placeholder {
  width: 140px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-photo img { border: 1px solid var(--line); display: block; }
.listing-photo-placeholder .photo-placeholder-label { font-size: 0.72rem; }
.listing-info { min-width: 0; }
.listing-addr { font-weight: 700; font-size: 1.05rem; }
.listing-fmv { color: var(--accent); font-weight: 700; margin-left: 0.5rem; white-space: nowrap; }
.listing-owner { display: block; color: var(--ink-soft); font-size: 0.9rem; }
.listing-card .flags { margin: 0.5rem 0 0; }
@media (max-width: 560px) {
  .listing-card { flex-direction: column; }
  .listing-photo { flex: none; }
  .listing-photo img,
  .listing-photo-placeholder { width: 100%; }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  font-weight: 600;
}
.page-pos { color: var(--ink-soft); }
.pager-disabled { color: #c9ced6; }

/* Top page: sort controls + ranking table (reuses .board/.pager) */
.sort-controls { margin: 0.25rem 0 1rem; color: var(--ink-soft); }
.sort-controls a { font-weight: 600; }
.sort-controls .sort-active { color: var(--ink); text-decoration: underline; }
.top-board { overflow-x: auto; }
.top-table td:nth-child(4) { max-width: 22rem; }

/* Property page tax estimate */
.tax-estimate { font-weight: 700; color: var(--accent); }
.tax-estimate-caption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.9rem 0 0;
}

/* Methodology */
.methodology { max-width: 75ch; }
.methodology h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
.methodology h2 { margin-top: 1.75rem; font-size: 1.2rem; }
.methodology p, .methodology li { color: var(--ink-soft); }
.methodology li { margin-bottom: 0.5rem; }

/* Map popup */
.popup-fmv { font-weight: 700; color: var(--accent); }
.popup-owner { color: var(--ink-soft); font-size: 0.85rem; }

/* Search: header box (every page), homepage box, results page */
.site-search { margin: 0 1rem; flex: 0 1 15rem; }
.site-search input {
  width: 100%;
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--ink);
}
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; }
  .site-search { order: 3; flex: 1 1 100%; margin: 0.6rem 0 0; }
}

.home-search { margin: 0 0 1.5rem; }
.home-search form,
.search-form { display: flex; gap: 0.5rem; max-width: 34rem; }
.home-search input,
.search-form input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
  background: var(--panel);
  color: var(--ink);
}
.search-btn {
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.search-btn:hover { text-decoration: none; opacity: 0.92; }

.search-page h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin: 0.5rem 0 0.75rem; }
.search-form { margin-bottom: 1.5rem; }
.search-section h2 { font-size: 1.15rem; margin: 1.75rem 0 0.25rem; }
.search-n { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }
.search-none { color: var(--ink-soft); }
.badge-onlist {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.search-note {
  display: inline-block;
  margin-left: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}
.search-tax { display: block; color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 0.1rem; }
.search-loc { display: block; color: var(--ink-soft); font-size: 0.85rem; }
