/* ==========================================================================
   AFCAAR — Coalition pour l'Autonomisation des Femmes Créatrices,
   Agricultrices et Artisanes
   Main stylesheet (vanilla CSS, no build step)
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Brand palette (from the logo) */
  --olive: #5E7A3A;
  --olive-dark: #3F5626;
  --olive-deep: #2C3D1A;
  --terracotta: #C8643B;
  --terracotta-deep: #A04A24;   /* AA-safe terracotta for text / buttons */
  --turquoise: #2E9C9A;
  --turquoise-deep: #1F6F6E;    /* AA-safe turquoise for text */
  --sand: #EADBC4;
  --stone: #F6EFE4;
  --ink: #24301C;
  --ink-soft: #4A5640;
  --white: #FFFDF9;

  /* Semantic */
  --bg: var(--stone);
  --surface: var(--white);
  --text: var(--ink);
  --text-muted: #56614B;
  --line: rgba(36, 48, 28, .12);

  /* Typography */
  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Tajawal", "Segoe UI", Tahoma, sans-serif;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 18px;
  --radius-sm: 10px;
  --header-h: 84px;
  --header-h-small: 64px;

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(36, 48, 28, .08);
  --shadow: 0 12px 32px -12px rgba(36, 48, 28, .25);
  --shadow-lg: 0 30px 60px -20px rgba(36, 48, 28, .35);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* Berber motif (inline SVG data URI, used for card borders / strips) */
  --berber-strip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Cpath d='M0 6 6 1l6 5 6-5 6 5 6-5 6 5 6-5 6 5' fill='none' stroke='%23C8643B' stroke-width='1.6'/%3E%3Cpath d='M24 3l3 3-3 3-3-3z' fill='%232E9C9A'/%3E%3Cpath d='M0 3l3 3-3 3zM48 3l-3 3 3 3z' fill='%235E7A3A'/%3E%3C/svg%3E");
  --berber-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23EADBC4' stroke-width='1' opacity='.55'%3E%3Cpath d='M30 4 56 30 30 56 4 30z'/%3E%3Cpath d='M30 16 44 30 30 44 16 30z'/%3E%3C/g%3E%3Cpath d='M30 26l4 4-4 4-4-4z' fill='%23EADBC4' opacity='.5'/%3E%3C/svg%3E");
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html[dir="rtl"] body,
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }

img, svg, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--olive-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 {
  font-family: var(--font-ar); font-weight: 700; letter-spacing: 0; line-height: 1.4;
}
h1 { font-size: clamp(2.2rem, 5.5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
p { margin: 0 0 1.1em; }
.ar { font-family: var(--font-ar); }
[hidden] { display: none !important; }

/* Focus states (keyboard) */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--turquoise);
  outline-offset: 3px;
  border-radius: 6px;
}
.on-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--sand); }

.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 1000;
  background: var(--olive-dark); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--olive); color: #fff; }

/* ---------- 3. Layout helpers ---------- */
main { overflow-x: clip; } /* slide-in reveals must never widen the mobile viewport */
@supports not (overflow-x: clip) { main { overflow-x: hidden; } }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 120px); position: relative; }
.section--tight { padding-block: clamp(48px, 7vw, 80px); }
.section--sand { background: var(--sand); }
.section--white { background: var(--white); }
.section--dark { background: var(--olive-deep); color: var(--stone); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section-head { max-width: 720px; margin: 0 auto clamp(36px, 5vw, 60px); text-align: center; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }
.section--dark .section-head p { color: var(--sand); }
.section-head--start { margin-inline: 0; text-align: start; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--terracotta-deep); margin-bottom: 14px;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; font-size: .95rem; }
.eyebrow::before {
  content: ""; width: 26px; height: 10px; flex: none;
  background: var(--berber-strip) left center / auto 10px repeat-x;
}
.section--dark .eyebrow, .on-dark .eyebrow { color: var(--sand); }
.grid { display: grid; gap: clamp(20px, 3vw, 32px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.text-center { text-align: center; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-muted); }

/* Berber divider (inline SVG pattern injected by main.js) */
.berber-divider { display: block; width: 100%; height: 24px; overflow: hidden; }
.berber-divider svg { width: 100%; height: 24px; }
.berber-divider--short { max-width: 180px; margin: 0 auto 20px; height: 18px; }
.berber-divider--short svg { height: 18px; }

/* ---------- 4. Buttons ---------- */
.btn {
  --btn-bg: var(--olive);
  --btn-fg: #fff;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px;
  border: 2px solid var(--btn-bg); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 500; font-size: .98rem; text-decoration: none; letter-spacing: .01em;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), transform .25s var(--ease);
  will-change: transform;
}
.btn:hover { color: var(--btn-fg); box-shadow: 0 10px 24px -10px rgba(36, 48, 28, .55); }
.btn svg { width: 18px; height: 18px; flex: none; }
html[dir="rtl"] .btn .icon-arrow { transform: scaleX(-1); }
.btn--primary { --btn-bg: var(--terracotta-deep); }
.btn--primary:hover { --btn-bg: #8A3D1C; }
.btn--olive:hover { --btn-bg: var(--olive-dark); }
.btn--ghost { background: transparent; color: var(--olive-dark); border-color: currentColor; }
.btn--ghost:hover { background: var(--olive-dark); border-color: var(--olive-dark); color: #fff; }
.btn--light { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn--light:hover { background: #fff; color: var(--olive-deep); border-color: #fff; }
.btn--small { min-height: 40px; padding: 8px 18px; font-size: .9rem; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn .ripple {
  position: absolute; z-index: -1; border-radius: 50%; pointer-events: none;
  background: rgba(255, 255, 255, .45); transform: scale(0);
  animation: ripple .65s var(--ease-out) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 500; padding-block: 8px;
  text-decoration: none; color: var(--olive-dark);
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }
html[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
html[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translateX(4px); }

/* ---------- 5. Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  background: var(--stone);
  transition: opacity .6s var(--ease), visibility .6s;
  animation: loaderFailsafe .6s 3s forwards; /* CSS-only safety net if JS is slow or blocked */
}
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; } }
.loader.is-done { opacity: 0; visibility: hidden; }
html:not(.js) .loader, html.no-loader .loader { display: none; }
/* Hold hero entrance animations until the loader has gone */
html.js:not(.no-loader):not(.loaded) .hero *,
html.js:not(.no-loader):not(.loaded) .hero h1 .word > span { animation-play-state: paused; }
.loader-inner { display: grid; justify-items: center; gap: 18px; }
.loader-logo { width: 120px; height: 120px; object-fit: contain; opacity: 0; transform: scale(.92); animation: loaderLogo .9s .1s var(--ease-out) forwards; }
.loader-pattern { width: 220px; height: 40px; }
.loader-pattern path {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: draw 1.4s var(--ease) forwards;
}
.loader-pattern .p1 { stroke: var(--terracotta); }
.loader-pattern .p2 { stroke: var(--turquoise); animation-delay: .25s; }
.loader-pattern .p3 { stroke: var(--olive); animation-delay: .45s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes loaderLogo { to { opacity: 1; transform: none; } }

/* ---------- 6. Page transition overlay ---------- */
.page-transition {
  position: fixed; inset: 0; z-index: 1900; pointer-events: none;
  background: var(--olive-deep) var(--berber-tile);
  opacity: 0; transition: opacity .35s var(--ease);
}
.page-transition.is-active { opacity: 1; pointer-events: all; }

/* ---------- 7. Header ---------- */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 900;
  height: var(--header-h);
  color: #fff;
  transition: height .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease), color .35s var(--ease);
}
.site-header::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 6px;
  background: var(--berber-strip) center / auto 6px repeat-x; opacity: 0; transition: opacity .35s;
}
.site-header.is-scrolled {
  height: var(--header-h-small);
  background: rgba(246, 239, 228, .82);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 6px 24px -14px rgba(36, 48, 28, .45);
  color: var(--ink);
}
.site-header.is-scrolled::after { opacity: .7; }
.site-header.menu-is-open { background: rgba(44, 61, 26, .97); box-shadow: none; color: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header.menu-is-open::after { opacity: 0; }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.brand:hover { color: inherit; }
.brand img {
  width: 54px; height: 54px; object-fit: contain; border-radius: 50%;
  background: var(--stone); padding: 3px; box-shadow: var(--shadow-sm);
  transition: width .35s var(--ease), height .35s var(--ease);
}
.is-scrolled .brand img { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-family: var(--font-head); font-size: 1.35rem; letter-spacing: .06em; }
.brand-text small { font-size: .75rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  position: relative; display: block; padding: 10px 14px; white-space: nowrap;
  color: inherit; text-decoration: none; font-size: .95rem; font-weight: 500;
}
.main-nav a::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 2px; height: 2px;
  background: var(--terracotta); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
html[dir="rtl"] .main-nav a::after { transform-origin: right; }
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after { transform: scaleX(1); }
.main-nav a:hover { color: inherit; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: inline-flex; padding: 3px; border-radius: 999px;
  border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 40%, transparent);
}
.lang-switch button {
  border: 0; background: transparent; color: inherit;
  min-width: 40px; height: 36px; padding: 0 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  transition: background .25s, color .25s;
}
.lang-switch button[lang="ar"] { font-family: var(--font-ar); font-size: .95rem; }
.lang-switch button[aria-pressed="true"] { background: var(--terracotta-deep); color: #fff; }
.lang-switch button:not([aria-pressed="true"]):hover { background: rgba(127, 127, 127, .18); }

.burger {
  display: none; position: relative; z-index: 1001;
  width: 46px; height: 46px; border: 0; border-radius: 50%;
  background: var(--olive); color: #fff;
}
.burger span {
  position: absolute; left: 13px; right: 13px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .4s var(--ease), opacity .25s, top .4s var(--ease);
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 22px; }
.burger span:nth-child(3) { top: 28px; }
.burger[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
.burger[aria-expanded="true"] span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

/* Full-screen mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 890; /* below the header so the burger stays clickable */
  display: flex; flex-direction: column; justify-content: flex-start;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: calc(var(--header-h) + 16px) var(--gutter) 32px;
  background: var(--olive-deep) var(--berber-tile);
  color: var(--stone);
  clip-path: circle(0% at calc(100% - 44px) 42px);
  visibility: hidden;
  transition: clip-path .7s var(--ease-out), visibility 0s .7s;
}
html[dir="rtl"] .mobile-menu { clip-path: circle(0% at 44px 42px); }
.mobile-menu.is-open { clip-path: circle(150% at calc(100% - 44px) 42px); visibility: visible; transition: clip-path .7s var(--ease-out), visibility 0s; }
html[dir="rtl"] .mobile-menu.is-open { clip-path: circle(150% at 44px 42px); }
.mobile-menu > nav { margin-top: auto; } /* centred when there is room, top-aligned when not */
.mobile-menu-foot { margin-bottom: auto; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mobile-menu a {
  display: inline-block; font-family: var(--font-head); font-size: clamp(1.5rem, min(8vw, 6.5vh), 2.6rem);
  color: var(--stone); text-decoration: none; padding: 4px 0;
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .2s;
}
html[lang="ar"] .mobile-menu a { font-family: var(--font-ar); }
.mobile-menu a:hover, .mobile-menu a[aria-current="page"] { color: var(--sand); }
.mobile-menu a[aria-current="page"]::before { content: "◆ "; color: var(--terracotta); font-size: .6em; vertical-align: middle; }
.mobile-menu.is-open a { opacity: 1; transform: none; }
.mobile-menu.is-open li:nth-child(1) a { transition-delay: .15s; }
.mobile-menu.is-open li:nth-child(2) a { transition-delay: .2s; }
.mobile-menu.is-open li:nth-child(3) a { transition-delay: .25s; }
.mobile-menu.is-open li:nth-child(4) a { transition-delay: .3s; }
.mobile-menu.is-open li:nth-child(5) a { transition-delay: .35s; }
.mobile-menu-foot { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.mobile-menu-foot a { font-family: var(--font-body); font-size: 1rem; opacity: 1; transform: none; }
.mobile-menu .lang-switch { color: var(--stone); }
body.menu-open { overflow: hidden; }

/* ---------- 8. Hero (home) ---------- */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 100px;
  color: #fff; overflow: hidden; isolation: isolate;
  background: var(--olive-deep);
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.hero-bg {
  position: absolute; inset: -6% -3%; z-index: -2;
  background: var(--olive-deep) var(--hero-image, url("../img/hero.svg")) center / cover no-repeat;
  animation: kenburns 28s ease-in-out infinite alternate;
  will-change: transform;
}
.hero-parallax { position: absolute; inset: 0; z-index: -2; will-change: transform; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(28, 38, 17, .9) 0%, rgba(36, 48, 28, .7) 45%, rgba(36, 48, 28, .25) 100%),
    linear-gradient(0deg, rgba(28, 38, 17, .75) 0%, transparent 40%);
}
html[dir="rtl"] .hero::before {
  background:
    linear-gradient(260deg, rgba(28, 38, 17, .9) 0%, rgba(36, 48, 28, .7) 45%, rgba(36, 48, 28, .25) 100%),
    linear-gradient(0deg, rgba(28, 38, 17, .75) 0%, transparent 40%);
}
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.14) translate(-2%, -1.5%); }
}
.hero-content { max-width: 760px; }
.hero-logo {
  width: 96px; height: 96px; border-radius: 50%; background: var(--stone); padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); margin-bottom: 26px;
  animation: fadeUp 1s .2s var(--ease-out) both;
}
.hero h1 { color: #fff; margin-bottom: 18px; text-wrap: balance; }
.hero h1 .word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; }
.hero h1 .word > span { display: inline-block; transform: translateY(105%); opacity: 0; animation: wordUp .9s var(--ease-out) forwards; }
.hero h1 em { font-style: italic; color: var(--sand); }
@keyframes wordUp { to { transform: none; opacity: 1; } }
.hero-tagline {
  font-family: var(--font-ar); font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--sand);
  margin-bottom: 18px; direction: rtl; text-align: start;
  animation: fadeUp 1s .9s var(--ease-out) both;
}
html[dir="ltr"] .hero-tagline { text-align: left; }
.hero-text { color: rgba(255,255,255,.88); font-size: clamp(1rem, 1.5vw, 1.15rem); max-width: 600px; animation: fadeUp 1s 1.05s var(--ease-out) both; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; animation: fadeUp 1s 1.2s var(--ease-out) both; }
.hero-scroll {
  position: absolute; bottom: 64px; inset-inline-start: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.6); border-radius: 20px;
}
html[dir="rtl"] .hero-scroll { transform: translateX(50%); }
.hero-scroll::after {
  content: ""; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: #fff; animation: scrollDot 1.8s infinite;
}
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
.hero-pattern { position: absolute; inset-inline: 0; bottom: 0; z-index: 1; }
.hero-pattern .berber-divider { background: var(--stone); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- 9. Inner page hero ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(var(--header-h) + clamp(60px, 9vw, 110px)) 0 clamp(70px, 9vw, 110px);
  background: var(--olive-deep) var(--berber-tile);
  color: var(--stone); text-align: center;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 20% 0%, rgba(200, 100, 59, .35), transparent 55%),
              radial-gradient(ellipse at 90% 100%, rgba(46, 156, 154, .3), transparent 50%);
}
.page-hero h1 { color: #fff; margin-bottom: 14px; }
.page-hero p { max-width: 680px; margin: 0 auto; color: var(--sand); font-size: 1.1rem; }
.page-hero .eyebrow { color: var(--sand); }
.page-hero .berber-divider { position: absolute; bottom: 0; inset-inline: 0; background: var(--stone); }
.breadcrumb { font-size: .85rem; margin-bottom: 18px; color: var(--sand); }
.breadcrumb a { color: #fff; display: inline-block; padding: 10px 2px; }
.breadcrumb span[aria-hidden] { margin-inline: 8px; opacity: .6; }

/* ---------- 10. About strip (home) ---------- */
.about-strip { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-visual { position: relative; }
.about-visual .frame {
  position: relative; border-radius: 200px 200px var(--radius) var(--radius); overflow: hidden;
  aspect-ratio: 4 / 5; box-shadow: var(--shadow-lg); background: var(--sand);
}
.about-visual .frame img { width: 100%; height: 100%; object-fit: cover; }
.about-visual .frame::after {
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(255,255,255,.55);
  border-radius: 190px 190px 12px 12px; pointer-events: none;
}
.about-badge {
  position: absolute; bottom: 28px; inset-inline-end: -18px;
  background: var(--white); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow);
  max-width: 240px; font-size: .88rem; line-height: 1.5;
}
.about-badge strong { display: block; font-family: var(--font-head); color: var(--olive-dark); font-size: 1.05rem; }
.mv-grid { display: grid; gap: 18px; margin-top: 28px; }
.mv-item {
  display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: start;
  padding: 20px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm);
}
.mv-item h3 { font-size: 1.15rem; margin-bottom: 4px; }
.mv-item p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.icon-badge {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--olive) 14%, transparent); color: var(--olive-dark);
}
.icon-badge svg { width: 26px; height: 26px; }
.icon-badge--terra { background: color-mix(in srgb, var(--terracotta) 15%, transparent); color: var(--terracotta-deep); }
.icon-badge--turq { background: color-mix(in srgb, var(--turquoise) 15%, transparent); color: var(--turquoise-deep); }

/* ---------- 11. Counters ---------- */
.counters {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--olive-dark) var(--berber-tile); color: #fff;
}
.counters::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, rgba(63, 86, 38, .96), rgba(44, 61, 26, .9));
}
.counters-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.counter { text-align: center; padding: 10px; position: relative; }
.counter + .counter::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 20%; bottom: 20%;
  width: 1px; background: rgba(234, 219, 196, .3);
}
.counter-value {
  display: block; font-family: var(--font-head); font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700; color: var(--sand); line-height: 1; margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.counter-label { font-size: .95rem; color: rgba(255,255,255,.85); }

/* ---------- 12. Cards (initiatives) ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; perspective: 1200px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
  transition: transform .5s var(--ease-out), box-shadow .4s var(--ease);
}
.card:hover { --ty: -6px; box-shadow: var(--shadow-lg); }
.card.is-tilting { transition: transform .12s linear, box-shadow .4s var(--ease); }
.card::before { /* Berber border strip */
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 8px; z-index: 2;
  background: var(--berber-strip) center / auto 8px repeat-x, var(--stone);
}
.card::after { /* olive-leaf shine sweep */
  content: ""; position: absolute; z-index: 3; top: -20%; bottom: -20%; width: 40%;
  left: -60%; pointer-events: none;
  background: linear-gradient(105deg, transparent 0%, rgba(234, 219, 196, 0) 20%, rgba(255, 253, 249, .55) 48%, rgba(94, 122, 58, .18) 55%, transparent 80%);
  border-radius: 50% 0;    /* leaf silhouette */
  transform: skewX(-18deg);
  transition: left .9s var(--ease);
}
.card:hover::after { left: 130%; }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 24px; transform: translateZ(30px); }
.card-body h3 { margin-bottom: 10px; }
.card-body p { color: var(--text-muted); font-size: .95rem; }
.card-body .link-arrow { margin-top: auto; }
.card-tag {
  position: absolute; top: 20px; inset-inline-start: 16px; z-index: 2;
  padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: rgba(255, 253, 249, .92); color: var(--olive-dark);
}
.card-ar { display: block; font-family: var(--font-ar); color: var(--terracotta-deep); font-size: 1rem; margin-bottom: 6px; }

/* ---------- 13. SAFE highlight band ---------- */
.safe-band { position: relative; overflow: hidden; isolation: isolate; background: var(--terracotta-deep); color: #fff; }
.safe-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .9;
  background: radial-gradient(circle at 85% 30%, rgba(234, 219, 196, .25), transparent 40%),
              linear-gradient(115deg, #8A3D1C 0%, #A04A24 50%, #B4562D 100%);
}
.safe-band::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: 45%; z-index: -1; opacity: .25;
  background: var(--berber-tile);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000);
}
.safe-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.safe-band h2 { color: #fff; }
.safe-band .eyebrow { color: var(--sand); }
.safe-band .eyebrow::before { filter: brightness(2.2); }
.safe-ar { font-family: var(--font-ar); font-size: 1.5rem; color: var(--sand); margin-bottom: 6px; }
.safe-band p { color: rgba(255,255,255,.92); }
.safe-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.safe-steps li {
  counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center;
  padding: 14px 18px; border-radius: 14px; background: rgba(255, 253, 249, .1);
  border: 1px solid rgba(255, 253, 249, .2);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.safe-steps li::before {
  content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--stone); color: var(--terracotta-deep); font-weight: 700; font-family: var(--font-head);
}
.safe-band .btn--light:hover { color: var(--terracotta-deep); }

/* ---------- 14. Post cards ---------- */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 28px; }
.post-card {
  position: relative; display: flex; flex-direction: column; background: var(--white);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease-out), box-shadow .4s var(--ease);
}
.post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.post-card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.post-card:hover .post-card-media img { transform: scale(1.06); }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 26px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.post-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: color-mix(in srgb, var(--turquoise) 16%, white); color: var(--turquoise-deep);
}
.badge[data-cat="advocacy"] { background: color-mix(in srgb, var(--terracotta) 15%, white); color: var(--terracotta-deep); }
.badge[data-cat="culture"] { background: color-mix(in srgb, var(--olive) 16%, white); color: var(--olive-dark); }
.badge[data-cat="press"] { background: var(--sand); color: var(--ink); }
.post-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* full card clickable */
.post-card h3 a:hover { color: var(--olive-dark); }
.post-card p { font-size: .93rem; color: var(--text-muted); margin-bottom: 16px; }
.post-card .link-arrow { margin-top: auto; }
.post-card:focus-within { box-shadow: 0 0 0 3px var(--turquoise), var(--shadow); }

/* ---------- 15. Partners marquee ---------- */
.marquee {
  position: relative; overflow: hidden; padding-block: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; gap: 24px; animation: marquee 40s linear infinite; }
html[dir="rtl"] .marquee-track { animation-name: marqueeRtl; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marqueeRtl { to { transform: translateX(50%); } }
.partner {
  flex: none; display: flex; align-items: center; gap: 14px;
  min-width: 260px; padding: 16px 22px; border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
  filter: grayscale(.6); opacity: .85; transition: filter .35s, opacity .35s, transform .35s var(--ease);
}
.partner:hover, .partner:focus-visible { filter: none; opacity: 1; transform: translateY(-3px); color: var(--ink); }
.partner-mark {
  flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem; color: #fff; background: var(--olive);
}
.partner:nth-child(3n+2) .partner-mark { background: var(--terracotta-deep); }
.partner:nth-child(3n) .partner-mark { background: var(--turquoise-deep); }
.partner-name { display: flex; flex-direction: column; line-height: 1.3; }
.partner-name strong { font-size: .98rem; }
.partner-name small { font-size: .75rem; color: var(--text-muted); max-width: 200px; }

/* ---------- 16. CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  background: var(--olive-deep) var(--berber-tile); color: var(--stone);
  border-radius: calc(var(--radius) * 1.6); padding: clamp(48px, 7vw, 90px) clamp(24px, 5vw, 70px);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 15% 20%, rgba(200, 100, 59, .45), transparent 45%),
              radial-gradient(circle at 85% 90%, rgba(46, 156, 154, .35), transparent 45%);
}
.cta-band h2 { color: #fff; }
.cta-band .eyebrow { color: var(--sand); }
.cta-band p { color: var(--sand); max-width: 620px; margin-inline: auto; font-size: 1.08rem; }
.cta-band .hero-ctas { justify-content: center; animation: none; }

/* ---------- 17. Footer ---------- */
.site-footer { background: var(--ink); color: rgba(246, 239, 228, .82); font-size: .94rem; }
.site-footer a { color: var(--stone); text-decoration: none; }
.site-footer a:hover { color: var(--sand); text-decoration: underline; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; padding-block: 64px 40px; }
.footer-brand img { width: 84px; height: 84px; border-radius: 50%; background: var(--stone); padding: 5px; margin-bottom: 16px; }
.footer-brand p { max-width: 300px; }
.footer-title { font-family: var(--font-head); color: #fff; font-size: 1.1rem; margin-bottom: 16px; }
html[lang="ar"] .footer-title { font-family: var(--font-ar); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.footer-links a { display: inline-block; padding: 8px 0; }
.footer-links li:not(:has(a)) { padding: 8px 0; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(246, 239, 228, .1); transition: background .3s, transform .3s var(--ease);
}
.social a:hover { background: var(--terracotta-deep); transform: translateY(-3px); }
.social svg { width: 20px; height: 20px; fill: currentColor; }
.newsletter { display: flex; gap: 8px; margin-top: 12px; }
.newsletter input {
  flex: 1 1 0; width: 0; min-width: 0; height: 46px; font-size: 16px; /* 16px stops iOS zooming on focus */ padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(246, 239, 228, .3); background: rgba(246, 239, 228, .08); color: #fff;
}
.newsletter input::placeholder { color: rgba(246, 239, 228, .7); }
.newsletter input:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
.newsletter .btn { min-height: 46px; padding-inline: 18px; }
.newsletter-msg { font-size: .85rem; margin-top: 8px; min-height: 1.4em; color: var(--sand); }
.footer-divider { opacity: .9; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding-block: 22px; font-size: .85rem; border-top: 1px solid rgba(246, 239, 228, .12);
}
.footer-credit {
  text-align: center; padding: 14px var(--gutter) 22px; font-size: .78rem; letter-spacing: .06em;
  color: rgba(246, 239, 228, .7);
}
.footer-credit a { color: var(--sand); border-bottom: 1px solid rgba(234, 219, 196, .4); }
.footer-credit a:hover { text-decoration: none; border-color: var(--sand); }

/* ---------- 18. About page ---------- */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.story-quote {
  position: relative; padding: 36px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow);
  font-family: var(--font-head); font-size: 1.3rem; font-style: italic; line-height: 1.5; color: var(--olive-dark);
}
html[lang="ar"] .story-quote { font-family: var(--font-ar); font-style: normal; }
.story-quote::before {
  content: "“"; position: absolute; top: -24px; inset-inline-start: 24px;
  font-size: 5rem; line-height: 1; color: var(--terracotta); font-family: var(--font-head);
}
.story-quote footer { margin-top: 14px; font-family: var(--font-body); font-style: normal; font-size: .9rem; color: var(--text-muted); }
.value {
  padding: 30px 26px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--olive); transition: transform .4s var(--ease-out), box-shadow .4s;
}
.value:nth-child(2) { border-top-color: var(--terracotta); }
.value:nth-child(3) { border-top-color: var(--turquoise); }
.value:nth-child(4) { border-top-color: var(--olive-dark); }
.value:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.value h3 { margin: 16px 0 8px; }
.value p { color: var(--text-muted); margin: 0; font-size: .95rem; }
.founder {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(28px, 5vw, 56px); border-radius: calc(var(--radius) * 1.4);
  background: var(--white); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.founder::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 10px; background: var(--berber-strip) center / auto 10px repeat-x, var(--sand); }
.founder-mark {
  width: clamp(120px, 18vw, 180px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center; padding: 18px;
  background: var(--olive-dark) var(--berber-tile); color: var(--stone);
  font-family: var(--font-head); font-size: 1.05rem; line-height: 1.25;
}
.founder-mark small { display: block; font-family: var(--font-ar); font-size: .95rem; margin-top: 6px; color: var(--sand); }
.ecosoc { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--turquoise) 14%, white); color: var(--turquoise-deep); font-size: .82rem; font-weight: 600; margin-bottom: 14px; }
.ecosoc svg { width: 16px; height: 16px; }
.member {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.member .partner-mark { width: 54px; height: 54px; }
.member h3 { font-size: 1.05rem; margin-bottom: 4px; }
.member p { margin: 0; font-size: .9rem; color: var(--text-muted); }
.team-card { text-align: center; padding: 30px 22px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm); }
.team-avatar {
  width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sand) var(--berber-tile); border: 4px solid var(--white); box-shadow: 0 0 0 2px var(--olive);
  font-family: var(--font-head); font-size: 2.2rem; color: var(--olive-dark); overflow: hidden;
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.team-card p { margin: 0; color: var(--text-muted); font-size: .9rem; }

/* ---------- 19. Initiatives page ---------- */
.subnav {
  position: sticky; top: var(--header-h-small); z-index: 50;
  background: rgba(246, 239, 228, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.subnav ul { display: flex; gap: 6px; overflow-x: auto; list-style: none; margin: 0; padding: 12px 0; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a {
  display: block; white-space: nowrap; padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--white);
}
.subnav a:hover, .subnav a.is-active { background: var(--olive); border-color: var(--olive); color: #fff; }
.initiative { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.initiative + .initiative { margin-top: clamp(80px, 10vw, 130px); }
.initiative:nth-of-type(even) .initiative-media { order: 2; }
.initiative-media { position: sticky; top: calc(var(--header-h-small) + 90px); }
.initiative-media .frame { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow-lg); background: var(--sand); position: relative; }
.initiative-media .frame::before { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 12px; background: var(--berber-strip) center / auto 12px repeat-x, var(--stone); z-index: 1; }
.initiative-media img { width: 100%; height: 100%; object-fit: cover; }
.initiative-num { font-family: var(--font-head); font-size: 4rem; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--terracotta); margin-bottom: 8px; }
.initiative h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.initiative .ar-title { font-family: var(--font-ar); font-size: 1.25rem; color: var(--terracotta-deep); margin-top: -6px; margin-bottom: 14px; }
.founder-note { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .85rem; margin-bottom: 18px; }
.block-title { font-family: var(--font-body); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--olive-dark); margin: 28px 0 12px; font-weight: 600; }
html[lang="ar"] .block-title { font-family: var(--font-ar); letter-spacing: 0; font-size: 1rem; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { position: relative; padding-inline-start: 30px; }
.check-list li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 14px; height: 14px;
  background: var(--terracotta); transform: rotate(45deg); border-radius: 2px;
  box-shadow: inset 0 0 0 4px var(--stone);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li { padding: 6px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .88rem; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--olive), var(--turquoise)); }
.timeline li { position: relative; padding-inline-start: 38px; padding-bottom: 18px; }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: 6px; width: 16px; height: 16px;
  transform: rotate(45deg); background: var(--stone); border: 3px solid var(--olive);
}
.timeline li.is-current::before { background: var(--terracotta); border-color: var(--terracotta); }
.timeline time, .timeline .tl-date { display: block; font-size: .8rem; font-weight: 600; color: var(--terracotta-deep); letter-spacing: .05em; }
.timeline p { margin: 2px 0 0; color: var(--text-muted); font-size: .95rem; }
.timeline strong { color: var(--ink); }

/* ---------- 20. Blog listing ---------- */
.blog-toolbar { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 9px 18px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.chip:hover { border-color: var(--olive); transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--olive-dark); color: #fff; border-color: var(--olive-dark); }
.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search svg { position: absolute; inset-inline-start: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search input {
  width: 100%; height: 48px; padding-inline: 46px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white);
  transition: border-color .25s, box-shadow .25s;
}
.search input:focus-visible { outline: none; border-color: var(--olive); box-shadow: 0 0 0 4px color-mix(in srgb, var(--olive) 20%, transparent); }
.blog-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.blog-empty svg { width: 64px; height: 64px; margin: 0 auto 14px; color: var(--sand); }
.load-more-wrap { text-align: center; margin-top: 48px; }
.results-count { font-size: .9rem; color: var(--text-muted); margin-bottom: 18px; }
.post-card.is-entering { animation: fadeUp .7s var(--ease-out) both; }

/* Skeletons */
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--sand) 25%, #F2E7D6 50%, var(--sand) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 380px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 21. Single post ---------- */
.post-hero { padding: calc(var(--header-h) + 50px) 0 0; background: var(--olive-deep) var(--berber-tile); color: var(--stone); position: relative; }
.post-hero-inner { max-width: 860px; margin: 0 auto; text-align: center; padding-bottom: 140px; }
.post-hero h1 { color: #fff; font-size: clamp(1.8rem, 4.2vw, 3rem); margin-bottom: 18px; }
.post-hero .post-meta { justify-content: center; color: var(--sand); font-size: .9rem; }
.post-hero .title-alt { font-family: var(--font-ar); color: var(--sand); font-size: 1.15rem; margin-bottom: 18px; }
.post-cover { max-width: 1000px; margin: -120px auto 0; position: relative; z-index: 2; padding-inline: var(--gutter); }
.post-cover figure { margin: 0; border-radius: calc(var(--radius) * 1.3); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9; background: var(--sand); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-layout { max-width: 760px; margin: 0 auto; padding-block: 56px 20px; }
.post-body { font-size: 1.07rem; }
.post-body h2 { font-size: 1.7rem; margin-top: 1.6em; }
.post-body h3 { margin-top: 1.4em; }
.post-body ul, .post-body ol { padding-inline-start: 1.3em; margin: 0 0 1.2em; }
.post-body li { margin-bottom: .4em; }
.post-body li::marker { color: var(--terracotta); }
.post-body blockquote {
  margin: 1.6em 0; padding: 18px 26px; border-inline-start: 4px solid var(--terracotta);
  background: var(--white); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-head); font-style: italic; font-size: 1.2rem; color: var(--olive-dark);
}
html[dir="rtl"] .post-body blockquote { border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-family: var(--font-ar); font-style: normal; }
.post-body > p:first-of-type::first-letter {
  float: inline-start; font-family: var(--font-head); font-size: 3.6em; line-height: .9; margin: .06em .12em 0 0; color: var(--terracotta-deep);
}
html[lang="ar"] .post-body > p:first-of-type::first-letter { float: none; font-size: inherit; margin: 0; color: inherit; font-family: inherit; }
.gallery-title { margin-top: 48px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 12px; }
.gallery button {
  position: relative; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden;
  aspect-ratio: 1; background: var(--sand); cursor: zoom-in;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out), filter .4s; }
.gallery button:hover img { transform: scale(1.08); filter: brightness(.85); }
.gallery button::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: center / 34px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E");
}
.gallery button:hover::after, .gallery button:focus-visible::after { opacity: 1; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.share-label { font-weight: 600; margin-inline-end: 6px; }
.share a, .share button {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none;
  transition: background .25s, color .25s, transform .25s var(--ease);
}
.share a:hover, .share button:hover { background: var(--olive-dark); color: #fff; transform: translateY(-3px); }
.share svg { width: 18px; height: 18px; fill: currentColor; }
.share-feedback { font-size: .85rem; color: var(--olive-dark); min-width: 80px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.post-nav a {
  display: block; padding: 20px 22px; border-radius: var(--radius); background: var(--white);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .25s, box-shadow .25s;
}
.post-nav a:hover { border-color: var(--olive); box-shadow: var(--shadow); color: var(--ink); }
.post-nav small { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--terracotta-deep); margin-bottom: 6px; }
html[lang="ar"] .post-nav small { letter-spacing: 0; }
.post-nav .next { text-align: end; grid-column: 2; }
.post-nav span { font-family: var(--font-head); font-weight: 600; }
html[lang="ar"] .post-nav span { font-family: var(--font-ar); }
.post-error { text-align: center; padding: 80px 0; }

/* ---------- 22. Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center;
  background: rgba(20, 26, 14, .94); opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s .35s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.lightbox-figure { margin: 0; max-width: min(92vw, 1200px); max-height: 86vh; display: grid; gap: 12px; justify-items: center; touch-action: pan-y; }
.lightbox-figure img {
  max-height: 78vh; width: auto; max-width: 100%; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  transform: scale(.92); opacity: 0; transition: transform .45s var(--ease-out), opacity .35s;
  user-select: none; -webkit-user-drag: none;
}
.lightbox.is-open .lightbox-figure img.is-loaded { transform: scale(1); opacity: 1; }
.lightbox-figure figcaption { color: var(--sand); font-size: .9rem; text-align: center; }
.lightbox button {
  position: absolute; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; transition: background .25s;
}
.lightbox button:hover { background: rgba(255,255,255,.2); }
.lightbox button svg { width: 22px; height: 22px; }
.lightbox-close { top: 20px; inset-inline-end: 20px; }
.lightbox-prev { inset-inline-start: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { inset-inline-end: 20px; top: 50%; transform: translateY(-50%); }
html[dir="rtl"] .lightbox-prev svg, html[dir="rtl"] .lightbox-next svg { transform: scaleX(-1); }
.lightbox-counter { position: absolute; top: 30px; inset-inline-start: 30px; color: var(--sand); font-size: .9rem; }

/* ---------- 23. Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact-cards { display: grid; gap: 18px; }
.contact-card {
  display: grid; grid-template-columns: 54px 1fr; gap: 16px; align-items: start;
  padding: 24px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-sm);
}
.contact-card h2 { font-size: 1.15rem; margin-bottom: 4px; }
.contact-card p { margin: 0 0 10px; color: var(--text-muted); font-size: .95rem; }
.contact-card .email-link { font-weight: 600; font-size: 1.05rem; word-break: break-all; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copy-feedback { font-size: .85rem; color: var(--olive-dark); }
.fb-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 28px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, #1D4E89 0%, #2C3D1A 100%);
  box-shadow: var(--shadow);
}
.fb-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--berber-tile); opacity: .25; }
.fb-card h2 { color: #fff; font-size: 1.35rem; }
.fb-card p { color: rgba(255,255,255,.88); }
.fb-card .fb-icon { width: 54px; height: 54px; border-radius: 16px; background: #fff; color: #1877F2; display: grid; place-items: center; margin-bottom: 16px; }
.fb-card .fb-icon svg { width: 30px; height: 30px; fill: currentColor; }
.fb-card .btn { --btn-bg: #fff; --btn-fg: #1D4E89; }
.fb-card .btn:hover { --btn-bg: var(--sand); --btn-fg: #14365F; }
.form-card { padding: clamp(24px, 4vw, 44px); border-radius: calc(var(--radius) * 1.3); background: var(--white); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.form-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 8px; background: var(--berber-strip) center / auto 8px repeat-x, var(--sand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .9rem; font-weight: 500; }
.field label .req { color: var(--terracotta-deep); }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 1.5px solid #D6CCBC; background: var(--stone);
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--olive); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--olive) 20%, transparent);
}
.field.has-error input, .field.has-error textarea { border-color: #B3261E; background: #FFF6F5; }
.field-error { font-size: .82rem; color: #B3261E; min-height: 1.2em; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; }
.form-note { font-size: .82rem; color: var(--text-muted); margin: 0; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status {
  display: none; grid-template-columns: 56px 1fr; gap: 16px; align-items: center;
  margin-top: 22px; padding: 18px 20px; border-radius: 14px; animation: statusIn .6s var(--ease-out);
}
.form-status.is-visible { display: grid; }
.form-status.is-success { background: color-mix(in srgb, var(--olive) 12%, white); color: var(--olive-deep); }
.form-status.is-error { background: #FDECEA; color: #8C1D18; }
.form-status p { margin: 0; }
.form-status strong { display: block; }
.status-icon { width: 56px; height: 56px; }
.status-icon circle { stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .7s .1s var(--ease) forwards; }
.status-icon path { stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s .6s var(--ease) forwards; }
@keyframes statusIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.embed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.embed {
  border-radius: var(--radius); overflow: hidden; background: var(--sand); box-shadow: var(--shadow-sm);
  min-height: 460px; position: relative; display: flex; flex-direction: column;
}
.embed iframe { width: 100%; flex: 1; border: 0; min-height: 460px; }
.embed--fb { background: var(--white); align-items: center; }
.embed--fb iframe { max-width: 500px; }
.embed-label { padding: 14px 20px; font-weight: 600; background: var(--white); border-bottom: 1px solid var(--line); width: 100%; display: flex; align-items: center; gap: 10px; }
.embed-label svg { width: 18px; height: 18px; color: var(--terracotta-deep); }

.whatsapp-float {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 800;
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: #1F8F4E; color: #fff; box-shadow: 0 12px 30px -8px rgba(31, 143, 78, .7);
  transition: transform .3s var(--ease);
  animation: floatIn .8s 1s var(--ease-out) both;
}
.whatsapp-float::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25D366;
  animation: pulse 2.4s infinite;
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; }
.whatsapp-float svg { width: 30px; height: 30px; fill: currentColor; }
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes floatIn { from { opacity: 0; transform: translateY(30px) scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- 24. 404 ---------- */
.error-page {
  min-height: 100vh; display: grid; place-items: center; text-align: center; position: relative; isolation: isolate; overflow: hidden;
  padding: calc(var(--header-h) + 40px) var(--gutter) 60px;
  background: var(--olive-deep) var(--berber-tile); color: var(--stone);
}
.error-page::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 50% 40%, rgba(200, 100, 59, .35), transparent 55%);
}
.error-code {
  font-family: var(--font-head); font-weight: 700; font-size: clamp(6rem, 22vw, 13rem); line-height: 1;
  background: linear-gradient(120deg, var(--sand), var(--terracotta), var(--turquoise));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fadeUp 1s var(--ease-out) both;
}
.error-page h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.error-page p { color: var(--sand); max-width: 520px; margin-inline: auto; }
.error-page .hero-ctas { justify-content: center; animation: none; }
.error-door { width: 110px; margin: 0 auto 10px; color: var(--sand); }

/* ---------- 25. Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--delay, 0s); }
.js [data-reveal="fade-up"] { transform: translateY(40px); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="slide-left"] { transform: translateX(-60px); }
.js [data-reveal="slide-right"] { transform: translateX(60px); }
.js [data-reveal="zoom"] { transform: scale(.92); }
html.js[dir="rtl"] [data-reveal="slide-left"] { transform: translateX(60px); }
html.js[dir="rtl"] [data-reveal="slide-right"] { transform: translateX(-60px); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 26. Responsive ---------- */
@media (min-width: 981px) and (max-width: 1199px) {
  /* small laptops: keep the full menu on one line */
  .brand-text small, .header-cta { display: none; }
  .main-nav a { padding-inline: 10px; }
  .main-nav a::after { inset-inline: 10px; }
}
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .main-nav, .header-cta, .header-actions > .lang-switch { display: none; }
  .burger { display: block; }
  .about-strip, .story, .safe-inner, .contact-grid, .initiative, .embed-grid { grid-template-columns: 1fr; }
  .initiative:nth-of-type(even) .initiative-media { order: 0; }
  .initiative-media { position: relative; top: 0; }
  .about-visual { max-width: 460px; margin-inline: auto; width: 100%; }
  .about-badge { inset-inline-end: 8px; }
  .counters-grid { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .counter:nth-child(3)::before { display: none; }
  .founder { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
@media (max-width: 640px) {
  :root { --header-h: 72px; --header-h-small: 60px; }
  .hero { padding-bottom: 80px; }
  .hero-logo { display: none; } /* already in the header */
  .hero-ctas .btn { flex: 1 1 100%; }
  .about-visual { max-width: 300px; }
  .about-badge { position: relative; inset: auto; margin: -56px auto 0; max-width: 92%; }
  .mv-item, .contact-card { grid-template-columns: 1fr; gap: 12px; }
  .card-media, .initiative-media .frame { aspect-ratio: 16 / 9; }
  .card-body { padding: 20px; }
  .section-head { margin-bottom: 32px; }
  .story-quote { padding: 28px 22px; font-size: 1.15rem; }
  .brand img { width: 46px; height: 46px; }
  .brand-text small { display: none; }
  .cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: minmax(0, 1fr); padding-top: 48px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: auto; }
  .hero-scroll { display: none; }
  .blog-toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; flex: none; } /* in the stacked layout flex-basis would become a height */
  .partner { min-width: 220px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 20px; transform: none; }
  .whatsapp-float { width: 54px; height: 54px; bottom: 18px; inset-inline-end: 18px; }
}

/* Phones in landscape: little height, so keep the hero compact */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: calc(var(--header-h) + 28px) 0 72px; }
  .hero-logo, .hero-scroll { display: none; }
  .hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
  .page-hero { padding: calc(var(--header-h) + 36px) 0 56px; }
  .subnav { position: static; } /* not enough height for two sticky bars */
}

/* Touch screens: no "stuck" hover effects after a tap */
@media (hover: none) {
  .card:hover { --ty: 0; box-shadow: var(--shadow-sm); }
  .card:hover::after { left: -60%; }
  .card:hover .card-media img, .post-card:hover .post-card-media img, .gallery button:hover img { transform: none; filter: none; }
  .post-card:hover, .value:hover, .partner:hover, .chip:hover,
  .share a:hover, .share button:hover, .social a:hover, .whatsapp-float:hover { transform: none; }
  .marquee:hover .marquee-track { animation-play-state: running; }
}

/* ---------- 27. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .hero-bg { animation: none; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero h1 .word > span { transform: none; opacity: 1; }
  .card { transform: none !important; }
  .card::after { display: none; }
  .loader { display: none; }
}

/* ---------- 28. Print ---------- */
@media print {
  .site-header, .mobile-menu, .site-footer, .loader, .page-transition, .whatsapp-float, .share, .post-nav, .lightbox { display: none !important; }
  body { background: #fff; }
  .page-hero, .post-hero { padding-top: 20px; background: #fff; color: #000; }
  .page-hero h1, .post-hero h1 { color: #000; }
}
