/* The blog's typography, in ONE place. The public pages (tarjum/blog.py, inside the site shell) and the editor in the app
   (web/src/pages/AdminBlogEditorPage.tsx) both load this file, so what a writer sees is what a reader gets.
   The body is `.post-body`; the title block and the column around it are `.post-col` / `.post-head`.
   Self-contained: it sets its own faces and colours, because the editor does not load site.css. */

.post-col, .post-body {
  --post-ink: #06283D; --post-text: #16303F; --post-muted: #4A6170; --post-line: #D3DFE6; --post-link: #024872; --post-accent: #0A7A68;
  --post-ar: "Noto Naskh Arabic", "Traditional Arabic", serif;
  --post-ar-head: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --post-en: "Source Serif 4", Georgia, serif;
}
.post-col { box-sizing: border-box; width: 100%; max-width: 760px; margin: 0 auto; padding: 48px 28px 24px; }
.post-col *, .post-col *::before, .post-col *::after { box-sizing: border-box; }

/* the title block */
.post-head { margin: 0 0 28px; }
.post-head h1 { margin: 0; font: 600 clamp(30px, 4.4vw, 44px)/1.3 var(--post-ar-head); color: var(--post-ink); text-wrap: balance; }
.post-head[dir=ltr] h1, .post-head:lang(en) h1 { font-family: var(--post-en); font-weight: 600; line-height: 1.2; }
.post-meta { margin: 12px 0 0; font: 400 15px/1.5 var(--post-ar-head); color: var(--post-muted); }
.post-head[dir=ltr] .post-meta { font-family: var(--post-en); }
.post-lede { margin: 14px 0 0; font: 400 19px/1.8 var(--post-ar-head); color: var(--post-muted); }

.post-cover { margin: 0 0 32px; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: 8px; }

/* the body */
.post-body { font: 400 20px/1.95 var(--post-ar); color: var(--post-text); overflow-wrap: anywhere; }
/* Text blocks keep their spaces as the editor does; the root must not, or a newline BETWEEN blocks (a post made from an HTML file) shows as a blank line. */
.post-body p, .post-body li, .post-body h2, .post-body h3, .post-body h4, .post-body figcaption { white-space: pre-wrap; }
.post-body[dir=ltr], .post-body:lang(en) { font-family: var(--post-en); font-size: 19px; line-height: 1.75; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.1em; }
.post-body h2, .post-body h3, .post-body h4 { font-family: var(--post-ar-head); color: var(--post-ink); text-wrap: balance; margin: 1.8em 0 .5em; }
.post-body[dir=ltr] h2, .post-body[dir=ltr] h3, .post-body[dir=ltr] h4,
.post-body:lang(en) h2, .post-body:lang(en) h3, .post-body:lang(en) h4 { font-family: var(--post-en); }
.post-body h2 { font-size: 30px; font-weight: 600; line-height: 1.35; }
.post-body h3 { font-size: 24px; font-weight: 600; line-height: 1.4; }
.post-body h4 { font-size: 20px; font-weight: 600; line-height: 1.5; }
.post-body a { color: var(--post-link); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: var(--post-ink); }
.post-body strong { font-weight: 700; }
.post-body ul, .post-body ol { margin: 0 0 1.1em; padding-inline-start: 1.6em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin: 0 0 .35em; }
.post-body li > p { margin: 0; }
.post-body blockquote { margin: 1.4em 0; padding: .2em 1.1em; border-inline-start: 4px solid var(--post-accent); color: var(--post-muted); }
.post-body blockquote > p:last-child { margin-bottom: 0; }
.post-body code { font: 400 .88em/1.5 ui-monospace, Consolas, monospace; background: #EEF3F6; border-radius: 4px; padding: .1em .35em; direction: ltr; unicode-bidi: isolate; }
.post-body pre { margin: 1.4em 0; padding: 14px 16px; background: #0E2B3D; color: #E9F2F7; border-radius: 8px; overflow-x: auto; direction: ltr; text-align: left; font: 400 15px/1.6 ui-monospace, Consolas, monospace; }
.post-body pre code { background: none; padding: 0; font: inherit; color: inherit; }
.post-body hr { border: 0; border-top: 1px solid var(--post-line); margin: 2.2em 0; }
.post-body figure { margin: 1.8em 0; }
.post-body img { display: block; max-width: 100%; height: auto; border-radius: 6px; margin-inline: auto; }
.post-body figcaption { margin-top: .6em; text-align: center; font: 400 15px/1.6 var(--post-ar-head); color: var(--post-muted); }
.post-body[dir=ltr] figcaption, .post-body:lang(en) figcaption { font-family: var(--post-en); }

/* a paragraph of another direction inside the post (a quotation in the other script) */
.post-body [dir=ltr] { text-align: left; }
.post-body [dir=rtl] { text-align: right; }

/* the public pages only: the index, the pager, the preview bar and the closing call to action */
.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 40px; }
.post-card { display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; border-bottom: 1px solid var(--post-line); }
.post-list li:last-child .post-card { border-bottom: 0; }
.post-card h2, .post-card h3 { margin: 0; font: 600 28px/1.35 var(--post-ar-head); color: var(--post-ink); }
.post-card[dir=ltr] h2, .post-card[dir=ltr] h3 { font-family: var(--post-en); }
.post-card h2 a, .post-card h3 a { color: inherit; text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { text-decoration: underline; }
.post-card .post-meta { margin: 0; }
.post-card-cover { display: block; margin-bottom: 6px; }
.post-card-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.post-card-summary { margin: 0; font: 400 18px/1.8 var(--post-ar); color: var(--post-text); }
.post-card[dir=ltr] .post-card-summary { font-family: var(--post-en); line-height: 1.65; }
.post-more { align-self: flex-start; font: 600 16px/1.5 var(--post-ar-head); color: var(--post-link); }
.post-empty { font: 400 19px/1.8 var(--post-ar-head); color: var(--post-muted); }
.blog-latest { padding-top: 0; padding-bottom: 0; }
.blog-latest > h2 { margin-bottom: 32px; }
.blog-latest > p { margin-top: 32px; }
.post-pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 40px; font: 400 16px/1.5 var(--post-ar-head); }
.post-preview { background: #FFE2A0; color: #4A2F00; text-align: center; padding: 10px 16px; font: 600 15px/1.5 var(--post-ar-head); }
.post-cta { max-width: 760px; margin: 24px auto 72px; padding: 32px 28px; border-top: 1px solid var(--post-line); }
.post-cta h2 { margin: 0 0 8px; font: 600 26px/1.4 var(--post-ar-head); color: var(--post-ink); }
.post-cta p { margin: 0 0 18px; font: 400 18px/1.8 var(--post-ar-head); color: var(--post-muted); }

@media (max-width: 600px) {
  .post-col { padding: 28px 20px 16px; }
  .post-body { font-size: 18px; line-height: 1.9; }
  .post-body[dir=ltr], .post-body:lang(en) { font-size: 17.5px; }
  .post-body h2 { font-size: 25px; }
  .post-body h3 { font-size: 21px; }
  .post-card h2 { font-size: 24px; }
  .post-cta { padding: 28px 20px; }
}
