/* Committee Desk — base stylesheet.
   Plain CSS, no build step, no framework. Mobile-first.

   Design direction: a working reference, not a brochure. The signature element
   is the "stamp" tag — a bordered, uppercase, monospace label used for status,
   authority, and category — because this site's whole job is telling a reader
   exactly where something stands (alleged vs. adjudicated, federal vs. state).
   That idea is borrowed straight from the content model, not decoration. */

:root {
  --ink: #1c2b33;
  --ink-soft: #4c5c63;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --line: #dcdad2;
  --ledger: #2b6e62;
  --ledger-dark: #1c4a41;
  --flag: #a8461e;

  --font-display: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  --measure: 42rem;
  --measure-wide: 60rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
}

a {
  color: var(--ledger-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--ledger);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-visible {
  outline: 3px solid var(--ledger);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(1.9rem, 1.6rem + 1.4vw, 2.6rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.4rem, 1.25rem + 0.8vw, 1.75rem); margin: 1.6em 0 0.5em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 0.4em; }

p, ul, ol {
  margin: 0 0 1.1em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--surface);
  padding: 0.75em 1.25em;
  z-index: 100;
  border-radius: 0 0 0.25em 0;
}

.skip-link:focus {
  left: 0;
}

/* ---- Header & nav ---- */

.site-header {
  border-bottom: 3px solid var(--ink);
  background: var(--surface);
}

.site-header-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}

.site-brand::before {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  background: var(--ledger);
  border-radius: 2px;
  transform: translateY(-0.05em);
}

.site-brand:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-left: auto;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.25em 0.1em;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ledger);
  font-weight: 600;
}

/* ---- Page wrapper ---- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}

.page-wide {
  max-width: var(--measure-wide);
}

/* ---- Footer ---- */

.site-footer {
  border-top: 3px solid var(--ink);
  background: var(--surface);
  margin-top: 3rem;
}

.site-footer-inner {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.25rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.disclaimer {
  border-left: 3px solid var(--flag);
  padding: 0.5em 0 0.5em 0.9em;
  margin: 0 0 1em;
  color: var(--ink);
}

.site-footer-links a {
  color: var(--ink-soft);
}

/* ---- Stamp tags: the signature element ---- */

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0.15em 0.5em;
  line-height: 1.5;
  margin: 0 0.35em 0.35em 0;
}

.tag-authority { color: var(--ledger-dark); }
.tag-applies { color: var(--ink-soft); }
.tag-category { color: var(--ink-soft); }

/* ---- Home ---- */

.hero p {
  font-size: 1.1rem;
  max-width: 38rem;
}

.hero-links {
  margin-top: 1.5rem;
}

.hero-links a {
  margin-right: 1.5rem;
}

/* ---- Generic list pages ---- */

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.entry-list li:first-child {
  border-top: none;
}

/* ---- Reference hub ---- */

.hub-intro {
  max-width: var(--measure);
}

.hub-disclaimer {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.filter-bar {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  background: var(--surface);
}

.filter-bar legend {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 0.4rem;
}

.filter-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.filter-bar label {
  cursor: pointer;
  padding: 0.3em 0.75em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.filter-input:checked + label {
  background: var(--ledger);
  border-color: var(--ledger);
  color: var(--surface);
}

.filter-input:focus-visible + label {
  outline: 3px solid var(--ledger);
  outline-offset: 2px;
}

.reference-group {
  margin-bottom: 2.5rem;
}

.reference-group h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35em;
}

.reference-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .reference-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.reference-item {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 1rem 1.1rem;
}

.reference-item h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.reference-item h3 a {
  text-decoration: none;
  color: var(--ink);
}

.reference-item h3 a:hover {
  color: var(--ledger-dark);
}

.reference-item .why {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 0.5em;
}

.reference-item .meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0.5em 0 0;
}

/* CSS-only filter (no JS): show/hide by data-applies, using :has().
   Falls back gracefully — browsers without :has() just show everything. */

.reference-hub:has(#filter-federal:checked)
  .reference-item:not([data-applies="federal"]):not([data-applies="both"]) {
  display: none;
}

.reference-hub:has(#filter-state:checked)
  .reference-item:not([data-applies="state"]):not([data-applies="both"]) {
  display: none;
}

.reference-hub:has(#filter-both:checked)
  .reference-item:not([data-applies="both"]) {
  display: none;
}

.reference-hub:has(#filter-federal:checked)
  .reference-group:not(:has(.reference-item[data-applies="federal"], .reference-item[data-applies="both"])) {
  display: none;
}

.reference-hub:has(#filter-state:checked)
  .reference-group:not(:has(.reference-item[data-applies="state"], .reference-item[data-applies="both"])) {
  display: none;
}

.reference-hub:has(#filter-both:checked)
  .reference-group:not(:has(.reference-item[data-applies="both"])) {
  display: none;
}

/* ---- Start Here hub ---- */

.start-here-path {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  counter-reset: start-here;
}

.start-here-path li {
  counter-increment: start-here;
  position: relative;
  padding: 1.1rem 0 1.1rem 3.25rem;
  border-top: 1px solid var(--line);
}

.start-here-path li:first-child {
  border-top: none;
}

.start-here-path li::before {
  content: counter(start-here);
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--ledger);
  color: var(--ledger-dark);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.start-here-path h2 {
  margin: 0 0 0.3em;
  font-size: 1.15rem;
}

.start-here-path h2 a {
  text-decoration: none;
  color: var(--ink);
}

.start-here-path h2 a:hover {
  color: var(--ledger-dark);
}

.start-here-path p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ---- Reference entry page ---- */

.breadcrumb {
  font-size: 0.9rem;
}

.breadcrumb a {
  color: var(--ink-soft);
}

.entry-meta {
  margin-bottom: 1.25rem;
}

.why-it-matters {
  font-size: 1.1rem;
  color: var(--ink);
  border-left: 3px solid var(--ledger);
  padding-left: 0.9em;
}

.source-link {
  margin-top: 2rem;
}

.source-link a {
  font-weight: 600;
}

/* ---- Status badges: enforcement legal posture ----
   Alleged/charged read as tentative (outlined, muted or flagged); settled reads
   as resolved-with-a-caveat (green outline); adjudicated/resolved read as
   settled fact (solid fill). The visual weight should track how sure we are. */

.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.3em 0.75em;
  border-radius: 3px;
  margin: 0 0 0.75rem;
}

.status-alleged {
  background: transparent;
  border: 2px dashed var(--ink-soft);
  color: var(--ink-soft);
}

.status-charged {
  background: transparent;
  border: 2px solid var(--flag);
  color: var(--flag);
}

.status-settled {
  background: transparent;
  border: 2px solid var(--ledger);
  color: var(--ledger-dark);
}

.status-adjudicated {
  background: var(--ink);
  border: 2px solid var(--ink);
  color: var(--surface);
}

.status-resolved {
  background: var(--ledger-dark);
  border: 2px solid var(--ledger-dark);
  color: var(--surface);
}

.presumption-note {
  border-left: 3px solid var(--ink-soft);
  padding: 0.5em 0 0.5em 0.9em;
  margin: 0 0 1.25em;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-style: italic;
  max-width: var(--measure);
}

/* ---- Enforcement index ---- */

.incident-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.incident-item {
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.incident-item:first-child {
  border-top: none;
}

.incident-item h2 {
  margin: 0.3em 0 0.35em;
  font-size: 1.15rem;
}

.incident-item h2 a {
  text-decoration: none;
  color: var(--ink);
}

.incident-item h2 a:hover {
  color: var(--ledger-dark);
}

.incident-meta {
  margin: 0 0 0.5em;
}

.incident-item .meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0.5em 0 0;
}

.tag-topic {
  color: var(--ledger-dark);
  text-decoration: none;
}

a.tag-topic:hover {
  color: var(--ledger);
}

.tag-primary { color: var(--ledger-dark); }
.tag-secondary { color: var(--ink-soft); }

/* CSS-only topic filter (no JS), same :has() approach as the reference hub. */

.enforcement-hub:has(#filter-topic-fraud-embezzlement:checked) .incident-item:not([data-topics~="fraud-embezzlement"]) { display: none; }
.enforcement-hub:has(#filter-topic-bsa-aml:checked) .incident-item:not([data-topics~="bsa-aml"]) { display: none; }
.enforcement-hub:has(#filter-topic-cyber-vendor:checked) .incident-item:not([data-topics~="cyber-vendor"]) { display: none; }
.enforcement-hub:has(#filter-topic-related-party:checked) .incident-item:not([data-topics~="related-party"]) { display: none; }
.enforcement-hub:has(#filter-topic-recordkeeping-reporting:checked) .incident-item:not([data-topics~="recordkeeping-reporting"]) { display: none; }
.enforcement-hub:has(#filter-topic-lending-credit:checked) .incident-item:not([data-topics~="lending-credit"]) { display: none; }
.enforcement-hub:has(#filter-topic-governance-oversight:checked) .incident-item:not([data-topics~="governance-oversight"]) { display: none; }
.enforcement-hub:has(#filter-topic-member-harm:checked) .incident-item:not([data-topics~="member-harm"]) { display: none; }

/* ---- Enforcement incident page ---- */

.incident-page .incident-meta,
.incident-page .incident-topics {
  margin: 0 0 0.6em;
}

.lede {
  font-size: 1.1rem;
  max-width: var(--measure);
}

.incident-timeline {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--line);
  max-width: var(--measure);
}

.incident-timeline li {
  position: relative;
  padding: 0 0 1.1rem 0.5rem;
}

.incident-timeline li::before {
  content: "";
  position: absolute;
  left: -1.55rem;
  top: 0.4em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ledger);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: block;
}

.control-lessons {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.control-lesson {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 1rem 1.1rem;
}

.control-question {
  font-weight: 600;
  margin: 0 0 0.4em;
}

.control-why {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 0.4em;
}

.control-related a {
  font-size: 0.85rem;
}

.incident-sources {
  margin: 0 0 2rem;
  padding-left: 1.25rem;
  max-width: var(--measure);
}

.incident-sources li {
  margin-bottom: 0.6em;
}

.incident-updates,
.incident-corrections {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  max-width: var(--measure);
}

.incident-updates li,
.incident-corrections li {
  padding: 0.5em 0;
  border-top: 1px solid var(--line);
}

.incident-updates li:first-child,
.incident-corrections li:first-child {
  border-top: none;
}

.incident-corrections {
  border-left: 3px solid var(--flag);
  padding-left: 1rem;
}

.update-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-right: 0.5em;
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
