/* Bradshaw Charts — component styles. Theme tokens live on .bc-root. */
.bc-root {
  --bc-ink: #242424;
  --bc-ink-muted: #5c5456;
  --bc-paper: #fcf6f8;
  --bc-raised: #ffffff;
  --bc-rule: rgba(36, 36, 36, 0.12);
  --bc-accent: #e52555;
  --bc-accent-deep: #bf1741;
  --bc-accent-soft: #ea5278;
  --bc-teal: #2fd0ce;
  --bc-teal-deep: #1a9a98;
  --bc-teal-soft: #7ee6e4;
  --bc-font-display: "Big Shoulders Display", Impact, sans-serif;
  --bc-font-label: Inter, system-ui, sans-serif;
  --bc-font-caption: "Source Serif 4", Georgia, serif;
  --bc-radius: 14px;
  color: var(--bc-ink);
  font-family: var(--bc-font-label);
  font-size: 16px;
  line-height: 1.45;
  background: var(--bc-paper);
}

.bc-root *,
.bc-root *::before,
.bc-root *::after { box-sizing: border-box; }

.bc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bc-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  min-width: 8rem;
  max-width: 18rem;
  padding: 0.55rem 0.7rem 0.6rem;
  background: #FFFFFF;
  color: #242424;
  border: 1px solid rgba(36, 36, 36, 0.14);
  border-radius: 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.35;
  opacity: 0;
  transform: none;
  transition: opacity 0.12s ease;
  box-shadow: 0 6px 18px rgba(36, 36, 36, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.bc-tooltip.is-on { opacity: 1; }
.bc-tooltip strong { display: block; font-weight: 500; color: #242424; }
.bc-tooltip em {
  display: block;
  font-style: normal;
  font-family: "Big Shoulders Display", Impact, sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin-top: 0.1rem;
  color: #242424;
}

/* ----- Story shell ----- */
.bc-mode-story {
  background: var(--bc-paper);
  color: var(--bc-ink);
}
.bc-story-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100svh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 3.25rem 1.25rem 10.5rem;
  overflow: hidden;
}
.bc-story-intro {
  text-align: center;
  flex: 0 0 auto;
  max-width: 44rem;
  margin: 0 auto 0.4rem;
}
.bc-kicker {
  margin: 0;
  font-family: var(--bc-font-label);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bc-accent);
}
.bc-title {
  margin: 0.15rem 0 0;
  font-family: var(--bc-font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 4.2vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.bc-headline-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
  min-height: 2.4rem;
}
.bc-headline {
  font-family: var(--bc-font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--bc-accent);
}
.bc-headline-label {
  font-family: var(--bc-font-caption);
  font-size: 0.95rem;
  color: var(--bc-ink-muted);
  font-style: italic;
  max-width: 22rem;
  text-align: left;
}

.bc-chart {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.bc-chart-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
  overflow: hidden;
}
.bc-chart-stage svg,
.bc-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.bc-legend {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  padding: 0.35rem 0 0.15rem;
  font-size: 0.78rem;
  color: var(--bc-ink-muted);
}
.bc-legend:empty { display: none; }
.bc-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: default;
}
.bc-swatch i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}
.bc-progress {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.45rem 0 0;
}
.bc-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(36, 36, 36, 0.22);
  cursor: pointer;
}
.bc-dot[aria-current="true"] { background: var(--bc-accent); }
.bc-dot:focus-visible { outline: 2px solid var(--bc-accent); outline-offset: 2px; }

.bc-story-steps {
  position: relative;
  z-index: 3;
  margin-top: -9.5rem;
  padding: 0 1rem 20vh;
  display: flex;
  flex-direction: column;
  gap: 70vh;
  pointer-events: none;
}
.bc-story-step {
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.bc-card {
  pointer-events: auto;
  width: min(34rem, calc(100% - 0.5rem));
  margin: 0 auto;
  padding: 1rem 1.15rem 1.05rem;
  background: rgba(252, 246, 248, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--bc-rule);
  border-radius: var(--bc-radius);
  box-shadow: 0 10px 30px rgba(36, 36, 36, 0.06);
}
.bc-card .bc-kicker { font-size: 0.68rem; }
.bc-card h3 {
  margin: 0.15rem 0 0.35rem;
  font-family: var(--bc-font-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.bc-card p {
  margin: 0;
  font-family: var(--bc-font-caption);
  font-size: 1.02rem;
  color: var(--bc-ink);
}
.bc-story-end {
  max-width: 36rem;
  margin: 2rem auto 0;
  padding: 0 1.25rem 15vh;
  text-align: center;
  font-size: 0.82rem;
  color: var(--bc-ink-muted);
}
.bc-story-end a { color: var(--bc-ink); }
.bc-source, .bc-credit {
  margin: 0.25rem 0 0;
}

/* ----- Embed shell ----- */
.bc-mode-embed {
  background: var(--bc-paper);
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 18px;
}
.bc-embed-head { margin-bottom: 0.6rem; }
.bc-mode-embed .bc-chart { min-height: 22rem; height: 28rem; }
.bc-mode-embed .bc-chart-stage { min-height: 20rem; }
.bc-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--bc-ink-muted);
}
.bc-btn {
  font-family: var(--bc-font-label);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--bc-rule);
  background: var(--bc-raised);
  color: var(--bc-ink);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}
.bc-btn:hover { border-color: var(--bc-ink); }
.bc-btn:focus-visible { outline: 2px solid var(--bc-accent); outline-offset: 2px; }
.bc-year {
  font-family: var(--bc-font-display);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--bc-ink);
  line-height: 1;
}

/* ----- Tickers ----- */
.bc-tickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.1rem 1.4rem;
  align-items: start;
  align-content: center;
  height: 100%;
  padding: 0.5rem 0.25rem;
}
.bc-ticker {
  text-align: left;
}
.bc-ticker .bc-kicker { margin-bottom: 0.15rem; }
.bc-ticker-value {
  font-family: var(--bc-font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--bc-accent);
}
.bc-ticker-label {
  margin: 0.35rem 0 0;
  font-family: var(--bc-font-caption);
  font-size: 0.98rem;
  color: var(--bc-ink);
}

/* SVG typography */
.bc-svg text, .bc-chart-stage text {
  font-family: var(--bc-font-label);
}
.bc-svg text:not([fill]), .bc-chart-stage text:not([fill]) {
  fill: var(--bc-ink);
}
.bc-svg .bc-axis, .bc-axis {
  font-size: 11px;
  fill: var(--bc-ink-muted);
}
.bc-svg .bc-label, .bc-label { font-size: 12px; font-weight: 500; }
.bc-svg .bc-value, .bc-value {
  font-family: var(--bc-font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
}

@media (max-width: 720px) {
  .bc-story-sticky {
    padding: 3.1rem 0.7rem 12.5rem;
  }
  .bc-story-intro { text-align: left; max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
  .bc-headline-row { justify-content: flex-start; align-items: flex-start; flex-direction: column; flex-wrap: nowrap; gap: 0.1rem; }
  .bc-headline-label { max-width: none; font-size: 0.9rem; line-height: 1.35; }
  .bc-story-steps { margin-top: -11.5rem; gap: 80vh; }
  .bc-story-step { min-height: 80vh; align-items: flex-end; }
  .bc-card { padding: 0.9rem 0.95rem; }
  .bc-mode-embed .bc-chart { height: 22rem; }
  .bc-tickers { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .bc-tooltip { transition: none; }
}

.bc-root[data-shot="1"] .bc-story-sticky { position: relative; }


/* Canvas marks (unit story and dense point charts) */
.bc-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

/* Sortable table chart */
.bc-table-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: var(--bc-raised);
  border: 1px solid var(--bc-rule);
  border-radius: 12px;
}
.bc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.bc-table th,
.bc-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bc-rule);
  white-space: nowrap;
}
.bc-table th {
  position: sticky;
  top: 0;
  background: var(--bc-paper);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--bc-ink-muted);
  z-index: 1;
}
.bc-table th button {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.bc-table th button:hover,
.bc-table th button:focus-visible { color: var(--bc-accent); }
.bc-table th[aria-sort="ascending"] button::after { content: " ↑"; color: var(--bc-accent); }
.bc-table th[aria-sort="descending"] button::after { content: " ↓"; color: var(--bc-accent); }
.bc-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bc-table th.num { text-align: right; }
.bc-table tbody tr:hover { background: rgba(229, 37, 85, 0.05); }

/* Draw-the-line quiz */
.bc-quiz-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}
.bc-quiz-bar .bc-btn { font-family: var(--bc-font-label); }
.bc-quiz-score {
  font-family: var(--bc-font-display);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}
