/* ---------------------------------------------------------------------------
   embed.css — shared chrome for every Linkenite infographic embed.
   Each embed is a standalone page loaded in an iframe inside a blog post, so
   this file is the whole design system for that page. Per-infographic styles
   live in the embed's own <style> block, namespaced.

   Brand tokens are read from the live linkenite.com stylesheet — do not invent
   values, and do not restyle per post.
--------------------------------------------------------------------------- */

:root {
  --ink:            #0c2236;  /* body / primary text */
  --heading:        #333333;
  --accent:         #00caca;  /* dominant data colour */
  --accent-2:       #0265ce;  /* secondary series */
  --accent-3:       #006dda;
  --support:        #751d9f;  /* fourth series, use sparingly */
  --muted:          #758696;  /* labels, gridlines */
  --muted-2:        #757095;
  --surface:        #ffffff;
  --surface-tint:   #f7f9fc;
  --surface-tint-2: #eaf1f8;
  --border:         #e2e8f0;

  --font-heading: "Montserrat", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-body:    "Open Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;

  --radius: 16px;
  --dur: 900ms;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* The page IS the card — the iframe supplies no chrome of its own. */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: transparent;   /* inherits the post's background */
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.embed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(12, 34, 54, .07);
  padding: 28px;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.embed-eyebrow {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.embed-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 2px 0 0;
  text-wrap: balance;
}

.embed-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 4px 0 0;
  max-width: 62ch;
}

.embed-chart { margin-top: 20px; }

/* Source line — every embed carrying data must name where the data came from. */
.embed-source {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 18px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.embed-source a { color: var(--accent-3); }

/* ---- animation contract -------------------------------------------------
   embed.js adds .is-animated to .embed-card when it scrolls into view.
   Every per-infographic transition hangs off that class. Content must be
   LEGIBLE before it fires: animate transform/opacity of decoration and the
   size of bars, never the presence of the numbers themselves.
------------------------------------------------------------------------- */
.embed-card .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.embed-card.is-animated .reveal { opacity: 1; transform: none; }

.embed-card .reveal:nth-child(2) { transition-delay: 60ms; }
.embed-card .reveal:nth-child(3) { transition-delay: 120ms; }
.embed-card .reveal:nth-child(4) { transition-delay: 180ms; }

/* Numbers in columns line up. */
.tabular { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .embed-card { padding: 20px; border-radius: 12px; }
  .embed-title { font-size: 17px; }
}

/* No-JS and reduced-motion both land on the finished state, not a blank card. */
@media (prefers-reduced-motion: reduce) {
  .embed-card .reveal { opacity: 1; transform: none; transition: none; }
}
.no-js .embed-card .reveal { opacity: 1; transform: none; }
