/* Blog article pages (lib/blog.js). Loaded after rectoly.css on the articles only (BLOG_CSS_VERSION in
   lib/blog.js: raise it with any change here), so the rest of the site's pages and their CSS_VERSION
   are untouched. Its rules win over rectoly.css's .post-header ones by coming later. */

/* The article's header, wider than the text (2026-11-26). The titles are written for search and run to
   60-110 characters; inside the 640px text column a 50px title broke into four or five lines, packed
   into the middle of the page. On a computer the header now takes up to 1000px, centred, with its lines
   balanced; the article text keeps its 640px column for a comfortable line length. On a phone the
   header stays in the page's own width, left-aligned as before. */
@media (min-width: 769px) {
  /* Equal negative margins on both sides (not a width and a left margin), so it stays centred on the
     right-to-left pages (ar) too. */
  .post-header {
    margin-inline: calc((100% - min(1000px, 100vw - 80px)) / 2);
    text-align: center;
  }
  .post-header .crumbs { justify-content: center; }
  .post-header h1 {
    font-size: clamp(32px, 3.4vw, 46px);
    line-height: 1.2;
    text-wrap: balance;
  }
  .post-header .post-lede {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    font-size: 18px;
    text-wrap: pretty;
  }
  /* The rule under the header keeps the text column's width, so it lines up with the article. */
  .post-header .post-meta { max-width: 640px; margin-left: auto; margin-right: auto; }
}

@media (max-width: 768px) {
  .post-header h1 { font-size: clamp(26px, 7vw, 34px); line-height: 1.25; text-wrap: balance; }
}

/* Urdu is set in Nastaliq, whose letters stand much taller than Latin ones: at the line heights above
   the two lines of a title ran into each other (2026-11-26, when the blog came to Urdu). The headings
   get room for it; body text already has 1.85. The blog index loads this file too, for its cards. */
html[lang="ur"] .post-header h1 { line-height: 1.9; }
html[lang="ur"] .post-body h2,
html[lang="ur"] .post-body h3,
html[lang="ur"] .post-card h2,
html[lang="ur"] .post-cta h2 { line-height: 1.8; }
html[lang="ur"] .post-lede { line-height: 2; }
