/* The report card lives in report-card.css (see its header for why). */
@import url("/report-card.css");

/* ── Data study articles: report card and ranked tables ─────────────────────
   Paired with blog-study.js, which builds the markup these rules style. Both
   are scoped to .sb-root (set by blog-study.js) and only act on what they find, so an
   article that loads them without a bridge or a ranked table is unchanged.

   The report card itself lives in styles.css (.sb-card), shared with the
   council hubs. */

/* ── Ranked tables ─────────────────────────────────────────────────────── */
.sb-root table.sb-ranked { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.sb-root table.sb-ranked th {
  background: transparent;
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(0, 200, 200, 0.45);
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary);
}
.sb-root table.sb-ranked td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  background: transparent;
}
.sb-root table.sb-ranked tr:nth-child(even) td { background: transparent; }
.sb-root table.sb-ranked tbody tr { transition: background 120ms ease; }
.sb-root table.sb-ranked tbody tr:hover td { background: rgba(0, 200, 200, 0.05); }
.sb-root table.sb-ranked .sb-rank { width: 52px; color: var(--text-muted, #7d8ea3); }
.sb-root table.sb-ranked td.sb-top { color: var(--teal); font-weight: 650; }
.sb-root table.sb-ranked .sb-hide { display: none; }
.sb-root table.sb-ranked th.sb-money { width: 52%; }

.sb-root .sb-cell { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); align-items: center; gap: 14px; }
.sb-root .sb-fig { text-align: right; color: var(--text-primary); font-weight: 650; white-space: nowrap; }
.sb-root .sb-fig strong { font-weight: inherit; }
.sb-root .sb-track { position: relative; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.sb-root .sb-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--w, 0%);
  border-radius: 4px;
  background: linear-gradient(90deg, #00a7a8 0%, #2ad9d6 100%);
  transform-origin: left center;
}
/* Bars grow in once, when the table first scrolls into view. The resting
   state is the full bar, so a reader without the script, a printout or a
   reduced-motion setting always sees the figure's true length. */
html.sb-motion .sb-root table.sb-ranked:not(.is-in) .sb-fill { transform: scaleX(0); }
html.sb-motion .sb-root table.sb-ranked .sb-fill { transition: transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); }
html.sb-motion .sb-root table.sb-ranked tbody tr:nth-child(n) .sb-fill { transition-delay: calc(var(--i, 0) * 28ms); }

.sb-root table.sb-wide th.sb-money { width: auto; }
.sb-root table.sb-wide .sb-cell { grid-template-columns: auto 72px; gap: 10px; justify-content: start; }
.sb-root table.sb-wide td { white-space: nowrap; }
.sb-root table.sb-wide td:nth-child(2) { white-space: normal; }

.sb-root .sb-table-note { margin: -16px 0 26px; font-size: 13px; color: var(--text-muted, #7d8ea3); }

@media (max-width: 768px) {
  .sb-root table.sb-ranked { min-width: 0; font-size: 14px; }
  .sb-root table.sb-ranked td { padding: 9px 8px; }
  .sb-root table.sb-ranked th { padding: 0 8px 8px; }
  .sb-root table.sb-ranked .sb-rank { width: 34px; }
  .sb-root table.sb-ranked th.sb-money { width: 46%; }
  .sb-root .sb-cell { grid-template-columns: 1fr; gap: 5px; }
  .sb-root .sb-fig { text-align: left; }
  .sb-root .sb-track { height: 5px; }
  .sb-root table.sb-wide { min-width: 600px; }
  .sb-root table.sb-wide .sb-cell { grid-template-columns: auto 56px; gap: 8px; }
  .sb-root table.sb-wide td:nth-child(2) { min-width: 140px; }
}

body.light .sb-root .sb-track { background: rgba(10, 40, 38, 0.08); }
body.light .sb-root table.sb-ranked tbody tr:hover td { background: rgba(0, 160, 160, 0.06); }

@media (prefers-reduced-motion: reduce) {
}
@media print {
  .sb-root .sb-fill { transform: none !important; }
}

/* ── Article opening ─────────────────────────────────────────────────────
   Meta line, standfirst, direct answer and key statistics. The order and
   wording on the page are unchanged; this is presentation only, so the
   direct answer and the statistics stay one clean block each for search and
   answer engines to lift. */

/* Meta: one quiet row, each part on its own, label and value told apart. */
.blog-article .article-meta {
  display: block;
  font-family: inherit; font-size: 12.5px; line-height: 1.5; letter-spacing: 0.01em;
  color: var(--text-muted, #7d8ea3);
  max-width: none;
}
.blog-article .article-meta .sb-meta-part { display: inline; }
.blog-article .article-meta .sb-sr + .sb-meta-part::before {
  content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 10px 3px;
  border-radius: 50%; background: currentColor; opacity: 0.7; vertical-align: middle;
}
.blog-article .article-meta .sb-meta-label { color: var(--text-muted, #7d8ea3); }
.blog-article .article-meta .sb-meta-value { color: var(--text-secondary); }

/* Standfirst: the intro reads as the article's opening line, not a box. */
.blog-article .article-intro {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  margin: 6px 0 26px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-primary);
  opacity: 0.92;
  max-width: 38em;
}

/* Direct answer: one even card, the label carrying the accent. */
.blog-article .direct-answer {
  margin: 0 0 30px;
  padding: 20px 24px 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(0, 200, 200, 0.05) 0%, rgba(0, 200, 200, 0) 70%),
    var(--bg-card);
}
.blog-article .direct-answer .block-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.14em;
  color: var(--teal); margin-bottom: 10px;
}
.blog-article .direct-answer .block-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 0 4px rgba(0, 200, 200, 0.15);
}
.blog-article .direct-answer p { font-size: 16.5px; line-height: 1.65; max-width: none; }

/* Key statistics: one panel of cells, the figure in the display face and
   any detail (the council, the share) set beneath it. */
.blog-article .stat-block-section { margin: 0 0 36px; }
/* !important only here: the site layer styles every h2 through a long
   :not() chain that no scoped selector can outrank, and this one heading is
   a label over the panel, not a section title. */
.blog-article .stat-block-section h2 {
  font-family: inherit !important; font-size: 11.5px !important; font-weight: 650 !important;
  letter-spacing: 0.14em !important; line-height: 1.3 !important; text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px; padding: 0; border: 0;
}
.blog-article .stat-block-section h2::after { display: none; }
.blog-article .stat-block {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  --cols: 3;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
/* Four or eight statistics sit four across; anything else three. Set in CSS
   so the panel has its final shape at first paint. */
.blog-article .stat-block:has(> .stat-item:nth-child(4):last-child),
.blog-article .stat-block:has(> .stat-item:nth-child(8):last-child) { --cols: 4; }
.blog-article .stat-block:has(> .stat-item:nth-child(2):last-child) { --cols: 2; }

/* Dividers drawn by each cell (right and bottom); the panel clips the ones on
   its outer edge, so an unfilled last row just shows card, not a block. */
.blog-article .stat-block .stat-item {
  display: flex; flex-direction: column; justify-content: flex-start;
  min-height: 104px;
  padding: 16px 18px 18px;
  background: transparent;
  border: 0; border-radius: 0;
  box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
}
.blog-article .stat-block .stat-item dt {
  font-size: 11px; font-weight: 650; letter-spacing: 0.1em; line-height: 1.35;
  color: var(--text-muted, #7d8ea3);
  margin: 0 0 10px;
  min-height: 2.7em; /* two lines, so every figure in a row starts level */
}
/* Original punctuation kept in the text for anything that reads it, hidden
   on screen. */
.blog-article .sb-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.blog-article .stat-block .stat-item dd {
  display: flex; flex-direction: column;
  margin: 0;
  font-family: inherit; font-weight: 400; color: var(--text-primary);
}
.blog-article .stat-block .sb-val {
  display: block;
  font-family: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  font-size: 32px; line-height: 1.02; letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
  color: var(--text-primary);
}
.blog-article .stat-block .sb-val { order: 1; }
.blog-article .stat-block .sb-sub {
  order: 2;
  display: block; margin-top: 6px;
  font-size: 13px; line-height: 1.35; color: var(--teal);
}
/* A value with no figure in it (a mechanism, a basis) reads as a short line
   of text rather than a headline number. */
.blog-article .stat-block .stat-item.sb-text .sb-val {
  font-family: inherit; font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: 0;
}
/* Long figures (ranges) step down so they hold one line in a cell. */
.blog-article .stat-block .stat-item.sb-long .sb-val { font-size: 25px; }

@media (max-width: 640px) {
  .blog-article .article-intro { font-size: 17.5px; margin-bottom: 22px; }
  .blog-article .direct-answer { padding: 18px 18px 20px; border-radius: 12px; }
  .blog-article .direct-answer p { font-size: 16px; }
  .blog-article .stat-block { --cols: 2 !important; border-radius: 12px; }
  .blog-article .stat-block .stat-item { min-height: 92px; padding: 14px 14px 16px; }
  .blog-article .stat-block .sb-val { font-size: 27px; }
  .blog-article .stat-block .stat-item.sb-long .sb-val { font-size: 21px; }
}
