/* The blog at /blog, on the site's design system (site.css loads first: tokens, .panel, .perf, .stub,
   .tag, .chips, .overline, .btn). Posts are slips; an article reads on paper-width lines. Post bodies
   come rendered from the Console: headings, figures, tables, code, callouts (.callout-note, -tip,
   -important, -warning, -caution) and video embeds. */

/* the header's Blog link, on blog pages */
.site-nav a[aria-current] { color: var(--ink); }

/* ---------- the blog bar: name, categories, search */
.blog-bar { border-bottom: 1px solid var(--rule); background: var(--paper); }
.blog-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
.blog-home { color: var(--ink); text-decoration: none; }
.blog-cats ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; padding: 0; }
.blog-cats a { color: var(--ink-muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.blog-cats a:hover, .blog-cats a[aria-current] { color: var(--ink); }
.blog-cats a[aria-current] { text-decoration: underline; text-decoration-color: var(--ultra); }
.blog-search { margin-left: auto; }
.blog-search input { font: inherit; font-size: 15px; height: 36px; width: 15rem; max-width: 100%; padding: 0 12px; border: 1.5px solid var(--rule-strong); border-radius: 6px; background: var(--fog); color: var(--ink); }
.blog-search input::placeholder { color: var(--ink-muted); }

.blog-section { padding: 56px 0 72px; }
.blog-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -0.035em; margin: 10px 0 14px; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.blog-meta a { color: inherit; }
.blog-empty { max-width: 36em; }
.blog-empty p + p { margin-top: 6px; color: var(--ink-muted); }

/* ---------- posts as slips */
.post-slips { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-slip article { height: 100%; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.post-slip-cover img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--paper-sunk); border-bottom: 1px solid var(--rule); }
.post-slip-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.post-slip h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.post-slip h2 a { color: var(--ink); text-decoration: none; }
.post-slip h2 a::after { content: ""; position: absolute; inset: 0; } /* the whole slip is the link */
.post-slip article { position: relative; }
.post-slip p:not(.overline) { color: var(--ink-muted); font-size: 16px; }
.post-slip .stub { gap: 8px; }
.post-slip-read { margin-left: auto; font-size: 13px; font-weight: 600; border: 1.5px solid var(--rule-strong); border-radius: 6px; padding: 4px 10px; background: var(--paper); }
.post-slip:hover article { border-color: var(--rule-strong); }
.post-slip:hover h2 a { text-decoration: underline; text-decoration-color: var(--ultra); }

.blog-pages { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 32px; }
.blog-pages span:last-child { text-align: right; }

/* ---------- an article */
.article { max-width: 760px; }
.article-head { margin-bottom: 28px; }
.article-head .overline a { color: var(--ultra); text-decoration: none; }
.article-lead { font-size: 20px; line-height: 1.5; color: var(--ink-muted); margin-bottom: 16px; }
.article-cover { margin: 0 0 32px; }
.article-cover img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--rule); }
.article-toc { margin: 0 0 32px; padding: 16px 20px; }
.article-toc ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.article-toc .l3 { margin-left: 18px; }
.article-toc a { color: var(--ink); text-decoration: none; }
.article-toc a:hover { color: var(--ultra); }

.article-body { font-size: 18px; line-height: 1.7; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.2; letter-spacing: -0.025em; margin-top: 1.8em; scroll-margin-top: 140px; }
.article-body h3 { font-size: 21px; line-height: 1.3; margin-top: 1.5em; scroll-margin-top: 140px; }
.article-body h4 { font-size: 18px; margin-top: 1.3em; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li + li { margin-top: 0.35em; }
.article-body img, .article-body video { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--rule); }
.article-body figure { margin-top: 1.6em; margin-bottom: 1.6em; }
.article-body figure img { margin: 0 auto; }
.article-body figcaption { text-align: center; }
.article-body code { font-family: var(--font-mono); font-size: 0.82em; background: var(--paper-sunk); padding: 0.12em 0.36em; border-radius: 3px; }
.article-body pre { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: 15px; line-height: 1.6; }
.article-body pre code { background: none; padding: 0; font-size: 0.85em; }
.article-body blockquote { margin-left: 0; margin-right: 0; padding-left: 20px; border-left: 2px solid var(--rule-strong); color: var(--ink-muted); }
.article-body hr { border: 0; border-top: 1.5px dashed var(--rule-strong); margin: 2.2em 0; }
.article-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; font-size: 16px; }
.article-body th { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); text-align: left; }
.article-body th, .article-body td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
.article-body .footnotes { font-size: 15px; color: var(--ink-muted); border-top: 1px solid var(--rule); padding-top: 12px; }

/* callouts: a paper slip with a printed label; warnings are hatched in hush amber, like promotional
   notifications in the app */
.article-body .callout { display: block; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 20px; font-size: 17px; }
.article-body .callout > p { margin: 0; }
.article-body .callout > p + p { margin-top: 0.6em; }
.article-body .callout-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px !important; font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-ultra-soft); }
.article-body .callout-title::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 1px; background: var(--ultra); }
.article-body .callout-note, .article-body .callout-tip { background: var(--paper); }
.article-body .callout-important { border: 1.5px solid var(--ultra); }
.article-body .callout-warning, .article-body .callout-caution { border-color: color-mix(in srgb, var(--hush) 45%, var(--rule)); background-color: var(--hush-soft); background-image: repeating-linear-gradient(135deg, var(--hush-hatch) 0 1.5px, transparent 1.5px 7px); }
.article-body .callout-warning .callout-title, .article-body .callout-caution .callout-title { color: var(--hush-ink); }
.article-body .callout-warning .callout-title::before, .article-body .callout-caution .callout-title::before { background: var(--hush); }
.article-body .callout-caution { border-width: 1.5px; border-color: var(--hush); }

.article-body .embed { position: relative; aspect-ratio: 16 / 9; }
.article-body .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 1px solid var(--rule); border-radius: 10px; }

.article-tags { margin-top: 36px; }
.article-tags a { color: var(--ink); text-decoration: none; }
.article-author { display: flex; gap: 16px; align-items: flex-start; margin-top: 28px; }
.article-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.article-author h3 a { color: var(--ink); text-decoration: none; }
.article-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; border: 1.5px solid var(--ultra); }
.article-cta h3 { font-size: 18px; margin: 6px 0 2px; }

.blog-preview { display: flex; gap: 10px; align-items: baseline; border: 1px solid color-mix(in srgb, var(--hush) 45%, var(--rule)); border-radius: 10px; padding: 12px 16px; margin-bottom: 24px; color: var(--hush-ink); font-weight: 600; }
.blog-preview .overline { color: var(--hush-ink); }

.blog-related { border-top: 1px solid var(--rule); margin-top: 64px; padding-top: 48px; }
.blog-related .section-head { margin-bottom: 16px; }

@media (max-width: 900px) {
  .post-slips { grid-template-columns: minmax(0, 1fr); }
  .blog-search { margin-left: 0; width: 100%; }
  .blog-search input { width: 100%; }
}
@media (max-width: 560px) {
  .blog-section { padding: 36px 0 56px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 24px; }
  .blog-pages { grid-template-columns: 1fr 1fr; }
  .blog-pages .overline { display: none; }
}
