/*
  styles.css: how the site looks.
  Written mobile first: the base styles are for phones, and the
  @media block near the bottom adjusts things for wider screens.
*/

/* ---------- Colors (change these to re-theme the whole site) ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1d2321;
  --muted: #5d6763;
  --border: #dedad1;
  --brand: #1f5f4a;

  --official: #17703f;        /* Verified: green */
  --official-bg: #e5f4ea;
  --city: #1c5c99;            /* City listed: blue */
  --city-bg: #e5eff9;
  --unverified: #9a5a00;      /* Unverified: amber */
  --unverified-bg: #fdf1dc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131715;
    --surface: #1c2220;
    --text: #e9ece9;
    --muted: #a2aca8;
    --border: #2f3834;
    --brand: #7fcfb0;
    --official: #7fd6a1;
    --official-bg: #183224;
    --city: #8fc0f0;
    --city-bg: #172a3d;
    --unverified: #f2bc66;
    --unverified-bg: #3a2b12;
  }
}

/* ---------- Basics ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--brand); }

h1, h2 { line-height: 1.25; }

main, .site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header and footer ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav { display: flex; gap: 14px; font-size: 15px; white-space: nowrap; }
.site-header nav a { text-decoration: none; font-weight: 600; }

.banner {
  background: var(--unverified-bg);
  color: var(--unverified);
  text-align: center;
  padding: 8px 16px;
  font-size: 15px;
}

.site-footer {
  padding-top: 24px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  font-size: 14px;
  color: var(--muted);
}

.disclaimer {
  font-size: 14px;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: 12px;
}

.loading { padding: 40px 0; color: var(--muted); }

/* ---------- Home: title and filters ---------- */
.page-title { margin: 20px 0 4px; font-size: 26px; }
.intro { margin: 0 0 16px; color: var(--muted); }

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.filters label span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.filters .search { grid-column: 1 / -1; }

.filters input,
.filters select {
  width: 100%;
  font: inherit;
  font-size: 16px;            /* 16px stops iPhones from zooming in */
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.count { margin: 16px 0 8px; font-size: 14px; color: var(--muted); }

/* ---------- Market cards ---------- */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.card {
  display: block;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.card:active { transform: scale(0.99); }
.card-official { border-left-color: var(--official); }
.card-city_listed { border-left-color: var(--city); }
.card-unverified { border-left-color: var(--unverified); }

.card h2 { margin: 6px 0 2px; font-size: 19px; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.county { font-size: 13px; color: var(--muted); }
.card-city { margin: 0; color: var(--muted); font-size: 15px; }
.card-date { margin: 8px 0 0; }
.date { font-weight: 600; }
.when {
  font-size: 13px;
  font-weight: 600;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--muted);
}
.card-warning { margin: 8px 0 0; font-size: 14px; color: var(--unverified); }
.empty { padding: 24px 0; color: var(--muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px 3px 4px;
  border-radius: 99px;
}
.badge-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  color: var(--surface);
}
.badge-official { background: var(--official-bg); color: var(--official); }
.badge-official .badge-icon { background: var(--official); }
.badge-city_listed { background: var(--city-bg); color: var(--city); }
.badge-city_listed .badge-icon { background: var(--city); }
.badge-unverified { background: var(--unverified-bg); color: var(--unverified); }
.badge-unverified .badge-icon { background: var(--unverified); }

/* ---------- Detail page ---------- */
.back { display: inline-block; margin-top: 16px; text-decoration: none; font-weight: 600; }
.detail h1 { margin: 8px 0 4px; font-size: 26px; }

.status-box {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.status-box p { margin: 8px 0; }
.status-official { border-color: var(--official); }
.status-city_listed { border-color: var(--city); }
.status-unverified { border-color: var(--unverified); background: var(--unverified-bg); }

.facts { margin: 0; }
.facts dt {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 14px;
}
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* ---------- How we verify page ---------- */
.prose h1 { margin: 20px 0 8px; font-size: 26px; }
.prose h2 { margin-top: 28px; font-size: 20px; }
.prose li { margin-bottom: 6px; }

/* ---------- Wider screens (tablets and computers) ---------- */
@media (min-width: 720px) {
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
  .filters .search { grid-column: auto; }
  .cards { grid-template-columns: 1fr 1fr; }
}

/* ---------- Very narrow phones: hide the app name so the menu fits ---------- */
@media (max-width: 380px) {
  .brand span { display: none; }
}
