/* Blog: the index page (/blog) and the article pages (article-*.html).
   Generated pages: tools/article_build.py. Article text sits in .legal-body (/site.css);
   this adds what articles need on top: cover, headings, images, the "read next" list and the index grid. */

/* ---------- article page ---------- */
.post-cover { width: min(100%, 60rem); margin: calc(-1 * var(--space-120)) auto 0; position: relative; z-index: 1; }
.post-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-24); box-shadow: var(--shadow-ring); }

.post-body { margin-inline: auto; gap: var(--space-8); }
.post-body h2, .post-body h3, .post-body h4 { margin: var(--space-28) 0 var(--space-8); color: var(--ink); font-family: var(--font-sans); text-wrap: balance; }
.post-body h2 { font-size: 24px; line-height: 1.4; font-weight: 600; }
.post-body h3 { font-size: 20px; line-height: 1.45; font-weight: 600; }
.post-body h4 { font-size: 17px; line-height: 1.5; font-weight: 600; }
.post-body > :first-child { margin-top: 0; }
.post-body ol { display: grid; gap: var(--space-8); margin: 0 0 var(--space-12); padding-left: 1.4em; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body img { display: block; max-width: 100%; height: auto; margin: var(--space-16) 0; border-radius: var(--radius-16); }
.post-body figure { margin: var(--space-16) 0; }
.post-body table { width: 100%; margin: var(--space-8) 0 var(--space-16); border-collapse: collapse; font: 400 15px/1.6 var(--font-sans); }
.post-body th, .post-body td { padding: var(--space-12) var(--space-14); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--ink-2); }
.post-body thead th { color: var(--ink); font-weight: 600; }
.post-body tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) { .post-body table { font-size: 14px; } .post-body th, .post-body td { padding: var(--space-10) var(--space-8); } .post-body tbody th { white-space: normal; } }

.post-more { width: min(100%, 44rem); margin: var(--space-72) auto 0; padding-top: var(--space-36); border-top: 1px solid var(--line); }
.post-more h2 { margin: 0 0 var(--space-20); color: var(--ink); font: 600 20px/1.4 var(--font-sans); }
.post-more ul { display: grid; gap: var(--space-12); margin: 0; padding: 0; list-style: none; }
.post-more a { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: var(--space-16); color: var(--ink); text-decoration: none; font: 500 16px/1.5 var(--font-sans); }
.post-more img { width: 112px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-12); }
.post-more a:hover span, .post-more a:focus-visible span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- index page ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-40) var(--space-28); width: min(100%, 72rem); margin-inline: auto; }
.blog-card { display: grid; align-content: start; gap: var(--space-12); color: var(--ink); text-decoration: none; }
.blog-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-20); box-shadow: var(--shadow-ring); transition: transform var(--dur-hover, .3s) var(--ease-hover, ease), box-shadow var(--dur-hover, .3s) var(--ease-hover, ease); }
.blog-card:hover img, .blog-card:focus-visible img { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.blog-card:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 6px; border-radius: var(--radius-20); }
.blog-meta { margin: var(--space-4) 0 0; color: var(--ink-3); font: 500 13px/1.4 var(--font-sans); letter-spacing: .02em; }
.blog-card h2 { margin: 0; font: 600 19px/1.45 var(--font-sans); text-wrap: balance; }
.blog-card p:not(.blog-meta) { margin: 0; color: var(--ink-2); font: 400 15px/1.7 var(--font-sans); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* the newest article leads: two columns wide, text beside the picture */
.blog-card.is-lead { grid-column: span 2; grid-template-columns: 1.25fr 1fr; align-items: center; gap: var(--space-28); }
.blog-card.is-lead h2 { font-size: 26px; line-height: 1.35; }
.blog-card.is-lead .blog-text { display: grid; gap: var(--space-12); }

@media (max-width: 960px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .post-cover { margin-top: calc(-1 * var(--space-96)); }
  .post-cover img { border-radius: var(--radius-16); }
  .post-more a { grid-template-columns: 88px 1fr; font-size: 15px; }
  .post-more img { width: 88px; }
  .blog-grid { grid-template-columns: 1fr; gap: var(--space-36); }
  .blog-card.is-lead { grid-column: auto; grid-template-columns: 1fr; gap: var(--space-12); }
  .blog-card.is-lead h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-card img { transition: none; }
  .blog-card:hover img { transform: none; }
}
