
    :root {
      --bg: #F6F8FF;
      --bg2: #EEF2FF;
      --card: rgba(255,255,255,0.92);
      --card2: rgba(255,255,255,0.78);
      --txt: #0B1020;
      --muted: rgba(11,16,32,.68);
      --faint: rgba(11,16,32,.52);
      --border: rgba(11,16,32,.10);
      --shadow: 0 18px 55px rgba(13,19,39,.10);
      --radius: 18px;
      --max: 1180px;

      --accent: #2563EB;   /* blue */
      --accent2:#06B6D4;   /* cyan */
      --accent3:#F59E0B;   /* amber */
    }

    *{ box-sizing:border-box; }
    html,body{ height:100%; }
    body{
      margin:0;
      font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Arabic", "Noto Naskh Arabic", sans-serif;
      color: var(--txt);
      background:
        radial-gradient(1200px 620px at 90% -10%, rgba(37,99,235,.18), transparent 60%),
        radial-gradient(900px 520px at -10% 20%, rgba(6,182,212,.16), transparent 55%),
        radial-gradient(1100px 560px at 110% 70%, rgba(245,158,11,.12), transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg2));
      overflow-x:hidden;
    }

    a{ color:inherit; text-decoration:none; }
    .wrap{ max-width: var(--max); margin:0 auto; padding: 22px 18px 110px; }

    .top{
      position: sticky; top: 0; z-index: 50;
      background: rgba(246,248,255,.78);
      backdrop-filter: blur(14px);
      border-bottom: 1px solid var(--border);
    }
    .top .inner{ max-width: var(--max); margin:0 auto; padding: 14px 18px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
    .brand{ display:flex; align-items:center; gap:10px; }
    .mark{
      width: 40px; height: 40px; border-radius: 14px;
      background: linear-gradient(135deg, rgba(37,99,235,.22), rgba(6,182,212,.18), rgba(245,158,11,.16));
      border: 1px solid rgba(11,16,32,.12);
      box-shadow: 0 12px 30px rgba(13,19,39,.12);
      position: relative; overflow: hidden;
    }
    .mark::after{
      content:"";
      position:absolute; inset:-40%;
      background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65), transparent 45%);
      transform: rotate(18deg);
    }
    .brand h1{ margin:0; font-size: 16px; line-height:1.1; }
    .brand .sub{ margin:0; font-size: 12px; color: var(--muted); }

    .actions{ display:flex; gap:10px; align-items:center; }
    .pill{
      display:inline-flex; align-items:center; gap:8px;
      padding: 10px 12px; border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.70);
      color: var(--muted);
      cursor:pointer;
      transition: transform .15s ease, background .15s ease, border-color .15s ease;
      user-select:none;
    }
    .pill:hover{ transform: translateY(-1px); background: rgba(255,255,255,.92); border-color: rgba(11,16,32,.16); }
    .pill strong{ color: var(--txt); }

    .hero{ padding: 22px 0 6px; }
    .hero-grid{ display:grid; grid-template-columns: 1.25fr .75fr; gap: 16px; align-items: stretch; }
    @media (max-width: 900px){ .hero-grid{ grid-template-columns: 1fr; } }

    .card{
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--card);
      box-shadow: var(--shadow);
    }
    .hero-card{ padding: 18px 18px 16px; position:relative; overflow:hidden; }
    .hero-card::before{
      content:"";
      position:absolute; inset: -140px -140px auto auto;
      width: 320px; height: 320px;
      background: radial-gradient(circle at 30% 30%, rgba(37,99,235,.22), transparent 55%);
      pointer-events:none;
    }
    .hero-title{ margin:0 0 8px; font-size: clamp(22px, 3.2vw, 36px); letter-spacing:-.3px; }
    .hero-desc{ margin:0 0 14px; color: var(--muted); line-height: 1.9; }

    .controls{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
    .search{
      flex: 1 1 340px;
      display:flex; align-items:center; gap:10px;
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.78);
    }
    .search input{
      width:100%;
      border:none; outline:none;
      background: transparent;
      color: var(--txt);
      font-size: 14px;
      padding: 2px 0;
    }
    .search .hint{ color: var(--faint); font-size: 12px; }
    .select{
      display:flex; align-items:center; gap:10px;
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.78);
      color: var(--muted);
    }
    select{
      background: transparent;
      border:none;
      color: var(--txt);
      outline:none;
      font-family: inherit;
      font-size: 13px;
      cursor:pointer;
    }

    .chips{ display:flex; gap:8px; flex-wrap:wrap; margin-top: 10px; }
    .chip{
      padding: 8px 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.62);
      color: var(--muted);
      cursor:pointer;
      transition: transform .15s ease, background .15s ease, border-color .15s ease;
      font-family: inherit;
      font-size: 12px;
    }
    .chip:hover{ transform: translateY(-1px); background: rgba(255,255,255,.92); border-color: rgba(11,16,32,.16); }
    .chip.active{ background: rgba(37,99,235,.10); border-color: rgba(37,99,235,.26); color: rgba(11,16,32,.86); }

    .stats{ padding: 16px; display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    @media (max-width: 520px){ .stats{ grid-template-columns: 1fr; } }
    .stat{
      padding: 12px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.70);
    }
    .stat .k{ font-size: 11px; color: var(--muted); }
    .stat .v{ font-size: 20px; font-weight: 800; margin-top: 4px; }
    .stat .t{ font-size: 12px; color: var(--faint); margin-top: 2px; line-height: 1.6; }

    .section-title{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin: 18px 0 10px; }
    .section-title h2{ margin:0; font-size: 16px; }
    .section-title p{ margin:0; color: var(--faint); font-size: 12px; }

    .featured{
      display:flex; gap: 12px;
      overflow:auto; padding-bottom: 8px;
      scroll-snap-type: x mandatory;
    }
    .featured::-webkit-scrollbar{ height: 10px; }
    .featured::-webkit-scrollbar-thumb{ background: rgba(11,16,32,.12); border-radius: 999px; }

    .fcard{
      flex: 0 0 320px;
      scroll-snap-align: start;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--card);
      overflow:hidden;
      box-shadow: 0 18px 55px rgba(13,19,39,.10);
      transition: transform .18s ease, border-color .18s ease;
    }
    .fcard:hover{ transform: translateY(-2px); border-color: rgba(11,16,32,.18); }
    .fimg{ height: 170px; background: rgba(11,16,32,.04); position:relative; }
    .fimg img{ width:100%; height:100%; object-fit:cover; display:block; }
    .fbody{ padding: 12px 12px 14px; }
    .badge{
      display:inline-flex; gap:6px; align-items:center;
      padding: 6px 10px; border-radius: 999px;
      font-size: 11px;
      color: rgba(11,16,32,.82);
      background: rgba(37,99,235,.10);
      border: 1px solid rgba(37,99,235,.20);
    }
    .name{ margin: 10px 0 6px; font-size: 14px; font-weight: 800; }
    .headline{ margin:0; color: var(--muted); font-size: 12px; line-height: 1.8;
      display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient: vertical; overflow:hidden; }
    .factions{ display:flex; gap:8px; margin-top: 12px; }
    .btn{
      display:inline-flex; align-items:center; justify-content:center; gap:8px;
      padding: 9px 10px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.82);
      color: rgba(11,16,32,.92);
      cursor:pointer;
      font-family: inherit;
      font-size: 12px;
      transition: transform .15s ease, background .15s ease, border-color .15s ease;
    }
    .btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.98); border-color: rgba(11,16,32,.18); }
    .btn.primary{ background: rgba(37,99,235,.10); border-color: rgba(37,99,235,.26); }

    .grid{ display:grid; grid-template-columns: repeat(12, 1fr); gap: 12px; margin-top: 12px; }
    .item{ grid-column: span 3; }
    @media (max-width: 1100px){ .item{ grid-column: span 4; } }
    @media (max-width: 780px){ .item{ grid-column: span 6; } }
    @media (max-width: 520px){ .item{ grid-column: span 12; } }

    .cardx{
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--card);
      overflow:hidden;
      height: 100%;
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
      box-shadow: 0 14px 36px rgba(13,19,39,.08);
    }
    .cardx:hover{ transform: translateY(-2px); border-color: rgba(11,16,32,.18); box-shadow: 0 18px 48px rgba(13,19,39,.10); }

    .thumb{ height: 170px; background: rgba(11,16,32,.04); position:relative; }
    .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

    .meta{ position:absolute; top: 10px; left: 10px; display:flex; gap:8px; align-items:center; }
    .tag{
      display:inline-flex; gap:6px; align-items:center;
      padding: 6px 10px; border-radius: 999px;
      font-size: 11px;
      background: rgba(255,255,255,.85);
      border: 1px solid var(--border);
      color: rgba(11,16,32,.80);
    }
    .tag.blue{ border-color: rgba(37,99,235,.22); background: rgba(37,99,235,.10); }

    .body{ padding: 12px 12px 14px; display:flex; flex-direction:column; gap:8px; }
    .fa{ font-weight: 800; font-size: 14px; line-height: 1.6; }
    .en{ color: var(--faint); font-size: 12px; }
    .desc{ color: var(--muted); font-size: 12px; line-height: 1.8;
      display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient: vertical; overflow:hidden; }

    .row{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:auto; }
    .mini{
      display:inline-flex; align-items:center; gap:8px;
      padding: 8px 10px; border-radius: 12px;
      border: 1px solid rgba(6,182,212,.22);
      background: rgba(6,182,212,.10);
      color: rgba(11,16,32,.86);
      font-size: 12px;
      cursor:pointer;
      transition: transform .15s ease, background .15s ease, border-color .15s ease;
    }
    .mini:hover{ transform: translateY(-1px); background: rgba(6,182,212,.14); border-color: rgba(6,182,212,.30); }
    .dot{ width: 8px; height: 8px; border-radius: 999px; background: var(--accent2); box-shadow: 0 0 0 6px rgba(6,182,212,.16); }

    .player{
      position: fixed;
      left: 16px; right: 16px; bottom: 16px;
      max-width: var(--max);
      margin: 0 auto;
      display:none;
      align-items:center;
      gap: 12px;
      padding: 12px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.88);
      backdrop-filter: blur(14px);
      box-shadow: 0 18px 55px rgba(13,19,39,.16);
      z-index: 80;
    }
    .player.show{ display:flex; }
    .pinfo{ flex: 1 1 auto; min-width: 0; }
    .ptitle{ font-weight: 800; font-size: 13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .psub{ font-size: 12px; color: var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

    .pbtn{
      width: 42px; height: 42px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.92);
      color: rgba(11,16,32,.92);
      cursor:pointer;
      display:flex; align-items:center; justify-content:center;
      transition: transform .15s ease, background .15s ease, border-color .15s ease;
      font-family: inherit;
    }
    .pbtn:hover{ transform: translateY(-1px); background: #fff; border-color: rgba(11,16,32,.18); }
    .pbar{ width: 220px; max-width: 34vw; }
    input[type="range"]{ width:100%; }

    .footer{
      margin-top: 18px;
      padding: 16px 18px;
      border-radius: var(--radius);
      border: 1px solid var(--border);
      background: var(--card2);
      color: var(--muted);
      font-size: 12px;
      line-height: 1.9;
    }
  

/* ---------- Shared components for profile pages ---------- */
.wrap, .container{ max-width: var(--max); margin:0 auto; padding: 22px 18px 110px; }
.container{ padding-bottom: 90px; }

.card{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.muted{ color: var(--muted); }
.kicker{ color: var(--muted); font-size: 12px; letter-spacing: .2px; }
.subtitle{ color: var(--muted); font-size: 13px; line-height: 1.9; }

.topbar{
  display:flex; gap:10px; align-items:center; justify-content:space-between;
  padding: 14px 16px;
  position: sticky; top: 12px; z-index: 60;
  background: rgba(246,248,255,.78);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 55px rgba(13,19,39,.08);
}
.topbar .brand b{ font-size: 14px; }
.topbar .brand small{ font-size: 12px; color: var(--muted); }

.nav{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.82);
  color: rgba(11,16,32,.92);
  cursor:pointer;
  font-family: inherit;
  font-size: 12px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{ transform: translateY(-1px); background:#fff; border-color: rgba(11,16,32,.18); }
.btn.disabled, .btn[aria-disabled="true"]{ opacity:.5; pointer-events:none; }

.hero{
  margin-top: 14px;
}
.hero-content{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 960px){
  .hero-content{ grid-template-columns: 1fr; }
}

.hero-media{ overflow:hidden; }
.hero-media .carousel{ height: 100%; }

.section{
  padding: 16px;
  margin-top: 12px;
}
.section h2{
  margin: 0 0 8px;
  font-size: 15px;
}
.section p{ margin: 0 0 10px; }

.prose{
  color: rgba(11,16,32,.88);
  line-height: 2.0;
  font-size: 14px;
  white-space: pre-wrap;
}
.prose blockquote{
  margin: 10px 0;
  padding: 10px 12px;
  border-right: 3px solid rgba(37,99,235,.35);
  background: rgba(37,99,235,.06);
  border-radius: 12px;
  color: rgba(11,16,32,.9);
}
.prose ul{ margin: 8px 0 8px 0; padding: 0 18px 0 0; }
.prose li{ margin: 4px 0; }

.toc{
  display:flex; flex-wrap:wrap; gap:8px;
  margin-top: 12px;
}
.toc a{
  display:inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  color: rgba(11,16,32,.84);
  font-size: 12px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.toc a:hover{ transform: translateY(-1px); background:#fff; border-color: rgba(11,16,32,.18); }

audio, video{
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.65);
}

/* ---------- Carousel ---------- */
.carousel{
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(11,16,32,.04);
}
.car-track{
  display:flex;
  width: 100%;
  height: min(420px, 62vw);
  max-height: 420px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  direction: ltr; /* keep scroll math consistent */
  scrollbar-width: none;
}
.car-track::-webkit-scrollbar{ display:none; }
.car-slide{
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  position: relative;
  scroll-snap-align: start;
}
.car-slide img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.img-fallback{
  position:absolute;
  inset:0;
  background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(6,182,212,.10), rgba(245,158,11,.10));
  opacity: .0;
  transition: opacity .2s ease;
}
.noimg .img-fallback{ opacity:1; }
.car-btn{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  color: rgba(11,16,32,.92);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 22px;
  line-height: 1;
  z-index: 5;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.car-btn:hover{ transform: translateY(-50%) scale(1.04); background:#fff; border-color: rgba(11,16,32,.18); }
.car-btn.prev{ left: 10px; }
.car-btn.next{ right: 10px; }
.car-dots{
  display:flex;
  gap: 8px;
  justify-content:center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.80);
}
.car-dots .dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(11,16,32,.28);
  cursor:pointer;
}
.car-dots .dot.active{
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(37,99,235,.14);
}

/* ---------- Related cards ---------- */
.related{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
@media (max-width: 720px){
  .related{ grid-template-columns: 1fr; }
}
.rel-card{
  display:flex;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  overflow:hidden;
  box-shadow: 0 14px 36px rgba(13,19,39,.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rel-card:hover{
  transform: translateY(-2px);
  border-color: rgba(11,16,32,.18);
  box-shadow: 0 18px 48px rgba(13,19,39,.10);
}
.rel-img{
  width: 96px;
  min-width: 96px;
  height: 96px;
  position: relative;
  background: rgba(11,16,32,.04);
}
.rel-img img{ width:100%; height:100%; object-fit:cover; display:block; }
.rel-meta{ padding: 12px 12px 12px 0; display:flex; flex-direction:column; gap: 6px; }
.rel-name{ font-weight: 800; font-size: 13px; line-height: 1.6; }
.rel-sub{ color: var(--muted); font-size: 12px; }
.rel-name .en{ font-weight: 400; color: var(--faint); font-size: 12px; }

/* Footer on profile pages */
.footer{
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}



/* --- FIX: stack section cards vertically on person pages --- */
main.grid > .card.section,
main.grid > section.card.section,
main.grid > .section {
  grid-column: 1 / -1;
  margin-top: 0;
}

/* Keep spacing consistent inside main.grid */
main.grid { gap: 14px; }

/* --- Site Footer (shared) --- */
.site-footer{
  margin-top: 22px;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.86);
  box-shadow: 0 18px 55px rgba(13,19,39,.08);
}
.site-footer-inner{
  display:grid;
  grid-template-columns: 1.3fr .7fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px){
  .site-footer-inner{ grid-template-columns: 1fr; }
}
.foot-title{ font-weight: 800; font-size: 14px; }
.foot-sub{ margin-top: 4px; color: var(--muted); font-size: 12px; }
.foot-desc{ margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.foot-links a{
  display:block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  margin-bottom: 10px;
  color: rgba(11,16,32,.86);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.foot-links a:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.96);
  border-color: rgba(11,16,32,.18);
}
.foot-meta{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.foot-small{ margin-top: 8px; color: var(--faint); font-size: 12px; }


/* --- Typography: better RTL numerals & ZWNJ --- */
.prose{ unicode-bidi: plaintext; }


/* --- Infographic + PDF blocks (global) --- */
.fullw{ grid-column: 1 / -1; }
    .media-frame{ position:relative; border-radius:16px; overflow:hidden; border:1px solid rgba(11,16,32,.10); background: rgba(11,16,32,.03); }
    .media-frame img{ display:block; width:100%; height:auto; max-height:720px; object-fit:contain; background:#fff; }
    .media-frame.media-missing{ display:flex; align-items:center; justify-content:center; min-height:240px; }
    .media-fallback{ display:none; padding:18px; }
    .media-frame.media-missing .media-fallback{ display:block; }
    .pdf-shell{ border-radius:16px; overflow:hidden; border:1px solid rgba(11,16,32,.10); background:#fff; }
    .pdf-viewer iframe{ width:100%; height:min(72vh, 900px); border:0; display:block; background:#fff; }
