/* Blog: list, post typography, code blocks. Builds on site.css variables, so light and dark both work. */

code, pre, kbd { font-family: "Cascadia Code", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace; }

.blog-head { padding: 64px 0 8px; max-width: 760px; }
.blog-head h1 { margin: 18px 0 12px; }
.blog-head .lead { margin-bottom: 20px; }
.blog-head .lead a { color: var(--accent-2); font-size: .9em; }
.back { color: var(--muted); text-decoration: none; font-size: .92rem; }
.back:hover { color: var(--text); }

.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { display: inline-block; font-size: .8rem; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); background: var(--bg-soft); }
.tag-list a:hover, .tag-list a[aria-current="page"] { color: var(--text); border-color: var(--accent); }

.post-list { list-style: none; padding: 0; margin: 28px 0 88px; display: grid; gap: 16px; max-width: 860px; }
.post-list.compact { margin: 0; max-width: none; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.post-list.compact .post-card h2 { font-size: 1.15rem; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; }
.post-card h2 { font-size: 1.35rem; margin: 6px 0 8px; letter-spacing: -.01em; }
.post-card h2 a { text-decoration: none; }
.post-card h2 a:hover { color: var(--accent-2); }
.post-card > p:not(.post-meta) { margin: 0 0 14px; color: var(--muted); }
.post-meta { color: var(--muted); font-size: .88rem; margin: 0; }
.draft-label { color: #f5a524; }
.empty { margin: 28px 0 88px; max-width: 760px; }
.empty h2 { font-size: 1.3rem; margin: 0 0 6px; }
.empty a { color: var(--accent-2); }

/* Post */
.post { max-width: 760px; padding: 48px 0 88px; }
.post-head h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 18px 0 12px; }
.post-head .post-meta { margin-bottom: 14px; font-size: .95rem; }
.draft-banner { margin: 16px 0 0; padding: 8px 14px; border-radius: 10px; border: 1px solid #f5a524; color: #f5a524; background: color-mix(in srgb, #f5a524 10%, transparent); font-size: .9rem; }

.post-body { margin-top: 36px; font-size: 1.06rem; }
.post-body p, .post-body li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.post-body h2, .post-body h3, .post-body h4 { position: relative; scroll-margin-top: 84px; letter-spacing: -.01em; }
.post-body h2 { font-size: 1.55rem; margin: 48px 0 12px; }
.post-body h3 { font-size: 1.2rem; margin: 34px 0 8px; }
.post-body .anchor { position: absolute; left: -1.1em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.post-body h2:hover .anchor, .post-body h3:hover .anchor, .post-body h4:hover .anchor { opacity: 1; }
.post-body a { color: var(--accent-2); }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.post-body blockquote { margin: 24px 0; padding: 6px 20px; border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 12px 12px 0; }
.post-body blockquote p { color: var(--muted); }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; margin: 24px 0; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.post-body th { background: var(--bg-soft); }
.post-body :not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.post-body kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; font-size: .85em; background: var(--card); }

figure.code { position: relative; margin: 24px 0; }
figure.code pre { margin: 0; overflow-x: auto; padding: 36px 22px 20px; border-radius: 14px; background: #0f1220; border: 1px solid #22273d; font-size: .88rem; line-height: 1.6; tab-size: 4; }
.code-lang { position: absolute; top: 9px; right: 74px; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #7d84a8; }
figure.code .copy { position: absolute; top: 6px; right: 8px; font: inherit; font-size: .74rem; padding: 3px 10px; border-radius: 8px; border: 1px solid #2c3250; background: #171b2e; color: #c9cde0; cursor: pointer; }
figure.code .copy:hover { border-color: var(--accent); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.post-nav a { text-decoration: none; padding: 18px 20px; }
.post-nav a span { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.post-nav a.next { text-align: right; grid-column: 2; }
.post-nav a:hover { border-color: var(--accent); }

/* Syntax highlighting (highlight.js classes; code blocks stay dark in both themes) */
.hljs { color: #d8dcf0; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type, .hljs-doctag { color: #c792ea; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-selector-attr, .hljs-template-tag { color: #a5e075; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #f78c6c; }
.hljs-comment, .hljs-quote { color: #6b7394; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section { color: #82aaff; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property, .hljs-params { color: #ffcb6b; }
.hljs-meta, .hljs-tag, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: #89ddff; }
.hljs-deletion { color: #ff6b81; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

@media (max-width: 760px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a.next { grid-column: 1; }
  .post-body .anchor { display: none; }
}
