/* ==========================================================================
   Long/Short Terminal - blog + devlog
   Rides landing.css design tokens (loaded first). Institutional research-note
   look: editorial article measure, mono metadata, functional-green accents.
   Zero grey text (white / near-white only). Dark scrollbars inherited.
   ========================================================================== */

.blog-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 46px) var(--gutter) 40px;
}
.blog-wrap.wide { max-width: var(--maxw); }

/* ---- Shared post metadata row ------------------------------------------- */
.post-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; color: var(--data);
  letter-spacing: 0.02em;
}
.post-meta time { color: var(--data); }
.post-dot { color: var(--line-2); }
.post-cat {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius);
  border: 1px solid var(--line-2);
}
.post-cat--up { color: var(--up-lbl); border-color: rgba(77,179,128,0.4); background: rgba(42,122,77,0.12); }
.post-cat--neutral { color: var(--head); background: var(--bg-1); }

/* ---- Ticker badges (deterministic, from the trade bundle) --------------- */
.tkr-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tkr-badge {
  display: inline-block;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; padding: 2px 8px; border-radius: var(--radius);
  border: 1px solid rgba(74,158,255,0.5); color: #4a9eff;
  background: rgba(74,158,255,0.1); white-space: nowrap;
  cursor: pointer; transition: color 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}
a.tkr-badge { text-decoration: none; }
.tkr-badge:hover { color: #8ec8ff; border-color: #8ec8ff; background: rgba(74,158,255,0.18); }

/* ---- Index ticker filter bar -------------------------------------------- */
.tkr-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 24px; }
.tkr-chip {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 12px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line-2); color: var(--head); background: var(--bg-1);
  transition: color 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}
.tkr-chip:hover { color: var(--up-br); border-color: var(--up-br); }
.tkr-chip.active { color: var(--up-lbl); border-color: rgba(77,179,128,0.5); background: rgba(42,122,77,0.14); }

/* ---- Trade arc (deterministic follow-up links between bundle members) ---- */
.trade-arc {
  margin: 40px 0 8px; padding: 22px 22px 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1);
}
.arc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.arc-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--up-lbl);
}
.arc-name { font-family: var(--mono); font-size: 13px; color: var(--head); }
.arc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.arc-step { border-top: 1px solid var(--line); }
.arc-step:first-child { border-top: none; }
.arc-step a {
  display: grid; grid-template-columns: 120px 1fr auto; align-items: baseline;
  gap: 12px; padding: 12px 4px; text-decoration: none; border: none;
  transition: background 160ms var(--ease);
}
.arc-step a:hover { background: rgba(77,179,128,0.06); }
.arc-role { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--up-lbl); }
.arc-step--current .arc-role { color: var(--data); }
.arc-title { color: var(--head); font-size: 0.99rem; line-height: 1.35; }
.arc-step a:hover .arc-title { color: var(--up-br); }
.arc-when { font-family: var(--mono); font-size: 11.5px; color: var(--data); white-space: nowrap; }
.arc-step--current { display: grid; grid-template-columns: 120px 1fr auto; align-items: baseline; gap: 12px; padding: 12px 4px; }
@media (max-width: 560px) {
  .arc-step a, .arc-step--current { grid-template-columns: 1fr; gap: 3px; }
  .arc-when { grid-column: 1; }
}

/* ---- Article header ----------------------------------------------------- */
.post-back { margin: 0 0 26px; font-family: var(--mono); font-size: 12.5px; }
.post-back a { color: var(--up-lbl); transition: color 160ms var(--ease); }
.post-back a:hover { color: var(--up-br); }
.post-head { margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
.post-title {
  font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.06;
  font-weight: 740; letter-spacing: -0.032em; color: var(--head);
  margin: 16px 0 14px;
}
.post-desc { font-size: clamp(1.05rem, 1.5vw, 1.24rem); color: var(--body); line-height: 1.5; max-width: 62ch; }
.post-byline {
  display: flex; align-items: center; gap: 13px; margin-top: 20px;
  font-family: var(--mono); font-size: 13px; color: var(--data);
}
.post-byline-who { display: inline-flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.post-byline-name { color: var(--data); }
.post-byline-role { color: var(--body); font-size: 12px; letter-spacing: 0.01em; }
.post-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #1a3d2c, #2a7a4d);
  color: #eafff3; font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
}
.post-avatar--img {
  padding: 0; background: #0e1a13; object-fit: cover; object-position: center top;
  border: 1.5px solid rgba(120,140,170,0.45);
}
.post-hero { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin: 0 0 34px; }

/* ---- Article body typography -------------------------------------------- */
.post-body { font-size: 1.06rem; line-height: 1.72; color: var(--body); }
.post-body > * + * { margin-top: 1.15em; }
.post-body h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.14; font-weight: 700;
  letter-spacing: -0.024em; color: var(--head);
  margin-top: 2.1em; padding-top: 0.6em; border-top: 1px solid var(--line);
}
.post-body h3 {
  font-size: 1.24rem; font-weight: 640; color: var(--head);
  letter-spacing: -0.016em; margin-top: 1.7em;
}
.post-body p { color: var(--body); }
.post-body strong { color: var(--data); font-weight: 640; }
.post-body em { color: var(--data); }
.post-body a { color: var(--up-lbl); text-decoration: none; border-bottom: 1px solid rgba(77,179,128,0.35); transition: color 160ms var(--ease), border-color 160ms var(--ease); }
.post-body a:hover { color: var(--up-br); border-bottom-color: var(--up-br); }
.post-body ul, .post-body ol { padding-left: 1.35em; color: var(--body); }
.post-body li { margin-top: 0.5em; }
.post-body li::marker { color: var(--up-lbl); }
.post-body blockquote {
  margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--up-br);
  color: var(--data); font-size: 1.14rem; line-height: 1.5; font-style: normal;
}
.post-body code {
  font-family: var(--mono); font-size: 0.9em; color: var(--data);
  background: var(--bg-2); padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line);
}
.post-body pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto;
}
.post-body pre code { background: none; border: none; padding: 0; color: var(--data); }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---- In-article data figures (embedded raw HTML in the markdown) -------- */
.fig {
  margin: 1.9em 0; padding: 20px 20px 16px; background: var(--bg-1);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.fig-cap {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em;
  color: var(--up-lbl); margin: 12px 0 0;
}
.fig-src { font-family: var(--mono); font-size: 11px; color: var(--data); margin-top: 4px; }

/* Interactive Lightweight-Charts container (refining articles) */
.lwchart {
  width: 100%; height: 300px; position: relative;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #08080c; overflow: hidden;
}
.lwchart.tall { height: 360px; }
.lw-legend {
  position: absolute; top: 9px; left: 12px; z-index: 4; pointer-events: none;
  font-family: var(--mono); font-size: 12px; color: var(--head);
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
  text-shadow: 0 1px 3px #000, 0 0 2px #000;
}
.lw-legend .lw-item { display: inline-flex; gap: 6px; align-items: baseline; }
.lw-legend .lw-v { color: var(--head); font-variant-numeric: tabular-nums; }
.lw-legend .lw-d { color: var(--up-lbl); font-size: 11px; }
/* Line-style swatches for the busier multi-line legends (EPS): solid vs dashed. */
.lw-legend .lw-sw {
  display: inline-block; width: 16px; height: 0;
  border-bottom-width: 2px; border-bottom-style: solid;
  vertical-align: middle; align-self: center;
}

/* Live platform demo embed (real dashboard slice, iframed into an article) */
.demo-embed {
  margin: 22px 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: #08080c; overflow: hidden;
}
.demo-embed-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: #0b0c11;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--up-lbl);
}
.demo-embed-bar .demo-embed-note {
  text-transform: none; letter-spacing: 0; color: var(--data); font-size: 12px;
}
.demo-frame {
  display: block; width: 100%; height: 460px; border: 0; background: #050507;
}
/* Full-page dashboard slices (e.g. the structures/payoff page) need their natural
   tall height so the chart, structure card and interactive payoff are all reachable
   without a nested scroll trap. */
.demo-frame.tall { height: 1500px; }
@media (max-width: 720px) { .demo-frame.tall { height: 1240px; } }

/* Selective break-out: let a single demo (e.g. the structures payoff, whose
   dashboard tables are unreadable at the 820px column width) run wider than the
   prose column while staying centered on the same axis. .blog-wrap is centered
   in the viewport (margin:0 auto), so 50% + translateX(-50%) re-centers the
   wider child on the page. Prose stays at the readable 820px. */
.demo-embed.breakout {
  width: min(1180px, 94vw);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}
@media (max-width: 720px) { .demo-embed.breakout { width: 100%; margin-left: 0; transform: none; } }

/* Stat row: a horizontal strip of headline numbers */
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; }
.stat {
  flex: 1 1 130px; min-width: 120px; padding: 14px 16px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.stat-v { font-family: var(--mono); font-size: 1.65rem; font-weight: 600; color: var(--head); letter-spacing: -0.02em; line-height: 1.1; }
.stat-v.up { color: var(--up-lbl); }
.stat-v.down { color: var(--down-br); }
.stat-l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--data); margin-top: 6px; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; margin-top: 4px; }
.data-table th, .data-table td { text-align: right; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.data-table th { color: var(--up-lbl); font-weight: 600; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; border-bottom-color: var(--line-2); }
.data-table td { color: var(--data); font-variant-numeric: tabular-nums; }
.data-table td:first-child, .data-table th:first-child { text-align: left; color: var(--body); }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.up { color: var(--up-lbl); }
.data-table td.down { color: var(--down-br); }
.data-table-wrap { overflow-x: auto; }

/* Pure-CSS mini bar chart (no JS): rows of labelled bars */
.barchart { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.bc-row { display: grid; grid-template-columns: 96px 1fr 62px; align-items: center; gap: 12px; }
.bc-lbl { font-family: var(--mono); font-size: 12px; color: var(--body); }
.bc-track { height: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.bc-fill { height: 100%; background: linear-gradient(90deg, #1a5e3c, var(--up-br)); }
.bc-val { font-family: var(--mono); font-size: 12px; color: var(--data); text-align: right; font-variant-numeric: tabular-nums; }

/* Update / editor callout */
.updbox {
  margin: 0 0 32px; padding: 16px 20px; border-radius: var(--radius);
  background: rgba(42,122,77,0.10); border: 1px solid rgba(77,179,128,0.35);
}
.updbox .updtag { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--up-lbl); }
.updbox p { color: var(--data); margin-top: 6px; }

/* Key-takeaway callout */
.keybox {
  margin: 1.9em 0; padding: 18px 22px; border-radius: var(--radius);
  background: var(--bg-1); border: 1px solid var(--line-2); border-left: 3px solid var(--up-br);
}
.keybox .keytag { display: block; font-family: var(--mono); font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em; color: var(--up-br); }
.keybox p { color: var(--data); margin-top: 6px; }

/* ---- Bull vs bear case: two-column verdict panel ------------------------
   Repeatable article element. Muted OLED green / red tints (mirrors .updbox
   green), near-white body text, accent-colored tags + bullet glyphs only.
   Collapses to a single column on narrow screens. */
.bullbear {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.9em 0;
}
.bb-col { padding: 15px 18px 17px; border-radius: var(--radius); border: 1px solid var(--line-2); }
.bb-col--bull { background: rgba(42,122,77,0.10); border-color: rgba(77,179,128,0.35); }
.bb-col--bear { background: rgba(138,51,51,0.11); border-color: rgba(207,106,106,0.38); }
.bb-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 13px; padding-bottom: 11px; border-bottom: 1px solid var(--line);
}
.bb-icon {
  flex-shrink: 0; width: 21px; height: 21px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; line-height: 1;
}
.bb-col--bull .bb-icon { color: #eafff3; background: rgba(77,179,128,0.20); border: 1px solid rgba(77,179,128,0.5); }
.bb-col--bear .bb-icon { color: #ffeaea; background: rgba(207,106,106,0.18); border: 1px solid rgba(207,106,106,0.5); }
.bb-tag {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.11em; text-transform: uppercase;
}
.bb-col--bull .bb-tag { color: var(--up-lbl); }
.bb-col--bear .bb-tag { color: #e39a9a; }
.bb-list { list-style: none; padding: 0; margin: 0; }
.bb-list li {
  position: relative; padding-left: 19px; margin: 0 0 11px;
  font-size: 0.97rem; line-height: 1.5; color: var(--body);
}
.bb-list li:last-child { margin-bottom: 0; }
.bb-list li::before {
  position: absolute; left: 0; top: 0; font-family: var(--mono); font-weight: 700; line-height: 1.55;
}
.bb-col--bull .bb-list li::before { content: "+"; color: var(--up-lbl); }
.bb-col--bear .bb-list li::before { content: "\2212"; color: #cf6a6a; }
.bb-list li strong { color: var(--data); font-weight: 640; }
@media (max-width: 640px) { .bullbear { grid-template-columns: 1fr; } }

/* ---- Article footer CTA ------------------------------------------------- */
.post-cta {
  margin-top: 46px; padding: 30px 28px; text-align: center;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.post-cta h3 { color: var(--head); font-size: 1.4rem; }
.post-cta p { color: var(--body); margin: 10px auto 20px; max-width: 52ch; }

/* ==========================================================================
   Index pages
   ========================================================================== */
.idx-head { margin-bottom: 40px; }
.idx-title { font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.04; font-weight: 750; letter-spacing: -0.034em; color: var(--head); margin: 6px 0 16px; }
.idx-intro { font-size: clamp(1.05rem, 1.5vw, 1.24rem); color: var(--body); max-width: 60ch; line-height: 1.55; }
.idx-empty { color: var(--data); font-family: var(--mono); }

/* Featured card (top post) */
.feat-card {
  display: block; margin-bottom: 30px; padding: 30px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg));
  border: 1px solid var(--line-2); border-radius: var(--radius);
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.feat-card:hover { border-color: var(--up-br); transform: translateY(-2px); }
.feat-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; font-weight: 720; color: var(--head); letter-spacing: -0.026em; margin: 14px 0 12px; }
.feat-desc { color: var(--body); font-size: 1.08rem; line-height: 1.5; max-width: 66ch; }
.feat-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-family: var(--mono); font-size: 13px; color: var(--up-lbl); }
.feat-more .arrow { transition: transform 200ms var(--ease); }
.feat-card:hover .feat-more .arrow { transform: translateX(4px); }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; padding: 22px 22px 20px;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}
.card:hover { border-color: var(--up-br); transform: translateY(-2px); }
.card-title { font-size: 1.24rem; line-height: 1.22; font-weight: 640; color: var(--head); letter-spacing: -0.016em; margin: 13px 0 9px; }
.card-desc { color: var(--body); font-size: 0.98rem; line-height: 1.5; flex: 1; }
.card-read { font-family: var(--mono); font-size: 11.5px; color: var(--data); margin-top: 16px; letter-spacing: 0.03em; }

@media (max-width: 640px) {
  .bc-row { grid-template-columns: 76px 1fr 54px; }
  .feat-card, .post-cta { padding: 22px 18px; }
}
