/* ==========================================================================
   Polices hébergées localement (fiabilité : plus de dépendance à Google Fonts)
   ========================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/tajawal-arabic-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/tajawal-arabic-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/tajawal-arabic-700-normal.woff2') format('woff2'); }

/* ==========================================================================
   Mohamed Baraa Lafi — Site personnel
   Design tokens + composants partagés
   ========================================================================== */

:root {
  --navy-900: #0D1F3C;
  --navy-700: #16315F;
  --navy-500: #1D6FD9;
  --gold: #2F80ED;
  --gold-light: #2F80ED;
  --cream: #F8FAFC;
  --gray-100: #EEF2F7;
  --white: #FFFFFF;

  --bg: var(--cream);
  --bg-alt: var(--gray-100);
  --surface: var(--white);
  --text: #111827;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --accent: var(--gold);
  --accent-text: #FFFFFF;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #DC2626;
  --nav-bg: rgba(248, 250, 252, 0.85);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);

  --font-title: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-ar: 'Tajawal', 'Inter', sans-serif;

  --radius: 10px;
  --container: 1160px;
}

html[data-theme="dark"] {
  --navy-900: #3A6ACF;
  --navy-700: #5A88E6;
  --gold: #5EA2FF;
  --gold-light: #5EA2FF;
  --bg: #0B1120;
  --bg-alt: #111827;
  --surface: #1E293B;
  --text: #F8FAFC;
  --text-muted: #CBD5E1;
  --border: #334155;
  --accent: var(--gold);
  --accent-text: #0B1120;
  --success: #4ADE80;
  --warning: #FBBF24;
  --danger: #F87171;
  --nav-bg: rgba(11, 17, 32, 0.85);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="ar"] { --font-title: 'Tajawal', 'Inter', sans-serif; --font-body: 'Tajawal', 'Inter', sans-serif; }
html[lang="ar"] body { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0; color: var(--text); }
p { margin: 0; line-height: 1.7; color: var(--text-muted); }
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
section { padding: 72px 0; }
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 14px;
}
html[data-theme="dark"] .eyebrow { color: var(--gold); }
.section-head { max-width: 640px; margin: 0 0 40px; }
.section-head h2 { font-size: 32px; font-weight: 600; margin-bottom: 10px; }
.section-head p { font-size: 16px; }
.accent-underline {
  width: 46px; height: 3px; border-radius: 2px; margin: 16px 0 22px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold));
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px;
  border-radius: 6px; font-size: 14px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.btn-primary { background: var(--navy-900); color: var(--white); box-shadow: 0 4px 14px rgba(13,27,42,0.25); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(13,27,42,0.3); }
html[data-theme="dark"] .btn-primary { background: var(--gold); color: var(--navy-900); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.btn-outline { border-color: var(--text); color: var(--text); }
.btn-outline:hover { background: var(--text); color: var(--bg); transform: translateY(-3px); }
.btn-tan { background: var(--gold); color: var(--navy-900); }
.btn-tan:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(199,180,155,0.4); }

/* ---------- Nav ---------- */
header.site-nav {
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(10px);
  background: var(--nav-bg); border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; max-width: var(--container); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; border-radius: 50%; transition: transform 0.4s ease; }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--font-title); font-size: 16px; font-weight: 700; color: var(--text); }
.brand-text span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
nav.primary-nav { display: flex; align-items: center; gap: 26px; }
nav.primary-nav a {
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text); position: relative; padding-bottom: 4px;
}
nav.primary-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--gold); transition: width 0.3s ease;
}
nav.primary-nav a:hover::after, nav.primary-nav a.active::after { width: 100%; }
nav.primary-nav a.active { color: var(--gold); }
nav.primary-nav a[data-i18n-aria="nav_home"] {
  display: flex; align-items: center; justify-content: center; padding: 4px;
}
.nav-tools { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; gap: 4px; font-size: 12px; font-weight: 700; }
.lang-switch button {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  padding: 5px 9px; border-radius: 5px; cursor: pointer; transition: all 0.25s ease;
}
.lang-switch button.active, .lang-switch button:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease;
}
.theme-toggle:hover { transform: rotate(20deg); border-color: var(--gold); }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--text); }
.burger { display: none; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.burger span { display: block; width: 16px; height: 2px; background: var(--text); margin: 3px auto; transition: all 0.3s ease; }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 64px; position: relative; overflow: hidden; text-align: center;
  background: radial-gradient(circle at 85% 10%, rgba(185,146,74,0.12), transparent 55%),
              radial-gradient(circle at 10% 95%, rgba(27,58,92,0.07), transparent 50%);
}
.hero-grid { display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: 720px; margin: 0 auto; }
.hero-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.hero-photo {
  width: 200px; height: 200px; border-radius: 50%; overflow: hidden; position: relative;
  border: 6px solid var(--surface); box-shadow: var(--shadow-lg);
  animation: floaty 6s ease-in-out infinite;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo::after {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  border: 1.5px dashed var(--gold); animation: spin 34s linear infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }
.flags { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--text-muted); }
.flags span.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.hero h1 { font-size: 44px; line-height: 1.15; font-weight: 700; margin: 4px 0 4px; }
.hero .role { font-size: 16px; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.hero h1 em { font-style: normal; color: var(--navy-700); }
html[data-theme="dark"] .hero h1 em { color: var(--gold); }
.hero p.lead { font-size: 17px; max-width: 58ch; margin: 8px 0 6px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* ---------- Quote band ---------- */
.quote-band { text-align: center; padding: 90px 0; }
.quote-band blockquote {
  font-family: var(--font-title); font-size: 28px; line-height: 1.5; font-weight: 500;
  color: var(--text); max-width: 780px; margin: 0 auto 20px; font-style: italic; position: relative;
}
.quote-band blockquote::before { content: '“'; color: var(--gold); font-size: 60px; display: block; line-height: 0.5; margin-bottom: 18px; font-family: var(--font-title); }
.quote-band cite { font-style: normal; font-size: 14px; color: var(--text-muted); letter-spacing: 0.03em; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 44px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat b { font-family: var(--font-title); font-size: 34px; color: var(--navy-700); display: block; }
html[data-theme="dark"] .stat b { color: var(--gold); }
.stat span { font-size: 13px; color: var(--text-muted); }

/* ---------- About / info cards ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.info-card { background: var(--bg-alt); border-radius: var(--radius); padding: 28px; display: grid; gap: 20px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; }
.info-row .ic {
  width: 36px; height: 36px; border-radius: 8px; background: var(--gold); color: var(--navy-900);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.info-row b { display: block; font-size: 15px; margin-bottom: 3px; }
.info-row span { font-size: 13px; color: var(--text-muted); }

/* ---------- Cards grid (work / articles / publications) ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; position: relative; overflow: hidden; transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--navy-700), var(--gold));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.card:hover::before { transform: scaleX(1); }
.card .tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; display: block; }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; font-family: var(--font-body); }
.card p { font-size: 14px; }
.card .meta { font-size: 12.5px; color: var(--text-muted); margin-top: 12px; }
.card .link-more { font-size: 13px; font-weight: 700; color: var(--navy-700); margin-top: 14px; display: inline-block; }
html[data-theme="dark"] .card .link-more { color: var(--gold); }

/* ---------- Publications list rows ---------- */
.pub-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 18px; align-items: start;
  padding: 24px 12px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent;
  border-radius: 4px; transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}
.pub-row:hover { background: var(--bg-alt); border-left-color: var(--gold); padding-left: 20px; }
.pub-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
  color: var(--text-muted); transition: color 0.3s ease, border-color 0.3s ease;
}
.pub-icon svg { width: 20px; height: 20px; }
.pub-row:hover .pub-icon { color: var(--accent); border-color: var(--accent); }
.pub-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pub-row .yr { font-family: var(--font-title); font-size: 13.5px; color: var(--text-muted); }
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge svg { flex-shrink: 0; }
.badge-type { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-published { background: rgba(34,197,94,0.13); color: var(--success); }
.badge-draft { background: rgba(47,128,237,0.13); color: var(--accent); }
.badge-progress { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-eco { background: rgba(47,128,237,0.13); color: var(--accent); }
.badge-politique { background: rgba(139,92,246,0.14); color: #7C3AED; }
html[data-theme="dark"] .badge-politique { color: #A78BFA; background: rgba(167,139,250,0.16); }
.badge-social { background: rgba(34,197,94,0.13); color: var(--success); }
.pub-row h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; font-family: var(--font-body); line-height: 1.4; }
.pub-row .venue { font-style: italic; font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.pub-row .co { font-size: 13.5px; }
.pub-row .dl { font-size: 13px; font-weight: 700; color: var(--navy-700); white-space: nowrap; padding-top: 3px; }
html[data-theme="dark"] .pub-row .dl { color: var(--gold); }
.pub-row .soon { font-size: 12.5px; font-style: italic; color: var(--text-muted); white-space: nowrap; padding-top: 3px; }

/* ---------- Sections showcase (home) ---------- */
.showcase { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.showcase a {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 20px; text-align: center; transition: all 0.35s ease;
}
.showcase a:hover { background: var(--navy-900); border-color: var(--navy-900); transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.showcase a:hover .ic2 { background: var(--gold); }
.showcase a:hover b, .showcase a:hover span { color: #fff; }
.showcase .ic2 {
  width: 46px; height: 46px; border-radius: 50%; background: var(--bg-alt); margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; transition: background 0.3s ease;
}
.showcase b { display: block; font-size: 15px; margin-bottom: 4px; }
.showcase span { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Values band ---------- */
.values-band { background: var(--navy-900); color: #fff; border-radius: var(--radius); padding: 40px 30px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.values-band .v { display: flex; gap: 12px; align-items: flex-start; }
.values-band b { display: block; color: var(--gold); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.values-band span { font-size: 14px; }

/* ---------- Timeline (CV) ---------- */
.timeline { position: relative; padding-left: 26px; border-left: 2px solid var(--border); }
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item::before {
  content: ''; position: absolute; left: -32px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy-700); border: 2px solid var(--bg); transition: transform 0.3s ease, background 0.3s ease;
}
html[data-theme="dark"] .tl-item::before { background: var(--gold); }
.tl-item:hover::before { transform: scale(1.4); }
.tl-item .yr { font-size: 12.5px; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.tl-item h3 { font-size: 16px; font-weight: 600; margin: 4px 0 3px; font-family: var(--font-body); }
.tl-item span.sub { font-size: 13.5px; color: var(--text-muted); }
.skill-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-pills span { background: var(--bg-alt); border: 1px solid var(--border); padding: 7px 14px; border-radius: 20px; font-size: 13px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-links a {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; font-size: 15px; font-weight: 600; transition: all 0.3s ease;
}
.contact-links a:hover { border-color: var(--gold); background: var(--bg-alt); transform: translateX(6px); }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 13px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: 14px; margin-bottom: 14px;
  transition: border-color 0.3s ease;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--gold); }
.contact-form label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

/* ---------- Footer ---------- */
footer.site-footer { background: var(--navy-900); color: #cfd6dd; padding: 56px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 34px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-grid h4 { color: #fff; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px; font-family: var(--font-body); }
.footer-grid a, .footer-grid p { font-size: 14px; color: #b9c2cc; display: block; margin-bottom: 10px; }
.footer-grid a:hover { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; font-size: 13px; color: #8b95a1; flex-wrap: wrap; gap: 12px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.socials a:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-900); transform: translateY(-3px); }

/* ---------- Page header (internal pages) ---------- */
.page-header { padding-top: 56px; padding-bottom: 20px; }
.page-header h1 { font-size: 36px; font-weight: 700; }

/* ---------- reveal-on-load ---------- */
.reveal { opacity: 0; animation: fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) forwards; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.18s; } .d3 { animation-delay: 0.3s; } .d4 { animation-delay: 0.42s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- RTL ---------- */
html[dir="rtl"] .pub-row { grid-template-columns: auto 1fr 52px; }
html[dir="rtl"] .pub-row:hover { border-left-color: transparent; border-right-color: var(--gold); padding-left: 12px; padding-right: 20px; }
html[dir="rtl"] .timeline { padding-left: 0; padding-right: 26px; border-left: none; border-right: 2px solid var(--border); }
html[dir="rtl"] .tl-item::before { left: auto; right: -32px; }
html[dir="rtl"] .info-row, html[dir="rtl"] .contact-links a { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] nav.primary-nav a::after { left: auto; right: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-photo-wrap { order: -1; }
  .hero-cta { justify-content: center; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .showcase { grid-template-columns: 1fr 1fr; }
  .values-band { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  nav.primary-nav { position: fixed; top: 73px; left: 0; right: 0; background: var(--bg); flex-direction: column;
    align-items: flex-start; padding: 20px 28px; border-bottom: 1px solid var(--border); gap: 16px;
    transform: translateY(-130%); opacity: 0; transition: all 0.35s ease; z-index: 90; }
  nav.primary-nav.open { transform: translateY(0); opacity: 1; }
  .burger { display: block; }
  .nav-tools { order: 3; }
  .hero h1 { font-size: 34px; }
  .grid-3, .showcase, .values-band, .footer-grid, .stats { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
  .hero { padding: 56px 0 40px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  /* More breathing room around content on phones */
  .page-header { padding-top: 44px; padding-bottom: 24px; }
  .page-header h1 { font-size: 29px; }
  .grid-3 { gap: 22px; row-gap: 26px; }

  /* Larger, easier-to-read article card text */
  .card { box-shadow: 0 3px 14px rgba(15,23,42,0.09); }
  .card .tag { font-size: 12px; }
  .card h3 { font-size: 18.5px; line-height: 1.45; }
  .card .link-more { font-size: 14.5px; margin-top: 16px; }
  .badge { font-size: 11.5px; padding: 4px 11px; }

  /* Bigger, more readable long-form article text */
  .article-body { font-size: 18px; line-height: 1.85; }
  .article-body h2 { font-size: 20.5px; margin: 38px 0 16px; }
  .article-body h3 { font-size: 17px; }
  .article-lede { font-size: 17.5px; }
}

/* ---------- Long-form article page ---------- */
.back-to-list { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--navy-700); margin-bottom: 18px; }
html[data-theme="dark"] .back-to-list { color: var(--gold); }
.back-to-list svg { width: 16px; height: 16px; }
html[dir="rtl"] .back-to-list svg, .article-body[dir="rtl"] .back-to-list svg { transform: scaleX(-1); }

.article-body { max-width: 760px; margin: 0 auto; font-size: 17.5px; line-height: 1.9; color: var(--text); }
[data-lang-block] { display: none; }
[data-lang-block="en"] { display: block; }
.article-body[lang="ar"] { font-family: var(--font-ar); }
.article-body p { margin: 0 0 20px; }
.article-body h2 { font-size: 21px; font-weight: 700; margin: 46px 0 18px; color: var(--navy-700); }
html[data-theme="dark"] .article-body h2 { color: var(--gold); }
.article-body h3 { font-size: 16.5px; font-weight: 700; margin: 30px 0 12px; }
.article-lede { font-size: 18px; color: var(--text-muted); max-width: 760px; margin: 0 auto 8px; }

.article-chart-card { max-width: 760px; margin: 26px auto 34px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 22px 18px; box-shadow: var(--shadow); }
.article-chart-card h4 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.article-chart-card .chart-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 16px; }
.chart-svg-wrap { width: 100%; overflow-x: auto; }
.chart-svg-wrap svg { display: block; width: 100%; height: auto; }
.chart-source { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; }

.article-refs { max-width: 760px; margin: 46px auto 0; padding-top: 26px; border-top: 1px solid var(--border); }
.article-refs ol { padding-inline-start: 22px; display: grid; gap: 12px; font-size: 14px; color: var(--text-muted); }
.article-refs ol[dir="rtl"] { padding-inline-start: 0; padding-inline-end: 22px; }
.article-refs a { color: var(--navy-700); font-weight: 600; }
html[data-theme="dark"] .article-refs a { color: var(--gold); }

/* ---------- Interactive cost-comparison table ---------- */
.cost-table-card { max-width: 100%; margin: 26px 0 34px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 22px 20px; box-shadow: var(--shadow); }
.cost-table-card h4 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.cost-table-card .chart-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.cost-table-sort { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-alt);
  color: var(--text); cursor: pointer; margin-bottom: 14px; transition: all .15s ease; }
.cost-table-sort:hover { border-color: var(--gold); color: var(--gold); }
.cost-table-sort svg { width: 13px; height: 13px; transition: transform .2s ease; }
.cost-table-sort.desc svg { transform: rotate(180deg); }
.cost-table-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.cost-table { border-collapse: collapse; width: 100%; font-size: 12.5px; white-space: nowrap; }
.cost-table th, .cost-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: end; }
.cost-table thead th { background: var(--bg-alt); font-weight: 700; color: var(--text); position: sticky; top: 0; }
.cost-table td.cat-cell, .cost-table td.item-cell, .cost-table th.corner-cell, .cost-table th.item-head {
  text-align: start; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cost-table thead th.corner-cell, .cost-table thead th.item-head { background: var(--bg-alt); z-index: 2; }
.cost-table td.cat-cell { font-weight: 700; color: var(--navy-700); background: var(--bg-alt); }
html[data-theme="dark"] .cost-table td.cat-cell { color: var(--gold); }
.cost-table td.weight-badge { text-align: center; font-size: 11px; color: var(--text-muted); }
.cost-table tbody tr:hover td:not(.cat-cell) { background: var(--bg-alt); }
.cost-table tfoot td { font-weight: 700; border-bottom: none; border-top: 2px solid var(--border); }
.cost-table th.tn-col, .cost-table td.tn-col { box-shadow: inset 0 0 0 9999px rgba(47,128,237,0.08); border-inline: 2px solid var(--gold); }
.cost-table-source { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; }

.article-cover { max-width: 760px; margin: 22px auto 6px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.article-cover img { display: block; width: 100%; height: auto; }

.share-bar { max-width: 760px; margin: 18px auto 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: all .15s ease; }
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.share-copied { font-size: 12.5px; color: var(--success); font-weight: 700; }
