/*
 * The blog: the index and one page per post. Tokens, nav, footer, buttons and
 * cells come from /styles.css; this file only adds what an article needs.
 */

.blog { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.blog > * { min-width: 0; }

/* Breadcrumb and the top of a page */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs li { display: inline-flex; gap: 6px; }
.crumbs li + li::before { content: '/'; color: var(--faint); }
.crumbs ol { display: contents; list-style: none; }

.b-hero { padding: 56px 64px 44px; display: grid; gap: 20px; }
.b-hero h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.045em; max-width: 900px; }
.b-hero .lede { margin-top: 0; max-width: 720px; }
.b-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); }

/* The article */
.article { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 720px); gap: 56px; padding: 56px 64px 64px; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 14px; }
.toc h2 { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); line-height: 1.35; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink); }

.prose { font-size: 17px; line-height: 1.7; color: var(--ink-2); }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: 52px; font-size: 27px; line-height: 1.2; color: var(--ink); scroll-margin-top: 84px; }
.prose h3 { margin-top: 32px; font-size: 19px; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose > :first-child { margin-top: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--faint); }
.prose code { background: var(--code-bg); padding: 0.1em 0.38em; border-radius: 6px; color: var(--ink); overflow-wrap: anywhere; }
.prose pre { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: var(--code-bg); border: 1px solid var(--line); overflow-x: auto; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.prose pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; overflow-wrap: normal; }
.prose pre .c { color: var(--muted); }
.prose blockquote { margin: 18px 0 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--line-2); color: var(--muted); }

.table-scroll { margin-top: 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 520px; }
.prose caption { caption-side: bottom; text-align: left; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.prose th { text-align: left; vertical-align: bottom; font-size: 13px; font-weight: 600; color: var(--ink); padding: 11px 16px; background: var(--tint); }
.prose td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.prose table code { overflow-wrap: normal; white-space: nowrap; }
.prose tbody th { font-size: 15px; font-weight: 500; background: none; border-top: 1px solid var(--line); vertical-align: top; }

.chat { margin-top: 22px; padding: 18px; border-radius: 14px; background: var(--tint); border: 1px solid var(--line); display: grid; gap: 10px; font-size: 15.5px; }
.chat p { max-width: 88%; padding: 9px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.chat .me { justify-self: end; background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chat small { display: block; font-size: 12.5px; color: var(--muted); }

.note { padding: 14px 18px; border-radius: 14px; background: var(--run-soft); color: var(--run-ink); font-size: 15.5px; }
.note a { color: inherit; }

/* Questions at the end of a post: plain visible Q&A */
.prose .qa h3 { margin-top: 26px; }

/* Related posts and the closing call to action */
.related { padding: 40px 64px 48px; }
.related h2 { font-size: 22px; }
.cards { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: grid; gap: 8px; align-content: start; height: 100%; padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--tint); transition: border-color 0.15s, background 0.15s; }
.card:hover { border-color: var(--line-2); background: var(--card); }
.card b { font-size: 16.5px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink); }
.card span { font-size: 14px; line-height: 1.5; color: var(--muted); }
.card em { font-style: normal; font-size: 12.5px; color: var(--faint); }

.post-cta { padding: 56px 64px; display: flex; justify-content: space-between; align-items: center; gap: 24px 40px; flex-wrap: wrap; }
.post-cta h2 { font-size: 28px; }
.post-cta p { margin-top: 8px; color: var(--ink-2); max-width: 520px; }
.post-cta .ctas { margin-top: 0; }

/* The index */
.b-list { padding: 8px 0; }
.b-list ul { list-style: none; margin: 0; padding: 0; }
.b-item { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 8px 40px; padding: 30px 64px; }
.b-item + .b-item { border-top: 1px solid var(--line); }
.b-item h2 { font-size: 23px; line-height: 1.25; }
.b-item h2 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.b-item p { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; max-width: 680px; }
.b-item .b-meta { justify-content: flex-end; text-align: right; align-self: start; padding-top: 6px; }
.b-item .b-meta { flex-direction: column; gap: 2px; }

@media (max-width: 1000px) {
	.b-hero { padding: 40px 24px 32px; }
	.article { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 36px 24px 48px; }
	/* On a phone the answer comes first; the headings are a scroll away. */
	.toc { display: none; }
	.related { padding: 32px 24px 36px; }
	.cards { grid-template-columns: minmax(0, 1fr); }
	.post-cta { padding: 40px 24px; }
	.b-item { grid-template-columns: minmax(0, 1fr); padding: 26px 24px; }
	.b-item .b-meta { flex-direction: row; justify-content: flex-start; text-align: left; padding-top: 0; order: -1; gap: 14px; }
}
@media (max-width: 520px) {
	.prose { font-size: 16.5px; }
	.prose h2 { font-size: 23px; margin-top: 44px; }
	.prose pre { font-size: 13.5px; padding: 14px; }
	.b-item h2 { font-size: 20px; }
	.crumbs li:last-child { display: none; }
}
