/* ============================================================================
   Window Masr — blog (listing + article pages).
   Shared stylesheet so 11 new pages don't each carry a full copy of the nav/
   footer/theme CSS. Reuses the exact same tokens, nav and footer markup/
   classes as portfolio.html so the blog reads as the same site, not a
   bolted-on section. Engine (scrollcraft.js/css) untouched — these are
   plain, non-scroll-jacked pages, same grammar as the portfolio page.
   ============================================================================ */

html { scrollbar-gutter: stable; }
.sc-grain::before { inset: auto; top: 50%; left: 50%; width: 4000px; height: 4000px; transform: translate(-50%, -50%); }

:root {
  --sc-canvas:      #FAF8F3;
  --sc-surface:     #FFFFFF;
  --sc-ink:         #14110D;
  --sc-ink-soft:    #6B6459;
  --sc-accent:      #F6931C;
  --sc-accent-ink:  #FFFFFF;
  --sc-font-display: "Fraunces", Georgia, serif;
  --sc-font-text:    "Manrope", system-ui, sans-serif;
  --sc-font-arabic:  "Cairo", "Tajawal", "Segoe UI", system-ui, sans-serif;
  --wm-line: color-mix(in oklab, var(--sc-ink) 10%, transparent);
}
body { background: var(--sc-canvas); }

/* ---- Arabic / RTL ---- */
[dir="rtl"], .rtl { direction: rtl; text-align: right; unicode-bidi: isolate; }
[lang="ar"] { font-family: var(--sc-font-arabic); }
[dir="rtl"] [data-sc-kinetic], .rtl [data-sc-kinetic] { unicode-bidi: isolate; }
html.lang-ar { --sc-font-display: var(--sc-font-arabic); --sc-font-text: var(--sc-font-arabic); }
html.lang-ar { --sc-leading-none: 1.4; }
html.lang-ar .p-hero h1, html.lang-ar .b-hero h1 { line-height: 1.4 !important; }
html.lang-ar .p-links { margin-inline-start: var(--sc-5); }
/* Whole blocks authored twice (one per language) rather than swapped by JS —
   used for article bodies, where hundreds of one-off sentences aren't worth
   a dictionary entry each. Same mechanism as the homepage's duplicated
   kinetic heading: both live in the DOM, CSS shows only the active one. */
html:not(.lang-ar) .lang-ar-only { display: none; }
html.lang-ar .lang-en-only { display: none; }

/* ---- nav (identical to portfolio.html) ---- */
.p-nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--sc-canvas) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--wm-line);
}
.p-nav__row {
  max-width: var(--sc-maxw); margin-inline: auto; padding-inline: var(--sc-gutter);
  height: 76px; display: flex; align-items: center; justify-content: space-between; gap: var(--sc-5);
}
.p-logo { display: flex; align-items: center; flex-shrink: 0; }
.p-logo img { height: 40px; width: auto; }
.p-links { display: none; align-items: center; gap: var(--sc-7); margin-inline-start: var(--sc-6); }
.p-links a { font-size: var(--sc-t-sm); font-weight: 600; text-decoration: none; color: var(--sc-ink); position: relative; white-space: nowrap; }
.p-links a[aria-current] { color: var(--sc-accent); }
.p-cta { display: none; align-items: center; gap: var(--sc-3); margin-inline-start: var(--sc-6); }
.p-phone { font-size: var(--sc-t-sm); font-weight: 700; text-decoration: none; color: var(--sc-ink); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.p-phone i { color: var(--sc-accent); }
.p-btn {
  background: var(--sc-accent); color: var(--sc-ink); font-weight: 700;
  font-size: var(--sc-t-sm); padding: 12px 22px; border-radius: var(--sc-r-pill);
  text-decoration: none; box-shadow: var(--sc-e1); display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; flex-shrink: 0;
  transition: transform var(--sc-d-base) var(--sc-ease-out), box-shadow var(--sc-d-base) var(--sc-ease-out);
}
.p-btn:hover { transform: translateY(-2px); box-shadow: var(--sc-e2); }
.p-menu-btn { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--sc-r-md); border: 1px solid var(--wm-line); background: none; color: var(--sc-ink); }
.wm-mobile-actions { display: flex; align-items: center; gap: var(--sc-3); flex-shrink: 0; }
@media (min-width: 1300px) {
  .p-links, .p-cta { display: flex; }
  .p-menu-btn, .wm-mobile-actions .wm-lang--mobile { display: none; }
}
.wm-lang { display: flex; align-items: center; border: 1.5px solid var(--wm-line); border-radius: var(--sc-r-pill); padding: 3px; gap: 2px; }
.wm-lang button { border: none; background: none; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: var(--sc-r-pill); color: var(--sc-ink-soft); transition: background 150ms, color 150ms; }
.wm-lang button.is-active { background: var(--sc-ink); color: #fff; }
.wm-lang--drawer { margin: var(--sc-4) var(--sc-gutter); justify-content: center; }
.p-drawer { display: none; border-top: 1px solid var(--wm-line); background: var(--sc-surface); }
.p-drawer.is-open { display: block; }
.p-drawer a { display: block; padding: 14px var(--sc-gutter); font-weight: 600; color: var(--sc-ink); text-decoration: none; border-bottom: 1px solid var(--wm-line); }

/* ---- blog listing hero ---- */
.b-hero { padding-block: var(--sc-9) var(--sc-7); border-bottom: 1px solid var(--wm-line); }
.b-hero__back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--sc-ink-soft); font-size: var(--sc-t-sm); font-weight: 600; padding-block: 10px; margin-block: -10px calc(var(--sc-6) - 10px); }
.b-hero__back:hover { color: var(--sc-accent); }
.b-eyebrow { font-family: var(--sc-font-text); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700; color: #8A4F0A; margin-bottom: var(--sc-3); }
.b-hero h1 { font-size: clamp(2rem, 1.6rem + 2.2vw, 3.6rem); max-width: 40rem; }
.b-hero p { max-width: 42rem; color: var(--sc-ink-soft); font-size: var(--sc-t-lg); margin-top: var(--sc-5); }

/* ---- blog card grid ---- */
.b-grid { max-width: var(--sc-maxw); margin-inline: auto; padding: var(--sc-8) var(--sc-gutter) var(--sc-10); display: grid; gap: var(--sc-6); grid-template-columns: 1fr; }
@media (min-width: 700px)  { .b-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .b-grid { grid-template-columns: repeat(3, 1fr); } }
.b-card {
  display: flex; flex-direction: column; background: var(--sc-surface); border: 1px solid var(--wm-line);
  border-radius: var(--sc-r-lg); overflow: hidden; text-decoration: none; box-shadow: var(--sc-e1);
  transition: transform var(--sc-d-base) var(--sc-ease-out), box-shadow var(--sc-d-base) var(--sc-ease-out);
}
.b-card:hover { transform: translateY(-3px); box-shadow: var(--sc-e2); }
.b-card__top { height: 6px; background: var(--sc-accent); flex: none; }
.b-card__body { padding: var(--sc-6); display: flex; flex-direction: column; gap: var(--sc-3); flex: 1; }
.b-card__tag { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: #8A4F0A; }
.b-card h2 { font-size: 1.25rem; line-height: 1.3; color: var(--sc-ink); }
html.lang-ar .b-card h2 { line-height: 1.5; }
.b-card p { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); line-height: 1.6; flex: 1; }
.b-card__read { font-size: 13px; font-weight: 700; color: var(--sc-ink); display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sc-2); }
.b-card:hover .b-card__read { color: var(--sc-accent); }

/* ---- article page ---- */
.article-hero { padding-block: var(--sc-9) var(--sc-6); border-bottom: 1px solid var(--wm-line); }
.article-hero .b-hero__back { margin-bottom: calc(var(--sc-6) - 10px); }
.article-hero h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 3rem); max-width: 46rem; }
.article-hero .b-eyebrow { margin-bottom: var(--sc-4); }
.article-meta { margin-top: var(--sc-5); display: flex; gap: var(--sc-5); flex-wrap: wrap; font-size: 13px; color: var(--sc-ink-soft); }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta i { color: var(--sc-accent); }

.article-body { max-width: 42rem; margin-inline: auto; padding: var(--sc-9) var(--sc-gutter); }
.article-body > * + * { margin-top: var(--sc-5); }
.article-body h2 { font-size: clamp(1.3rem, 1.15rem + 0.8vw, 1.7rem); margin-top: var(--sc-8); line-height: 1.3; }
html.lang-ar .article-body h2 { line-height: 1.5; }
.article-body p { color: var(--sc-ink); font-size: var(--sc-t-base); line-height: 1.85; }
.article-body ul, .article-body ol { color: var(--sc-ink); font-size: var(--sc-t-base); line-height: 1.85; padding-inline-start: 1.4em; display: flex; flex-direction: column; gap: 10px; }
.article-body li::marker { color: var(--sc-accent); font-weight: 700; }
.article-body strong { color: var(--sc-ink); }

.article-cta {
  max-width: 42rem; margin-inline: auto; margin-top: var(--sc-9); padding: var(--sc-gutter);
  background: linear-gradient(160deg, #14110D 0%, #0B0906 100%); border-radius: var(--sc-r-lg);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--sc-4);
}
.article-cta h3 { color: #fff; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); }
.article-cta p { color: rgba(255,255,255,.75); font-size: var(--sc-t-sm); max-width: 30rem; }
.article-cta .p-btn { margin-top: var(--sc-2); }

.article-nav { max-width: 42rem; margin-inline: auto; padding: 0 var(--sc-gutter) var(--sc-10); display: flex; justify-content: space-between; gap: var(--sc-4); flex-wrap: wrap; }
.article-nav a { font-size: var(--sc-t-sm); font-weight: 700; color: var(--sc-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.article-nav a:hover { color: var(--sc-accent); }

/* ---- footer (identical to portfolio.html) ---- */
footer.p-foot { background: #14110D; color: color-mix(in oklab, #fff 78%, transparent); }
.p-foot__bar { height: 6px; background: repeating-linear-gradient(90deg, #F6931C 0 24px, #FAB551 24px 28px, #F6931C 28px 52px, #14110D 52px 56px); }
.p-foot__grid { max-width: var(--sc-maxw); margin-inline: auto; padding: var(--sc-8) var(--sc-gutter); display: grid; gap: var(--sc-7); grid-template-columns: 1fr; }
@media (min-width: 860px) { .p-foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.p-foot__grid a { color: inherit; text-decoration: none; }
.p-foot__grid a:hover { color: var(--sc-accent); }
.p-foot h2 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; margin-bottom: var(--sc-4); }
.p-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.p-foot__social { display: flex; gap: 10px; margin-top: var(--sc-5); }
.p-foot__social a { width: 38px; height: 38px; border-radius: 999px; background: color-mix(in oklab, #fff 12%, transparent); display: inline-flex; align-items: center; justify-content: center; }
.p-foot__social a:hover { background: var(--sc-accent); color: #14110D; }
.p-foot__bottom { border-top: 1px solid color-mix(in oklab, #fff 10%, transparent); padding: var(--sc-5) var(--sc-gutter); display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: 12px; color: color-mix(in oklab, #fff 55%, transparent); max-width: var(--sc-maxw); margin-inline: auto; }
