/* =============================================================================
 * cega-mark.css — LIVE styling for the CEGA evidence-grade badge + the
 * "Verifera Evidence Review" trust-mark on /supplements/<slug>/ pages.
 *
 * Self-contained port of the design-system contract in camden-medicals at
 * engineering/design-system/cega/{tokens.css,dials.css}. Only the token values
 * + dial/pip/low/mark/brand rules the live mu-plugin render uses are bundled
 * here, so the badge renders correctly even though the operator deploys ONLY
 * mu-plugins (not the theme). Token values are GENERATED from the vendored
 * platform-core canon (camden-foundation/lib/platform-core/src/Design/
 * tokens.enc.css) by bin/build_cega_mark_tokens.py — they move with the brand
 * pin and CANNOT drift (CI --check gate). Never hand-edit the generated block.
 *
 * LOAD-BEARING RULE (carried verbatim): honest-low (insufficient / mixed)
 * renders neutral grey-blue (--cm-low-*); RED is firewalled to the safety
 * shield and never appears on this grade surface. A low score must never read
 * as a product failure.
 * ============================================================================= */

:root {
  /* BEGIN GENERATED — build_cega_mark_tokens.py: canon values from the vendored
     platform-core src/Design (moves with the brand pin). Do NOT hand-edit. */
  /* Brand atoms */
  --cm-navy:            #061645;
  --cm-gold:            #FFB300;  /* fill/rule/mark ONLY — fails AA as text */
  --cm-gold-ink:        #6B4A00;  /* AA-safe gold-as-text on cream 5.2:1 */

  /* Neutral ground + ink */
  --cm-cream-deep:      #F3EDE3;
  --cm-paper:           #FFFFFF;
  --cm-ink:             #1D2433;
  --cm-ink-3:           #6B6B6B;
  --cm-rule:            #E8E3D9;

  /* Dial-1 evidence-blue ramp */
  --cm-ev-300:          #9DB6E0;  /* pip EMPTY */
  --cm-ev-500:          #3A62A8;  /* pip FILLED / icon */
  --cm-ev-700:          #21407A;  /* strong-tier text 8.1:1 */

  /* Honest-low neutral grey-blue (insufficient / mixed) — NEVER red */
  --cm-low-100:         #E1E5EA;
  --cm-low-500:         #5E6B7A;
  --cm-low-700:         #3E4855;

  /* Type */
  --cm-font-display:    'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --cm-font-body:       'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cm-fs-h1-editorial: 2.625rem;
  --cm-fs-body:         1rem;
  --cm-fs-caption:      0.8125rem;
  --cm-fs-meta:         0.78rem;
  --cm-track-meta:      0.06em;

  /* Space + radius */
  --cm-space-4:         4px;
  --cm-space-8:         8px;
  --cm-space-12:        12px;
  --cm-space-16:        16px;
  --cm-space-24:        24px;
  --cm-radius-label:    6px;
  --cm-radius-pill:     9999px;
  /* END GENERATED */

  /* Camden-local tokens — NO canon counterpart; hand-maintained. Source of truth:
     camden-medicals engineering/design-system/cega/tokens.local.css (veto-#2
     pending promote-to-canon vs delete). */
  --cm-ink-2:           #4A4A4A;
  --cm-rule-strong:     #CFC8BC;
}

/* ── Visually-hidden accessible text (sr-only clip pattern) ───────────────── */
.cega-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── DIAL-1 — evidence strength ───────────────────────────────────────────── */
.cega-dial {
  display: inline-flex;
  flex-direction: column;
  gap: var(--cm-space-4);
  font-family: var(--cm-font-body);
}
.cega-dial__label {
  font-size: var(--cm-fs-meta);
  font-weight: 500;
  font-variant: small-caps;
  letter-spacing: var(--cm-track-meta);
  text-transform: lowercase;
  color: var(--cm-ink-3);
  line-height: 1.4;
}
.cega-dial__value {
  font-family: var(--cm-font-body);
  font-size: var(--cm-fs-body);
  font-weight: 500;
  font-variant: small-caps;
  line-height: 1.3;
}
.cega-dial--evidence .cega-dial__value { color: var(--cm-ev-700); }
.cega-dial--evidence.cega-dial--strong   .cega-dial__value { color: var(--cm-ev-700); }
.cega-dial--evidence.cega-dial--moderate .cega-dial__value { color: var(--cm-ev-700); }
.cega-dial--evidence.cega-dial--limited  .cega-dial__value { color: var(--cm-ev-500); }
.cega-dial--evidence.cega-dial--insufficient .cega-dial__value { color: var(--cm-low-700); }
.cega-dial--evidence.cega-dial--mixed    .cega-dial__value { color: var(--cm-low-700); }
.cega--low .cega-dial--evidence .cega-dial__value,
.cega-dial--evidence.cega-dial--low .cega-dial__value { color: var(--cm-low-700); }

/* certainty pips — the visual is pips, NEVER a 0-100 number */
.cega-pips {
  display: inline-flex;
  align-items: center;
  gap: var(--cm-space-4);
  line-height: 1;
}
.cega-pip {
  display: inline-block;
  inline-size: 9px; block-size: 9px;
  border-radius: var(--cm-radius-pill);
}
.cega-pip--filled { background: var(--cm-ev-500); }
.cega-pip--empty  { background: var(--cm-ev-300); }
.cega--low .cega-pip--filled,
.cega-dial--insufficient .cega-pip--filled,
.cega-dial--mixed .cega-pip--filled { background: var(--cm-low-500); }
.cega--low .cega-pip--empty,
.cega-dial--insufficient .cega-pip--empty,
.cega-dial--mixed .cega-pip--empty { background: var(--cm-low-100); }

/* ── MARK CONTAINERS ──────────────────────────────────────────────────────── */
.cega-mark {
  display: flex;
  flex-direction: column;
  gap: var(--cm-space-12);
  font-family: var(--cm-font-body);
  color: var(--cm-ink);
}
.cega-mark--label {
  gap: var(--cm-space-16);
  padding: var(--cm-space-16) var(--cm-space-24);
  border: 1px solid var(--cm-rule);
  border-radius: var(--cm-radius-label);
  background: var(--cm-paper);
  max-inline-size: 34rem;
}
/* whole-mark suppression: render NO strength cell */
.cega-mark--suppressed .cega-dial--evidence,
.cega-mark--suppressed .cega-pips { display: none; }

.cega-mark__note {
  margin: 0;
  font-size: var(--cm-fs-caption);
  line-height: 1.5;
  color: var(--cm-ink-2);
}

/* ── VERIFERA EVIDENCE REVIEW MARK — page-top consumer trust-mark ─────────── */
.cega-mark--review {
  gap: var(--cm-space-12);
  border-color: var(--cm-rule-strong);
  border-top: 3px solid var(--cm-gold);   /* brand gold rule — fill use, AA-exempt */
  background: var(--cm-cream-deep);
  max-inline-size: 34rem;
}
.cega-brand {
  display: flex;
  flex-direction: column;
  gap: var(--cm-space-4);
  padding-bottom: var(--cm-space-8);
  border-bottom: 1px solid var(--cm-rule);
}
.cega-brand__wordmark {
  font-family: var(--cm-font-display);     /* Cormorant Garamond */
  font-weight: 500;
  font-size: var(--cm-fs-h1-editorial);
  line-height: 1.1;
  color: var(--cm-navy);                   /* 14.8:1 on cream-deep — AAA */
}
.cega-brand__tagline {
  font-family: var(--cm-font-body);        /* DM Sans */
  font-size: var(--cm-fs-caption);
  font-weight: 400;
  line-height: 1.4;
  color: var(--cm-ink-2);
}
/* honest-low review mark keeps the wordmark navy (brand chrome, not a claim) */
.cega-mark--review.cega--low .cega-brand__wordmark { color: var(--cm-navy); }

@media (prefers-reduced-motion: reduce) {
  .cega-mark *, .cega-dial * { transition: none !important; }
}
