/* ============================================================
   Aventurine: the blog (/blog/ and /blog/<slug>/)
   Load after css/sections.css and css/sections-layer.css.
   These pages are generated by scripts/build-blog.js.

   Everything spans the site's full content column (.wrap), as on
   index.html. Prose stays readable by sitting in a column of a grid, never
   by narrowing the page; the column beside it holds the post's contents.

   No eyebrows: no small uppercase labels above headings or sections.
   ============================================================ */

.blog-page { padding: clamp(4.5rem, 9vw, 6.5rem) 0 clamp(3rem, 6vw, 4.5rem) }
.blog-head h1 { margin: 0; font-size: var(--font-size-page-title); text-wrap: balance }
.blog-head .lead {
  margin: 1.4rem 0 0;
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}
.blog-byline { margin: 1rem 0 0; font-size: .95rem; color: var(--text-muted) }
.blog-byline a { color: inherit }

/* ---------- the post list ---------- */
.blog-list {
  list-style: none;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.blog-item {
  display: grid;
  grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
  gap: .6rem clamp(1.5rem, 4vw, 3rem);
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--border);
}
.blog-item time { font-size: .95rem; line-height: 1.9; color: var(--text-muted) }
.blog-item h2 { margin: 0; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.25; text-wrap: balance }
.blog-item h2 a { color: var(--text); text-decoration: none }
.blog-item h2 a:hover { color: var(--accent); text-decoration: underline }
.blog-item p { margin: .55rem 0 0; line-height: 1.6; color: var(--text-muted); text-wrap: pretty }
.blog-empty { margin: clamp(2.5rem, 5vw, 4rem) 0 0; font-size: 1.1rem; color: var(--text-muted) }
@media (max-width: 640px) { .blog-item { grid-template-columns: minmax(0, 1fr) } }

.blog-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  color: var(--text-muted);
}
.blog-pager a { color: var(--accent) }

/* ---------- a post ---------- */
.blog-post {
  display: grid;
  grid-template-columns: minmax(0, 46rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
@media (max-width: 900px) {
  .blog-post { grid-template-columns: minmax(0, 1fr) }
  .blog-toc { display: none }
}

.blog-prose { font-size: 1.08rem; line-height: 1.75; color: var(--text-muted); overflow-wrap: break-word }
.blog-prose > * + * { margin-top: 1.1rem }
.blog-prose > :first-child { margin-top: 0 }
.blog-prose h2 { margin-top: 2.6rem; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.2; color: var(--text); scroll-margin-top: 6rem }
.blog-prose h3 { margin-top: 2rem; font-size: 1.25rem; font-weight: 700; color: var(--text); scroll-margin-top: 6rem }
.blog-prose h4, .blog-prose h5, .blog-prose h6 { margin-top: 1.6rem; font-size: 1.05rem; font-weight: 700; color: var(--text) }
.blog-prose ul, .blog-prose ol { padding-left: 1.3rem }
.blog-prose li + li { margin-top: .4rem }
.blog-prose li > ul, .blog-prose li > ol { margin-top: .4rem }
.blog-prose li.task { list-style: none; margin-left: -1.3rem }
.blog-prose strong { color: var(--text) }
.blog-prose a { color: var(--accent) }
.blog-prose mark { padding: 0 .2em; border-radius: 3px; background: var(--accent-soft); color: var(--text) }
.blog-prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4rem 0 }
.blog-prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md) }
.blog-prose blockquote {
  margin-inline: 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--accent-soft);
  font-family: 'Lusitana', Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--text);
}
.blog-prose code {
  padding: .1em .35em;
  border-radius: 4px;
  background: var(--panel);
  font: 400 .88em 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--text);
}
.blog-prose pre {
  padding: 1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  font-size: .92rem;
  line-height: 1.6;
}
.blog-prose pre code { padding: 0; background: none; font-size: inherit }

.blog-prose .blog-table { overflow-x: auto }
.blog-prose table { width: 100%; border-collapse: collapse; font-size: .98rem }
.blog-prose th, .blog-prose td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top }
.blog-prose th { color: var(--text); font-weight: 700 }

.blog-prose .callout {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.blog-prose .callout > * + * { margin-top: .6rem }
.blog-prose .callout-title { margin: 0; font-weight: 700; color: var(--text) }
.blog-prose .callout-warning, .blog-prose .callout-danger { border-left-color: var(--danger) }

/* ---------- the contents beside the writing ---------- */
.blog-toc { position: sticky; top: 6rem; font-size: .95rem }
.blog-toc-title { margin: 0 0 .6rem; font-weight: 700; color: var(--text) }
.blog-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--border) }
.blog-toc li a { display: block; padding: .3rem 0 .3rem 1rem; color: var(--text-muted); text-decoration: none; line-height: 1.4 }
.blog-toc li a:hover { color: var(--accent) }

.blog-all { margin: clamp(2.5rem, 5vw, 4rem) 0 0 }
.blog-all a { color: var(--accent) }

/* base.css paints em with a green sweep and no slant (for headline accents);
   in a post it is ordinary italic emphasis */
.blog-prose em, .blog-item em {
  font-style: italic;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}
