/* ═══════════════════════════════════════════════════════════════
   cfpb-response-data — page-specific styles.
   Inherits shell (hero, page-body, section) and typography from /styles.css.
   Only chart-card internals, the full-25 table, and the methodology
   block live here.
   ═══════════════════════════════════════════════════════════════ */

/* ── Chart cards ─────────────────────────────────────────── */
.chart-card {
  padding-bottom: var(--rhythm);
  margin-bottom: var(--rhythm);
  border-bottom: 1px solid var(--border);
}

.chart-card:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.chart-card-header {
  margin-bottom: 1.5rem;
}

.chart-num {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.chart-card h2 {
  margin: 0;
}

.hero-chart-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 1.25rem;
}

.hero-chart-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.chart-caption {
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--ink-light);
  margin-bottom: 0.75rem;
  max-width: 700px;
}

.chart-footnote {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── Full-25 table ─────────────────────────────────────── */
.table-section {
  margin-top: calc(var(--rhythm) * 1.25);
  padding-top: var(--rhythm);
  border-top: 1px solid var(--border);
}

.table-intro {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink-light);
  max-width: 720px;
  margin-bottom: 1.75rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
}

#companies-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

#companies-table thead th {
  background: var(--cream);
  color: var(--ink-light);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.9rem 0.9rem;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

#companies-table thead th.num { text-align: right; }
#companies-table thead th.link-col { cursor: default; text-align: left; }

#companies-table thead th[data-sort-key]::after {
  content: " ↕";
  color: var(--ink-muted);
  font-size: 0.7rem;
}

#companies-table thead th.sort-asc::after { content: " ▲"; color: var(--accent); }
#companies-table thead th.sort-desc::after { content: " ▼"; color: var(--accent); }

#companies-table tbody td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}

#companies-table tbody tr:last-child td { border-bottom: none; }
#companies-table tbody tr:hover { background: color-mix(in oklab, var(--accent) 3%, white); }

#companies-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-light);
}

#companies-table tbody td.company-name { font-weight: 500; }

#companies-table tbody td .legal-name {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

#companies-table .delta-down { color: var(--red); font-weight: 600; }
#companies-table .delta-up { color: var(--green); font-weight: 600; }
#companies-table .delta-flat { color: var(--ink-muted); }

#companies-table .cfpb-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

#companies-table .cfpb-link:hover { text-decoration-color: var(--accent); }

.table-footnote {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 1rem;
  line-height: 1.5;
}

.table-footnote code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--cream);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--ink-light);
}

/* ── Contamination-events methodology block ─────────────── */
.methodology-section {
  margin-top: calc(var(--rhythm) * 1.25);
  padding-top: var(--rhythm);
  border-top: 1px solid var(--border);
  max-width: 720px;
}

.methodology-section ul {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-light);
  margin: 0.5rem 0 1rem 1.25rem;
}

.methodology-section ul li { margin-bottom: 0.75rem; }
.methodology-section em { font-style: italic; color: var(--ink); }

.methodology-note {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 !important;
  border-radius: 0 4px 4px 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  #companies-table thead th,
  #companies-table tbody td { padding: 0.65rem 0.6rem; font-size: 0.85rem; }
}
