/* ═══════════════════════════════════════════
   DESIGN TOKENS — mirrors new_index.css
   (self-contained, overrides base.css vars)
═══════════════════════════════════════════ */
@font-face { font-family:'Inter'; font-style:normal; font-weight:100 900; font-display:swap;
  src:url('/fonts/Inter-var.woff2') format('woff2'),
       url('/fonts/Inter-var.ttf') format('truetype'); }
:root {
  /* Light enterprise scheme: cool slate neutrals + periwinkle accent (matches new_index.css). */
  --bg:       oklch(0.99  0.004 255);
  --bg2:      oklch(0.955 0.007 255);
  --bg3:      oklch(0.930 0.008 255);
  --line:     oklch(0.875 0.008 255);
  --text:     oklch(0.14  0.012 250);
  --text-dim: oklch(0.46  0.010 250);
  --text-sub: oklch(0.52  0.010 250);
  --accent:   oklch(0.40  0.10  273);          /* periwinkle peri-700 ≈ #404e8c (was green) */
  --accent-l: oklch(0.40  0.10  273 / 0.09);
  --f-serif:  var(--f-sans);   /* unified: Inter everywhere (was Georgia serif) */
  --f-sans:   'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono:   ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --pad:      max(24px, 5vw);
}
/* Dark = neutral surfaces + smoke periwinkle (matches the tools/homepage chrome). theme.js
   sets data-theme on <html>; the @media keeps zero-JS auto-dark but yields to a forced light. */
:root[data-theme="dark"] {
  --bg:       #16171a;
  --bg2:      #1d1f23;
  --bg3:      #25282e;
  --line:     #2c2f36;
  --text:     #e7e8ec;
  --text-dim: #9aa0aa;
  --text-sub: #8c929c;
  --accent:   #9aa9d2;
  --accent-l: rgba(154,169,210,.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:       #16171a;
    --bg2:      #1d1f23;
    --bg3:      #25282e;
    --line:     #2c2f36;
    --text:     #e7e8ec;
    --text-dim: #9aa0aa;
    --text-sub: #8c929c;
    --accent:   #9aa9d2;
    --accent-l: rgba(154,169,210,.14);
  }
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Skip link — visible only on keyboard focus (WCAG 2.4.1 Bypass Blocks) */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--bg);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-size: 14px; font-weight: 500;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; background: none; border: none; color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }
.lang-dropdown__item.is-active {
  color: var(--accent);
  background: var(--accent-l);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   BLOG SHELL & LAYOUT
═══════════════════════════════════════════ */
.blog-shell {
  padding-top: 60px;
  min-height: 100vh;
}

.blog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* ═══════════════════════════════════════════
   BLOG HERO
═══════════════════════════════════════════ */
.blog-hero {
  padding: 56px var(--pad) 44px;
  border-bottom: 1px solid var(--line);
}

.blog-hero h1 {
  font-family: var(--f-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 14px;
}

.blog-hero > p {
  font-size: 15px;
  color: var(--text-dim);
  font-weight: 300;
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 28px;
}

/* ═══════════════════════════════════════════
   FEED VIEW SWITCH
═══════════════════════════════════════════ */
.feed-switch {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--bg2);
  margin-bottom: 0;
}
.feed-switch__btn {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-sub);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.feed-switch__btn + .feed-switch__btn {
  border-left: 1px solid var(--line);
}
.feed-switch__btn:hover { color: var(--text); }
.feed-switch__btn.is-active {
  color: var(--accent);
  background: var(--accent-l);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   FEED FILTER BAR
═══════════════════════════════════════════ */
.feed-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--pad);
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.feed-filter[hidden] { display: none; }
.feed-filter__summary { color: var(--text-dim); font-weight: 300; }
.feed-filter__clear { color: var(--accent); font-size: 12px; }
.feed-filter__clear:hover { text-decoration: underline; }

/* Header language switcher reuses the shared .lang-switcher / .lang-menu styles
   from /tools/theme.css (details/summary), same as every other page on the site. */

/* ═══════════════════════════════════════════
   BLOG FEED
═══════════════════════════════════════════ */
.blog-feed { border-bottom: 1px solid var(--line); }

.status {
  padding: 20px var(--pad);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 300;
  border-bottom: 1px solid var(--line);
}

.news-grid { display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════
   POST CARD
═══════════════════════════════════════════ */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px var(--pad);
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background 0.15s;
}
.post-card:last-child { border-bottom: none; }
.post-card:hover { background: var(--bg2); }
.post-card.is-clickable { cursor: pointer; }
.post-card.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.post-card--highlight { background: var(--accent-l); }

/* ─── Post header ─── */
.post-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.post-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--accent-l);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.post-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.post-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.post-author-line {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 5px;
}
.post-author { font-size: 13px; font-weight: 600; color: var(--text); }
.post-handle,
.post-separator,
.post-meta { font-size: 12px; color: var(--text-sub); }
.post-submeta { font-size: 11px; color: var(--text-sub); letter-spacing: 0.03em; }

.post-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--accent-l);
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ─── Post image ─── */
.post-image {
  width: 100%;
  height: clamp(180px, 38vw, 400px);
  object-fit: cover;
  border: 1px solid var(--line);
}

/* ─── Post title ─── */
.post-title {
  font-family: var(--f-serif);
  font-size: clamp(18px, 2.8vw, 22px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
}

/* ─── Post text ─── */
.post-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-dim);
  font-weight: 300;
  white-space: pre-line;
}
.post-text--article { color: var(--text-sub); }
.post-text a { color: var(--accent); }
.post-text-preview,
.post-text-rest { white-space: pre-line; }
.post-text-details { display: block; margin-top: 10px; }
.post-text-details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.03em;
  list-style: none;
}
.post-text-details > summary::-webkit-details-marker { display: none; }
.post-text-details[open] > summary { display: none; }
.post-text-details[open] .post-text-rest { display: block; margin-top: 8px; }

/* ─── Link preview ─── */
.post-link-preview {
  display: block;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: background 0.15s, border-color 0.15s;
}
.post-link-preview:hover { background: var(--bg3); border-color: var(--accent); }
.post-link-preview img {
  width: 100%; height: 200px; object-fit: cover;
  display: block; border-bottom: 1px solid var(--line);
}
.post-link-meta { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.post-link-meta strong { font-size: 14px; font-weight: 500; color: var(--text); }
.post-link-meta span { font-size: 12px; color: var(--text-sub); }

/* ─── Post actions ─── */
.post-actions {
  display: flex; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.post-action {
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-sub);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.post-action:hover { border-color: var(--accent); color: var(--text); }
.post-action--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.post-action--primary:hover { opacity: 0.85; color: var(--bg); }

/* ─── Post tags ─── */
.post-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.post-tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 11px;
  letter-spacing: 0.03em;
  transition: border-color 0.15s, color 0.15s;
}
.post-tag:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Code in feed ─── */
code {
  font-family: var(--f-mono);
  font-size: 0.88em;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
}
pre {
  margin: 10px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--bg3);
  overflow-x: auto;
}
pre code { display: block; padding: 0; border: none; background: transparent; }

/* ═══════════════════════════════════════════
   LOAD MORE
═══════════════════════════════════════════ */
.load-more {
  display: flex; justify-content: center;
  padding: 28px var(--pad);
}
.load-more button {
  display: inline-block;
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.load-more button:hover {
  background: var(--accent);
  color: var(--bg);
}
.load-more button[disabled] {
  border-color: var(--line);
  color: var(--text-sub);
  cursor: not-allowed;
}
.load-more button[disabled]:hover { background: transparent; color: var(--text-sub); }
/* load-more: clean solid themed button (overrides base.css .btn.primary gradient/pill) */
#load-more {
  background: #373b42;
  color: #fff;
  border: 1px solid #373b42;
  border-radius: 8px;
  padding: 10px 28px;
}
#load-more:hover { background: #2b2e34; color: #fff; }
#load-more[disabled] { background: transparent; color: var(--text-sub); border-color: var(--line); cursor: not-allowed; }

/* ═══════════════════════════════════════════
   ARTICLE PAGE
═══════════════════════════════════════════ */
.blog-article {
  max-width: 1260px;
  margin: 0 auto;
  padding: 56px var(--pad) 96px;
}

.blog-article > .card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.blog-article header {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-article h1 {
  font-family: var(--f-serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
}

.blog-article header > p {
  font-size: 18px;
  color: var(--text-dim);
  font-weight: 400;
  line-height: 1.7;
  max-width: 720px;
}
.muted { color: var(--text-sub); }

.article-hero {
  width: 100%;
  height: clamp(200px, 42vw, 380px);
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: block;
  margin-bottom: 32px;
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
  display: grid;
  gap: 20px;
  min-width: 0;
}
.article-body > * { min-width: 0; }

.article-body ul,
.article-body ol {
  padding-inline-start: 1.6em;
  margin: 0;
}
.article-body li + li { margin-top: 0.35em; }

/* To-do / checklist */
.article-body ul.task-list { list-style: none; padding-inline-start: 0.2em; }
.article-body .task-item { display: flex; align-items: flex-start; gap: 0.55em; }
.article-body .task-check {
  flex: 0 0 auto; width: 1.05em; height: 1.05em; margin-top: 0.28em;
  border: 2px solid var(--line); border-radius: 4px; position: relative;
}
.article-body .task-item[data-checked="true"] .task-check {
  background: #2563eb; border-color: #2563eb;
}
.article-body .task-item[data-checked="true"] .task-check::after {
  content: ""; position: absolute; left: 0.28em; top: 0.02em;
  width: 0.3em; height: 0.62em; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.article-body .task-item[data-checked="true"] .task-text {
  text-decoration: line-through; color: var(--text-dim);
}

.article-body p {
  font-size: 17px;
  color: var(--text-dim);
  font-weight: 400;
  margin: 0;
}

.article-body h2 {
  font-family: var(--f-serif);
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 8px;
}
.article-body h2:first-child { border-top: none; padding-top: 0; }

/* Sub-headings must stay a clear step ABOVE 17px body copy. */
.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.article-body h4 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: 0.01em;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
}
.article-body a:hover { border-bottom-style: solid; }
/* absolute URL = external (internal links are relative) */
.article-body a[href^="http"]::after {
  content: "↗";
  font-size: .72em;
  margin-left: 2px;
  vertical-align: top;
  opacity: .75;
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 32px auto;
  width: 100%;
}

.article-body mark {
  background: #fde68a;
  color: #1f2937;
  padding: 0.05em 0.2em;
  border-radius: 2px;
}
.article-body sup, .article-body sub { font-size: 0.75em; line-height: 0; }

/* Table of contents */
.article-body .article-toc {
  border: 1px solid var(--line);
  background: var(--bg2);
  border-radius: 10px;
  padding: 0.9em 1.1em;
  margin: 1.5em 0;
}
.article-body .article-toc .toc-head {
  font-weight: 600; margin: 0 0 0.4em; font-size: 0.82em;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim);
}
.article-body .article-toc ol { list-style: none; padding-inline-start: 0; margin: 0; }
.article-body .article-toc li { margin: 0.2em 0; }
.article-body .article-toc li.lvl-3 { padding-inline-start: 1em; }
.article-body .article-toc li.lvl-4 { padding-inline-start: 2em; }
.article-body .article-toc a { border-bottom: none; }
.article-body .article-toc a:hover { border-bottom: 1px solid currentColor; }
.article-body :is(h2, h3, h4) { scroll-margin-top: 80px; }

/* Video embed facade (click-to-watch card, opens in a new tab) */
.article-body .video-embed {
  display: block; text-decoration: none; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; max-width: 640px; margin: 1.4em 0;
  color: var(--text);
}
.article-body .video-embed:hover { border-color: var(--accent); }
.article-body .ve-poster {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1f2937, #374151);
}
.article-body .ve-play {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: #dc2626;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; padding-left: 3px; transition: transform 0.12s;
}
.article-body .video-embed:hover .ve-play { transform: scale(1.08); }
.article-body .ve-label {
  display: block; padding: 0.6em 0.8em; font-size: 0.9em; color: var(--text-dim);
}

/* Syntax-highlight token colors (emitted by the editor's highlighter) */
.article-body pre code .tok-com { color: #6b7280; font-style: italic; }
.article-body pre code .tok-str { color: #16a34a; }
.article-body pre code .tok-num { color: #c2410c; }
.article-body pre code .tok-kw  { color: #2563eb; font-weight: 600; }

/* ─── Callout / admonition blocks ─── */
.article-body .callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--bg2);
}
.article-body .callout .callout-icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.5;
}
.article-body .callout .callout-body { min-width: 0; }
.article-body .callout .callout-body > :first-child { margin-top: 0; }
.article-body .callout .callout-body > :last-child { margin-bottom: 0; }
.article-body .callout-info    { border-left-color: #2563eb; background: rgba(37,99,235,.06); }
.article-body .callout-warning { border-left-color: #d97706; background: rgba(217,119,6,.07); }
.article-body .callout-success { border-left-color: #16a34a; background: rgba(22,163,74,.07); }
.article-body .callout-danger  { border-left-color: #dc2626; background: rgba(220,38,38,.07); }

.article-body .spoiler {
  margin: 0;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--bg2);
}
.article-body .spoiler > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  list-style: none;
}
.article-body .spoiler > summary::-webkit-details-marker { display: none; }
.article-body .spoiler > summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 8px;
  transition: transform .15s ease;
}
.article-body .spoiler[open] > summary::before { transform: rotate(90deg); }
.article-body .spoiler .spoiler-body { padding: 0 16px 12px; }
.article-body .spoiler .spoiler-body > :first-child { margin-top: 0; }
.article-body .spoiler .spoiler-body > :last-child { margin-bottom: 0; }

.article-body blockquote {
  position: relative;
  margin: 0;
  padding: 18px 24px 18px 56px;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, color-mix(in oklch, var(--accent) 8%, var(--bg2)), var(--bg2));
  color: var(--text-dim);
  font-style: italic;
  font-weight: 300;
}
.article-body blockquote::before {
  content: "\201C";
  position: absolute;
  left: 14px;
  top: 2px;
  font-family: var(--f-sans);   /* unified: Inter everywhere (was Georgia) */
  font-style: normal;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
  opacity: .45;
}
.article-body blockquote > :last-child { margin-bottom: 0; }

.article-body :where(code:not(pre code)) {
  font-family: var(--f-mono);
  font-size: 0.88em;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
}
.article-body pre {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--bg3);
  overflow-x: auto;
}
.article-body pre code {
  display: block; padding: 0;
  border: none; background: transparent;
  font-size: 13px; white-space: pre;
}

/* Code block wrapper: copy button + language label */
.article-body .code-wrap { position: relative; margin: 1.2em 0; }
.article-body .code-wrap pre { margin: 0; }
.article-body .code-copy {
  position: absolute; top: 8px; right: 8px;
  padding: 4px 10px; font-size: 12px; line-height: 1;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg2); color: var(--text-dim);
  cursor: pointer; opacity: 0; transition: opacity 0.12s, color 0.12s;
}
.article-body .code-wrap:hover .code-copy,
.article-body .code-copy:focus-visible { opacity: 1; }
.article-body .code-copy:hover { color: var(--text); }
.article-body .code-lang {
  position: absolute; top: 8px; left: 14px;
  font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--text-dim); opacity: 0.7; pointer-events: none;
}

.article-body img {
  max-width: 100%;
  display: block;
}

/* Block alignment (paragraphs, headings, blockquotes, figures) */
.article-body .align-center { text-align: center; }
.article-body .align-right { text-align: right; }
.article-body figure.align-center { margin-left: auto; margin-right: auto; }
.article-body figure.align-left {
  float: left; max-width: min(48%, 340px); margin: 0.3em 1.4em 0.8em 0;
}
.article-body figure.align-right {
  float: right; max-width: min(48%, 340px); margin: 0.3em 0 0.8em 1.4em;
}
.article-body figure.align-full { max-width: min(1100px, 96vw); }
/* Floated figures must not bleed across section boundaries */
.article-body h2, .article-body h3, .article-body hr { clear: both; }

/* Figure = one soft card; image and caption share a rounded frame so the
   caption gently wraps the bottom of the photo instead of floating below it. */
.article-body figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg2);
  box-shadow: 0 1px 2px color-mix(in oklch, var(--accent) 6%, transparent),
              0 8px 24px -16px color-mix(in oklch, var(--accent) 35%, transparent);
}
.article-body figure img {
  border: 0;
  width: 100%;
}

/* Caption hugs the photo: soft gradient lip, hairline separator, centered. */
.article-body figcaption {
  position: relative;
  margin: 0;
  padding: 12px 20px 14px;
  font-family: var(--f-sans);   /* unified: Inter everywhere */
  font-size: 0.86rem;
  font-style: italic;
  font-weight: 300;
  text-align: center;
  color: var(--text-sub);
  line-height: 1.55;
  border-top: 1px solid color-mix(in oklch, var(--accent) 16%, var(--line));
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--accent) 7%, var(--bg2)), var(--bg2));
}

.article-body .chart-figure figcaption {
  font-family: var(--f-sans);
  font-style: normal;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.article-body .article-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--bg2);
}
.article-body table {
  width: max-content; min-width: 100%;
  border-spacing: 0; border-collapse: separate;
}
/* Safety net: a bare <table> (published before the scroll wrapper existed, or
   pasted markup) scrolls internally instead of blowing out the page width on
   mobile. Wrapped tables keep their .article-table-wrap scroller unchanged. */
.article-body > table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.article-body thead { background: var(--bg3); }
.article-body th,
.article-body td {
  padding: 10px 14px;
  min-width: 140px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}
.article-body th { font-weight: 600; color: var(--text); }
.article-body td { color: var(--text-dim); font-weight: 300; }
.article-body tr > :last-child { border-right: none; }
.article-body tbody tr:last-child > * { border-bottom: none; }

/* ─── Article tags ─── */
.article-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-tags span {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 11px;
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 560px) {
  .blog-hero { padding: 40px var(--pad) 32px; }
  .post-card { padding: 20px var(--pad); }
  .blog-article { padding: 40px var(--pad) 64px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
