/* ==========================================================================
 * Implementation Research hub components (r-*).
 * Used on the homepage and the research, publications, governance and
 * hospital pages. Tokens come from brand.css.
 * ========================================================================== */

.r-kicker {
  display: inline-block;
  font: 700 0.78rem/1 var(--h-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--h-orange-text);
  margin-bottom: 12px;
}
.h-path .r-kicker, .r-dark .r-kicker { color: var(--h-orange-bright); }

/* Utility bar links */
.c-topbar__links { display: flex; gap: 18px; flex-wrap: wrap; }
.c-topbar__links a { color: inherit; text-decoration: none; }
.c-topbar__links a:hover { text-decoration: underline; }

/* Stats banner */
.r-stats { background: var(--h-deep); color: #fff; }
.r-stats ul {
  list-style: none; margin: 0 auto; padding: 32px var(--h-gutter);
  max-width: var(--h-max);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px;
}
.r-stats li { border-left: 3px solid var(--h-orange-bright); padding-left: 16px; }
.r-stats strong { display: block; font: 800 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--h-display); }
.r-stats span { display: block; font-weight: 600; margin-top: 4px; }
.r-stats small { display: block; color: var(--h-pale); font-size: 0.85rem; margin-top: 2px; }
@media (max-width: 860px) { .r-stats ul { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .r-stats ul { grid-template-columns: 1fr; } }

/* Dual engine */
.r-engine { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: stretch; margin-top: 32px; }
.r-engine__col { background: #fff; border: 1px solid var(--h-line); border-radius: var(--radius-sm); padding: 28px; }
.r-engine__col h3 { font: 700 1.25rem/1.2 var(--h-display); color: var(--h-navy); margin: 0 0 12px; }
.r-engine__col ul { margin: 0; padding-left: 18px; color: var(--h-ink-soft); }
.r-engine__col li { margin: 6px 0; }
.r-engine__col--research { border-top: 6px solid var(--h-orange); }
.r-engine__col--clinic { border-top: 6px solid var(--h-blue); }
.r-engine__link { display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--h-orange); }
@media (max-width: 760px) {
  .r-engine { grid-template-columns: 1fr; }
  .r-engine__link { transform: rotate(90deg); }
}

/* Card grid (pillars, studies, publications, governance items) */
.r-grid { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.r-card { background: #fff; border: 1px solid var(--h-line); border-radius: var(--radius-sm); padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.r-card h3 { font: 700 1.15rem/1.25 var(--h-display); color: var(--h-navy); margin: 0; }
.r-card p { margin: 0; color: var(--h-ink-soft); }
.r-card__num { font: 800 0.8rem/1 var(--h-body); letter-spacing: 0.1em; color: var(--h-orange-text); text-transform: uppercase; }
.r-card__label { font-weight: 700; color: var(--h-ink); }
.r-card__foot { margin-top: auto; padding-top: 8px; }
.r-card dl { margin: 4px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: 0.92rem; }
.r-card dt { font-weight: 700; color: var(--h-ink); }
.r-card dd { margin: 0; color: var(--h-ink-soft); }
.r-pending { color: var(--h-ink-soft); font-style: italic; }
.r-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--h-sky); color: var(--h-navy); align-self: flex-start; }
.r-tag--orange { background: var(--h-peach); color: var(--h-orange-text); }

/* Callout quote */
.r-callout { margin: 32px 0 0; padding: 24px 28px; border-left: 6px solid var(--h-orange); background: var(--h-peach); font: 600 1.15rem/1.5 var(--h-display); color: var(--h-navy); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Two-column feature (hospital / living lab) */
.r-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.r-split img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.r-checks { list-style: none; padding: 0; margin: 20px 0 0; }
.r-checks li { padding: 12px 0 12px 32px; border-top: 1px solid var(--h-line); position: relative; }
.r-checks li::before { content: ""; position: absolute; left: 4px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--h-orange); }
.r-checks strong { color: var(--h-navy); }
@media (max-width: 860px) { .r-split { grid-template-columns: 1fr; } }

/* Theory of Change diagram */
.r-toc { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 32px; counter-reset: toc; }
.r-toc__step { position: relative; padding: 24px 20px 24px 20px; background: var(--h-sky); border: 1px solid var(--h-line); margin-right: 18px; border-radius: var(--radius-sm); }
.r-toc__step:not(:last-child)::after {
  content: ""; position: absolute; right: -16px; top: 50%; transform: translateY(-50%);
  border: 8px solid transparent; border-left: 10px solid var(--h-orange);
}
.r-toc__step:last-child { margin-right: 0; background: var(--h-blue); color: #fff; border-color: var(--h-blue); }
.r-toc__step:last-child h3, .r-toc__step:last-child p { color: #fff; }
.r-toc__step h3 { font: 700 1rem/1.25 var(--h-display); color: var(--h-navy); margin: 0 0 8px; }
.r-toc__step p { font-size: 0.9rem; color: var(--h-ink-soft); margin: 0; }
.r-toc__step small { display: block; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--h-orange-text); margin-bottom: 6px; }
.r-toc__step:last-child small { color: var(--h-orange-bright); }
.r-toc__loop { margin-top: 16px; text-align: center; font-weight: 600; color: var(--h-navy); }
@media (max-width: 960px) {
  .r-toc { grid-template-columns: 1fr; gap: 18px; }
  .r-toc__step { margin-right: 0; }
  .r-toc__step:not(:last-child)::after { right: 50%; top: auto; bottom: -18px; transform: translateX(50%); border: 8px solid transparent; border-top: 10px solid var(--h-orange); }
}

/* Study-site map */
.r-map { height: 440px; border-radius: var(--radius-sm); border: 1px solid var(--h-line); margin-top: 24px; z-index: 0; }
.r-map-legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; font-size: 0.9rem; color: var(--h-ink-soft); }
.r-map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* RE-AIM dashboard */
.r-reaim { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.r-reaim li { background: #fff; border-radius: var(--radius-sm); padding: 20px; border-top: 6px solid var(--h-orange); }
.r-reaim b { display: block; font: 800 2rem/1 var(--h-display); color: var(--h-orange-text); }
.r-reaim h3 { font: 700 1.05rem/1.2 var(--h-display); color: var(--h-navy); margin: 8px 0 6px; }
.r-reaim p { font-size: 0.88rem; color: var(--h-ink-soft); margin: 0 0 10px; }
.r-reaim .r-pending { font-size: 0.85rem; }
@media (max-width: 960px) { .r-reaim { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .r-reaim { grid-template-columns: 1fr; } }

/* Publications list */
.r-pubs { list-style: none; padding: 0; margin: 24px 0 0; }
.r-pubs li { display: grid; grid-template-columns: 140px 1fr auto; gap: 16px; align-items: center; padding: 18px 0; border-top: 1px solid var(--h-line); }
.r-pubs li:last-child { border-bottom: 1px solid var(--h-line); }
.r-pubs h3 { font: 700 1.05rem/1.35 var(--h-display); color: var(--h-navy); margin: 0; }
@media (max-width: 700px) { .r-pubs li { grid-template-columns: 1fr; gap: 6px; } }
