/* ============================================
   TechTalkByte — video-detail.css
   Shared styles for all video detail pages
   ============================================ */

/* ---- BREADCRUMB ---- */
.breadcrumb-bar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin-top: 64px;
}
.breadcrumb-bar a {
  color: var(--text-muted); text-decoration: none; font-size: 0.83rem;
  transition: color 0.2s;
}
.breadcrumb-bar a:hover { color: var(--accent-2); }
.bc-sep { color: var(--text-dim); margin: 0 8px; font-size: 0.83rem; }
.breadcrumb-bar span:last-child { color: var(--text); font-size: 0.83rem; }

/* ---- ARTICLE HEADER ---- */
.article-header {
  padding: 56px 0 48px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.article-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 10% 50%, rgba(124,111,247,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.article-header .container { position: relative; z-index: 1; }

.article-meta-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.article-tag {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--accent); background: rgba(124,111,247,0.1);
  border: 1px solid rgba(124,111,247,0.2);
  padding: 4px 12px; border-radius: 4px;
}
.article-read-time { font-size: 0.82rem; color: var(--text-muted); }

.article-header h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 16px;
}
.article-subtitle {
  font-size: 1rem; color: var(--text-muted); max-width: 620px;
  line-height: 1.7; margin-bottom: 28px;
}
.article-ig-cta {
  display: flex; align-items: center; gap: 12px;
}
.ig-label { font-size: 0.85rem; color: var(--text-muted); }
.btn-sm { padding: 7px 16px; font-size: 0.82rem; }

/* ---- LAYOUT ---- */
.article-main { min-height: 100vh; }

.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 80px;
}

/* ---- TOC ---- */
.toc {
  position: sticky; top: 84px;
}
.toc-inner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.toc-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim);
  margin-bottom: 14px;
}
.toc ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block; font-size: 0.82rem; color: var(--text-muted);
  text-decoration: none; padding: 5px 8px; border-radius: 5px;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1.4;
}
.toc a:hover { color: var(--accent-2); background: rgba(124,111,247,0.07); border-left-color: var(--accent); }

/* ---- ARTICLE BODY ---- */
.article-body { min-width: 0; }

.article-body section {
  padding: 0;
  margin-bottom: 56px;
}
.article-body h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.article-body h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--accent-2);
  margin-top: 28px; margin-bottom: 10px;
}
.article-body p {
  font-size: 0.95rem; color: var(--text-muted);
  line-height: 1.85; margin-bottom: 14px;
}
.article-body p:last-child { margin-bottom: 0; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--bg-3); color: var(--accent-2);
  padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---- SPLIT HEADER (title left, embed right) ---- */
.article-header--split { padding: 48px 0; }

.article-header-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: center;
}

.article-header-left { display: flex; flex-direction: column; }

.article-key-points {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 24px;
}
.kp-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 14px;
}
.kp-icon { font-size: 1rem; flex-shrink: 0; }

/* Right column — embed / button */
.article-header-right { display: flex; justify-content: center; align-items: flex-start; }

/* ── Instagram Embed Component ── */
.ig-embed-component {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 16px;
}

/* "Watch on Instagram" button */
.ig-view-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: #fff; font-size: 0.9rem; font-weight: 600;
  border-radius: 10px; text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.ig-view-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* Mobile embed wrapper */
.ig-embed-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim);
  margin-bottom: 10px;
}
.ig-embed-wrap .instagram-media {
  border-radius: 12px !important;
  box-shadow: 0 0 0 1px var(--border), 0 12px 32px rgba(0,0,0,0.4) !important;
}

/* ── Legacy (keep for backward compat) ── */
.reel-embed-direct {
  width: 100%; max-width: 340px;
}
.reel-embed-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim);
  margin-bottom: 10px;
}
.reel-embed-direct .instagram-media {
  border-radius: 12px !important;
  box-shadow: 0 0 0 1px var(--border), 0 12px 32px rgba(0,0,0,0.4) !important;
}

@media (max-width: 860px) {
  .article-header-grid {
    grid-template-columns: 1fr;
  }
  .article-header-right {
    justify-content: flex-start;
  }
}

/* ---- REEL PREVIEW + MODAL (legacy, kept for other pages) ---- */
.article-reel-wrapper {
  margin-top: 28px;
}
.reel-label {
  font-size: 0.8rem; color: var(--text-dim);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.reel-label::before {
  content: '▶';
  color: var(--accent); font-size: 0.65rem;
}

/* The fake "paused video" card */
.reel-preview-card {
  position: relative;
  width: 320px;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  border: none;
  cursor: pointer;
  background: var(--bg-3);
  display: block;
  padding: 0;
  box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
.reel-preview-card:hover {
  transform: scale(1.015);
  box-shadow: 0 0 0 1px rgba(124,111,247,0.4), 0 20px 48px rgba(0,0,0,0.6);
}

/* Gradient content background — mimics a paused frame */
.reel-preview-bg {
  position: absolute; inset: 0;
  background: linear-gradient(
    160deg,
    #0d0d18 0%,
    #111130 40%,
    #0a1628 100%
  );
  display: flex; align-items: center; justify-content: center;
}
.reel-preview-lines {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px; width: 100%; z-index: 1;
}
.reel-preview-lines span {
  font-size: 0.78rem; font-weight: 500; color: rgba(255,255,255,0.55);
  font-family: var(--mono);
  line-height: 1.5;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  text-align: left;
}
.reel-preview-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(124,111,247,0.15) 0%, transparent 70%);
}

/* Big play button in center */
.reel-play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 62px; height: 62px;
  background: rgba(124,111,247,0.9);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 8px rgba(124,111,247,0.2);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  z-index: 2;
}
.reel-play-btn svg { width: 26px; height: 26px; margin-left: 4px; }
.reel-preview-card:hover .reel-play-btn {
  background: var(--accent);
  box-shadow: 0 0 0 12px rgba(124,111,247,0.15);
  transform: translate(-50%, -50%) scale(1.08);
}

/* Bottom bar (like a video player HUD) */
.reel-preview-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  z-index: 2;
}
.reel-preview-bar-left {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.7); font-size: 0.75rem; font-weight: 600;
}
.reel-preview-bar-right {
  font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.5);
  letter-spacing: 0.03em;
}

/* ---- MODAL LIGHTBOX ---- */
.reel-modal {
  position: fixed; inset: 0; z-index: 999;
  display: none; align-items: center; justify-content: center;
}
.reel-modal.is-open { display: flex; }

.reel-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reel-modal-box {
  position: relative; z-index: 1;
  animation: scaleIn 0.22s ease;
  display: flex; flex-direction: column; align-items: center;
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

.reel-modal-close {
  position: absolute; top: -44px; right: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  transition: background 0.2s;
}
.reel-modal-close:hover { background: rgba(255,255,255,0.18); }
.reel-modal-close svg { width: 16px; height: 16px; }

.reel-modal-embed {
  width: min(400px, 90vw);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  background: #fff;
}

/* ---- FLOW STEPS ---- */
.flow-steps { display: flex; flex-direction: column; gap: 0; margin: 24px 0; }
.flow-step {
  display: flex; gap: 16px; position: relative;
}
.flow-step:not(:last-child)::after {
  content: '';
  position: absolute; left: 19px; top: 44px;
  width: 2px; height: calc(100% - 12px);
  background: var(--border);
}
.flow-step-num {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(124,111,247,0.12);
  border: 1px solid rgba(124,111,247,0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; color: var(--accent-2);
  margin-top: 2px; position: relative; z-index: 1;
}
.flow-step-body { padding-bottom: 28px; flex: 1; }
.flow-step-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.flow-step-desc { font-size: 0.87rem; color: var(--text-muted); line-height: 1.7; }

/* ---- DIAGRAM ---- */
.diagram-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 20px 0;
}
.diagram-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-dim);
  background: var(--bg-3); border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.diagram {
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--text-muted); line-height: 1.8;
  padding: 20px; margin: 0;
  overflow-x: auto; white-space: pre;
}

/* ---- CODE BLOCK ---- */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-family: var(--mono); font-size: 0.82rem;
  color: var(--text-muted); line-height: 1.8;
  overflow-x: auto;
  margin: 16px 0;
}
.code-block code { background: none; color: inherit; padding: 0; border: none; font-size: inherit; }
.hl-comment { color: var(--text-dim); }
.hl-keyword { color: var(--accent-2); }
.hl-string  { color: var(--green); }
.hl-number  { color: var(--yellow); }

/* ---- CALLOUT ---- */
.callout {
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.88rem; line-height: 1.7;
  border-left: 3px solid;
}
.callout strong { display: block; margin-bottom: 4px; }
.callout-info {
  background: rgba(124,111,247,0.07);
  border-color: var(--accent);
  color: var(--text-muted);
}
.callout-info strong { color: var(--accent-2); }
.callout-warning {
  background: rgba(251,191,36,0.06);
  border-color: var(--yellow);
  color: var(--text-muted);
}
.callout-warning strong { color: var(--yellow); }
.callout-success {
  background: rgba(52,211,153,0.06);
  border-color: var(--green);
  color: var(--text-muted);
}
.callout-success strong { color: var(--green); }

/* ---- COMPARISON TABLE ---- */
.comparison-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 20px 0; font-size: 0.87rem;
}
.ct-header, .ct-row {
  display: grid; grid-template-columns: 1fr 1.2fr 1.2fr;
}
.ct-header { background: var(--bg-3); font-weight: 600; color: var(--text); }
.ct-header span, .ct-row span { padding: 11px 14px; border-right: 1px solid var(--border); }
.ct-header span:last-child, .ct-row span:last-child { border-right: none; }
.ct-row { border-top: 1px solid var(--border); }
.ct-row:nth-child(even) { background: rgba(255,255,255,0.01); }
.ct-row span:first-child { color: var(--text-muted); }
.ct-row span:not(:first-child) { color: var(--text); }

/* ---- TOOLS GRID ---- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 20px 0; }
.tool-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  transition: border-color 0.2s;
}
.tool-card:hover { border-color: var(--border-hover); }
.tool-name { font-weight: 700; font-size: 0.9rem; color: var(--accent-2); margin-bottom: 6px; }
.tool-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* ---- TAKEAWAYS ---- */
.takeaways-box {
  background: linear-gradient(135deg, rgba(124,111,247,0.08), rgba(167,139,250,0.04));
  border: 1px solid rgba(124,111,247,0.25);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 8px;
}
.takeaways-title {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent);
  margin-bottom: 16px;
}
.takeaways-box ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.takeaways-box li {
  font-size: 0.9rem; color: var(--text-muted); line-height: 1.6;
  padding-left: 20px; position: relative;
}
.takeaways-box li::before {
  content: '→';
  position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}
.takeaways-box code { font-size: 0.82em; }

/* ---- RELATED ---- */
.related-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-section h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-muted); margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.related-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.related-title { font-size: 0.88rem; font-weight: 600; color: var(--text); line-height: 1.4; }

/* ---- SAGA TIMELINE ---- */
.saga-timeline { display: flex; flex-direction: column; gap: 0; margin: 24px 0; }
.saga-step {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 0; position: relative;
}
.saga-step:not(:last-child)::after {
  content: ''; position: absolute;
  left: 59px; top: 44px;
  width: 2px; height: calc(100% - 12px);
  background: var(--border); z-index: 0;
}
.saga-left {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 4px; padding-bottom: 28px; position: relative; z-index: 1;
}
.saga-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700;
  border: 2px solid;
  background: var(--bg);
}
.saga-dot.debit   { border-color: var(--accent);  color: var(--accent); }
.saga-dot.credit  { border-color: var(--green);   color: var(--green); }
.saga-dot.rollback{ border-color: var(--red);     color: var(--red); }
.saga-dot.settle  { border-color: var(--yellow);  color: var(--yellow); }
.saga-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-dim);
  margin-top: 6px; text-align: center;
}
.saga-body { padding-bottom: 28px; padding-top: 6px; }
.saga-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.saga-desc { font-size: 0.86rem; color: var(--text-muted); line-height: 1.7; }

/* ---- STAT PILLS ---- */
.stat-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.stat-pill {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.pill-num { font-size: 1.3rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.pill-label { font-size: 0.75rem; color: var(--text-muted); }

/* ---- LANGUAGE TABS ---- */
.lang-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.lang-tab {
  padding: 8px 18px;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.lang-tab:hover { color: var(--text); }
.lang-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.lang-panel { margin-top: 0; }

.code-explain {
  background: rgba(124,111,247,0.05);
  border: 1px solid rgba(124,111,247,0.15);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 12px 16px;
  font-size: 0.83rem; color: var(--text-muted); line-height: 1.7;
}
.code-explain strong { color: var(--accent-2); }
.code-explain .lang-panel > .code-block { border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 0; }

.lang-panel > .code-block {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  margin-top: 0;
  border-top: none;
}

/* ---- CIRCUIT BREAKER STATES ---- */
.cb-states { display: flex; flex-direction: column; gap: 0; margin: 24px 0; }

.cb-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0;
}
.cb-state-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.cb-state-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.cb-state--closed .cb-state-dot  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.cb-state--open .cb-state-dot    { background: var(--red);   box-shadow: 0 0 8px var(--red); }
.cb-state--halfopen .cb-state-dot { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }

.cb-state--closed  { border-color: rgba(52,211,153,0.2); background: rgba(52,211,153,0.03); }
.cb-state--open    { border-color: rgba(248,113,113,0.2); background: rgba(248,113,113,0.03); }
.cb-state--halfopen{ border-color: rgba(251,191,36,0.2);  background: rgba(251,191,36,0.03); }

.cb-state--closed  .cb-state-header { background: rgba(52,211,153,0.06); }
.cb-state--open    .cb-state-header  { background: rgba(248,113,113,0.06); }
.cb-state--halfopen .cb-state-header { background: rgba(251,191,36,0.06); }

.cb-state-name {
  font-size: 0.95rem; font-weight: 800; letter-spacing: 0.04em;
}
.cb-state--closed  .cb-state-name  { color: var(--green); }
.cb-state--open    .cb-state-name  { color: var(--red); }
.cb-state--halfopen .cb-state-name { color: var(--yellow); }

.cb-state-sub { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

.cb-state-body { padding: 16px 18px; }
.cb-state-body p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }
.cb-state-body p:last-child { margin-bottom: 0; }
.cb-state-body strong { color: var(--text); }

.cb-state-arrow {
  text-align: center; color: var(--text-dim);
  font-size: 0.78rem; font-weight: 600; font-family: var(--mono);
  padding: 10px 0;
}

/* ---- RESPONSIVE — TABLET ---- */
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; padding-top: 32px; }
  .toc { position: static; }

  /* Split header stacks on tablet */
  .article-header-grid { grid-template-columns: 1fr; gap: 32px; }
  .article-header-right { justify-content: flex-start; }
}

/* ---- RESPONSIVE — MOBILE ---- */
@media (max-width: 640px) {
  .article-header { padding: 28px 0 24px; }
  .article-header--split { padding: 28px 0; }
  .article-header h1,
  .article-header-left h1 { font-size: 1.55rem; line-height: 1.2; }
  .article-subtitle { font-size: 0.9rem; }

  /* TOC hidden on mobile — inline scroll */
  .toc { display: none; }

  /* Article body padding */
  .article-body section { margin-bottom: 40px; }
  .article-body h2 { font-size: 1.25rem; }
  .article-body h3 { font-size: 1rem; }
  .article-body p { font-size: 0.9rem; }

  /* Code blocks scroll horizontally */
  .code-block { font-size: 0.75rem; padding: 14px; }
  .diagram { font-size: 0.72rem; padding: 14px; }

  /* Comparison table — hide first column */
  .ct-header span:first-child,
  .ct-row span:first-child { display: none; }
  .ct-header, .ct-row { grid-template-columns: 1fr 1fr; }

  /* Flow steps */
  .flow-step-num { width: 32px; height: 32px; font-size: 0.78rem; }

  /* Reel embed full width on mobile */
  .reel-embed-direct { max-width: 100%; }

  /* Key points */
  .article-key-points { gap: 8px; }
  .kp-item { font-size: 0.83rem; padding: 8px 12px; }

  /* Related grid — 1 col */
  .related-grid { grid-template-columns: 1fr; }

  /* SAGA timeline */
  .saga-step { grid-template-columns: 80px 1fr; }
  .saga-step:not(:last-child)::after { left: 39px; }

  /* Tools grid — 2 col */
  .tools-grid { grid-template-columns: 1fr 1fr; }

  /* Stat pills — wrap */
  .stat-pills { gap: 8px; }
  .stat-pill { padding: 10px 14px; }
  .pill-num { font-size: 1.1rem; }

  /* CB states */
  .cb-state-sub { display: none; }

  /* Takeaways */
  .takeaways-box { padding: 20px; }
}
