/* reform-progress - "Most partner countries are implementing health
   financing reforms": one full-width white card - title row, chart
   (toolbar/View toggle + bars, full card width), source line, then
   "What the data show" + 3 insight cards in a row underneath, all inside
   that one card (no side sidebar - per the client-provided reference
   screenshot). Section header/backdrop come from the master twig - not
   part of this component. Chart chrome (.hf-tools/.hf-seg/.hf-chart/...)
   is ../shared/css/hf-charts.css, loaded alongside this file, and keeps
   its own --hf-* mockup-exact chart-data colors (brand blue / coral),
   unrelated to this file's card/insight-card chrome.

   The card below sets its own flex `gap: 0` - title-row/mount/source/
   insights-title/insights each carry their own top spacing instead.
   .hf-tools (hf-charts.css) has no top margin of its own by default (its
   other consumers' own cards already have a gap between children), so
   this component adds it back locally just below - without it, the View
   toggle sits with no space under the title row. */
.hf-reform-progress {
  --hfrp-ink: var(--clr-gray-dark, #4d4d4d);
  --hfrp-border: var(--clr-gray-light, #dbdbdb);
  --hfrp-teal: var(--clr-blue, #21568c);
  --hfrp-yellow: var(--clr-yellow-orange, #f8b323);
  --hfrp-tint: var(--clr-gray-100, #f2f2f2);

  font-family: var(--primary-ff, 'Poppins', sans-serif);
  color: var(--hfrp-ink);
}

/* ---------- card ---------- */
.hf-reform-progress__card {
  background: var(--clr-white, #fff);
  border: 0;
  border-radius: 0 24px 0 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-sizing: border-box;
}

.hf-reform-progress__title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hf-reform-progress__title-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  min-width: 0;
}

.hf-reform-progress__card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.hf-reform-progress__card-actions .visualization-actions-block {
  position: static;
  inset: auto;
}

.hf-reform-progress__divider {
  width: 1px;
  height: 30px;
  background: var(--hfrp-teal);
}

.hf-reform-progress .maximize-popup {
  cursor: pointer;
}

.hf-reform-progress__chart-title {
  margin: 0;
  font-size: var(--fs-20, 20px);
  line-height: 1.3;
  font-weight: var(--fw-bold, 700);
  color: var(--clr-teal-dark, #0a544f);
}

.hf-reform-progress__chart-sub {
  margin: 0 0 0 16px;
  padding-left: 16px;
  border-left: 2px solid var(--hfrp-teal);
  font-size: var(--fs-14, 14px);
  line-height: 1.5;
  color: var(--hfrp-ink);
}

@media (max-width: 1000px) {
  .hf-reform-progress__chart-sub {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
  }
}

/* ---------- chart + source ---------- */
/* This component's own card has gap:0 (see its header comment), so unlike
   every other .hf-tools consumer, the View toggle needs its own
   margin-top added back locally here. Scoped to .hf-reform-progress__card
   specifically, not the whole .hf-reform-progress root - js/hf-popup.js
   MOVES .hf-tools out of this card into the popup's own Download row on
   open, where it's no longer a descendant of __card, so this stops
   matching there and the popup's own margin-top:0 (hf-charts.css) wins
   as intended; a selector scoped to the root instead would incorrectly
   keep outranking that by source order. */
.hf-reform-progress__card .hf-tools {
  margin-top: 14px;
}

.hf-reform-progress__source {
  margin: 0;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hfrp-border);
  font-size: var(--fs-13, 13px);
  line-height: 1.55;
  color: var(--hfrp-ink);
}

.hf-reform-progress__source b {
  color: var(--hfrp-ink);
  font-weight: 600;
}

.hf-reform-progress__source:empty {
  display: none;
}

/* ---------- "What the data show" + 3 insight cards ----------
   Typography/grid/card-shape (.hf-stat-group-title, .hf-stat-grid,
   .hf-stat-card, .hf-stat-card__value/__text) are all shared
   (../shared/css/hf-charts.css) - this component only sets its own
   vertical spacing and the 3 color custom properties those shared
   classes expose. */
.hf-reform-progress__insights-title {
  margin-top: 24px;
  --hf-stat-group-title-color: var(--hfrp-ink);
}

.hf-reform-progress__insights {
  margin-top: 16px;
}

.hf-reform-progress__insight {
  --hf-stat-bg: var(--hfrp-tint);
  --hf-stat-accent: var(--hfrp-yellow);
}

.hf-reform-progress__stat {
  --hf-stat-value-color: var(--hfrp-teal);
}

.hf-reform-progress__insight-text {
  --hf-stat-text-color: var(--hfrp-ink);
}

@media (max-width: 559px) {
  .hf-reform-progress__card {
    padding: 20px 16px;
  }

  .hf-reform-progress__stat {
    font-size: 24px;
  }

  .hf-reform-progress__divider {
    display: none;
  }
}
