/* مدونة زهو — static pages written by scripts/seo/blog.ts. M3 sage tokens (same values as src/m3/tokens.generated.css),
   Thmanyah Sans, RTL, mobile-first. No JavaScript besides the one-line theme pick in the page head. */
@font-face { font-family: "Thmanyah Sans"; src: url("/fonts/thmanyahsans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("/fonts/thmanyahsans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("/fonts/thmanyahsans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("/fonts/thmanyahsans-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  color-scheme: light;
  --primary: #306a4e; --on-primary: #e6ffee; --primary-container: #b3f0cd; --on-primary-container: #225c41;
  --secondary-container: #d0e8d8; --on-secondary-container: #41574a;
  --surface: #f7faf5; --surface-low: #eff5ee; --surface-mid: #e9f0e8; --surface-high: #e2eae2; --surface-lowest: #ffffff;
  --on-surface: #2b352f; --on-surface-variant: #58615b; --outline: #737d76; --outline-variant: #aab4ac;
  --link: #275a41;
  --shadow: 0 20px 48px -28px rgb(20 45 32 / 0.35);
  --r-xl: 28px; --r-l: 20px; --r-m: 16px;
  --max: 1200px; --read: 720px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #a3d1b6; --on-primary: #1e4834; --primary-container: #315b45; --on-primary-container: #bfeed2;
  --secondary-container: #2b4034; --on-secondary-container: #adc5b5;
  --surface: #0b0f0c; --surface-low: #0f1511; --surface-mid: #141b17; --surface-high: #1a211d; --surface-lowest: #070a08;
  --on-surface: #dee8df; --on-surface-variant: #a4aea5; --outline: #6e7871; --outline-variant: #414a44;
  --link: #a3d1b6;
  --shadow: 0 20px 48px -28px rgb(0 0 0 / 0.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--surface); color: var(--on-surface); font-family: "Thmanyah Sans", "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 18px; line-height: 1.8; text-rendering: optimizeLegibility; }
a { color: var(--link); }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 840px) { .wrap { padding-inline: 32px; } }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; padding: 8px 16px; border-radius: 12px; background: var(--primary); color: var(--on-primary); z-index: 60; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* header */
.bar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 45%, transparent); }
.bar-in { display: flex; align-items: center; gap: 8px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 1; color: inherit; text-decoration: none; min-width: 0; }
.brand img { width: 38px; height: 38px; }
.brand b { font-size: 22px; font-weight: 900; line-height: 1; }
.brand small { display: block; font-size: 11px; letter-spacing: 2px; color: var(--on-surface-variant); line-height: 1.4; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--on-surface-variant); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-high); color: var(--on-surface); }
.nav a[aria-current="page"] { color: var(--on-secondary-container); background: var(--secondary-container); }
.nav .cta { background: var(--primary); color: var(--on-primary); }
.nav .cta:hover { background: var(--primary); color: var(--on-primary); filter: brightness(1.08); }
@media (max-width: 599.98px) { .nav .hide-sm { display: none; } .nav a { padding: 8px 12px; } }

/* index */
.hero { padding: 40px 0 24px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(36px, 8vw, 60px); line-height: 1.15; font-weight: 900; }
.hero p { margin: 0; max-width: 640px; font-size: 19px; color: var(--on-surface-variant); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--secondary-container); color: var(--on-secondary-container); font-weight: 900; font-size: 14px; margin-bottom: 16px; line-height: 1; }
.grid { list-style: none; margin: 0; padding: 24px 0 64px; display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { height: 100%; display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-low); color: inherit; text-decoration: none; transition: border-radius .35s cubic-bezier(.34,1.3,.64,1), background-color .2s; }
.card:hover { border-radius: 40px; background: var(--surface-mid); }
.card img { aspect-ratio: 1200 / 630; object-fit: cover; width: 100%; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; flex: 1; }
.card h2 { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 900; }
.card p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--on-surface-variant); flex: 1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--on-surface-variant); }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 10px; background: var(--primary-container); color: var(--on-primary-container); font-weight: 700; font-size: 13px; line-height: 1; }

/* article */
.crumbs { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; color: var(--on-surface-variant); }
.crumbs li + li::before { content: "‹"; margin-inline-end: 8px; color: var(--outline); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.post-head { max-width: 880px; padding: 16px 0 24px; }
.post-head h1 { margin: 12px 0 16px; font-size: clamp(32px, 6.4vw, 52px); line-height: 1.25; font-weight: 900; }
.post-head .lede { margin: 0 0 16px; font-size: 20px; line-height: 1.75; color: var(--on-surface-variant); }
.cover { margin: 0 0 32px; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
.cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
@media (max-width: 599.98px) { .cover { margin-inline: -16px; border-radius: 0; } }
.layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); padding-bottom: 48px; }
@media (min-width: 1080px) { .layout { grid-template-columns: minmax(0, var(--read)) 280px; justify-content: space-between; } }
.toc { align-self: start; padding: 18px 20px; border-radius: var(--r-l); background: var(--surface-low); font-size: 15px; line-height: 1.6; }
.toc b { display: block; margin-bottom: 8px; font-size: 15px; }
.toc ol { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 6px; }
.toc a { color: var(--on-surface-variant); text-decoration: none; }
.toc a:hover { color: var(--primary); text-decoration: underline; }
@media (min-width: 1080px) { .toc { position: sticky; top: 88px; order: 2; } }
.prose { min-width: 0; }
.prose h2 { margin: 48px 0 12px; font-size: clamp(24px, 4.4vw, 30px); line-height: 1.4; font-weight: 900; }
.prose h3 { margin: 32px 0 8px; font-size: 21px; line-height: 1.5; font-weight: 700; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-inline-start: 26px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--primary); font-weight: 700; }
.prose blockquote { margin: 24px 0; padding: 16px 20px; border-inline-start: 4px solid var(--primary); border-radius: 12px; background: var(--surface-low); color: var(--on-surface-variant); }
.prose blockquote p { margin: 0; }
.prose strong { font-weight: 700; color: var(--on-surface); }
.prose > :first-child { margin-top: 0; }
.fn { font-size: 12px; line-height: 0; margin-inline-start: 2px; }
.fn a { text-decoration: none; font-weight: 700; padding: 0 3px; border-radius: 6px; background: var(--primary-container); color: var(--on-primary-container); }
.sources { margin-top: 48px; padding: 20px 24px; border-radius: var(--r-l); background: var(--surface-low); font-size: 15px; line-height: 1.7; }
.sources h2 { margin: 0 0 8px; font-size: 20px; }
.sources ol { margin: 0; padding-inline-start: 22px; }
.sources li { margin-bottom: 10px; overflow-wrap: anywhere; }
.sources li:target { background: var(--secondary-container); border-radius: 8px; }
.sources .back { margin-inline-start: 6px; font-size: 13px; }
.note { margin-top: 24px; font-size: 14px; color: var(--on-surface-variant); }
.zahw-cta { position: relative; overflow: hidden; margin: 40px 0 0; padding: 28px 24px; border-radius: var(--r-xl); background: var(--primary-container); color: var(--on-primary-container); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.zahw-cta b { font-size: 24px; font-weight: 900; line-height: 1.35; }
.zahw-cta p { margin: 0; font-size: 17px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 16px; text-decoration: none; }
.zahw-cta .btn { background: var(--on-primary-container); color: var(--primary-container); }
.btn:hover { filter: brightness(1.08); }
.related { padding: 8px 0 64px; }
.related > h2 { margin: 0; font-size: 26px; font-weight: 900; }
.related .grid { padding-bottom: 0; }

/* footer */
.foot { padding: 40px 0 calc(32px + env(safe-area-inset-bottom)); background: var(--surface-low); font-size: 15px; color: var(--on-surface-variant); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--primary); text-decoration: underline; }
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .bar, .toc, .zahw-cta, .related, .foot { display: none; } body { font-size: 12pt; } }
