/* ==========================================================================
   Blog (/blog/ and /blog/<slug>/). Built on the tokens in assets/site.css.
   ========================================================================== */

.blog-hero { padding-top: clamp(40px, 7vw, 80px); padding-bottom: 28px; }
.blog-hero__inner, .post__head { display: flex; flex-direction: column; gap: 18px; }
.blog-hero__inner .h-display { font-size: clamp(40px, 5.4vw, 58px); }

/* ---------- List ---------- */

.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.post-card { position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; border-radius: 18px; }
.post-card__img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-bottom: 1px solid var(--line); }
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 24px; }
.post-card .h3 { margin: 0; }
.post-card__link { color: var(--text); }
.post-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-card:hover .post-card__link { color: var(--accent); }
.post-card__summary { margin: 0; line-height: 1.6; font-size: 15px; color: var(--muted-2); max-width: 680px; }

.post-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.post-meta > * + *::before { content: "·"; margin-right: 14px; color: var(--dim); }
.post-meta__draft { color: var(--accent); font-weight: 600; }

.post-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.post-meta + .post-tags { margin-top: 12px; }
.post-tags li { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }

/* ---------- Post ---------- */

.post__head > * { max-width: 820px; }
.post__title { font-size: clamp(36px, 5vw, 54px); }
.post__head .lead { max-width: 720px; }
.post__back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; color: var(--muted); }
.post__back svg { transform: scaleX(-1); }
.post__back:hover { color: var(--accent); }

.post__body { display: flex; flex-direction: column; gap: 32px; }
.post__body > * { max-width: 820px; }
.post__cover { width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line); }

/* Long-form text */
.prose { font-size: 17px; line-height: 1.75; color: var(--muted-2); max-width: 720px; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure { margin: 0 0 1.25em; }
.prose h2, .prose h3 { font-family: var(--display); color: var(--text); letter-spacing: -.02em; line-height: 1.2; scroll-margin-top: 96px; text-wrap: balance; }
.prose h2 { font-size: 28px; font-weight: 600; margin: 1.9em 0 .6em; }
.prose h3 { font-size: 21px; font-weight: 600; margin: 1.6em 0 .5em; }
.prose__anchor { margin-left: 6px; color: var(--dim); font-weight: 400; opacity: 0; transition: opacity .2s; text-decoration: none; }
.prose h2:hover .prose__anchor, .prose h3:hover .prose__anchor, .prose__anchor:focus-visible { opacity: 1; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 2.4em 0; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); }
.prose code { font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--bg-inset); color: var(--text); }
.prose pre {
    padding: 18px 20px; overflow-x: auto; border-radius: 14px;
    background: #23273A; color: #ECEAF4; font-size: 14px; line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, .08);
}
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; border-bottom-color: var(--line-2); }

/* About the author */
.post-author { display: flex; gap: 18px; align-items: flex-start; max-width: 720px; }
.post-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.post-author strong { font-family: var(--display); font-size: 18px; color: var(--text); }
.post-author p { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: var(--muted-2); }
.post-author__links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.post-author__links a { color: var(--accent); font-weight: 500; }

/* Older / newer */
.post-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; max-width: 820px; }
.post-pager__link { display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.post-pager__link:hover { color: var(--text); }
.post-pager__link .label { display: inline-flex; align-items: center; gap: 6px; }
.post-pager__link strong { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.post-pager__link--prev .label svg { transform: scaleX(-1); }
.post-pager__link--next { text-align: right; align-items: flex-end; }

@media (max-width: 640px) {
    .prose { font-size: 16px; }
    .prose h2 { font-size: 24px; }
    .post-card__body { padding: 18px 18px 20px; }
    .post-author { flex-direction: column; }
    .post-pager { grid-template-columns: 1fr 1fr; }
    .post-pager > .btn { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}

@media print {
    .post-pager, .post-author, .prose__anchor { display: none; }
    .prose pre { background: #f2f2f2; color: #111; }
}
