/* Blog pages: reading width on phones, compact index cards, contents list, inline call to action.
   Loaded after each page's own <style>, so these rules win where they overlap. */

/* ── Reading width ───────────────────────────────────────────────────────────
   On a phone the article sat in a card inside a padded page: the text column was ~266px (about 33 characters
   a line). Less padding gives it ~330px. */
@media (max-width: 640px) {
  .layout { padding: 20px 12px 56px; gap: 24px; }
  .article-body { padding: 20px 16px; border-radius: 10px; }
  .article-header { margin-bottom: 20px; }
  .article-title { font-size: var(--step-xl); }
}

/* ── Blog index: the image blocks were 16:9 at full card width (385px tall on a laptop, 192px on a phone) ── */
.card-img { aspect-ratio: auto; height: 150px; font-size: var(--step-3xl); }
@media (max-width: 640px) {
  .hero { padding: 28px 20px 24px; }
  .hero h1 { font-size: var(--step-2xl); margin-bottom: 10px; }
  .card-img { height: 84px; font-size: var(--step-2xl); }
  .card-body { padding: 16px 18px 20px; }
}

/* ── "In this article" ────────────────────────────────────────────────────── */
.blog-toc { margin: 8px 0 24px; padding: 14px 18px; background: #f7f7f8; border: 1px solid #e5e7eb; border-radius: 10px; }
.blog-toc > summary { cursor: pointer; font-weight: 700; font-size: var(--step-sm); min-height: 44px; display: flex; align-items: center; list-style: none; }
.blog-toc > summary::-webkit-details-marker { display: none; }
.blog-toc > summary::after { content: "+"; margin-left: auto; font-size: var(--step-md); }
.blog-toc[open] > summary::after { content: "\2212"; }
.blog-toc ol { margin: 4px 0 0 18px; padding: 0; }
.blog-toc li { margin: 0; }
.blog-toc a { display: inline-block; padding: 8px 0; font-size: var(--step-sm); color: #111; text-decoration: underline; }
.article-body h2 { scroll-margin-top: 80px; }

/* ── Call to action in the middle of a long read, phones only (the side column covers wider screens) ── */
.blog-inline-cta { display: none; }
@media (max-width: 860px) {
  .blog-inline-cta {
    display: flex; flex-direction: column; gap: 10px; margin: 28px 0; padding: 16px 18px; background: #111; color: #fff; border-radius: 10px;
  }
  .blog-inline-cta strong, .article-body .blog-inline-cta strong { font-size: var(--step-md); color: #fff; }
  .blog-inline-cta span { font-size: var(--step-sm); color: #d1d5db; }
  .blog-inline-cta a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; background: #fff; color: #111 !important; font-weight: 700; border-radius: 8px; text-decoration: none; }
}
