/*
Theme Name: NOG - Northern Ontario Grants
Description: Custom data-driven index theme for northernontariogrants.com. The authoritative registry: GOV.UK clarity at craft level, boreal-ledger identity. No page builders, no plugins required, near-zero JS.
Version: 1.0.0
Author: Northern Ontario Grants
Requires PHP: 8.1
Text Domain: nog
*/

/* ============================================================
   BOREAL LEDGER — the paper registry Northern Ontario never built.
   Ink on warm paper · one spruce accent · hairline rules · stamped chips ·
   tabular numerals wherever money or dates appear. Restraint, precisely.
   ============================================================ */

/* ---------- fonts (self-hosted, subset; metric fallbacks) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-600.woff2") format("woff2");
  font-weight: 500 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans-latin-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --paper: #faf8f3;
  --paper-raise: #ffffff;
  --paper-sink: #f1eee6;
  --ink: #171f1b;
  --ink-soft: #46544c;
  --ink-faint: #6e7a72;
  --spruce: #175c3d;
  --spruce-deep: #0e402a;
  --spruce-wash: #e7efe9;
  --hairline: #d8d3c6;
  --hairline-soft: #e6e2d7;
  --open: #175c3d;
  --open-wash: #e1eee5;
  --closing: #7a4d00;
  --closing-wash: #f6ecd9;
  --closed: #4c5a63;
  --closed-wash: #e6eaec;
  --uncertain: #7a3d00;
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
  --wide: 74rem;
  --narrow: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131715;
    --paper-raise: #1a201d;
    --paper-sink: #0e1210;
    --ink: #e9e7de;
    --ink-soft: #adb7ae;
    --ink-faint: #86918a;
    --spruce: #5cb98a;
    --spruce-deep: #83cda6;
    --spruce-wash: #1b2d24;
    --hairline: #2d342f;
    --hairline-soft: #232a26;
    --open: #5cb98a;
    --open-wash: #1b2d24;
    --closing: #d9a850;
    --closing-wash: #2e2617;
    --closed: #93a0a8;
    --closed-wash: #20272b;
    --uncertain: #d09a5a;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  /* faint paper grain — light mode only, imperceptible but felt */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.015 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}
@media (prefers-color-scheme: dark) { body { background-image: none; } }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.012em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin: 0 0 0.6rem; text-wrap: balance; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.65rem); margin: 2.4rem 0 0.7rem; }
h3 { font-size: 1.1rem; margin: 1.2rem 0 0.4rem; }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--spruce); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--spruce-deep); }
ul, ol { padding-left: 1.4rem; max-width: var(--measure); }
li { margin-bottom: 0.35rem; }
code { background: var(--paper-sink); border: 1px solid var(--hairline-soft); border-radius: 2px; padding: 0.08em 0.35em; font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.5rem 0; }
.nog-num, time, td { font-variant-numeric: tabular-nums; }
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.wrap--wide { max-width: var(--wide); margin: 0 auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
main.wrap { padding-top: 1rem; }
.prose h2 { border-bottom: 1px solid var(--hairline-soft); padding-bottom: 0.35rem; }

.visually-hidden, .skip {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus {
  position: fixed; top: 0.5rem; left: 0.5rem; z-index: 99; width: auto; height: auto; clip: auto;
  background: var(--spruce); color: #fff; padding: 0.6rem 1rem; border-radius: 2px;
}

/* ---------- header / footer ---------- */
.site-strip {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); padding-block: 0.45rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.site-strip__right { letter-spacing: 0.04em; text-transform: none; }
.site-head { border-bottom: 3px double var(--ink); background: var(--paper); }
.site-head__inner { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding-block: 1.05rem; }
.site-head__brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-head__brand em { font-style: normal; color: var(--spruce); }
.site-head__mark { color: var(--spruce); font-size: 0.7em; margin-right: 0.3rem; vertical-align: 0.08em; }
.site-head__nav { display: flex; gap: clamp(0.8rem, 2.2vw, 1.7rem); flex-wrap: wrap; }
.site-head__nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.site-head__nav a:hover { color: var(--ink); border-bottom-color: var(--spruce); }

.site-foot { border-top: 2px solid var(--ink); margin-top: 3rem; background: var(--paper-sink); }
.site-foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; padding-block: 2.2rem 1rem; }
.site-foot__brand { font-family: var(--serif); font-size: 1.1rem; margin-bottom: 0.4rem; }
.site-foot__brand em { font-style: normal; color: var(--spruce); }
.site-foot nav h2 { font-family: var(--sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); margin: 0 0 0.6rem; }
.site-foot nav a { display: block; color: var(--ink-soft); text-decoration: none; margin-bottom: 0.35rem; font-size: 0.95rem; }
.site-foot nav a:hover { color: var(--spruce); }
.site-foot__legal { font-size: 0.85rem; color: var(--ink-faint); padding-block: 1rem 2rem; border-top: 1px solid var(--hairline); max-width: none; }
@media (max-width: 800px) { .site-foot__grid { grid-template-columns: 1fr 1fr; } }

/* ---------- hero band ---------- */
.nog-kicker { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--spruce); margin: 0 0 1rem; }
.hero2 {
  --hero-ink: #f4f1e8;
  --hero-faint: rgba(244, 241, 232, 0.62);
  --hero-line: rgba(244, 241, 232, 0.16);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='620' viewBox='0 0 900 620' fill='none' stroke='%23f4f1e8' stroke-opacity='0.055' stroke-width='1.1'%3E%3Cpath d='M-40 90 C140 30 260 140 430 96 C610 50 700 130 940 84'/%3E%3Cpath d='M-40 170 C120 118 300 214 470 168 C640 124 760 206 940 158'/%3E%3Cpath d='M-40 260 C160 200 280 300 450 252 C620 208 740 292 940 240'/%3E%3Cpath d='M-40 356 C130 300 310 396 480 348 C650 302 770 384 940 334'/%3E%3Cpath d='M-40 452 C150 396 270 492 440 446 C610 400 750 480 940 430'/%3E%3Cpath d='M-40 548 C140 492 300 586 470 540 C640 494 760 574 940 526'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #123d29 0%, #0e3423 55%, #0a2a1c 100%);
  background-size: 1200px auto, cover;
  color: var(--hero-ink);
}
.hero2__grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(17rem, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(2.4rem, 5vw, 4rem);
}
.hero2__overline { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--hero-faint); margin: 0 0 1.3rem; }
.hero2__h1 {
  font-family: var(--serif); font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 1.02; letter-spacing: -0.018em; color: var(--hero-ink); margin: 0 0 1.3rem;
}
.hero2__sub { color: var(--hero-faint); font-size: clamp(1rem, 1.9vw, 1.14rem); line-height: 1.6; max-width: 56ch; margin-bottom: 1.9rem; }
.hero2__cta { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.btn--paper { background: var(--hero-ink); color: #123d29; font-weight: 600; padding: 0.75rem 1.5rem; }
.btn--paper:hover { background: #fff; color: #0e3423; }
.hero2__browse { color: var(--hero-ink); font-weight: 600; text-decoration-color: var(--hero-line); text-underline-offset: 4px; }
.hero2__browse:hover { color: #fff; }

.hero2__panel {
  border: 1px solid var(--hero-line); background: rgba(10, 42, 28, 0.5);
  padding: 1.3rem 1.4rem 1.1rem; backdrop-filter: blur(2px);
}
.hero2__panel-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hero-faint); margin: 0 0 0.8rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--hero-line); }
.hero2__list { list-style: none; margin: 0; padding: 0; max-width: none; }
.hero2__list li { padding: 0.6rem 0; border-bottom: 1px solid var(--hero-line); }
.hero2__list li:last-child { border-bottom: 0; }
.hero2__list a { color: var(--hero-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 0.15rem; }
.hero2__list a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--hero-line); }
.hero2__when { color: var(--hero-faint); font-size: 0.85rem; }
.hero2__when em { font-style: normal; color: #dfb45e; font-weight: 600; margin-left: 0.4rem; }
.hero2__none { color: var(--hero-faint); font-size: 0.9rem; }
.hero2__panel-foot { margin: 0.8rem 0 0; font-size: 0.82rem; }
.hero2__panel-foot a { color: var(--hero-faint); }
.hero2__panel-foot a:hover { color: var(--hero-ink); }

.hero2__stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  border-top: 1px solid var(--hero-line);
  padding-top: 1.1rem; padding-bottom: 1.4rem; gap: 0 1.2rem;
}
.stat2__num { display: block; font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; line-height: 1.15; color: var(--hero-ink); }
.stat2--date .stat2__num { font-size: clamp(1.05rem, 1.8vw, 1.3rem); padding-top: 0.45rem; }
.stat2__label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hero-faint); }
@media (max-width: 860px) {
  .hero2__grid { grid-template-columns: 1fr; }
  .hero2__panel { max-width: 34rem; }
}

/* ---------- section overlines ---------- */
.sec { display: flex; align-items: baseline; gap: 0.9rem; }
.sec__no { font-family: var(--sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; color: var(--spruce); }
.home__doors .sec, .home__stack .sec, .home__trust .sec { margin-top: 1.2rem; }

/* ---------- signature choreography: the ledger draws itself in ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .door, .trustgrid > div, .pcard, .audgrid__card, .guidelist li {
      animation: nog-rise 0.7s both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .home__doors .hero__doors, .tablewrap, .closing {
      animation: nog-rule 0.9s both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}
@keyframes nog-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes nog-rule { from { opacity: 0; } }
.hero__doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0; margin-top: 2.4rem; border: 1px solid var(--hairline); background: var(--paper-raise); }
.door {
  display: block; text-decoration: none; color: var(--ink);
  padding: 1.2rem 1.3rem 1.3rem; border-right: 1px solid var(--hairline-soft);
  transition: background 120ms ease;
}
.door:last-child { border-right: 0; }
.door:hover { background: var(--spruce-wash); color: var(--ink); }
.door strong { display: block; font-family: var(--serif); font-size: 1.2rem; margin-bottom: 0.3rem; }
.door span { color: var(--ink-faint); font-size: 0.88rem; }
@media (max-width: 900px) { .door { border-right: 0; border-bottom: 1px solid var(--hairline-soft); } .door:last-child { border-bottom: 0; } }
.home__stack p, .home__trust p { max-width: var(--measure); }
.trustgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.4rem; margin-top: 1rem; }
.trustgrid h3 { font-family: var(--sans); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--spruce); margin: 0 0 0.3rem; }
.trustgrid p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.home__method { margin-top: 1.4rem; }

/* ---------- chips / flags / provenance ---------- */
.chip {
  display: inline-block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.18rem 0.6rem; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.chip--open    { background: var(--open-wash);    color: var(--open);    border-color: color-mix(in srgb, var(--open) 35%, transparent); }
.chip--closing { background: var(--closing-wash); color: var(--closing); border-color: color-mix(in srgb, var(--closing) 35%, transparent); }
.chip--closed  { background: var(--closed-wash);  color: var(--closed);  border-color: color-mix(in srgb, var(--closed) 30%, transparent); }
.chip--neutral { background: var(--paper-sink);   color: var(--ink-soft); border-color: var(--hairline); }
.flag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 2px; margin-left: 0.4rem; }
.flag--repay   { background: var(--closing-wash); color: var(--closing); }
.flag--depends { background: var(--paper-sink); color: var(--ink-soft); border: 1px dashed var(--hairline); }

.prov { font-size: 0.8rem; color: var(--ink-faint); margin: 0.35rem 0 0; max-width: none; }
.prov a { color: var(--ink-faint); }
.prov__tier { font-weight: 600; padding: 0.05rem 0.4rem; border-radius: 3px; }
.prov__tier--human     { background: var(--open-wash); color: var(--open); }
.prov__tier--auto      { background: var(--paper-sink); color: var(--ink-soft); border: 1px solid var(--hairline-soft); }
.prov__tier--autoverified { background: var(--spruce-wash); color: var(--spruce-deep); border: 1px solid color-mix(in srgb, var(--spruce) 25%, transparent); }
.prov__tier--uncertain { background: var(--closing-wash); color: var(--uncertain); }
.prov--unconfirmed, .prov--expired { color: var(--uncertain); }

/* ---------- breadcrumbs / page heads ---------- */
.crumbs { font-size: 0.8rem; margin: 0.6rem 0 1.8rem; letter-spacing: 0.02em; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; max-width: none; }
.crumbs li + li::before { content: "/"; color: var(--ink-faint); margin-right: 0.4rem; }
.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--spruce); }
.crumbs [aria-current] { color: var(--ink-soft); }
.ihead { margin-bottom: 1.6rem; }
.ihead__sub { color: var(--ink-soft); font-size: 1.02rem; max-width: none; }
.phead__chips { margin-bottom: 0.7rem; }
.phead__funder { color: var(--ink-soft); font-size: 1.05rem; }
.phead__aka { color: var(--ink-faint); font-size: 0.9rem; }

/* ---------- the answer band ---------- */
.answer {
  border-left: 3px solid var(--spruce);
  background: var(--spruce-wash);
  padding: 1rem 1.3rem; margin: 1.4rem 0 2rem; border-radius: 0;
}
.answer p { margin: 0; font-size: 1.08rem; max-width: var(--measure); }

/* ---------- the ledger card ---------- */
.ledger { border: 1px solid var(--hairline); border-radius: 2px; background: var(--paper-raise); margin: 1.5rem 0; overflow: hidden; }
.ledger__grid { margin: 0; }
.ledger__row { display: grid; grid-template-columns: 10rem 1fr; gap: 1rem; padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--hairline-soft); }
.ledger__row:last-child { border-bottom: 0; }
.ledger__row dt { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); padding-top: 0.2rem; }
.ledger__row dd { margin: 0; font-size: 1.02rem; }
.ledger__row dd.nog-num { font-size: 1.15rem; font-weight: 600; }
.ledger__detail { color: var(--ink-soft); font-size: 0.9rem; }
.ledger__list { margin: 0.4rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 640px) { .ledger__row { grid-template-columns: 1fr; gap: 0.2rem; } }

/* ---------- notices ---------- */
.notice { border: 1px solid var(--hairline); border-radius: 2px; padding: 0.8rem 1.1rem; margin: 1.2rem 0; max-width: var(--measure); }
.notice p { margin: 0; }
.notice--closed { border-color: color-mix(in srgb, var(--closed) 40%, transparent); background: var(--closed-wash); }
.notice--tip { border-left: 3px solid var(--spruce); background: var(--spruce-wash); }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 2px; background: var(--paper-raise); margin: 1rem 0 1.5rem; }
.table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table th {
  text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-faint); font-weight: 600; padding: 0.7rem 0.9rem;
  border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--paper-raise); z-index: 1;
}
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]::after { content: " ↕"; color: var(--ink-faint); font-size: 0.85em; }
.table th[data-sort].is-asc::after  { content: " ↑"; color: var(--spruce); }
.table th[data-sort].is-desc::after { content: " ↓"; color: var(--spruce); }
.table td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--hairline-soft); vertical-align: top; font-size: 0.92rem; }
.table tbody tr:hover { background: var(--paper-sink); }
.table td a { text-decoration: none; font-weight: 600; color: var(--ink); }
.table td a:hover { color: var(--spruce); text-decoration: underline; }
.table__funder { color: var(--ink-soft); }
.table--programs td:first-child { min-width: 16rem; max-width: 24rem; }
.table td.nog-money { text-align: left; white-space: nowrap; font-weight: 600; }
.table__note { font-size: 0.8rem; color: var(--ink-faint); }
.table__ver { font-size: 0.82rem; color: var(--ink-faint); white-space: nowrap; }
.table__ver--unconfirmed, .table__ver--expired { color: var(--uncertain); }
.verdot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: 0.05em; }
.verdot--human { background: var(--open); }
.verdot--autoverified { background: var(--open); opacity: 0.55; }
.verdot--auto { background: var(--ink-faint); opacity: 0.5; }
.verdot--stale { background: var(--closing); }
.verdot--none { background: transparent; border: 1px solid var(--hairline); }
.guidelist__meta { font-size: 0.78rem !important; color: var(--ink-faint) !important; margin-top: 0.4rem !important; }
.cell-yes { color: var(--open); font-weight: 600; }
.cell-no  { color: var(--closed); }
.aside-note { font-size: 0.88rem; color: var(--ink-faint); max-width: var(--measure); }

/* table tools */
.tabletools { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 1rem 0 0.4rem; }
.tabletools[hidden] { display: none; }
.tabletools input[type="search"] {
  flex: 1 1 16rem; padding: 0.55rem 0.85rem; font: inherit; color: var(--ink);
  background: var(--paper-raise); border: 1px solid var(--hairline); border-radius: 2px;
}
.tabletools input[type="search"]:focus { outline: 2px solid var(--spruce); outline-offset: 1px; }
.tabletools__chips { display: flex; gap: 0.35rem; }
.tabletools__chips button {
  font: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.35rem 0.8rem; cursor: pointer;
  background: var(--paper-raise); color: var(--ink-soft); border: 1px solid var(--hairline); border-radius: 999px;
}
.tabletools__chips button[aria-pressed="true"] { background: var(--spruce); border-color: var(--spruce); color: #fff; }
.tabletools__count { font-size: 0.85rem; color: var(--ink-faint); }
.tabletools__export { font-size: 0.85rem; font-weight: 600; }

/* ---------- program cards ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.pcard { border: 1px solid var(--hairline); border-radius: 2px; background: var(--paper-raise); padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.pcard__top { margin-bottom: 0.5rem; }
.pcard__title { font-size: 1.05rem; margin: 0 0 0.2rem; font-family: var(--serif); }
.pcard__title a { color: var(--ink); text-decoration: none; }
.pcard__title a:hover { color: var(--spruce); }
.pcard__funder { color: var(--ink-faint); font-size: 0.85rem; margin: 0 0 0.5rem; }
.pcard__amount { font-weight: 600; margin: 0 0 0.3rem; }
.pcard__detail { color: var(--ink-soft); font-size: 0.88rem; margin: 0; }
.pcard .prov { margin-top: auto; padding-top: 0.5rem; }
.empty { color: var(--ink-faint); font-style: italic; }

/* ---------- closing soon ---------- */
.closing { border: 1px solid var(--hairline); border-left: 4px solid var(--closing); border-radius: 2px; background: var(--paper-raise); padding: 1.1rem 1.3rem; margin: 1.6rem 0; }
.closing h2 { margin: 0 0 0.7rem; font-size: 1.15rem; }
.closing__list { list-style: none; padding: 0; margin: 0; max-width: none; }
.closing__list li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.35rem 0; border-bottom: 1px dashed var(--hairline-soft); }
.closing__list li:last-child { border-bottom: 0; }
.closing__when { color: var(--closing); font-size: 0.88rem; font-weight: 600; }
.closing__more { margin: 0.7rem 0 0; font-size: 0.92rem; }

/* ---------- process / stacking / faq ---------- */
.process__steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--measure); }
.process__steps li { counter-increment: step; position: relative; padding: 0 0 1rem 2.6rem; border-left: 1px solid var(--hairline); margin-left: 0.9rem; }
.process__steps li::before {
  content: counter(step); position: absolute; left: -0.95rem; top: -0.1rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--spruce); color: #fff; font-size: 0.85rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.process__steps li:last-child { border-left-color: transparent; }
.faq { margin: 2.2rem 0; }
.faq__item { border-bottom: 1px solid var(--hairline-soft); max-width: var(--measure); }
.faq__item summary { cursor: pointer; font-weight: 600; padding: 0.75rem 0; list-style-position: outside; }
.faq__item summary:hover { color: var(--spruce); }
.faq__a { padding: 0 0 0.9rem; color: var(--ink-soft); }
.faq__a p { margin: 0; }

/* ---------- misc sections ---------- */
.cite { border-top: 1px dashed var(--hairline); margin-top: 3rem; padding-top: 1.2rem; }
.cite h2 { font-size: 0.8rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); margin: 0 0 0.5rem; }
.cite__text { font-size: 0.9rem; color: var(--ink-soft); background: var(--paper-sink); border-radius: 2px; padding: 0.7rem 1rem; max-width: none; }
.cite__license { font-size: 0.82rem; color: var(--ink-faint); }
.btn {
  display: inline-block; background: var(--spruce); color: #fff; font-weight: 600; text-decoration: none;
  padding: 0.6rem 1.2rem; border-radius: 2px; border: 0; cursor: pointer; font-size: 1rem;
}
.btn:hover { background: var(--spruce-deep); color: #fff; }
.btn--small { font-size: 0.85rem; padding: 0.35rem 0.8rem; }
.flayer { border-top: 1px solid var(--hairline); padding-top: 1.2rem; margin-top: 1.6rem; }
.flayer__blurb { color: var(--ink-soft); }
.flayer__list { list-style: none; padding: 0; max-width: none; }
.flayer__list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px dashed var(--hairline-soft); }
.flayer__count { color: var(--ink-faint); font-size: 0.88rem; white-space: nowrap; }
.contlist { list-style: none; padding: 0; max-width: none; column-width: 22rem; column-gap: 2.5rem; }
.contlist li { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--hairline-soft); break-inside: avoid; }
.contlist--muted { color: var(--ink-soft); }
.orglist { list-style: none; padding: 0; max-width: var(--measure); }
.orglist li { padding: 0.7rem 0; border-bottom: 1px solid var(--hairline-soft); }
.orglist__type { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; color: var(--spruce); margin-left: 0.5rem; }
.orglist__role, .orglist__serves { font-size: 0.9rem; color: var(--ink-soft); }
.audgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.audgrid__card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 1px solid var(--hairline); border-radius: 2px; background: var(--paper-raise); padding: 1.1rem 1.2rem; }
.audgrid__card:hover { border-color: var(--spruce); color: var(--ink); }
.audgrid__card h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.audgrid__card p { color: var(--ink-soft); font-size: 0.92rem; flex: 1; }
.audgrid__count { color: var(--spruce); font-weight: 600; font-size: 0.9rem; }
.guidelist { list-style: none; padding: 0; max-width: 52rem; }
.guidelist li { padding: 1.2rem 0; border-bottom: 1px solid var(--hairline-soft); }
.guidelist__item { display: grid; grid-template-columns: 11rem 1fr; gap: 1.4rem; align-items: start; }
.guidelist__item > div:only-child, .guidelist__item:not(:has(.guidelist__thumb)) { grid-template-columns: 1fr; }
.guidelist__thumb img { width: 100%; height: auto; border: 1px solid var(--hairline); background: var(--paper-raise); }
.guidelist h2 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.guidelist h2 a { text-decoration: none; color: var(--ink); }
.guidelist h2 a:hover { color: var(--spruce); }
.guidelist p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 640px) { .guidelist__item { grid-template-columns: 1fr; } .guidelist__thumb { max-width: 16rem; } }
.changelog { list-style: none; padding: 0; max-width: var(--measure); }
.changelog li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--hairline-soft); }
.changelog time { color: var(--ink-faint); font-size: 0.9rem; }
.pointers { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; margin: 1.5rem 0; }
.pointers__item h2 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.pointers__item p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.decoder { border: 1px dashed var(--closing); border-radius: 2px; padding: 1.1rem 1.3rem; margin: 1.6rem 0; background: var(--closing-wash); }
.decoder h2 { margin-top: 0; }
.decoder__more { margin-bottom: 0; font-size: 0.92rem; }

/* ---------- finder ---------- */
.finder { margin: 1.5rem auto 2.5rem; max-width: 42rem; }
.finder__step { border: 1px solid var(--hairline); border-top: 3px solid var(--spruce); background: var(--paper-raise); padding: 1.6rem 1.7rem; }
.finder__q { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin: 0 0 1rem; }
.finder__opts { display: grid; gap: 0.5rem; }
.finder__opts button {
  font: inherit; text-align: left; padding: 0.7rem 1rem; cursor: pointer;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 2px; color: var(--ink);
}
.finder__opts button:hover { border-color: var(--spruce); background: var(--spruce-wash); }
.finder__meta { display: flex; justify-content: space-between; margin-top: 1rem; font-size: 0.85rem; color: var(--ink-faint); }
.finder__back { background: none; border: 0; color: var(--spruce); cursor: pointer; font: inherit; font-size: 0.9rem; padding: 0; }
.finder__results h2 { margin-top: 0; }
.finder__restart { margin-top: 1rem; }

/* ---------- guide figures (NotebookLM slide pipeline) ---------- */
.gfig { margin: 1.4rem 0 1.8rem; max-width: 760px; }
.gfig img {
  width: 100%; height: auto; border: 1px solid var(--hairline); border-radius: 2px;
  box-shadow: 0 4px 16px rgba(15, 40, 28, 0.07);
}
.gfig figcaption { font-size: 0.82rem; color: var(--ink-faint); margin-top: 0.45rem; }

/* ---------- print: grant pages get taken to the bank ---------- */
@media print {
  .site-head, .site-foot, .tabletools, .btn, .skip, .finder__meta { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  .prov a::after, .apply a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .ledger, .pcard, .tablewrap { border-color: #999; box-shadow: none; }
  .chip { border: 1px solid #000; background: none !important; color: #000 !important; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .door { transition: none; }
}
