/*
Theme Name: Kootenai Record
Theme URI: https://example.org/kootenai-record
Description: Civic decisions tracker for Kootenai County BOCC and the Post Falls and Coeur d'Alene City Councils. Reads the kr_ tables (same WordPress database or a second database set in wp-config.php).
Version: 0.1.0
Requires PHP: 7.4
Requires at least: 6.0
License: GPL-2.0-or-later
Text Domain: kootenai-record
*/

:root {
  --ink: #1d2330;
  --muted: #5b6475;
  --line: #dde1e8;
  --bg: #f7f8fa;
  --card: #ffffff;
  --accent: #1f5f8b;
  --pass: #1e7a46;
  --fail: #b3261e;
  --warn: #8a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
a:hover { text-decoration: none; }
.kr-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.kr-header { background: var(--ink); color: #fff; }
.kr-header .kr-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.kr-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; }
.kr-nav a { color: #dfe7f2; text-decoration: none; margin-left: 18px; }
.kr-nav a:hover { color: #fff; }
main { padding: 28px 0 48px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.kr-sub { color: var(--muted); margin: 0 0 20px; }
.kr-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 14px; }
.kr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kr-stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.kr-stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.kr-stat span { color: var(--muted); font-size: .9rem; }
table.kr-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.kr-table th, .kr-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kr-table th { background: #eef1f5; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.kr-table td.num, .kr-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kr-table tr:last-child td { border-bottom: 0; }
.kr-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.kr-passed { color: var(--pass); }
.kr-failed { color: var(--fail); }
.kr-tabled, .kr-unknown, .kr-continued, .kr-withdrawn { color: var(--warn); }
.kr-vote-yes { color: var(--pass); font-weight: 600; }
.kr-vote-no { color: var(--fail); font-weight: 600; }
.kr-meta { color: var(--muted); font-size: .9rem; }
.kr-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.kr-filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 3px; }
.kr-filters input, .kr-filters select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 130px; }
.kr-filters button { font: inherit; padding: 7px 14px; border-radius: 6px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.kr-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.kr-timeline li { position: relative; margin: 0 0 14px; }
.kr-timeline li::before { content: ""; position: absolute; left: -25px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.kr-motion { white-space: pre-wrap; background: #f3f5f8; border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 4px; }
.kr-pager { display: flex; gap: 12px; margin-top: 14px; }
.kr-note { font-size: .85rem; color: var(--muted); }
.kr-footer { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) {
  .kr-table thead { display: none; }
  .kr-table tr { display: block; border-bottom: 1px solid var(--line); }
  .kr-table td { display: block; border: 0; padding: 4px 12px; }
  .kr-table td.num { text-align: left; }
}
