/* Prism blog — long-form reading surface. Reuses landing.css tokens + fonts;
   this file adds the article typography and the index layout. Light/dark come
   from the tokens; RTL/LTR from the page `dir` + logical properties. */

.blog-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.blog-bar {
  max-width: 760px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 14px;
}
.blog-header .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; }
.blog-logo { flex: none; }
.blog-crumb { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; padding: 5px 10px; border-radius: 9px; }
.blog-crumb:hover { color: var(--ink); background: var(--surface-2); }
.blog-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.blog-actions .lang { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; padding: 6px 10px; border-radius: 9px; }
.blog-actions .lang:hover { color: var(--ink); background: var(--surface-2); }

.blog-wrap { max-width: 720px; margin: 0 auto; padding: 40px 22px 72px; }

/* ── index ─────────────────────────────── */
.blog-index-head { margin-bottom: 30px; }
.blog-index-head h1 { font-size: clamp(30px, 5vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--ink); text-wrap: balance; }
.blog-index-head p { font-size: 16px; color: var(--muted); margin: 0; max-width: 52ch; }

.blog-index { display: flex; flex-direction: column; gap: 8px; }
.post-card {
  display: block; text-decoration: none; color: inherit;
  padding: 20px 22px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.post-card-date { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.post-card-title { font-size: 20px; font-weight: 800; line-height: 1.3; margin: 6px 0 6px; color: var(--ink); text-wrap: balance; }
.post-card-excerpt { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0; }
.blog-empty { color: var(--muted); font-size: 16px; padding: 30px 0; }

/* ── post ─────────────────────────────── */
.post-back { margin: 0 0 22px; }
.post-back a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; }
.post-back a:hover { color: var(--ink); }

.post-meta { font-size: 13px; font-weight: 700; letter-spacing: 0.03em; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.post-title { font-size: clamp(28px, 5.5vw, 42px); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; margin: 8px 0 14px; color: var(--ink); text-wrap: balance; }
.post-lede { font-size: 18px; line-height: 1.6; color: var(--muted); margin: 0 0 24px; text-wrap: pretty; }
.post-cover { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--border); margin: 0 0 30px; display: block; }

/* Article body — comfortable long-form reading. */
.post-body { font-size: 17px; line-height: 1.8; color: var(--ink); }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.15em; text-wrap: pretty; }
.post-body h2 { font-size: 25px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; margin: 1.9em 0 0.5em; color: var(--ink); text-wrap: balance; }
.post-body h3 { font-size: 20px; font-weight: 800; line-height: 1.35; margin: 1.6em 0 0.4em; color: var(--ink); }
.post-body h4 { font-size: 17px; font-weight: 800; margin: 1.4em 0 0.4em; color: var(--ink); }
.post-body a { color: #3E5FB5; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
:root[data-theme=dark] .post-body a { color: #8fa6e6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .post-body a { color: #8fa6e6; } }
.post-body strong { font-weight: 800; color: var(--ink); }
.post-body ul, .post-body ol { margin: 0 0 1.15em; padding-inline-start: 1.4em; }
.post-body li { margin: 0.3em 0; }
.post-body li::marker { color: var(--muted-2); }
.post-body blockquote {
  margin: 1.4em 0; padding: 4px 18px; color: var(--muted);
  border-inline-start: 3px solid var(--border-strong); font-style: italic;
}
.post-body blockquote p { margin: 0.4em 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); margin: 1.2em 0; }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em;
  background: var(--surface-2); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border);
}
.post-body pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; overflow-x: auto; margin: 1.4em 0; direction: ltr;
}
.post-body pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.7; }

/* ── footer ─────────────────────────────── */
.blog-foot { border-top: 1px solid var(--border); margin-top: 20px; }
.blog-foot-in {
  max-width: 720px; margin: 0 auto; padding: 22px; display: flex; align-items: center; gap: 14px;
  color: var(--muted-2); font-size: 13px; font-weight: 600;
}
.blog-foot .brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--ink); text-decoration: none; }
.blog-foot-in > span { margin-inline-start: auto; }

@media (prefers-reduced-motion: reduce) { .post-card { transition: none; } }
