/* CK Council Watch — minimal, civic, Wikipedia-like. System fonts only;
   no JavaScript, no external CSS/fonts/CDN. Off-white page framing a clean,
   readable white article column. */
:root {
  --w: 60rem;
  --ink: #1b1b1b; --muted: #555a60;
  --line: #d9dce0; --line-soft: #ebedf0;
  --accent: #0b57d0; --visited: #6a4fb6;
  --warn-ink: #6b5111; --warn-bg: #fbf3df; --warn-line: #ecdcb0;
  --page-bg: #f6f6f4; --quote-bg: #fbfbfa;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--page-bg);
  font: 16px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, "Noto Sans", sans-serif;
}

/* Links — visibly links, visited tracking, accessible focus */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--visited); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Skip-to-content: off-screen until keyboard-focused, then visible top-left so
   keyboard/screen-reader users can jump past the nav straight to the article. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--accent);
  padding: 0.5rem 0.85rem; border: 1px solid var(--line); border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

/* Masthead: site title + subtitle, then nav tabs */
header.masthead { max-width: var(--w); margin: 0 auto; padding: 1.1rem 1.25rem 0.5rem; }
header.masthead .brand {
  display: inline-block; font-weight: 700; font-size: 1.4rem;
  letter-spacing: -0.01em; color: var(--ink);
}
header.masthead .brand:hover { text-decoration: none; }
header.masthead .tag { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.92rem; }

nav.site {
  display: flex; flex-wrap: wrap; gap: 0 0.15rem;
  max-width: var(--w); margin: 0 auto; padding: 0 0.6rem;
  border-bottom: 1px solid var(--line);
}
nav.site a { display: inline-block; padding: 0.45rem 0.6rem; font-size: 0.95rem; border-bottom: 2px solid transparent; }
nav.site a:hover { text-decoration: none; background: var(--line-soft); border-bottom-color: var(--line); }

/* Preview notice — subtle but visible, sits just above the article */
.banner {
  max-width: var(--w); margin: 0.9rem auto 0; padding: 0.5rem 0.85rem;
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line); border-radius: 3px;
  font-size: 0.88rem; line-height: 1.5;
}

/* Article column — a clean, framed, readable document */
main {
  max-width: var(--w); margin: 0.9rem auto 2rem; padding: 1.6rem 1.9rem 2.5rem;
  background: #fff; border: 1px solid var(--line);
}

/* Headings — wiki-style underlined page title + section rules */
h1 { font-size: 1.7rem; line-height: 1.25; font-weight: 600; margin: 0 0 0.8rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
h2 { font-size: 1.3rem; font-weight: 600; margin: 1.8rem 0 0.6rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--line-soft); }
h3 { font-size: 1.08rem; font-weight: 600; margin: 1.3rem 0 0.45rem; }
p { margin: 0.6rem 0; }

/* Lists — readable, scannable */
ul, ol { padding-left: 1.4rem; margin: 0.5rem 0; }
li { margin: 0.25rem 0; }
li > ul, li > ol { margin: 0.25rem 0; }

/* Evidence quotes + source/continuation metadata */
blockquote { margin: 0.5rem 0 0.5rem 0.25rem; padding: 0.35rem 0.9rem; border-left: 3px solid var(--line); background: var(--quote-bg); color: #333; }
blockquote, .cont { font-size: 0.95rem; }
.cont { color: var(--muted); margin: 0.15rem 0 0.5rem 0.6rem; }

/* Tables (the councillors activity table). Wrapped in .tablewrap so it scrolls
   sideways on a phone instead of overflowing the article column. */
.tablewrap { overflow-x: auto; margin: 0.8rem 0; }
table { border-collapse: collapse; margin: 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--line); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--line-soft); }
/* count columns (everything after the first label column) read right-aligned */
table th:not(:first-child), table td:not(:first-child) { text-align: right; }

/* Collapsible long sections (Phase 2C) — native <details>; no JavaScript.
   Closed by default so long pages stay scannable; the summary and every
   aggregate trust count (which live OUTSIDE the fold) are never hidden. */
details { margin: 0.6rem 0 1rem; border: 1px solid var(--line-soft); border-radius: 3px; background: var(--quote-bg); }
details > summary {
  cursor: pointer; padding: 0.45rem 0.8rem; font-weight: 600; color: var(--ink);
  list-style: none; -webkit-user-select: none; user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--muted); }
details[open] > summary::before { content: "▾"; }
details > summary:hover { background: var(--line-soft); }
details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
details[open] > summary { border-bottom: 1px solid var(--line-soft); }
details > *:not(summary) { margin-left: 0.8rem; margin-right: 0.8rem; }

/* /ask embedded chat — a full-page civic research surface. Botpress mounts the
   webchat into #bp-ask-root; this is the only page that loads JavaScript. */
.ask-chat {
  margin: 1.2rem auto 0;
  min-height: 720px;
  height: calc(100vh - 240px);
  background: var(--quote-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.ask-chat .ask-fallback { margin: 0; padding: 1rem 1.2rem; color: var(--muted); }
.ask-note { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

footer { max-width: var(--w); margin: 0 auto; padding: 1.25rem 1.9rem 3rem; color: var(--muted); font-size: 0.85rem; }

/* Narrow screens — edge-to-edge article, wrapping nav */
@media (max-width: 40rem) {
  main { margin: 0.6rem 0.5rem 1.5rem; padding: 1.1rem 1rem 1.8rem; }
  .banner { margin: 0.6rem 0.5rem 0; }
  header.masthead { padding: 0.9rem 1rem 0.4rem; }
  nav.site { padding: 0 0.35rem; }
  footer { padding: 1.1rem 1rem 2.5rem; }
  h1 { font-size: 1.45rem; }
}

/* Print — drop chrome, keep content readable */
@media print {
  body { background: #fff; }
  nav.site, .banner { display: none; }
  main { border: 0; max-width: none; margin: 0; padding: 0; }
  a { color: #000; }
  /* Expand folds when printing so a printed/PDF record is complete. Best
     effort: reliable in Firefox; some Chromium builds may still collapse. */
  details { border: 0; background: none; }
  details > *:not(summary) { display: block !important; margin: 0; }
  details > summary::before { content: ""; }
}
