/* ── Histórico Abril Seúl con zoom 2026 ─────────────────────────────────
 * Editorial/data widget. Replica la paleta de jesus-orderbook (mismo
 * post) para coherencia visual. Sin gradientes en texto, sin neón.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-page:     #0E1118;
  --bg-panel:    #131820;
  --bg-soft:     #161C26;
  --hairline:    #232A36;
  --hairline-soft: #1A2029;
  --text:        #B5BAC4;
  --text-strong: #E8EAEE;
  --text-muted:  #6E7480;
  --text-faint:  #4A5060;
  --accent:      #6B9EBB;
  --accent-soft: rgba(107, 158, 187, 0.12);
  --accent-rgb:  107, 158, 187;
  --warn:        #C7555A;
  --motion-ease: cubic-bezier(0.165, 0.84, 0.44, 1);
}

[data-theme="light"] {
  --bg-page:     #f4e9da;
  --bg-panel:    #ede3d6;
  --bg-soft:     #e3d6c2;
  --hairline:    #c4b598;
  --hairline-soft: #d4c4b0;
  --text:        #5a4a3d;
  --text-strong: #2b2218;
  --text-muted:  #8a7060;
  --text-faint:  #a89080;
  --accent:      #2b5d73;
  --accent-soft: rgba(43, 93, 115, 0.10);
  --accent-rgb:  43, 93, 115;
  --warn:        #9a3f43;
}

html, body {
  width: 100%;
  background: var(--bg-page);
  color: var(--text);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  min-height: 100vh;
}

html.embedded body { padding: 0; min-height: auto; }
html.embedded .panel { padding: 16px 18px 12px; }

.zoom-fig {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 22px 24px 26px;
  position: relative;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────── */
.zoom-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline-soft);
  margin-bottom: 22px;
}
.zoom-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  color: var(--text-strong);
  letter-spacing: 0.005em;
}
.zoom-sub {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ── Year chart ───────────────────────────────────────── */
.year-section {
  position: relative;
}

.year-chart {
  position: relative;
  height: 152px; /* 132 bars + 20 breathing for 2026 label */
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  align-items: end;
  gap: 0;
  /* sin padding horizontal para alinear exactamente con .cone-wrap y
   * .day-section — la geometría del cono depende de que los tres compartan
   * el mismo ancho de contenido. */
}

.year-bar-cell {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.year-bar {
  width: 24px;
  max-width: 100%;
  background: var(--text-faint);
  border-radius: 1.5px 1.5px 0 0;
  position: relative;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 320ms var(--motion-ease);
  will-change: transform;
}
.year-bar.bar-2026 {
  background: var(--accent);
}
.year-bar.bar-above {
  /* sutil distinción para los que cruzan el umbral, sin gritar */
  background: var(--text-muted);
}
.in-view .year-bar { transform: scaleY(1); }

/* threshold + mean lines */
.ref-line {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  border-top: 1px dashed var(--accent);
  opacity: 0.55;
}
.ref-line[data-kind="mean"] {
  border-top-style: dotted;
  border-top-color: var(--text-faint);
  opacity: 0.7;
}
.ref-line .ref-label {
  position: absolute;
  right: 0;
  top: -7px;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-panel);
  padding: 0 5px;
  font-variant-numeric: tabular-nums;
}
.ref-line[data-kind="mean"] .ref-label {
  color: var(--text-faint);
}

/* value label sobre 2026 — posicionado en el cell, no en el bar
 * (para evitar que el transform: scaleY del bar lo distorsione). */
.year-value-label {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -3px);
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--motion-ease) 280ms;
}
.in-view .year-value-label { opacity: 1; }

/* axis */
.year-axis {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  margin-top: 8px;
}
.year-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.year-label.is-current {
  color: var(--accent);
  font-weight: 500;
}

/* ── Cone (spotlight) ────────────────────────────────── */
.cone-wrap {
  position: relative;
  height: 64px;
  margin: 4px 0 0;
  pointer-events: none;
}
.cone-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* ── Day chart ───────────────────────────────────────── */
.day-section {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 6px;
  padding: 16px 18px 18px;
  margin-top: -1px; /* fundir con la base del cono */
}
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.day-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  color: var(--text-strong);
}
.day-meta {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.day-ghost-line {
  border-top: 1px dashed var(--accent);
  opacity: 0.35;
  margin: 0 0 10px;
  padding-top: 4px;
  text-align: right;
}
.day-ghost-line span {
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-style: normal;
}

.day-chart {
  position: relative;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  align-items: end;
  gap: 3px;
}

.day-cell {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.day-bar {
  width: 100%;
  max-width: 14px;
  background: var(--accent);
  opacity: 0.55;
  border-radius: 1px 1px 0 0;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 220ms var(--motion-ease), opacity 220ms ease;
  min-height: 1.5px;
}
.day-bar.is-future {
  background: var(--text-faint);
  opacity: 0.18;
}
.day-bar.is-peak {
  opacity: 1;
  background: var(--accent);
  filter: brightness(1.15);
}
.in-view .day-bar { transform: scaleY(1); }

.day-peak-label {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -4px);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--motion-ease) 700ms;
}
.in-view .day-peak-label { opacity: 1; }

.day-axis {
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  margin-top: 8px;
  gap: 3px;
}
.day-num {
  font-size: 8.5px;
  color: var(--text-faint);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.day-num.is-milestone {
  color: var(--text-muted);
}

/* ── Figcaption ──────────────────────────────────────── */
.zoom-figcaption {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
  letter-spacing: 0.005em;
  font-variant-numeric: tabular-nums;
}
.zoom-figcaption strong {
  color: var(--accent);
  font-weight: 500;
}
.zoom-figcaption em {
  font-style: italic;
  opacity: 0.75;
  display: block;
  margin-top: 4px;
  font-size: 10px;
}

/* ── Visually hidden table for SR ────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .year-bar,
  .day-bar,
  .year-value-label,
  .day-peak-label {
    transition: opacity 250ms ease;
    transform: scaleY(1) !important;
  }
  .year-bar,
  .day-bar { opacity: 0; }
  .in-view .year-bar { opacity: 1; }
  .in-view .day-bar { opacity: 0.55; }
  .in-view .day-bar.is-future { opacity: 0.18; }
  .in-view .day-bar.is-peak { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  body { padding: 16px 8px; }
  .panel { padding: 18px 14px 20px; }
  .zoom-title { font-size: 16px; }
  .year-bar { width: 16px; }
  .year-chart { height: 132px; }
  .year-label { font-size: 8.5px; }
  .day-section { padding: 12px 12px 14px; }
  .day-chart { gap: 1.5px; height: 64px; }
  .day-axis { gap: 1.5px; }
  .day-bar { max-width: 9px; }
  .day-num { font-size: 7px; }
  .cone-wrap { height: 48px; }
  .zoom-figcaption { font-size: 10px; }
}

@media (max-width: 420px) {
  .day-num:not(.is-milestone) { color: transparent; } /* hide labels except milestones */
}
