/* Strathroy-Caradoc Council Watch - one stylesheet for every page. Colours match the PDF reports (scripts/cw_style.py). */
:root {
  --navy: #173c51; --navy-2: #24536d; --gold: #c8961e; --gold-ink: #6b4d05; --gold-soft: #fbf3df;
  --text: #253542; --muted: #5d7280; --link: #17668a;
  --bg: #f6f8f9; --card: #ffffff; --line: #dbe3e8; --soft: #eef3f6;
  --ok: #2e7d4f; --ok-soft: #e4f3ea; --warn: #9a6400; --warn-soft: #fbefd9; --bad: #a83a32; --bad-soft: #f8e5e3;
  --info: #17668a; --info-soft: #e2eff5;
  --radius: 12px; --wrap: 1080px;
  font-size: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--link); }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1 { font-size: 1.9rem; margin: 0 0 .4rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1.1rem; margin: 1.2rem 0 .4rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* preview ribbon */
.preview { background: var(--gold-soft); color: var(--gold-ink); text-align: center; font-size: .85rem; padding: 6px 16px; border-bottom: 1px solid #ecd9a8; }

/* header: brand on the left, quick links (search + donate) always top right */
.top { background: var(--card); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { width: 44px; height: 44px; flex: none; }
.brand b { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; line-height: 1.15; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-family: system-ui, sans-serif; font-size: .72rem; }
.quick { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.quick a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: .9rem; }
.quick .q-search { color: var(--navy); border: 1px solid var(--line); background: var(--card); }
.quick .q-donate { background: var(--gold); color: #fff; }
.quick .q-donate:hover { background: #b0821a; color: #fff; }
.quick svg { width: 18px; height: 18px; }
.nav { background: var(--navy); }
.nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #fff; text-decoration: none; padding: 10px 12px; white-space: nowrap; font-size: .95rem; opacity: .88; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -3px 0 var(--gold); }
@media (max-width: 560px) {
  .brand small { display: none; }
  .brand b { font-size: 1.05rem; }
  .brand .b-place { display: block; font-size: .68rem; font-family: system-ui, sans-serif; color: var(--muted); letter-spacing: .02em; }
  .quick .q-search span { display: none; }
  .quick a { padding: 8px 11px; }
}

main { padding: 24px 0 48px; }
.hero { background: var(--navy); color: #fff; padding: 36px 0 40px; margin-top: -24px; }
.hero h1 { color: #fff; font-size: 2.1rem; }
.hero p { margin: .2rem 0 1.2rem; font-size: 1.1rem; opacity: .92; max-width: 40rem; }

/* search box */
.searchbox { display: flex; gap: 8px; max-width: 42rem; }
.searchbox input { flex: 1; min-width: 0; font-size: 1.05rem; padding: 14px 16px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--text); }
.searchbox input:focus { outline: 3px solid var(--gold); border-color: var(--gold); }
.searchbox button { font-size: 1rem; font-weight: 700; padding: 0 20px; border-radius: 10px; border: 0; background: var(--gold); color: #fff; cursor: pointer; }
.hint { font-size: .9rem; opacity: .85; margin-top: 8px; }
.hint a { color: inherit; }
.hero .hint a { color: #fff; }

/* cards and grids */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; }
a.card { display: block; text-decoration: none; color: var(--text); }
a.card:hover { border-color: var(--navy-2); box-shadow: 0 2px 10px rgba(23, 60, 81, .08); }
.card h3 { margin: 0 0 .3rem; }
.card p { margin: .2rem 0; }
.card .meta { color: var(--muted); font-size: .85rem; }
.topic { display: flex; gap: 14px; align-items: flex-start; }
.topic svg { width: 40px; height: 40px; flex: none; color: var(--navy); background: var(--soft); border-radius: 10px; padding: 7px; }
.topic h3 { font-size: 1.05rem; }
.topic p { font-size: .9rem; color: var(--muted); }
.count { font-size: .8rem; color: var(--muted); }

/* badges: date-based ones are printed by the builder, personal ones are added by site.js */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; min-height: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; letter-spacing: .02em; }
.badge.new { background: var(--ok-soft); color: var(--ok); }
.badge.upd { background: var(--info-soft); color: var(--info); }
.badge.me { background: var(--gold); color: #fff; }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.arch { background: var(--soft); color: var(--muted); }

/* follow star */
.follow { border: 1px solid var(--line); background: var(--card); color: var(--navy); border-radius: 999px; padding: 6px 14px; font-size: .9rem; cursor: pointer; font-weight: 600; }
.follow[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }

/* plain-words box */
.plain { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.plain h2 { margin-top: 0; font-size: 1.2rem; }
.plain ul { margin: .4rem 0; padding-left: 1.2rem; }
.lede { font-size: 1.15rem; }

/* findings with plain evidence labels */
.findings { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.findings li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.label { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; margin-right: 6px; vertical-align: 1px; }
.label.records { background: var(--ok-soft); color: var(--ok); }
.label.reported { background: var(--warn-soft); color: var(--warn); }
.label.unanswered { background: var(--soft); color: var(--navy); }
.pg { font-size: .85rem; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--muted); margin: 6px 0 12px; }

/* dates panel */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.facts div { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.facts b { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.btn { display: inline-block; text-decoration: none; font-weight: 700; padding: 11px 18px; border-radius: 10px; background: var(--navy); color: #fff; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn.alt { background: var(--card); color: var(--navy); border: 1px solid var(--navy); }
.btn.gold { background: var(--gold); }

/* jargon: tap to see the meaning */
.term { border-bottom: 2px dotted var(--gold); cursor: help; }
dl.gloss { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; gap: 8px 16px; }
dl.gloss dt { font-weight: 700; color: var(--navy); }
dl.gloss dd { margin: 0; }
@media (max-width: 560px) { dl.gloss { grid-template-columns: 1fr; } dl.gloss dd { margin-bottom: 8px; } }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--soft); color: var(--navy); font-size: .85rem; }
.scroll { overflow-x: auto; }

/* timeline (updates log, what's new) */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); }
.timeline li { padding: 0 0 16px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -8px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--card); border: 3px solid var(--navy-2); }
.timeline li.fresh::before { border-color: var(--gold); background: var(--gold); }
.timeline .when { font-size: .85rem; color: var(--muted); }
.kind { font-size: .75rem; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .04em; }
.kind.Correction { color: var(--bad); }

/* platform tracker */
.status { display: inline-block; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status.s-none { background: var(--soft); color: var(--muted); }
.status.s-progress { background: var(--info-soft); color: var(--info); }
.status.s-kept { background: var(--ok-soft); color: var(--ok); }
.status.s-partly { background: var(--warn-soft); color: var(--warn); }
.status.s-changed { background: #f3e8fb; color: #6b3a8c; }
.status.s-broken { background: var(--bad-soft); color: var(--bad); }
.promise { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.promise q { color: var(--muted); font-style: italic; }
.promise .row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.person { display: flex; gap: 14px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex: none; }

.note { background: var(--soft); border-radius: 10px; padding: 12px 16px; font-size: .95rem; }
.note.warn { background: var(--warn-soft); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sources { font-size: .9rem; padding-left: 1.2rem; }
.sources li { margin-bottom: 6px; word-break: break-word; }

/* search results */
.results { list-style: none; padding: 0; display: grid; gap: 10px; }
.results li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.results .rk { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.results a.rt { font-weight: 700; font-size: 1.05rem; }
.results mark { background: var(--gold-soft); color: inherit; padding: 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chips button, .chips a { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: .9rem; cursor: pointer; color: var(--navy); text-decoration: none; }
.chips button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* "for you" strip on the home page, filled by site.js */
#foryou:empty { display: none; }
.foryou { background: var(--gold-soft); border: 1px solid #ecd9a8; border-radius: var(--radius); padding: 14px 18px; margin: 0 0 8px; }
.foryou h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.foryou ul { margin: 0; padding-left: 1.2rem; }
.linkbtn { background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; font-size: .9rem; padding: 0; }

footer { background: var(--navy); color: #dfe8ee; padding: 28px 0; font-size: .9rem; }
footer a { color: #fff; }
footer .cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media print {
  .top, .nav, .quick, footer, .follow, .preview { display: none; }
  body { background: #fff; }
}

/* records request progress steps */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0; counter-reset: st; }
.steps li { counter-increment: st; font-size: .82rem; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--card); margin-right: 6px; font-weight: 700; font-size: .72rem; }
.steps li.done { background: var(--navy); color: #fff; }
.steps li.done::before { background: var(--gold); color: #fff; }
details summary { cursor: pointer; padding: 8px 0; color: var(--navy); }

/* suggest form */
.suggest label { display: block; margin: 14px 0 4px; }
.suggest input:not([type="checkbox"]), .suggest textarea { width: 100%; font: inherit; font-size: 1rem; padding: 11px 13px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.suggest input:focus, .suggest textarea:focus { outline: 3px solid var(--gold); border-color: var(--gold); }
.suggest label.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.suggest label.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
button.btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; }

/* page reader (read.html): a Drive PDF opened at a page with pdf.js */
.reader h1 { font-size: 1.45rem; overflow-wrap: anywhere; }
.reader [hidden], .r-bar[hidden] { display: none; }
.r-pages { margin: 14px 0 0; }
.r-page { position: relative; background: #fff; margin: 0 auto 12px; border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 5px rgba(23, 60, 81, .16); }
.r-page canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.r-n { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; color: var(--muted); font-size: .9rem; padding: 0 12px; }
.r-page.ready .r-n { display: none; }
.r-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--navy); color: #fff; border-top: 3px solid var(--gold); padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); }
.r-step { font: inherit; font-weight: 700; font-size: .95rem; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--gold); color: #fff; cursor: pointer; }
.r-step:disabled { opacity: .4; cursor: default; }
.r-go { display: flex; align-items: center; gap: 6px; font-size: .95rem; white-space: nowrap; }
.r-go input { width: 4.2em; min-height: 40px; font: inherit; font-size: 1rem; text-align: center; border: 0; border-radius: 8px; padding: 4px; color: var(--text); background: #fff; }
.r-go input:focus { outline: 3px solid var(--gold); }
body.r-on footer { padding-bottom: 96px; }
@media (max-width: 560px) {
  .r-pages { margin-left: -16px; margin-right: -16px; }   /* pages use the full width of a phone */
  .r-page { border-radius: 0; margin-bottom: 8px; }
  .r-go label { display: none; }
  .r-step { padding: 0 12px; }
}
@media print { .r-bar, #r-btns, #r-status { display: none; } }
