/* Blog: list, post typography, code blocks. Builds on the site.css design tokens (docs/DESIGN.md). */

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

.blog-head { padding: 64px 0 8px; }
.blog-head h1 { margin: 18px 0 12px; font-size: clamp(2.2rem, 4.6vw, 3.6rem); text-wrap: balance; }
@media (min-width: 900px) { .blog-head h1 { white-space: nowrap; } }
.blog-head .lead { margin-bottom: 20px; }
.blog-head .lead a { color: var(--violet); 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; font-weight: 600; padding: 3px 11px; border-radius: 999px; text-decoration: none; color: #cfc4ff; background: var(--lav-t); }
.tag-list li:nth-child(4n+2) a { color: #ffc2a0; background: var(--peach-t); }
.tag-list li:nth-child(4n+3) a { color: #8ff0c9; background: var(--mint-t); }
.tag-list li:nth-child(4n+4) a { color: #a9cbff; background: var(--sky-t); }
.tag-list a:hover, .tag-list a[aria-current="page"] { box-shadow: inset 0 0 0 1.5px currentColor; }

.post-list { list-style: none; padding: 0; margin: 8px 0 28px; 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 { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; transition: border-color .25s, transform .25s; }
.post-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-list:not(.compact) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.post-list:not(.compact) > .post-card:first-child { grid-column: 1 / -1; padding: 34px 36px; background: radial-gradient(700px 300px at 0% 0%, rgba(180, 162, 255, .16), transparent 65%), linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015)); border-color: var(--line-strong); }
.post-list:not(.compact) > .post-card:first-child h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
@media (max-width: 760px) { .post-list:not(.compact) { grid-template-columns: 1fr; } }
.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(--violet); }
.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: #ffdf8a; }
.empty { margin: 8px 0 28px; max-width: 760px; }
.empty h2 { font-size: 1.3rem; margin: 0 0 6px; }
.empty a { color: var(--violet); }

/* 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: 12px; color: #ffdf8a; background: var(--butter-t); 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(--violet); }
.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); }
/* A quote that is all bold ("> **...**") reads as a pull quote: larger, brighter, with the gradient edge. */
.post-body blockquote:has(> p > strong:only-child) { position: relative; margin: 36px 0; padding: 16px 26px; border-left: 0; border-radius: 14px; background: var(--grad-soft); }
.post-body blockquote:has(> p > strong:only-child)::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 14px 0 0 14px; background: var(--grad); }
.post-body blockquote:has(> p > strong:only-child) p { color: var(--text); font-size: 1.3rem; line-height: 1.45; letter-spacing: -.01em; margin: 6px 0; }
.post-body > p:first-child { font-size: 1.2rem; color: var(--text); }
.post-body li + li { margin-top: 4px; }
.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: #0b0d14; border: 1px solid var(--line-strong); 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; }
}

/* Blog landing */
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 8px 0 12px; }
.topic-card { display: block; text-decoration: none; padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); transition: transform .25s, box-shadow .25s; }
.topic-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.topic-card .emoji { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; background: var(--peach-t); }
.topic-grid > :nth-child(2) .emoji { background: var(--mint-t); }
.topic-grid > :nth-child(3) .emoji { background: var(--sky-t); }
.topic-grid > :nth-child(4) .emoji { background: var(--lav-t); }
.topic-card strong { display: block; margin: 12px 0 2px; }
.topic-card small { color: var(--muted); }
.subscribe { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 88px; padding: 24px 28px; }
.subscribe p { margin: 0; }
@media (max-width: 900px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Share row on a post */
.post-share { margin: 48px 0 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.post-share-label { color: var(--muted); font-size: .9rem; font-weight: 600; }
.post-share-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.post-share .btn { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; }
.post-share .ico { width: 15px; height: 15px; }
.post-share .share-li:hover { color: #70a9ff; border-color: #70a9ff; }
.post-share .share-x:hover { color: var(--text); border-color: var(--line-strong); }

/* Archive: by year, on the blog index and the /blog/archive/ page */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.more-link { color: var(--violet); text-decoration: none; font-size: .92rem; white-space: nowrap; }
.more-link:hover { text-decoration: underline; }
.archive-preview { margin: 8px 0 28px; }
.archive { margin: 8px 0 72px; }
.archive-year { margin: 0 0 28px; }
.archive-year h3 { font-size: 1.05rem; color: var(--muted); letter-spacing: .02em; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.archive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.archive-list li { display: flex; gap: 14px; align-items: baseline; padding: 7px 10px; border-radius: 10px; transition: background .2s; }
.archive-list li:hover { background: var(--bg-soft); }
.archive-list time { flex: 0 0 auto; width: 74px; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.archive-list a { text-decoration: none; }
.archive-list a:hover { color: var(--violet); }
@media (max-width: 560px) { .archive-list li { flex-wrap: wrap; gap: 2px 14px; } }

/* Author-only controls (shown by site.js in the author's browser). .btn sets display, so restate hidden. */
.author-only[hidden] { display: none !important; }
.blog-head .author-only { margin-top: 4px; }

/* Section tones: 1 Cloud, 2 AI, 3 Growth, 4 Focus (same order as the topic cards). */
.tone-1 { --tone: #ffc2a0; --tone-t: var(--peach-t); }
.tone-2 { --tone: #8ff0c9; --tone-t: var(--mint-t); }
.tone-3 { --tone: #a9cbff; --tone-t: var(--sky-t); }
.tone-4 { --tone: #cfc4ff; --tone-t: var(--lav-t); }

.cat-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 11px; border-radius: 999px; text-decoration: none; color: var(--tone, var(--violet)); background: var(--tone-t, var(--lav-t)); }
.cat-badge:hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.post-card .cat-badge { margin-bottom: 10px; }
.post-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Cover images */
.post-card.has-cover { padding-top: 0; overflow: hidden; }
.post-card-cover { display: block; margin: 0 -26px 18px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.post-list:not(.compact) > .post-card.has-cover:first-child { padding-top: 0; }
.post-list:not(.compact) > .post-card.has-cover:first-child .post-card-cover { margin: 0 -36px 22px; aspect-ratio: 21 / 9; }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.post-card:hover .post-card-cover img { transform: scale(1.03); }
.post-cover { margin: 28px 0 0; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

/* Topic cards open their section */
.topic-go { display: block; margin-top: 12px; font-size: .84rem; font-weight: 600; color: var(--violet); opacity: .75; transition: opacity .2s; }
.topic-card:hover .topic-go { opacity: 1; }

/* Section pages: /blog/<tag>/ */
.section-title { display: flex; align-items: center; gap: 16px; margin: 18px 0 12px; }
.section-title h1 { margin: 0; }
.section-emoji { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.9rem; background: var(--tone-t); box-shadow: inset 0 0 0 1px var(--line); }
.section-head .lead { margin-bottom: 8px; }
.section-count { margin: 0 0 18px; color: var(--tone); font-size: .9rem; font-weight: 600; }
.section-others { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 8px 0 88px; padding-top: 22px; border-top: 1px solid var(--line); }
.section-others > span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.section-others .topics { margin: 0; }
@media (max-width: 560px) { .section-emoji { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 16px; } }

/* "More in <section>" on a post */
.related { margin-top: 48px; }
.related .post-list { margin-top: 12px; }

/* About */
.about-head.has-photo { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.about-head h1 { margin: 18px 0 12px; }
.about-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); box-shadow: 0 20px 60px -20px rgba(180, 162, 255, .5); }
.about-body { max-width: 760px; margin-top: 8px; }
.about-body h2:first-child { margin-top: 12px; }
.about-ctas { margin: 40px 0 88px; }
@media (max-width: 640px) {
  .about-head.has-photo { grid-template-columns: 1fr; gap: 8px; }
  .about-photo { width: 112px; height: 112px; }
}
