/* ==========================================================================
   Blog: index cards and the interactive charts in posts (assets/js/blogchart.js).
   Series colors match the compound interest page: Nasdaq-100 is orange.
   ========================================================================== */

.blog-hub .blog-date { font-size: 0.75rem; color: var(--rc-text-muted); font-variant-numeric: tabular-nums; }

.bc {
  --bc-ink: #0f172a;
  --bc-muted: #64748b;
  --bc-grid: #e9edf2;
  --bc-axis: #cbd5e1;
  --bc-surface: #ffffff;
  --bc-panel: #f8fafc;
  --bc-border: #e2e8f0;
  --bc-s1: #eb6834;
  --bc-s2: #6250d6;
  --bc-pt: #2a78d6;
  --bc-accent: #2563eb;
  position: relative;
  margin: 1.4rem 0 1.6rem;
  color: var(--bc-ink);
  font-size: 0.85rem;
}
html[data-theme="dark"] .bc {
  --bc-ink: #e2e8f0;
  --bc-muted: #94a3b8;
  --bc-grid: #2b3a4e;
  --bc-axis: #475569;
  --bc-surface: #1e293b;
  --bc-panel: #0f172a;
  --bc-border: #334155;
  --bc-s1: #d95926;
  --bc-s2: #9085e9;
  --bc-pt: #3987e5;
  --bc-accent: #60a5fa;
}

.bc-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.5rem; }
.bc-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-bottom: 0.5rem; }
.bc-seg { display: inline-flex; border: 1px solid var(--bc-border); border-radius: 8px; overflow: hidden; }
.bc-seg button { font: inherit; font-size: 0.8rem; padding: 0.3rem 0.75rem; border: 0; background: var(--bc-surface); color: var(--bc-muted); cursor: pointer; }
.bc-seg button + button { border-left: 1px solid var(--bc-border); }
.bc-seg button[aria-pressed="true"] { background: var(--bc-panel); color: var(--bc-ink); font-weight: 600; }
.bc-seg button:focus-visible { outline: 2px solid var(--bc-accent); outline-offset: -2px; }
.bc-legend { display: flex; flex-wrap: wrap; gap: 0.9rem; color: var(--bc-muted); font-size: 0.8rem; }
.bc-key { display: inline-flex; align-items: center; gap: 0.35rem; }
.bc-key i { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: currentColor; }
.bc-key.bc-s1 i { background: var(--bc-s1); }
.bc-key.bc-s2 i { background: var(--bc-s2); }

.bc-box { position: relative; }
.bc svg { display: block; max-width: 100%; height: auto; overflow: visible; font-family: inherit; }
.bc-grid line { stroke: var(--bc-grid); stroke-width: 1; }
.bc-grid line.bc-zero { stroke: var(--bc-axis); stroke-dasharray: 4 3; }
.bc-axis text { fill: var(--bc-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.bc-axis line { stroke: var(--bc-axis); }
.bc-axis .bc-base { stroke: var(--bc-axis); }
.bc-axis .bc-glab { fill: var(--bc-ink); font-size: 12px; font-weight: 600; }
.bc-axis .bc-gsub { font-size: 11px; }
.bc .bc-ref { stroke: var(--bc-axis); stroke-dasharray: 2 3; }
.bc-series path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bc-series .bc-s1 { stroke: var(--bc-s1); }
.bc-series .bc-s2 { stroke: var(--bc-s2); }
.bc .bc-dot { stroke: var(--bc-surface); stroke-width: 2; }
.bc .bc-dot.bc-s1 { fill: var(--bc-s1); }
.bc .bc-dot.bc-s2 { fill: var(--bc-s2); }
.bc .bc-note { fill: var(--bc-ink); font-size: 11px; }
.bc .bc-end { fill: var(--bc-ink); font-size: 12px; font-weight: 600; }
.bc .bc-end-v { fill: var(--bc-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.bc-hover line { stroke: var(--bc-muted); stroke-width: 1; }
.bc .bc-hit, .bc .bc-hitm { fill: transparent; cursor: crosshair; }
.bc .bc-hitm { cursor: default; }

.bc .bc-pt { fill: var(--bc-pt); fill-opacity: 0.55; stroke: var(--bc-surface); stroke-width: 1; cursor: default; }
.bc .bc-pt.is-on { fill-opacity: 1; stroke: var(--bc-ink); }
.bc .bc-mean { stroke: var(--bc-ink); stroke-width: 3; stroke-linecap: round; }
.bc .bc-ci { stroke: var(--bc-ink); stroke-width: 1.5; }

.bc-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 9rem; padding: 0.4rem 0.6rem; border: 1px solid var(--bc-border); border-radius: 8px; background: var(--bc-surface); color: var(--bc-ink); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12); font-size: 0.78rem; line-height: 1.45; }
.bc-tip b { display: block; font-weight: 600; margin-bottom: 0.1rem; }
.bc-tip .bc-row { display: flex; align-items: center; gap: 0.4rem; color: var(--bc-muted); }
.bc-tip .bc-row i { width: 10px; height: 2px; background: currentColor; }
.bc-tip .bc-row.bc-s1 i { background: var(--bc-s1); }
.bc-tip .bc-row.bc-s2 i { background: var(--bc-s2); }
.bc-tip .bc-row em { margin-left: auto; padding-left: 0.8rem; font-style: normal; color: var(--bc-ink); font-variant-numeric: tabular-nums; font-weight: 600; }

.bc-table { margin-top: 0.5rem; font-size: 0.8rem; }
.bc-table summary { cursor: pointer; color: var(--bc-muted); }
.bc-table > div { max-height: 22rem; overflow: auto; margin-top: 0.4rem; }
.bc-table table { width: 100%; border-collapse: collapse; display: table; font-size: 0.78rem; }
.bc-table th, .bc-table td { padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--bc-border); text-align: left; }
.bc-table th { color: var(--bc-muted); font-weight: 600; position: sticky; top: 0; background: var(--bc-surface); }
.bc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bc-err { color: var(--bc-muted); font-style: italic; }

.blog-note { margin-top: 2rem; padding-top: 0.6rem; border-top: 1px solid var(--bc-border, #e2e8f0); font-size: 0.8rem; color: #64748b; }
html[data-theme="dark"] .blog-note { color: #94a3b8; border-top-color: #334155; }

/* Blog index: research notes list */
.resources-container .nl-count { font-size: 0.8rem; font-weight: 400; color: var(--rc-text-muted); margin-left: 0.3rem; }
.resources-container .nl-lead { font-size: 0.9rem; color: var(--rc-text-muted); margin: 0.6rem 0 0.4rem; }
.blog-subscribe { font-size: 0.9rem; }
.nl-controls { display: grid; gap: 0.6rem; margin: 0.6rem 0 0.8rem; }
.nl-search { font: inherit; font-size: 0.9rem; padding: 0.4rem 0.7rem; border: 1px solid var(--rc-border); border-radius: 8px; background: var(--rc-card-bg); color: var(--rc-text-main); max-width: 24rem; width: 100%; }
.nl-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.nl-chips button { font: inherit; font-size: 0.75rem; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--rc-border); background: var(--rc-card-bg); color: var(--rc-text-muted); cursor: pointer; }
.nl-chips button span { opacity: 0.7; margin-left: 0.15rem; font-variant-numeric: tabular-nums; }
.nl-chips button[aria-pressed="true"] { border-color: var(--rc-accent); color: var(--rc-text-main); background: var(--rc-subcard-bg); font-weight: 600; }
.nl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rc-border); }
.nl-list li { padding: 0.55rem 0.1rem; border-bottom: 1px solid var(--rc-border-subtle, var(--rc-border)); margin: 0; }
.nl-list li a { font-weight: 600; font-size: 0.95rem; }
.nl-list li .nl-topic { margin-left: 0.5rem; font-size: 0.7rem; color: var(--rc-text-muted); white-space: nowrap; }
.nl-list li p { margin: 0.15rem 0 0; font-size: 0.82rem; color: var(--rc-text-muted); }
.nl-empty { color: var(--rc-text-muted); font-style: italic; }

/* Research note pages */
.note-meta { font-size: 0.8rem; color: #64748b; margin-bottom: 1rem; }
html[data-theme="dark"] .note-meta { color: #94a3b8; }
.note-fig { margin: 1.2rem 0 1.6rem; }
.note-fig img { display: block; max-width: 100%; height: auto; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
html[data-theme="dark"] .note-fig img { border-color: #334155; }
.note-fig figcaption { font-size: 0.8rem; color: #64748b; margin-top: 0.35rem; }
html[data-theme="dark"] .note-fig figcaption { color: #94a3b8; }

/* Blog section tabs: Finance / Trading / Security */
.blog-tabs { display: flex; flex-wrap: wrap; gap: 0.2rem; border-bottom: 1px solid var(--rc-border); margin: 1rem 0 0.4rem; }
.blog-tabs button { font: inherit; font-size: 0.92rem; padding: 0.45rem 0.9rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--rc-text-muted); cursor: pointer; }
.blog-tabs button span { font-size: 0.75rem; opacity: 0.75; margin-left: 0.2rem; font-variant-numeric: tabular-nums; }
.blog-tabs button[aria-selected="true"] { color: var(--rc-text-main); border-bottom-color: var(--rc-accent); font-weight: 600; }
.blog-tabs button:focus-visible { outline: 2px solid var(--rc-accent); outline-offset: 2px; }
.blog-empty { color: var(--rc-text-muted); margin-top: 1.2rem; }
.resources-container [hidden] { display: none !important; }

/* Generic line and bar charts: fixed categorical order (same hues as the compound interest page) */
.bc { --bc-c0: #94a3b8; --bc-c1: #2a78d6; --bc-c2: #eb6834; --bc-c3: #1baf7a; --bc-c4: #eda100; --bc-c5: #e87ba4; --bc-c6: #008300; --bc-c7: #6250d6; --bc-c8: #e34948; --bc-band: rgba(148, 163, 184, 0.16); }
html[data-theme="dark"] .bc { --bc-c0: #64748b; --bc-c1: #3987e5; --bc-c2: #d95926; --bc-c3: #199e70; --bc-c4: #c98500; --bc-c5: #d55181; --bc-c6: #0ca30c; --bc-c7: #9085e9; --bc-c8: #e66767; --bc-band: rgba(148, 163, 184, 0.12); }
.bc-series .bc-c0 { stroke: var(--bc-c0); } .bc-series .bc-c1 { stroke: var(--bc-c1); } .bc-series .bc-c2 { stroke: var(--bc-c2); } .bc-series .bc-c3 { stroke: var(--bc-c3); } .bc-series .bc-c4 { stroke: var(--bc-c4); }
.bc-series .bc-c5 { stroke: var(--bc-c5); } .bc-series .bc-c6 { stroke: var(--bc-c6); } .bc-series .bc-c7 { stroke: var(--bc-c7); } .bc-series .bc-c8 { stroke: var(--bc-c8); }
.bc .bc-dot.bc-c0, .bc .bc-bar.bc-c0 { fill: var(--bc-c0); } .bc .bc-dot.bc-c1, .bc .bc-bar.bc-c1 { fill: var(--bc-c1); } .bc .bc-dot.bc-c2, .bc .bc-bar.bc-c2 { fill: var(--bc-c2); }
.bc .bc-dot.bc-c3, .bc .bc-bar.bc-c3 { fill: var(--bc-c3); } .bc .bc-dot.bc-c4, .bc .bc-bar.bc-c4 { fill: var(--bc-c4); } .bc .bc-dot.bc-c5, .bc .bc-bar.bc-c5 { fill: var(--bc-c5); }
.bc .bc-dot.bc-c6, .bc .bc-bar.bc-c6 { fill: var(--bc-c6); } .bc .bc-dot.bc-c7, .bc .bc-bar.bc-c7 { fill: var(--bc-c7); } .bc .bc-dot.bc-c8, .bc .bc-bar.bc-c8 { fill: var(--bc-c8); }
.bc-key.bc-c0 i { background: var(--bc-c0); } .bc-key.bc-c1 i { background: var(--bc-c1); } .bc-key.bc-c2 i { background: var(--bc-c2); } .bc-key.bc-c3 i { background: var(--bc-c3); } .bc-key.bc-c4 i { background: var(--bc-c4); }
.bc-key.bc-c5 i { background: var(--bc-c5); } .bc-key.bc-c6 i { background: var(--bc-c6); } .bc-key.bc-c7 i { background: var(--bc-c7); } .bc-key.bc-c8 i { background: var(--bc-c8); }
.bc-tip .bc-row.bc-c0 i { background: var(--bc-c0); } .bc-tip .bc-row.bc-c1 i { background: var(--bc-c1); } .bc-tip .bc-row.bc-c2 i { background: var(--bc-c2); } .bc-tip .bc-row.bc-c3 i { background: var(--bc-c3); } .bc-tip .bc-row.bc-c4 i { background: var(--bc-c4); }
.bc-tip .bc-row.bc-c5 i { background: var(--bc-c5); } .bc-tip .bc-row.bc-c6 i { background: var(--bc-c6); } .bc-tip .bc-row.bc-c7 i { background: var(--bc-c7); } .bc-tip .bc-row.bc-c8 i { background: var(--bc-c8); }
.bc .bc-legend { margin-bottom: 0.4rem; }
.bc .bc-band { fill: var(--bc-band); }
.bc .bc-bar { stroke: var(--bc-surface); stroke-width: 1; }
.bc .bc-bar:hover { opacity: 0.85; }
.bc .bc-err { stroke: var(--bc-ink); stroke-width: 1.5; }
.bc .bc-vlab { fill: var(--bc-ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.bc-axis .bc-clab { fill: var(--bc-ink); font-size: 11.5px; }
.bc-axis .bc-xlab { font-size: 11px; }
.bc-table .bc-ci-t { color: var(--bc-muted); }
