/* Restoration Register — the whole stylesheet.

   One file, no build step, no framework. Every page on the site loads this and
   nothing else. Kept small deliberately: the pages that earn traffic are read
   on phones, often on a job site, and Softr's version shipped ~1 MB of
   JavaScript before a single word of copy appeared. */

:root {
  --ink: #1c1a17;
  --ink-soft: #5a544c;
  --rule: #ddd6cb;
  --paper: #fdfcfa;
  --panel: #f5f1ea;
  --accent: #7a3b1f;
  --accent-soft: #9c5a37;
  --good: #2f5d3a;
  --max: 62rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

a { color: var(--accent); }
a:hover { color: var(--accent-soft); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- header / nav ---- */

.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.92rem;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* ---- page furniture ---- */

main { padding: 1.75rem 0 3rem; }

.crumbs {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}

.crumbs a { color: var(--ink-soft); }

h1 {
  font-size: 1.95rem;
  line-height: 1.22;
  margin: 0 0 0.6rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2rem 0 0.7rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.4rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}

.meta {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---- the headline number on a grant page ----
   HANDOFF.md is emphatic that the dollar amount and the review date are the
   two things a visitor came for. They get their own block, above everything. */

.headline-amount {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  margin: 0 0 1.4rem;
}

.headline-amount .amount {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
}

.headline-amount .amount.none {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.headline-amount .reviewed {
  display: block;
  margin-top: 0.45rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---- fact tables ---- */

.facts {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 1.5rem;
  font-size: 0.97rem;
}

.facts th,
.facts td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.facts th {
  width: 11rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---- calls to action ---- */

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.65rem 1.1rem;
  border-radius: 4px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.cta:hover { background: var(--accent-soft); color: #fff; }

/* ---- listing cards ---- */

.cards {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.card {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  background: #fff;
}

.card h3 { margin: 0 0 0.25rem; font-size: 1.02rem; }
.card h3 a { text-decoration: none; }
.card p { margin: 0.2rem 0; font-size: 0.92rem; color: var(--ink-soft); }

.tag {
  display: inline-block;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  color: var(--ink-soft);
  margin-right: 0.3rem;
}

.tag.featured {
  background: #fdf3e6;
  border-color: #e2c69c;
  color: #8a5a1c;
}

/* ---- the grants table on the homepage ---- */

.table-scroll { overflow-x: auto; }

.grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin-top: 0.9rem;
}

.grid th,
.grid td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.grid th {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.grid tbody tr:hover { background: var(--panel); }

/* ---- the client-side filter ---- */

.filter {
  margin: 1.4rem 0 0.4rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.filter label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}

.filter input {
  width: 100%;
  max-width: 26rem;
  font: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}

.filter input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-count {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}

/* Rows and cards the filter has ruled out. Set by search.js. */
[hidden] { display: none !important; }

/* ---- prose ---- */

.prose p { margin: 0 0 1rem; }

.asks {
  margin: 0.6rem 0 1.4rem;
  padding-left: 1.2rem;
}

.asks li { margin-bottom: 0.6rem; }

.note {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1.05rem;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}

.note strong { display: block; margin-bottom: 0.3rem; }

.sponsor {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--good);
  border-radius: 4px;
  padding: 0.9rem 1.05rem;
  margin: 1.2rem 0;
  font-size: 0.95rem;
  background: #fff;
}

.sponsor img { max-width: 180px; height: auto; display: block; margin-bottom: 0.5rem; }

/* ---- the correction block that every listing carries ---- */

.correct {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.correct strong { color: var(--ink); }

/* ---- footer ---- */

.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--panel);
  padding: 1.5rem 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-foot p { margin: 0 0 0.4rem; }

.linkrow {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}

@media (max-width: 34rem) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .facts th { width: auto; display: block; border: 0; padding-bottom: 0; }
  .facts td { display: block; padding-top: 0.15rem; }
}
