/* TEA exhibit kit — one visual standard for every chart in the Energy Prosperity 2030 longform.
   Header, legend and source are real HTML (they wrap on phones); the plot is an SVG redrawn at
   the container's true width, so text stays at real size instead of shrinking with a viewBox. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  --cream: #fafaf7;
  --card: #ffffff;
  --ink: #1c1830;
  --sub: #6b6680;
  --muted: #9a937e;
  --grid: #e6e2d6;
  --rule: #e8e5da;
  --red: #c8553d;        /* fossil / cost / warning */
  --purple: #3f2a82;     /* incumbent system / primary series */
  --purple-alt: #6e4fce; /* secondary purple */
  --teal: #1e9e89;       /* electric / win / outcome */
  --teal-soft: #a8dccf;
  --tan: #ddd0b3;        /* neutral / remainder / missing */
  --tan-soft: #ece4d1;
  --amber: #d98b3a;      /* in-progress states only */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--cream); color: var(--ink); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: 'DM Mono', ui-monospace, monospace; }

.ex { padding: 28px 32px 22px; }
.ex-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.ex-kicker { font: 700 11.5px/1.3 'DM Mono', monospace; letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.ex-brand { font: 700 10px/1.3 'DM Mono', monospace; letter-spacing: .1em; color: var(--ink); white-space: nowrap; }
.ex-title { font-weight: 800; font-size: 25px; letter-spacing: -.02em; line-height: 1.2; margin: 8px 0 6px; text-wrap: balance; }
.ex-sub { font-size: 13.5px; line-height: 1.45; font-weight: 500; color: var(--sub); max-width: 68ch; }
.ex-body { margin-top: 18px; position: relative; }
.ex-plot { width: 100%; }
.ex-plot svg { display: block; overflow: visible; }

.ex-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 12px; color: var(--sub); }
.ex-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ex-legend i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.ex-legend i.line { height: 3px; border-radius: 2px; width: 16px; }
.ex-legend i.dash { height: 0; width: 16px; border-top: 2px dashed currentColor; border-radius: 0; background: none !important; }

.ex-note { font-size: 12.5px; line-height: 1.45; color: var(--sub); margin-top: 12px; }
.ex-source { font: 400 10.5px/1.5 'DM Mono', monospace; color: var(--muted); margin-top: 14px; }

/* Stat tiles (headline numbers) */
.ex-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ex-stat { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--purple); border-radius: 6px; padding: 14px 14px 12px; }
.ex-stat b { display: block; font: 500 26px/1.1 'DM Mono', monospace; letter-spacing: -.02em; }
.ex-stat strong { display: block; font-size: 13px; margin-top: 6px; }
.ex-stat small { display: block; font-size: 11.5px; color: var(--sub); margin-top: 2px; }

/* Controls for interactive exhibits */
.ex-tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--card); }
.ex-tabs button { font: 600 12.5px 'Plus Jakarta Sans', sans-serif; padding: 8px 14px; border: 0; background: none; color: var(--sub); cursor: pointer; }
.ex-tabs button + button { border-left: 1px solid var(--rule); }
.ex-tabs button[aria-pressed="true"], .ex-tabs button.on { background: var(--purple); color: #fff; }
.ex-btn { font: 600 12.5px 'Plus Jakarta Sans', sans-serif; padding: 8px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--card); color: var(--ink); cursor: pointer; }
.ex-btn.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Tooltip */
.ex-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.4; padding: 7px 9px; border-radius: 5px; opacity: 0; transition: opacity .12s; white-space: nowrap; z-index: 5; }
.ex-tip.show { opacity: 1; }

@media (max-width: 560px) {
  .ex { padding: 20px 16px 16px; }
  .ex-brand { display: none; }
  .ex-title { font-size: 20px; }
  .ex-sub { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
