/* ===== BLOG ===== index, category and article pages (T6). Merged into app.css PAGES by T9. */

/* -- topics: a row of plain links, 16px apart -- */
.topic-nav { margin-bottom: var(--sp-12); }
.topic-nav h2 { margin-bottom: var(--sp-3); }
.topic-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: var(--sp-6); }
.topic-count { font: 400 var(--fs-11) var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 0; color: var(--text-3); }

/* -- post list: ruled rows, not cards; two columns from 900px -- */
.post-list { display: grid; border-top: 1px solid var(--border); }
@media (min-width: 900px) { .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-12); } }
@media (min-width: 900px) { .post-list .post-card { padding: var(--sp-8) 0; } }
.related-posts .post-list { grid-template-columns: minmax(0, 1fr); }
/* each row is a grid: title, excerpt, then one meta row (category, meta, link). The source order (category, meta, title)
   is asserted by tests, so placement does the layout. The card is a size container so the meta row adapts to the
   column it sits in (one column, two columns, related list), not to the viewport. */
.post-list .post-card {
	display: grid; grid-template-columns: minmax(0, max-content) auto 1fr; align-items: baseline;
	container-type: inline-size;
	padding: calc(var(--sp-6) + var(--sp-1)) 0; background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
}
.post-list .post-card h2, .post-list .post-card h3 { grid-area: 1 / 1 / 2 / -1; min-width: 0; margin-bottom: var(--sp-2); font-size: var(--fs-17); line-height: var(--lh-snug); letter-spacing: 0; overflow-wrap: break-word; }
.post-list .post-card h2 a, .post-list .post-card h3 a { text-decoration: none; }
.post-list .post-card:hover h2 a, .post-list .post-card:hover h3 a,
.post-list .post-card h2 a:hover, .post-list .post-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.post-excerpt { grid-area: 2 / 1 / 3 / -1; min-width: 0; margin: 0 0 var(--sp-3); color: var(--text-2); }
@media (min-width: 600px) { .post-list .post-excerpt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
/* narrow column: meta on its own line, then category (truncating) with the link pinned to the end */
.post-list .post-meta { grid-area: 3 / 1 / 4 / -1; min-width: 0; margin: 0; }
.post-list .post-category {
	grid-area: 4 / 1; display: block; min-width: 0; min-height: 0; margin-right: var(--sp-3);
	font: 400 var(--fs-13)/1.45 var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-list .post-more { grid-area: 4 / 3; justify-self: end; margin-left: var(--sp-3); font-size: var(--fs-13); line-height: 1.45; white-space: nowrap; }
/* wide enough: one unbroken row. The meta keeps its full width, the category gives up space first, the link sits at the end */
@container (min-width: 540px) {
	.post-list .post-category { grid-area: 3 / 1; }
	.post-list .post-meta { grid-area: 3 / 2; min-width: auto; white-space: nowrap; }
	.post-list .post-more { grid-area: 3 / 3; }
}

/* -- article column -- */
.post { padding-top: var(--sp-10); }
@media (min-width: 600px) { .post { padding-top: var(--sp-14); } }
@media (min-width: 900px) { .post { padding-top: var(--sp-20); } }
.breadcrumbs { margin-bottom: var(--sp-8); font-size: var(--fs-13); color: var(--text-3); }
.breadcrumbs a { color: var(--text-2); }
.post-header { margin-bottom: var(--sp-12); }
.post-header h1 { margin-bottom: var(--sp-4); }

/* table of contents: bordered block, label-style heading, 13px links */
.toc { margin-bottom: var(--sp-12); padding: var(--sp-5) var(--sp-6); }
.toc summary {
	display: flex; align-items: center; min-height: 32px; cursor: pointer;
	font: 600 var(--fs-11)/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
@media (pointer: coarse) { .toc summary { min-height: 44px; } }
.toc ol { margin: var(--sp-3) 0 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-2); font-size: var(--fs-13); }
.toc ol ol { margin-top: var(--sp-2); }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover, .toc a:focus-visible { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }

/* -- article body (HTML from blog-content.js, styled only through .prose) -- */
.prose { font-size: var(--fs-17); line-height: var(--lh-article); color: var(--text); overflow-wrap: break-word; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure, .prose iframe, .prose video { margin: 0 0 var(--sp-5); }
.prose p:last-child { margin-bottom: var(--sp-5); }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin: var(--sp-16) 0 var(--sp-4); font-size: var(--fs-24); }
.prose h3 { margin: var(--sp-10) 0 var(--sp-3); font-size: var(--fs-20); font-weight: 600; }
.prose h2, .prose h3 { scroll-margin-top: var(--sp-20); }
.prose h4 { margin: var(--sp-6) 0 var(--sp-2); font-size: var(--fs-17); }
.prose ul, .prose ol { padding-left: var(--sp-6); }
.prose li + li, .prose li > ul, .prose li > ol { margin-top: var(--sp-2); }
.prose li > ul, .prose li > ol { margin-bottom: 0; }
.prose blockquote { padding-left: var(--sp-4); border-left: 2px solid var(--border-strong); color: var(--text-2); font-style: normal; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r-1); }
.prose figure img { margin: 0; }
.prose figcaption { margin-top: var(--sp-2); font-size: var(--fs-13); line-height: 1.45; color: var(--text-3); text-align: left; }
.prose iframe, .prose video { display: block; width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-1); }
.prose hr { margin: var(--sp-14) 0; }
/* code: inline code and pre come from the shared CODE section; pre scrolls inside its own box */
.prose pre { max-width: 100%; }
/* tables: data table spec; a bare <table> becomes its own scroll box so the page never scrolls sideways */
.prose table {
	display: block; width: max-content; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
	border: 1px solid var(--border); border-radius: var(--r-1); background: var(--surface);
	border-collapse: separate; border-spacing: 0; white-space: nowrap;
}
.prose th, .prose td { padding: 0 var(--sp-4); text-align: left; border-bottom: 1px solid var(--border); }
.prose th:first-child, .prose td:first-child { padding-left: var(--sp-4); }
.prose th:last-child, .prose td:last-child { padding-right: var(--sp-4); }
.prose td { height: var(--row-h); font: 400 var(--fs-13)/1 var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "zero" 0; color: var(--text); }
.prose th {
	height: var(--sp-10); background: var(--surface-2); border-bottom-color: var(--border-strong);
	font: 600 var(--fs-11)/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.prose tr:last-child td { border-bottom: 0; }
@media (pointer: fine) { .prose tbody tr:hover td { background: var(--surface-3); } }

/* -- email list block and footer links -- */
.post-signup { margin-top: var(--sp-16); }
.post-signup h2 { margin: 0 0 var(--sp-2); }
.post-back { margin-top: var(--sp-12); font-size: var(--fs-13); color: var(--text-3); }
/* the section keeps the class pair "container section" (pinned by test/seo.test.js); .section padding wipes the
   container gutter, so restore it here to share the article column edge */
.related-posts { max-width: var(--container-narrow); }
.section.related-posts { padding-left: var(--gutter); padding-right: var(--gutter); }
.related-posts h2 { margin-bottom: 0; }
