/* ---------------------------------------------------------------------------
   Corpus visualisations.

   Colour roles are declared once here and referenced by role in viz.js. The
   categorical trio was validated with the data-viz palette checker against a
   white chart surface: lightness band PASS, chroma floor PASS, CVD ΔE 13.0,
   normal-vision ΔE 16.3, all three >= 3:1 contrast. Replacing a hue means
   re-running that validation.
   --------------------------------------------------------------------------- */
.cr-viz {
  --viz-surface:  #ffffff;
  --viz-ink:      #1f1f1f;
  --viz-muted:    #6b6b6b;
  --viz-grid:     #e6e4e2;
  --viz-series-1: #AA1A02;   /* brand red   — timeline, institutions, grantors */
  --viz-series-2: #2a78d6;   /* blue        — transaction types, recipients    */
  --viz-series-3: #4a3aa7;   /* violet      — parties acting as both           */

  margin: 1.6em 0 2.2em;
  padding: 0;
  background: var(--viz-surface);
}
.cr-viz__chart { width: 100%; }
.cr-viz svg { display: block; max-width: 100%; overflow: visible; }
.cr-viz__noscript {
  padding: 1em 1.1em;
  background: #f6f2f1;
  border-left: 3px solid var(--viz-series-1);
  font-size: .95em;
}

/* Panels (institutions / types side by side on wide screens) */
.cr-viz__panels { display: grid; grid-template-columns: 1fr; gap: 2.2em; }
@media (min-width: 1000px) { .cr-viz__panels { grid-template-columns: 1fr 1fr; gap: 2.6em; } }
.cr-viz__panel h3 {
  margin: 0 0 .2em;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--viz-muted);
  border-bottom: 1px solid var(--viz-grid);
  padding-bottom: .3em;
}
.cr-viz__sub {
  margin: .5em 0 1em;
  font-size: .9em;
  line-height: 1.5;
  color: var(--viz-muted);
}
.cr-viz__toggle { white-space: nowrap; margin-left: .3em; }
.cr-viz__toggle input { vertical-align: middle; margin-right: .25em; }

/* Controls above the network */
.cr-viz__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6em 1.4em;
  padding: .7em .9em;
  margin-bottom: .8em;
  background: #f6f5f4;
  border: 1px solid var(--viz-grid);
  border-radius: 4px;
  font-size: .9em;
}
.cr-viz__field { display: flex; align-items: center; gap: .45em; color: var(--viz-muted); }
.cr-viz__field input[type="search"] {
  padding: .3em .5em;
  border: 1px solid #ccc;
  border-radius: 3px;
  font: inherit;
  min-width: 190px;
}
.cr-viz__field input[type="range"] { width: 130px; }
.cr-viz__field output { font-weight: bold; color: var(--viz-ink); min-width: 1.4em; text-align: center; }
.cr-viz__btn {
  border: 1px solid var(--viz-series-1);
  background: #fff;
  color: var(--viz-series-1);
  font: inherit;
  font-size: .95em;
  padding: .28em .9em;
  border-radius: 999px;
  cursor: pointer;
}
.cr-viz__btn:hover, .cr-viz__btn:focus { background: var(--viz-series-1); color: #fff; }
.cr-viz__legend { display: flex; flex-wrap: wrap; gap: .3em 1em; margin-left: auto; color: var(--viz-ink); }
.cr-viz__legend span { display: inline-flex; align-items: center; gap: .4em; }
.cr-viz__legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.cr-viz__plot {
  border: 1px solid var(--viz-grid);
  border-radius: 4px;
  background: var(--viz-surface);
  overflow: hidden;            /* the graph is pannable; it must not spill onto the page */
}
.cr-viz__plot svg { overflow: hidden; }

/* Shared hover tooltip */
.cr-viz-tip {
  position: fixed;
  z-index: 900;
  pointer-events: none;
  background: rgba(25, 18, 16, .94);
  color: #fff;
  padding: .5em .7em;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 320px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.cr-viz-tip[hidden] { display: none; }
.cr-viz-tip__pct { color: #d9cfcb; }

/* The landing page's three cards */
.cr-viz-cards { display: grid; grid-template-columns: 1fr; gap: 1.4em; margin: 1.6em 0 2em; }
@media (min-width: 820px) { .cr-viz-cards { grid-template-columns: repeat(3, 1fr); } }
.cr-viz-card {
  border: 1px solid var(--viz-grid, #e6e4e2);
  border-top: 3px solid #AA1A02;
  border-radius: 4px;
  padding: 1.1em 1.2em 1.2em;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cr-viz-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.cr-viz-card .kicker {
  margin: 0 0 .25em;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.cr-viz-card h3 { margin: 0 0 .45em; font-size: 20px; }
.cr-viz-card h3 a { color: #AA1A02; text-decoration: none; }
.cr-viz-card h3 a:hover { text-decoration: underline; }
.cr-viz-card p { margin: 0 0 .8em; font-size: .95em; line-height: 1.55; }
.cr-viz-card .actionlink {
  display: inline-block;
  font-size: .85em;
  font-weight: bold;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #AA1A02;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
@media (prefers-reduced-motion: reduce) {
  .cr-viz-card { transition: none; }
  .cr-viz-card:hover { transform: none; }
}

/* The "what this cannot show" note each page carries */
.cr-viz-note {
  background: #f6f2f1;
  border-left: 3px solid #AA1A02;
  padding: .9em 1.1em;
  margin: 1.6em 0;
  font-size: .95em;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Insights: findings computed from the corpus, each a claim plus its evidence.
   --------------------------------------------------------------------------- */
.cr-ins { margin: 0 0 3em; }
.cr-ins__claim {
  font-size: 24px;
  line-height: 1.28;
  color: #AA1A02;
  margin: 0 0 .55em;
  padding-bottom: .35em;
  border-bottom: 2px solid #AA1A02;
}
.cr-ins__body { margin-bottom: 1.2em; }
.cr-ins__body p { margin: 0 0 .8em; line-height: 1.62; }
.cr-ins__scroll { overflow-x: auto; margin: 0 0 1em; }
.cr-ins__table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 520px; }
.cr-ins__table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #6b6b6b;
  font-weight: bold;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid #ccc;
  white-space: nowrap;
}
.cr-ins__table td { padding: 9px 12px 9px 0; border-bottom: 1px solid #ededed; vertical-align: middle; }
.cr-ins__table tr:last-child td { border-bottom: 0; }
.cr-ins__table th.num, .cr-ins__table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cr-ins__table tbody tr:hover { background: #faf6f5; }
.cr-ins__amp { color: #999; padding: 0 .15em; }
.cr-ins__bar {
  display: block;
  height: 9px;
  min-width: 2px;
  background: #AA1A02;
  border-radius: 2px;
  opacity: .78;
}
.cr-ins__caveat {
  background: #f6f2f1;
  border-left: 3px solid #AA1A02;
  padding: .8em 1em;
  margin: 0;
  font-size: .92em;
  line-height: 1.6;
  color: #444;
}

/* Insights landing: one card per finding */
.cr-ins-cards { display: grid; grid-template-columns: 1fr; gap: 1.2em; margin: 1.8em 0 2em; }
@media (min-width: 760px) { .cr-ins-cards { grid-template-columns: 1fr 1fr; } }
.cr-ins-card {
  display: block;
  border: 1px solid #e3ddda;
  border-left: 3px solid #AA1A02;
  border-radius: 4px;
  padding: 1.1em 1.3em 1.2em;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cr-ins-card:hover, .cr-ins-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.11);
  text-decoration: none;
}
.cr-ins-card h3 { margin: 0 0 .4em; font-size: 19px; color: #AA1A02; }
.cr-ins-card p { margin: 0 0 .9em; font-size: .94em; line-height: 1.55; color: #444; }
.cr-ins-card__num {
  display: inline-block;
  font-size: 12px; font-weight: bold; letter-spacing: .05em; text-transform: uppercase;
  color: #6b6b6b; background: #f4f0ee; padding: .3em .7em; border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  .cr-ins-card { transition: none; }
  .cr-ins-card:hover { transform: none; }
}

/* Back link, sort affordances and in-table links */
.cr-ins__back { margin: 0 0 1em; font-size: .92em; }
.cr-ins__hint { margin: 0 0 .7em; font-size: .86em; color: #777; font-style: italic; }
.cr-ins__table th[data-col] { cursor: pointer; user-select: none; }
.cr-ins__table th[data-col]:hover { color: #AA1A02; }
.cr-ins__table th[data-col]:focus-visible { outline: 2px solid #AA1A02; outline-offset: 2px; }
.cr-ins__arrow { display: inline-block; width: .8em; text-align: left; opacity: .55; }
.cr-ins__table th.is-asc  .cr-ins__arrow::after { content: "\2191"; }
.cr-ins__table th.is-desc .cr-ins__arrow::after { content: "\2193"; }
.cr-ins__go { color: #AA1A02; text-decoration: none; border-bottom: 1px solid rgba(170,26,2,.28); }
.cr-ins__go:hover { border-bottom-color: #AA1A02; background: #faf1ef; }
.cr-ins__muted { color: #999; font-size: .9em; }

/* The original Drupal theme paints <th> with a dark background; these tables
   are plain data and need the page's own surface, not that. */
.cr-ins__table th,
.cr-ins__table thead th {
  background: transparent !important;
  background-image: none !important;
  color: #6b6b6b;
  border-bottom: 2px solid #ddd;
  padding: 0 14px 9px 0 !important;
  text-shadow: none;
}
.cr-ins__table th.num { padding-right: 0 !important; }
.cr-ins__table td { background: transparent; }

/* The Drupal theme shades thead ROWS (rgba(0,0,0,.063)), not the cells — that
   is the grey band that was swallowing the column titles. Clear the row and
   set the headings in solid black so they read against the page background. */
.cr-ins__table thead tr,
.cr-ins__table thead {
  background: transparent !important;
  background-image: none !important;
}
.cr-ins__table thead th {
  color: #1f1f1f !important;
  font-weight: bold;
  border-bottom: 2px solid #AA1A02;
}
.cr-ins__table thead th:hover { color: #AA1A02 !important; }

/* The decades bar needs a column to live in: without a width the cell collapses
   and the bars render as slivers. */
.cr-ins__barwrap { display: block; width: 100%; min-width: 130px; }
.cr-ins__table td:has(.cr-ins__barwrap) { width: 34%; }
.cr-ins__table th:nth-child(3) { width: 34%; }

/* Research question — laid out as on the MLGB insights page */
.rq {
  background: #fff;
  border: 1px solid #e3ddda;
  border-left: 3px solid #AA1A02;
  border-radius: 4px;
  padding: 1.05em 1.25em 1.15em;
  margin: .8em 0 1em;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.05);
}
.rq[hidden] { display: none; }
.rq-topic {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #AA1A02;
  background: #f7ebe8;
  border-radius: 99px;
  padding: .18em .65em;
  margin-bottom: .5em;
}
.rq-body { font-size: 17.5px; line-height: 1.55; margin: .2em 0 .9em; color: #262626; }
.rq-act { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; margin: 0; }
.cr-btn {
  display: inline-block;
  border: 1px solid #AA1A02;
  background: #AA1A02;
  color: #fff;
  font: inherit;
  font-size: .85em;
  font-weight: bold;
  letter-spacing: .02em;
  padding: .4em .95em;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.cr-btn:hover, .cr-btn:focus { background: #8a1502; border-color: #8a1502; color: #fff; text-decoration: none; }
.cr-btn--ghost { background: none; color: #AA1A02; border-color: #ddd6d3; }
.cr-btn--ghost:hover, .cr-btn--ghost:focus { background: #f7ebe8; color: #AA1A02; border-color: #AA1A02; }
.rq-exhausted { background: #f6f2f1; border-left: 3px solid #AA1A02; padding: .9em 1.1em; line-height: 1.6; }
.rq-exhausted[hidden] { display: none; }
.rq-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .7em; }
.rq-list li { background: #fff; border: 1px solid #e3ddda; border-radius: 8px; padding: .75em .95em; }
.rq-list li p { margin: .35em 0 .6em; line-height: 1.55; }
.rq-start { color: #AA1A02; font-size: .9em; font-weight: bold; text-decoration: none; }
.rq-start:hover { text-decoration: underline; }
.cr-q__note { font-size: .88em; color: #777; line-height: 1.6; margin: 1.2em 0 0; }
@media (prefers-reduced-motion: reduce) { .cr-btn { transition: none; } }

/* modern.css styles every link inside a page body:
     .node-page .field-name-body a:not(.bib-tag) { color: var(--cr-red-dark) }
   That is specificity (0,3,2) and beats a bare .cr-btn (0,1,0), so an ANCHOR
   styled as a filled button came out dark-red on red and was unreadable, while
   the <button> beside it was fine. These selectors match that specificity and
   sit later in the cascade (viz.css depends on crusades-modern). */
.node-page .field-name-body a.cr-btn,
.node-page .field-name-body a.cr-btn:visited {
  color: #fff;
}
.node-page .field-name-body a.cr-btn:hover,
.node-page .field-name-body a.cr-btn:focus {
  color: #fff;
}
.node-page .field-name-body a.cr-btn--ghost,
.node-page .field-name-body a.cr-btn--ghost:visited,
.node-page .field-name-body a.cr-btn--ghost:hover,
.node-page .field-name-body a.cr-btn--ghost:focus {
  color: #AA1A02;
}
.node-page .field-name-body a.cr-ins__go,
.node-page .field-name-body a.rq-start,
.node-page .field-name-body a.actionlink {
  color: #AA1A02;
}

/* The narrow-screen scroll hint for insight tables; responsive.css shows it. */
.cr-ins__swipe { display: none; }
