/* ===== training.html — كتالوج الدورات (شرائح · شبكة · لوحة التفصيل · استمارة الاهتمام) =====
   يُحمَّل بعد الـ<style> المضمّن وقبل mobile-fixes.css. سلّم المسافات ٨px حصرًا،
   لا نصّ تحت ١٢px، لا هدف لمس تحت ٤٤px. الشبكة ٣ أعمدة ديسكتوب · ٢ تابلت · ١ موبايل. */

/* ---------- الهيرو القصير ---------- */
.hero.hero-short{min-height:min(60vh,520px);padding:96px 0}
.hero.hero-short .in{max-width:760px}
.hero.hero-short h1.hero-t{font-size:46px}
@media(max-width:880px){.hero.hero-short h1.hero-t{font-size:34px}}
.hero.hero-short p.lead{margin:16px auto 24px}

/* ---------- الكتالوج ---------- */
.catalog{background:var(--paper-2)}
.catalog .sec-head{margin-bottom:32px}

/* شرائح التصفية */
.chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:0 auto 40px;max-width:960px}
/* ⛔ flex:0 0 auto عالميًّا: بدونها تنضغط الشرائح العشر إلى 34px (دائرة بحرف واحد) حين تصير .chips بلا التفاف على ≤768px — قياس حيّ 2026-09-06 */
.chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 16px;border-radius:999px;border:1.5px solid var(--line);
  background:var(--surface);color:var(--navy);font:inherit;font-weight:700;font-size:14px;line-height:1.4;cursor:pointer;white-space:nowrap;
  transition:background .15s,border-color .15s,color .15s}
.chip:hover{border-color:var(--navy)}
.chip[aria-pressed="true"]{background:var(--navy);border-color:var(--navy);color:#fff}
.chip .dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--c,var(--gold))}
.chip[aria-pressed="true"] .dot{box-shadow:0 0 0 2px rgba(255,255,255,.5)}
@media(max-width:768px){
  .chips{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;
    margin-left:calc(-1 * var(--space-4));margin-right:calc(-1 * var(--space-4));padding:0 var(--space-4) 8px;margin-bottom:24px}
  .chips::-webkit-scrollbar{display:none}
}

/* الفهرس الثابت (يولّده tools/build-catalog-static.py للزواحف ولمن بلا جافاسكربت) — قائمة مسطّحة بترتيب الطلب (rank) مع وسم الفئة؛ الشبكة الحيّة تُزيله، ويظهر مجدّدًا إن تعذّر تحميل الكتالوج */
.cat-index{list-style:none;margin:0 0 40px;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.js .cat-index{display:none}
.js .cat-index.show{display:grid}
.cat-index>li{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:8px 24px}
.cat-index li a{display:flex;align-items:center;min-height:44px;padding:8px 0;font-size:14px;font-weight:700;line-height:1.6;color:var(--navy);text-decoration:underline;text-underline-offset:3px}
.cat-index li a:hover{color:var(--human)}
.cat-index .cix-cat{font-size:12px;font-weight:700;line-height:1.4;color:var(--muted);padding:0 0 8px}
@media(max-width:1023px){.cat-index{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.cat-index{grid-template-columns:1fr;gap:16px}}

/* الشبكة */
.cgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
@media(max-width:1023px){.cgrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.cgrid{grid-template-columns:1fr;gap:16px}}

/* البطاقة — رابط كامل إلى #course=<slug> */
.cc{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden;
  transition:transform .16s,box-shadow .16s,border-color .16s;color:inherit}
.cc:hover{transform:translateY(-4px);box-shadow:0 16px 40px rgba(59,30,23,.12);border-color:transparent}
.cc:focus-visible{outline:2px solid var(--human);outline-offset:2px}
.cc[hidden]{display:none}
/* مساحة الصورة: تدرّج الفئة + أيقونة + وسم — أو صورة الكتالوج إن وُجدت */
.cc .art{position:relative;height:160px;display:grid;place-items:center;background:var(--g,linear-gradient(135deg,#3B1E17,#2E4470));overflow:hidden}
.cc .art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.cc .art .ico{width:56px;height:56px;color:rgba(255,255,255,.92);stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;
  filter:drop-shadow(0 4px 12px rgba(15,23,42,.35))}
.cc .art::after{content:"";position:absolute;inset:auto -40px -80px auto;width:200px;height:200px;border-radius:50%;background:rgba(255,255,255,.08);pointer-events:none}
.cc .tag{position:absolute;top:16px;right:16px;font-size:12px;font-weight:800;line-height:1.4;border-radius:8px;padding:4px 8px;background:rgba(255,255,255,.94);color:var(--navy)}
.cc .tag.live{background:var(--agree);color:#fff}
.cc .body{display:flex;flex-direction:column;flex:1;padding:16px 16px 16px}
.cc h3{font-family:'Aref Ruqaa',serif;font-size:19px;font-weight:800;color:var(--navy);line-height:1.55;margin-bottom:8px}
.cc p.pitch{font-size:14px;color:var(--ink-2);line-height:1.8;margin-bottom:16px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.cc .meta{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;line-height:1.4;border-radius:8px;padding:4px 8px;background:var(--paper-2);color:var(--ink-2)}
.pill.lv{color:var(--ai);background:rgba(14,142,155,.1)}
.pill.fm{color:var(--human);background:var(--human-bg)}
/* الحالة الصادقة: «برنامج مطروح» لا دورة منعقدة — الشارة والسطر تحتها على كل بطاقة وفي لوحة التفصيل */
.pill.of{color:var(--gold);background:var(--gold-bg)}
.cc p.open-note{font-size:12px;color:var(--muted);line-height:1.7;margin-bottom:16px}
.cp-open-note{font-size:13px;color:var(--ink-2);line-height:1.8;background:var(--gold-bg);border-radius:10px;padding:8px 16px;margin-bottom:16px}
.cc .foot{margin-top:auto}
.cc .cta-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:8px 16px;border-radius:11px;
  background:var(--human);color:#fff;font-weight:800;font-size:14px;line-height:1.4;transition:background .15s}
.cc:hover .cta-btn{background:#8a2444}
.cc.live .cta-btn{background:var(--navy)}
.cc .cta-btn .ic{width:16px;height:16px}

/* ---------- لوحة التفصيل ---------- */
/* ⛔ display:flex على .cp كانت تغلب [hidden] الافتراضي فتظهر اللوحة «المخفية» فوق الصفحة — الحسم بالصريح */
.cp[hidden],.cp-backdrop[hidden]{display:none!important}
.cp-backdrop{position:fixed;inset:0;z-index:80;background:rgba(15,23,42,.62);backdrop-filter:blur(3px)}
.cp{position:fixed;z-index:90;top:50%;left:50%;transform:translate(-50%,-50%);width:min(720px,calc(100% - 32px));max-height:calc(100% - 48px);
  background:var(--surface);border-radius:24px;box-shadow:0 32px 80px rgba(15,23,42,.35);display:flex;flex-direction:column;overflow:hidden}
.cp-head{position:relative;flex:none;padding:24px 24px 16px;background:var(--g,linear-gradient(135deg,#3B1E17,#2E4470));color:#fff}
.cp-head .tag{display:inline-block;font-size:12px;font-weight:800;line-height:1.4;border-radius:8px;padding:4px 8px;background:rgba(255,255,255,.94);color:var(--navy);margin-bottom:8px}
.cp-head h2{font-family:'Aref Ruqaa',serif;font-size:24px;font-weight:800;line-height:1.5;color:#fff;padding-inline-end:56px}
.cp-close{position:absolute;top:16px;left:16px;width:44px;height:44px;border-radius:12px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff;
  display:grid;place-items:center;cursor:pointer;font:inherit;transition:background .15s}
.cp-close:hover{background:rgba(255,255,255,.24)}
.cp-close .ic{width:20px;height:20px}
.cp-body{overflow-y:auto;padding:24px;-webkit-overflow-scrolling:touch}
.cp-meta{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.cp-desc{font-size:15px;color:var(--ink);line-height:1.9;margin-bottom:24px}
.cp-body h3{font-family:'Aref Ruqaa',serif;font-size:19px;font-weight:800;color:var(--navy);margin-bottom:8px}
.cp-body ul{list-style:none;margin:0 0 24px;padding:0;display:grid;gap:8px}
.cp-body ul li{position:relative;padding-inline-start:24px;font-size:14px;color:var(--ink-2);line-height:1.8}
.cp-body ul li::before{content:"";position:absolute;inset-inline-start:0;top:10px;width:12px;height:12px;border-radius:50%;background:var(--gold-bg);border:2px solid var(--gold)}
.cp-body p.aud{font-size:14px;color:var(--ink-2);line-height:1.8;margin-bottom:24px}

/* استمارة الاهتمام داخل اللوحة */
.cp-form{background:var(--paper);border:1px solid var(--line);border-radius:16px;padding:24px}
.cp-form h3{margin-bottom:16px}
.cp-form .row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:560px){.cp-form .row{grid-template-columns:1fr}}
.cp-form .fld{margin-bottom:16px}
.cp-form label{display:block;font-weight:800;font-size:13px;color:var(--navy);margin-bottom:8px}
.cp-form label .opt{font-weight:600;color:var(--muted)}
.cp-form input[type="text"],.cp-form input[type="tel"],.cp-form input[type="email"]{width:100%;min-height:48px;font:inherit;font-size:16px;color:var(--ink);background:var(--surface);
  border:1.5px solid var(--line);border-radius:11px;padding:8px 16px;transition:border-color .15s}
.cp-form input:focus{border-color:var(--human);outline:none}
.cp-form input[type="tel"],.cp-form input[type="email"]{direction:ltr;text-align:right}
.cp-err{display:none;background:var(--human-bg);color:var(--human);font-weight:700;font-size:13px;border-radius:10px;padding:8px 16px;margin-bottom:16px;line-height:1.7}
.cp-err.show{display:block}
.cp-form .btn{width:100%;justify-content:center;min-height:48px}
.cp-form .btn:disabled{opacity:.6;cursor:not-allowed;transform:none}
.cp-form .note{font-size:12px;color:var(--muted);line-height:1.7;margin-top:8px;text-align:center}
.cp-done{background:rgba(28,154,91,.08);border:1px solid rgba(28,154,91,.3);border-radius:16px;padding:24px;text-align:center}
.cp-done .seal{width:48px;height:48px;border-radius:14px;background:var(--agree);color:#fff;display:grid;place-items:center;margin:0 auto 16px}
.cp-done .seal .ic{width:24px;height:24px;stroke-width:2.2}
.cp-done p{font-size:16px;font-weight:800;color:var(--agree);line-height:1.8;margin-bottom:16px}
.cp-done .btn{min-height:44px}
/* لا تمرير للصفحة خلف اللوحة */
body.cp-open{overflow:hidden}
/* موبايل: اللوحة ورقة كاملة من الأسفل */
@media(max-width:640px){
  .cp{top:auto;left:0;bottom:0;transform:none;width:100%;max-height:calc(100% - 24px);border-radius:24px 24px 0 0}
  .cp-head{padding:16px 16px 16px}
  .cp-head h2{font-size:20px}
  .cp-body{padding:16px}
  .cp-form{padding:16px}
}
@media(prefers-reduced-motion:no-preference){
  .cp{animation:cp-in .22s ease-out}
  @keyframes cp-in{from{opacity:0}to{opacity:1}}
}

/* ---------- خطوات الرحلة (٣) ---------- */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;max-width:980px;margin:0 auto}
@media(max-width:760px){.steps{grid-template-columns:1fr;gap:16px}}
.step{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:24px}
.step .n{font-family:'Aref Ruqaa',serif;font-size:40px;color:var(--gold);line-height:1;margin-bottom:16px}
.step h3{font-family:'Aref Ruqaa',serif;font-size:19px;font-weight:800;color:var(--navy);line-height:1.55;margin-bottom:8px}
.step p{font-size:14px;color:var(--ink-2);line-height:1.85}

/* ═══ خبير البرنامج (المرحلة ٥ · منى أوّل خبيرة) ═══════════════════════════
   يظهر فقط حين يحمل البرنامج حقل expert في الكتالوج. بلا صورة مخترعة: حرف أوّل الاسم.
   ⛔ بلا تقييم وبلا عدد متدرّبين وبلا سعر — الشارة تبقى «برنامج مطروح». */
.xby{display:flex;align-items:center;gap:8px;margin-bottom:16px}
.xby .xa{width:32px;height:32px;border-radius:50%;flex:none;display:grid;place-items:center;
  background:var(--gold-bg);color:var(--gold);font-family:'Aref Ruqaa',serif;font-size:17px;font-weight:800;line-height:1}
.xby .xt{display:flex;flex-direction:column;min-width:0}
.xby .xt b{font-size:13px;font-weight:800;color:var(--navy);line-height:1.5}
.xby .xt span{font-size:12px;color:var(--muted);line-height:1.5}
.cp-expert{background:var(--paper-2);border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:16px}
.cp-expert[hidden]{display:none}
.cp-expert .x-kick{font-size:12px;font-weight:800;color:var(--gold);line-height:1.5;margin-bottom:8px}
.cp-expert .xby{margin-bottom:8px}
.cp-expert .x-role{font-size:13px;color:var(--ink-2);line-height:1.8;margin-bottom:8px}
.cp-expert .x-link{font-size:13px;font-weight:800;color:var(--human);text-decoration:underline;text-underline-offset:3px}
