﻿/* ─────────────────────────────────────
   Episodio 02 — estilos locales
   Cargado después de shared/tokens.css + shared/components.css.
   Solo contiene estilos exclusivos de este episodio.
   ───────────────────────────────────── */

/* ─────────────────────────────────────
   ep02 — overrides locales
   El hero del ep02 NO usa collage de imágenes. Lo sustituye un panel
   tipográfico con KPIs grandes — política Núcleo: máx. 2 imágenes raster
   por episodio cuando sean suficientemente ilustrativas.
   ───────────────────────────────────── */
.hero-stats {
  margin-top: 4rem;
  display: grid;
  gap: 1px;
  background: var(--mist-2);
  border: 1px solid var(--mist-2);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .hero-stats { grid-template-columns: repeat(4, 1fr); } }

.hero-stat {
  background: var(--paper);
  padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 8.5rem;
}
.hero-stat .stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--graphite);
}
.hero-stat .stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.hero-stat .stat-foot {
  font-size: 0.85rem;
  color: var(--graphite);
  margin-top: auto;
}

/* ─────────────────────────────────────
   responses donut
   ───────────────────────────────────── */
.responses-wrap {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 820px) { .responses-wrap { grid-template-columns: 1fr 1fr; } }

.responses-svg { width: 100%; max-width: 360px; margin: 0 auto; }
.responses-svg .arc { transition: transform 240ms var(--ease-spring), opacity 240ms; transform-origin: center; cursor: pointer; }
.responses-svg .arc:hover { transform: scale(1.04); }
.responses-svg .arc.dim { opacity: 0.35; }
.responses-svg .center-num {
  font-family: var(--font-display); font-weight: 600;
  font-size: 64px; fill: var(--ink); text-anchor: middle; dominant-baseline: central;
  font-variant-numeric: tabular-nums lining-nums;
}
.responses-svg .center-label {
  font-family: var(--font-mono); font-size: 11px; fill: var(--graphite);
  letter-spacing: 0.08em; text-anchor: middle; text-transform: uppercase;
}

.responses-legend { list-style: none; display: flex; flex-direction: column; gap: 0.85rem; }
.responses-legend li {
  display: grid; grid-template-columns: 14px auto 1fr auto; gap: 0.85rem; align-items: baseline;
  padding: 0.65rem 0; border-top: 1px solid var(--mist-2);
  cursor: pointer; transition: background 160ms;
}
.responses-legend li:hover { background: color-mix(in oklab, var(--bone) 50%, transparent); }
.responses-legend li:last-child { border-bottom: 1px solid var(--mist-2); }
.responses-legend .swatch {
  width: 12px; height: 12px; border-radius: 2px; align-self: center;
}
.responses-legend .code {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink); font-weight: 500;
}
.responses-legend .desc { color: var(--graphite); font-size: 0.92rem; }
.responses-legend .count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink); }

/* ─────────────────────────────────────
   timeline comparator (ex vivo vs in vivo)
   ───────────────────────────────────── */
.compare-toggle {
  display: inline-flex; padding: 4px; background: var(--bone);
  border-radius: 999px; gap: 4px; margin: 0 0 2rem;
}
.compare-toggle button {
  font-family: var(--font-mono); font-size: 0.78rem;
  background: transparent; border: 0; color: var(--graphite);
  padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: background 220ms, color 220ms;
}
.compare-toggle button[aria-pressed="true"] {
  background: var(--ink); color: var(--paper);
}

.compare-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) { .compare-grid { grid-template-columns: 1fr 1fr; gap: 3rem; } }

.compare-col h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.4rem; margin-bottom: 0.25rem;
}
.compare-col .compare-sub {
  font-family: var(--font-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--graphite); margin-bottom: 1.5rem;
}
.compare-track {
  position: relative; padding-left: 1.25rem;
  border-left: 2px solid var(--mist-2);
  display: flex; flex-direction: column; gap: 0.9rem;
}
.compare-step {
  position: relative; padding: 0.85rem 1rem;
  background: var(--paper); border: 1px solid var(--mist-2);
  transition: border-color 240ms, transform 240ms;
}
.compare-step::before {
  content: ""; position: absolute; left: -1.6rem; top: 1.25rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink); border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--mist-2);
}
.compare-col.in-vivo .compare-step::before { background: var(--signal); }
.compare-step .step-num {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--graphite); letter-spacing: 0.08em;
}
.compare-step .step-title {
  font-weight: 600; margin: 0.15rem 0 0.25rem;
}
.compare-step .step-time {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--ink-2);
}
.compare-step.collapsed { opacity: 0.45; transform: scale(0.985); }

.compare-total {
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--mist-2);
  display: flex; justify-content: space-between; align-items: baseline;
}
.compare-total .label {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--graphite); letter-spacing: 0.08em; text-transform: uppercase;
}
.compare-total .value {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.6rem; letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums lining-nums;
}
.compare-col.in-vivo .compare-total .value { color: var(--signal); }

/* ─────────────────────────────────────
   expansion curve
   ───────────────────────────────────── */
.curve-wrap { background: var(--paper); border: 1px solid var(--mist-2); padding: clamp(1rem, 3vw, 2rem); }
.curve-svg { width: 100%; height: auto; }
.curve-svg .axis-line, .curve-svg .grid-line { stroke: var(--mist-2); stroke-width: 1; }
.curve-svg .axis-text {
  font-family: var(--font-mono); font-size: 11px; fill: var(--graphite);
}
.curve-svg .curve-path {
  fill: none; stroke: var(--signal); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px color-mix(in oklab, var(--signal) 40%, transparent));
}
.curve-svg .curve-band { fill: var(--signal-soft); opacity: 0.45; }
.curve-svg .marker-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.55; }
.curve-svg .marker-dot { fill: var(--ink); }
.curve-svg .marker-label {
  font-family: var(--font-mono); font-size: 11px; fill: var(--ink);
  letter-spacing: 0.04em;
}
.curve-svg .marker-label.peak { fill: var(--signal); font-weight: 500; }

/* ─────────────────────────────────────
   adverse events table
   ───────────────────────────────────── */
.ae-wrap { overflow-x: auto; }
.ae-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-sans);
}
.ae-table th, .ae-table td {
  padding: 0.85rem 1rem; text-align: left;
  border-bottom: 1px solid var(--mist-2);
  font-size: 0.95rem;
}
.ae-table thead th {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--graphite); font-weight: 500;
  border-bottom: 1.5px solid var(--ink);
}
.ae-table tbody tr { transition: background 160ms; }
.ae-table tbody tr:hover { background: color-mix(in oklab, var(--bone) 60%, transparent); }
.ae-table .ae-cat { font-weight: 500; }
.ae-table .ae-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  position: relative;
}
.ae-table .ae-bar {
  display: inline-block; vertical-align: middle;
  height: 8px; background: var(--bone);
  border-radius: 4px; overflow: hidden; width: 80px; margin-left: 0.5rem;
}
.ae-table .ae-bar > span {
  display: block; height: 100%;
  background: var(--ink); transition: width 600ms var(--ease-spring);
}
.ae-table .ae-cell.high .ae-bar > span { background: var(--signal); }
.ae-table .ae-note {
  font-size: 0.85rem; color: var(--graphite);
  padding: 1rem; background: color-mix(in oklab, var(--bone) 60%, transparent);
  border-left: 2px solid var(--signal); margin-top: 1rem;
}

/* ─────────────────────────────────────
   world map
   ───────────────────────────────────── */
.map-toggle { margin-bottom: 1.25rem; }
.map-wrap {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--mist-2);
  padding: 0.5rem;
  overflow: hidden;
}
/* Inline simplemaps base — recolor the country paths via .land */
.map-base { position: relative; line-height: 0; }
.map-base svg { width: 100%; height: auto; display: block; }
.map-base .land {
  fill: var(--bone);
  stroke: var(--paper);
  stroke-width: 0.6;
  transition: fill 600ms ease;
}
.map-wrap[data-mode="potential"] .map-base .land {
  fill: var(--signal-soft);
  transition: fill 1800ms cubic-bezier(.4, 0, .2, 1);
  transition-delay: 1500ms;
}
.map-wrap[data-mode="conv"] .map-base .land {
  fill: var(--bone);
  transition: fill 600ms ease;
}
.map-stack { position: relative; line-height: 0; }
.map-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.map-overlay .center-dot {
  fill: var(--ink); fill-opacity: 0.92;
  transition: r 420ms var(--ease-spring), fill 360ms;
  pointer-events: auto;
  cursor: pointer;
}
.map-overlay a { cursor: pointer; }
.map-overlay a:hover .center-dot,
.map-overlay a:focus .center-dot { fill: var(--signal); }
.map-overlay .center-dot.potential {
  fill: var(--signal);
  fill-opacity: 0.85;
  pointer-events: none;
}
.map-overlay .center-dot.potential.phase-3 {
  fill-opacity: 0.55;
}
.map-fallback { padding: 2rem; text-align: center; color: var(--graphite); font-family: var(--font-mono); font-size: 0.8rem; }
.map-credits {
  margin-top: 0.75rem;
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--graphite); line-height: 1.6;
}
.map-credits a { color: var(--graphite); text-decoration: underline; text-decoration-color: var(--mist-2); }
.map-credits a:hover { color: var(--ink); text-decoration-color: var(--signal); }
.map-tooltip {
  position: absolute; pointer-events: none;
  background: var(--ink); color: var(--paper);
  padding: 0.45rem 0.7rem;
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.04em;
  transform: translate(-50%, -110%);
  opacity: 0; transition: opacity 160ms;
  white-space: nowrap;
}
.map-tooltip.show { opacity: 1; }
.map-legend {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1rem; font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--graphite);
}
.map-legend .key { display: inline-flex; align-items: center; gap: 0.5rem; }
.map-legend .key .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ─────────────────────────────────────
   sources block
   ───────────────────────────────────── */
.sources-list {
  list-style: none; display: flex; flex-direction: column; gap: 1rem;
}
.sources-list li { padding: 1rem 0; border-top: 1px solid var(--mist-2); }
.sources-list li:last-child { border-bottom: 1px solid var(--mist-2); }
.sources-list .src-num {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--signal); letter-spacing: 0.06em;
}
.sources-list .src-cite { font-size: 0.95rem; line-height: 1.5; margin-top: 0.25rem; }
.sources-list .src-cite a { font-family: var(--font-mono); font-size: 0.85rem; }
