/* www/static/css/caoversight.css
 * caoversight.org brand tokens + base styles.
 * Tone: factual, archival, public-record. Parallels www/static/css/sheriff.css.
 */

:root {
  --co-primary: #2f4a3a;
  --co-primary-dark: #233628;
  --co-primary-light: #4e6a59;
  --co-accent: #b58a3c;
  /* --co-accent-text: accessible dark-gold for rendered text (4.5:1 on white/bg/muted-bg) */
  --co-accent-text: #8a6020;
  --co-status-active: #2d6a3e;
  --co-status-quiet: #8a8a8a;
  --co-bg: #faf8f3;
  --co-bg-elevated: #ffffff;
  --co-bg-muted: #ede9df;
  --co-border: #d4cebe;
  --co-text: #1f2937;
  --co-text-muted: #6b7280;
  /* --co-text-muted-on-muted: accessible text-muted for use on --co-bg-muted (4.5:1 min) */
  --co-text-muted-on-muted: #505869;
  --co-text-inverse: #faf8f3;
  --co-font-display: 'Fraunces', 'Newsreader', Georgia, serif;
  --co-font-body: 'Newsreader', Georgia, serif;
  --co-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--co-bg);
  color: var(--co-text);
  font-family: var(--co-font-body);
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Brand typography */
h1, h2, h3, h4 {
  font-family: var(--co-font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 1.5rem 0 0.75rem;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

a {
  color: var(--co-primary);
  text-decoration: underline;
  text-decoration-color: rgba(47, 74, 58, 0.25);
  text-underline-offset: 2px;
}
a:hover { text-decoration-color: var(--co-primary); }

.co-container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: var(--co-primary-dark);
  color: var(--co-text-inverse);
}

/* Law strip (top of every page) */
.co-law-strip {
  background: var(--co-primary-dark);
  color: var(--co-text-inverse);
  font-size: 0.92rem;
  padding: 0.6rem 1.5rem;
  text-align: center;
  letter-spacing: 0.01em;
}
.co-law-strip a {
  color: var(--co-text-inverse);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
  margin-left: 0.35rem;
  font-weight: 500;
}
.co-law-strip a:hover { text-decoration-color: var(--co-accent); }
.co-law-strip strong { font-weight: 600; color: var(--co-accent); }

/* Nav */
.co-nav {
  background: var(--co-bg-elevated);
  border-bottom: 1px solid var(--co-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.co-nav-logo { text-decoration: none; line-height: 1; display: flex; align-items: center; gap: 0.65rem; }
.co-nav-logo__img {
  display: block;
  height: 48px;
  width: 48px;
  flex: 0 0 48px;
  transition: opacity 130ms ease;
}
.co-nav-logo:hover .co-nav-logo__img,
.co-nav-logo:hover .co-nav-wordmark { opacity: 0.72; }
.co-nav-wordmark { display: flex; flex-direction: column; gap: 0; transition: opacity 130ms ease; }
.wnm-ca, .wnm-oversight, .wnm-tld {
  display: block;
  font-family: var(--co-font-display);
  line-height: 1.15;
}
.wnm-ca { font-size: 14px; font-weight: 600; color: var(--co-primary); letter-spacing: 0.04em; }
.wnm-oversight { font-size: 10px; font-weight: 400; color: var(--co-primary-light); letter-spacing: 0.05em; }
.wnm-tld { font-size: 8.5px; font-weight: 600; color: var(--co-accent-text); letter-spacing: 0.09em; }

.co-nav-links { display: flex; gap: 1.5rem; }
.co-nav-links a {
  color: var(--co-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.co-nav-links a:hover { color: var(--co-primary); }

.co-nav-search { margin-left: auto; }
.co-nav-search input {
  width: 240px;
  font-family: var(--co-font-body);
  font-size: 0.92rem;
  padding: 0.45rem 0.95rem;
  background: var(--co-bg);
  color: var(--co-text);
  border: 1px solid var(--co-border);
  border-radius: 999px;
  outline: none;
}
.co-nav-search input:focus {
  border-color: var(--co-accent);
  background: var(--co-bg-elevated);
  box-shadow: 0 0 0 3px rgba(181, 138, 60, 0.12);
}

/* Hero */
.co-hero { padding: 2.5rem 0 0.5rem; }
.co-hero h1 { margin: 0 0 0.25rem; font-size: 2.75rem; letter-spacing: -0.01em; }

.co-lede {
  font-size: 1.2rem;
  color: var(--co-text-muted);
  margin: 0.5rem 0 1.5rem;
  line-height: 1.5;
}
.co-hero-compact h1 { font-size: 2.4rem; }

.co-hero-with-glyph {
  display: flex; gap: 1.75rem; align-items: center; padding: 2.5rem 0 0.5rem;
}
.co-hero-glyph {
  width: 144px; height: 144px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--co-bg-muted); border-radius: 8px;
  font-family: var(--co-font-display); font-weight: 700;
  font-size: 1.05rem; color: var(--co-primary);
  text-align: center; line-height: 1.2;
}

/* Stats strip */
.co-stats-strip {
  display: flex;
  gap: 2.25rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: var(--co-bg-muted);
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
  align-items: baseline;
}
.co-stats-strip > div { display: flex; flex-direction: column; }
.co-stats-strip strong {
  font-family: var(--co-font-mono);
  font-size: 1.55rem;
  color: var(--co-primary);
  display: block;
  line-height: 1.1;
  font-weight: 500;
}
.co-stats-strip span {
  font-size: 0.82rem;
  color: var(--co-text-muted-on-muted);
  margin-top: 0.15rem;
}

.co-intro p { max-width: 80ch; font-size: 1rem; line-height: 1.65; margin: 0 0 1rem; }

.co-section-head {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--co-border);
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.co-section-head h2 { margin: 0; font-size: 1.65rem; letter-spacing: -0.005em; }
.co-section-meta {
  margin: 0; color: var(--co-text-muted); font-size: 0.88rem;
  font-family: var(--co-font-mono);
}

/* Source cards */
.co-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2rem;
  list-style: none; padding: 0;
}
.co-source-card {
  position: relative;
  background: var(--co-bg-elevated);
  border: 1px solid var(--co-border);
  border-top: 3px solid var(--co-accent);
  padding: 1.2rem 1.35rem 1.25rem;
  display: flex; flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.co-source-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(47, 74, 58, 0.25);
}
.co-source-card .acronym {
  font-family: var(--co-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--co-accent-text);
  margin: 0 0 0.4rem;
  font-weight: 500;
}
.co-source-card .name {
  font-family: var(--co-font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--co-text);
  margin: 0 0 0.55rem;
  line-height: 1.25;
}
.co-source-card .tagline {
  font-size: 0.93rem;
  color: var(--co-text);
  margin: 0 0 0.85rem;
  flex: 1;
  line-height: 1.45;
}
.co-source-card .stats {
  display: flex; align-items: baseline; gap: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--co-border);
  font-size: 0.85rem;
  color: var(--co-text-muted);
}
.co-source-card .stats strong {
  font-family: var(--co-font-mono);
  font-size: 1rem;
  color: var(--co-primary);
  font-weight: 500;
}
.co-source-card .range {
  margin-left: auto;
  font-family: var(--co-font-mono);
  font-size: 0.78rem;
  color: var(--co-text-muted);
}

/* Highlights section */
.co-highlights {
  margin: 3rem -1.5rem 2.5rem;
  padding: 2.75rem 1.5rem 2rem;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(47, 74, 58, 0.06), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(181, 138, 60, 0.06), transparent 55%),
    var(--co-bg-muted);
  border-top: 1px solid var(--co-border);
  border-bottom: 1px solid var(--co-border);
}
.co-highlights-eyebrow {
  font-family: var(--co-font-mono); font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--co-accent-text); margin: 0 0 0.5rem;
}
.co-highlights-title {
  font-family: var(--co-font-display);
  font-weight: 600; font-style: italic;
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  line-height: 1.15; letter-spacing: -0.01em;
  color: var(--co-primary); margin: 0 0 0.75rem;
  max-width: 720px;
}
.co-highlights-dek {
  font-size: 1.08rem; line-height: 1.55;
  color: var(--co-text); margin: 0 0 2rem;
  max-width: 60ch;
}
.co-highlights-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.co-highlight {
  background: var(--co-bg-elevated);
  border: 1px solid var(--co-border);
  border-top: 3px solid var(--co-primary);
  padding: 1.1rem 1.25rem 1.25rem;
}
.co-highlight-kicker {
  font-family: var(--co-font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--co-accent-text);
  font-weight: 500; display: block; margin-bottom: 0.4rem;
}
.co-highlight h3 {
  margin: 0 0 0.45rem;
  font-family: var(--co-font-display);
  font-weight: 600; font-size: 1.1rem;
}
.co-highlight p { margin: 0; font-size: 0.94rem; line-height: 1.5; }

/* Categories */
.co-category { margin: 2.25rem 0 1rem; }
.co-category h2 {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  color: var(--co-primary);
}
.co-category-blurb {
  margin: 0 0 1rem;
  color: var(--co-text-muted);
  font-size: 0.92rem;
  max-width: 60ch;
  line-height: 1.55;
}
.co-category-kicker {
  font-family: var(--co-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--co-accent-text);
  margin: 0 0 0.3rem;
}

/* Tight grid variant */
.co-source-grid.tight {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.co-source-card.tight { padding: 0.95rem 1.05rem 1rem; }
.co-source-card.tight .name { font-size: 0.98rem; }
.co-source-card.tight .tagline { font-size: 0.87rem; margin-bottom: 0.6rem; }
.co-source-card.tight .stats { padding-top: 0.5rem; font-size: 0.82rem; }

.co-source-card.external {
  border-top-width: 3px;
  border-color: var(--co-accent);
  background:
    linear-gradient(135deg, rgba(181, 138, 60, 0.10), rgba(181, 138, 60, 0.03) 60%),
    var(--co-bg-elevated);
}
.co-source-card.external .acronym { color: var(--co-primary); }
.co-source-card.external .stats { border-top-color: var(--co-accent); }
.co-source-card.external .stats strong {
  color: var(--co-accent-text);
  font-family: var(--co-font-body);
  font-size: 0.92rem;
  font-weight: 600;
}
.co-source-card.external .range {
  color: var(--co-accent-text);
  font-weight: 600;
}
.co-source-card.external:hover {
  box-shadow: 0 10px 24px -10px rgba(181, 138, 60, 0.35);
}
.co-source-card.external .ug-mark {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

/* Type pill */
.co-type-pill {
  display: inline-block;
  font-family: var(--co-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--co-text-muted);
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--co-border);
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* Footer */
.co-footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  background: var(--co-primary-dark);
  color: var(--co-text-inverse);
  font-size: 0.92rem;
}
.co-footer a { color: var(--co-text-inverse); }
.co-footer-row {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.co-footer-note {
  max-width: 1080px; margin: 1.25rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.8125rem;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 720px) {
  .co-footer-row { grid-template-columns: 1fr; }
  .co-hero-with-glyph { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .co-highlights { margin-inline: -1.5rem; padding: 2rem 1.5rem 1.5rem; }
  .co-nav { flex-wrap: wrap; gap: 0.75rem 1.25rem; }
  .co-nav-search { order: 4; flex: 1 1 100%; margin-left: 0; }
  .co-nav-search input { width: 100%; }
}

/* ── Per-source page ─────────────────────────────────────────────────────── */
.co-breadcrumb { color: var(--co-text-muted); font-size: 0.9rem; padding: 1rem 0 0; }
.co-breadcrumb a { color: var(--co-accent-text); text-decoration: underline; text-underline-offset: 2px; }
.co-breadcrumb a:hover { opacity: 0.8; }
.co-source-header { padding: 0.4rem 0 0.2rem; }
.co-source-header__kicker {
  display: block; font-family: var(--co-font-mono);
  font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--co-accent-text);
  margin-bottom: 0.25rem;
}

/* Filter bar */
.co-source-filter { margin: 1rem 0; }
.co-source-filter form {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  background: var(--co-bg-muted); border: 1px solid var(--co-border);
  border-radius: 8px; padding: 0.75rem 1rem;
}
.co-source-filter label { font-size: 0.9rem; color: var(--co-text-muted-on-muted); }
.co-source-filter select {
  padding: 0.4rem 0.65rem; border: 1px solid var(--co-border);
  border-radius: 6px; font-size: 0.9rem; background: #fff;
  color: var(--co-text);
}
.co-filter-btn {
  background: var(--co-primary); color: #fff; border: none;
  padding: 0.4rem 0.9rem; border-radius: 6px; font-size: 0.9rem; cursor: pointer;
}
.co-filter-btn:hover { opacity: 0.9; }
.co-filter-reset { font-size: 0.85rem; color: var(--co-text-muted-on-muted); text-decoration: none; }
.co-filter-reset:hover { color: var(--co-danger, #dc2626); text-decoration: underline; }

/* Report table */
.co-report-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin: 1rem 0 0.5rem; }
.co-report-table th {
  background: var(--co-bg-muted); padding: 0.55rem 0.7rem;
  text-align: left; font-weight: 600; color: var(--co-primary);
  border-bottom: 2px solid var(--co-border);
}
.co-report-table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--co-border); vertical-align: top; }
.co-report-table tbody tr:hover { background: rgba(45, 106, 62, 0.04); }
.co-num { font-family: var(--co-font-mono); font-variant-numeric: tabular-nums; font-size: 0.88rem; color: var(--co-text-muted); white-space: nowrap; }
.co-mono { font-family: var(--co-font-mono); font-size: 0.88rem; color: var(--co-text-muted); white-space: nowrap; }
.co-report-agencies { color: var(--co-text-muted); font-size: 0.85rem; margin-top: 0.2rem; }
.co-report-excerpt { color: var(--co-text-muted); font-size: 0.84rem; font-style: italic; margin-top: 0.25rem; line-height: 1.45; }
.co-pdf-link { font-size: 0.85rem; white-space: nowrap; }
.co-text-muted { color: var(--co-text-muted); }

/* Empty state */
.co-empty-state { padding: 3rem 1rem; text-align: center; color: var(--co-text-muted); }

/* ── LAFCO per-county page (issue #1860) ─────────────────────────────────── */
/* Filter bar: labels wrap their selects so County + Year read as a unit. */
.co-source-filter label { display: inline-flex; align-items: center; gap: 0.4rem; }

/* "Jump to county" index */
.co-county-jump {
  margin: 0.5rem 0 1.5rem; font-size: 0.9rem; line-height: 1.9;
  color: var(--co-text-muted);
}
.co-county-jump__label {
  font-family: var(--co-font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--co-accent-text); margin-right: 0.4rem;
}
.co-county-jump a { color: var(--co-primary); text-decoration: none; }
.co-county-jump a:hover { text-decoration: underline; color: var(--co-accent); }
.co-county-jump__sep { color: var(--co-border); }

/* County section header */
.co-county-section { margin: 1.75rem 0; scroll-margin-top: 1rem; }
.co-county-head {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  margin: 0 0 0.25rem; padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--co-border);
  font-family: var(--co-font-display); font-size: 1.35rem; color: var(--co-primary);
}
.co-county-head__anchor { color: inherit; text-decoration: none; }
.co-county-head__anchor:hover { color: var(--co-accent); }
.co-county-count {
  font-family: var(--co-font-mono); font-size: 0.78rem; font-weight: 400;
  color: var(--co-text-muted); letter-spacing: 0.02em;
}

/* LAFCO table: Date (narrow, the adopted/published date) · Report (title link,
   which now carries the full subject — the description column was dropped as it
   was mostly OCR cover-noise; #1873). */
.co-report-table--lafco { table-layout: fixed; }
.co-report-table--lafco th.co-num,
.co-report-table--lafco td.co-num { width: 8rem; }
.co-report-table--lafco .co-col-title { width: auto; }
.co-report-table--lafco .co-col-title a { font-weight: 500; }

/* Responsive: source page table */
@media (max-width: 720px) {
  .co-source-filter form { padding: 0.6rem 0.75rem; }
  .co-report-table { font-size: 0.86rem; }
  .co-report-table th, .co-report-table td { padding: 0.45rem 0.5rem; }
  .co-report-table:not(.co-report-table--lafco) th:nth-child(3),
  .co-report-table:not(.co-report-table--lafco) td:nth-child(3) { display: none; } /* hide report# col on mobile */
  .co-report-table--lafco { table-layout: auto; }
  .co-report-table--lafco th.co-num,
  .co-report-table--lafco td.co-num { width: 5.5rem; }
  .co-county-jump { line-height: 2.1; }
}
