/* Human Intelligence Advocacy Group (HIAG) stylesheet
   Adapted from the Fletcher portfolio stylesheet. No external dependencies. */

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1c2430;
  --muted: #5a6573;
  --border: #d9dee5;
  --accent: #1f4e79;
  --accent-soft: #e8eff6;
  --notice-bg: #fff7e0;
  --notice-border: #c9a227;
  --sev-high: #9b2c2c;
  --sev-high-bg: #fbeaea;
  --sev-med: #8a5a00;
  --sev-med-bg: #fdf3dc;
  --sev-low: #2f6b3a;
  --sev-low-bg: #e9f5ec;
  --measure: 46rem;
  --radius: 6px;
  font-size: 17px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

/* ---------- Header / navigation ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand span { color: var(--muted); font-weight: 400; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

/* ---------- Main layout ---------- */
main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
.prose { max-width: var(--measure); }
.wide { max-width: 64rem; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); }
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.3rem; }
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--surface); padding: 0.1em 0.3em; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.lede { font-size: 1.15rem; color: var(--muted); max-width: var(--measure); }
.meta { color: var(--muted); font-size: 0.9rem; }

/* ---------- Notices ---------- */
.notice {
  border-left: 4px solid var(--notice-border);
  background: var(--notice-bg);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1.5rem;
  max-width: var(--measure);
}
.notice strong.notice-title, .notice > strong:first-child { display: block; }
.placeholder {
  background: var(--notice-bg);
  border: 1px dashed var(--notice-border);
  padding: 0 0.3em;
  border-radius: 3px;
}
.callout {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  max-width: var(--measure);
}
.callout > :last-child { margin-bottom: 0; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  background: var(--bg);
}
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card p { margin-bottom: 0.5rem; color: var(--muted); font-size: 0.95rem; }
.card .tag { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
caption {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
thead th {
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; }
td.blank { height: 2.2rem; }
table.form th[scope="row"] { width: 32%; background: var(--surface); }

.sev { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 3px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.sev-high { color: var(--sev-high); background: var(--sev-high-bg); }
.sev-med  { color: var(--sev-med);  background: var(--sev-med-bg); }
.sev-low  { color: var(--sev-low);  background: var(--sev-low-bg); }

/* ---------- Checklists ---------- */
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.55rem;
}
ul.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
}

/* ---------- Definition lists ---------- */
dl.profile { display: grid; grid-template-columns: 12rem 1fr; gap: 0.4rem 1rem; margin: 0 0 1.5rem; }
dl.profile dt { font-weight: 600; }
dl.profile dd { margin: 0; }

/* ---------- Table of contents ---------- */
nav.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  margin: 0 0 2rem;
  max-width: var(--measure);
  font-size: 0.95rem;
}
nav.toc ol { margin: 0.25rem 0 0; padding-left: 1.25rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .inner { max-width: 64rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.site-footer p { margin: 0 0 0.35rem; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  :root { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  main { padding-top: 1.25rem; }
  dl.profile { grid-template-columns: 1fr; }
  dl.profile dt { margin-top: 0.5rem; }
  table.form th[scope="row"] { width: 40%; }
}

/* ---------- Print (templates are meant to be printed or saved as PDF) ---------- */
@media print {
  :root { font-size: 11pt; }
  .site-header, .site-footer, nav.toc, .no-print { display: none; }
  main { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  .table-wrap { overflow: visible; border: 0; }
  table, th, td { border: 1px solid #999; }
  h2 { break-after: avoid; }
  tr { break-inside: avoid; }
}

/* ---------- Excerpts ---------- */
blockquote.excerpt {
  margin: 0 0 1.5rem;
  padding: 0.25rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}
blockquote.excerpt p { margin: 0.75rem 0; }

/* ---------- HIAG additions ---------- */
.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  margin: 0.25rem 0.5rem 0.25rem 0;
}
.button:hover { background: #163a5c; }
.button.secondary { background: var(--accent-soft); color: var(--accent); }
.mission {
  font-size: 1.25rem;
  line-height: 1.5;
  border-left: 4px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin: 1.5rem 0 2rem;
  max-width: var(--measure);
}

/* ---------- Tracker status labels ---------- */
.st { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 3px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.st-ok     { color: var(--sev-low);  background: var(--sev-low-bg); }
.st-part   { color: var(--sev-med);  background: var(--sev-med-bg); }
.st-unconf { color: var(--sev-high); background: var(--sev-high-bg); }

.card h2 { margin: 0 0 0.5rem; padding: 0; border: 0; font-size: 1.05rem; }

/* ---------- Tracker filters and change list ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: flex-end; background: var(--surface); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1rem; }
.filters label { display: flex; flex-direction: column; font-size: 0.85rem; font-weight: 600; gap: 0.2rem; }
.filters select, .filters button { font: inherit; font-weight: 400; font-size: 0.95rem; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); }
.filters button { cursor: pointer; color: var(--accent); }
.filters p { margin: 0; width: 100%; }
.filters p:empty { display: none; }
[hidden] { display: none !important; }
ul.changes { max-width: var(--measure); }
