/* =====================================================================
   هوية الصفحات الداخلية (نوفمبر 2026) — نفس روح الصفحة الرئيسية:
   أخضر متدرّج بدون الشعاع الدهبي، زخرفة نجمة أزهرية خافتة، ونقشة حروف
   عربية في ركنين (بترسمها js/brand-hero.js). الهيرو بقى أقصر وفيه محتوى
   مفيد (نبذة/بحث/أزرار المسارات) بدل الفراغ.
   مطبّقة على كل صفحات الموقع العامة (الهيرو .page-hero--v2، والشرائط الخضرا
   الصغيرة .brand-band في صفحات التفاصيل والمقال).
   ===================================================================== */

/* ---------- الهيرو ---------- */
.page-hero--v2 {
  background: linear-gradient(160deg, #1a6e4f 0%, #125a40 30%, #0d4430 62%, #082e21 100%);
  padding: 34px 0 34px;
  text-align: center;
}
header.site-header--float + .page-hero--v2 { padding-top: 138px; }
.page-hero--v2::before { display: none; }
.page-hero--v2 .hero-calli { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
.page-hero--v2 .hero-calli text { font-family: "Aref Ruqaa", "Amiri", serif; font-weight: 700; }
.page-hero--v2 .hero-orn, .brand-band > .hero-orn {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72'%3E%3Cg fill='none' stroke='%23e6cd8a' stroke-opacity='.16' stroke-width='1'%3E%3Crect x='22' y='22' width='28' height='28'/%3E%3Crect x='22' y='22' width='28' height='28' transform='rotate(45 36 36)'/%3E%3Ccircle cx='36' cy='36' r='6'/%3E%3Cpath d='M0 0L22 22M72 0L50 22M0 72L22 50M72 72L50 50M36 0V16.2M36 55.8V72M0 36H16.2M55.8 36H72'/%3E%3Crect x='-7' y='-7' width='14' height='14' transform='rotate(45 0 0)'/%3E%3Crect x='65' y='-7' width='14' height='14' transform='rotate(45 72 0)'/%3E%3Crect x='-7' y='65' width='14' height='14' transform='rotate(45 0 72)'/%3E%3Crect x='65' y='65' width='14' height='14' transform='rotate(45 72 72)'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: radial-gradient(ellipse 46% 70% at 50% 55%, transparent 35%, #000 100%);
  mask-image: radial-gradient(ellipse 46% 70% at 50% 55%, transparent 35%, #000 100%);
}
.page-hero--v2 .container { position: relative; z-index: 1; }
.page-hero--v2 > .hero-orn { position: absolute; }
/* نصوص قديمة جوه بعض الهيروهات كانت بـ style مباشر */
.page-hero--v2 p:not(.page-hero-lead) { color: rgba(255,255,255,.82); }
.page-hero--v2 .breadcrumbs[style] { margin-top: 18px !important; margin-bottom: 0 !important; }
.page-hero--v2 .blog-search { margin-top: 16px; }
.page-hero--v2 .hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(230,205,138,.35); color: var(--gold-light);
  padding: 6px 14px; border-radius: 999px; font-size: .78rem; font-weight: 700; margin-bottom: 12px;
}
html[lang="ar"] body.site-public .page-hero--v2 h1 { font-size: clamp(2.3rem, 4vw, 3rem); margin-bottom: 6px; line-height: 1.35; }
.page-hero--v2 .page-hero-lead { color: rgba(255,255,255,.82); max-width: 58ch; margin: 0 auto 18px; font-size: .98rem; line-height: 1.8; }
.page-hero--v2 .breadcrumbs { margin-top: 18px; font-size: .8rem; }

/* الشرائط الخضرا الصغيرة (تفاصيل دورة/معلم، عنوان المقال) بنفس الهوية */
.brand-band, body.site-public .post-hero-plain, body.site-public .post-hero-titlebar, body.site-public .post-hero-skeleton {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1a6e4f 0%, #125a40 35%, #0d4430 70%, #082e21 100%);
}
.brand-band > .hero-orn { position: absolute; inset: 0; z-index: 0; -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 60%); mask-image: linear-gradient(to left, #000 0%, transparent 60%); }
html[dir="ltr"] .brand-band > .hero-orn { -webkit-mask-image: linear-gradient(to right, #000 0%, transparent 60%); mask-image: linear-gradient(to right, #000 0%, transparent 60%); }
.brand-band > .container { position: relative; z-index: 1; }

/* بحث داخل الهيرو */
.hero-search { position: relative; max-width: 520px; margin: 0 auto 16px; }
.hero-search input {
  width: 100%; padding: 13px 48px 13px 20px; border-radius: 999px; border: 1.5px solid rgba(230,205,138,.45);
  background: rgba(255,255,255,.96); font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
html[dir="ltr"] .hero-search input { padding: 13px 20px 13px 48px; }
.hero-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.18), var(--focus-ring); }
.hero-search svg { position: absolute; top: 50%; inset-inline-start: 18px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gold-dark); pointer-events: none; }

/* أزرار المسارات */
.track-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.track-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(230,205,138,.3); color: #fff; font-size: .85rem; font-weight: 700;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.track-chip:hover, .track-chip:focus-visible { background: rgba(230,205,138,.18); border-color: var(--gold-light); transform: translateY(-2px); outline: none; }
.track-chip .track-icon-sm { width: 20px; height: 20px; color: var(--gold-light); flex-shrink: 0; }

/* ---------- صفحة الدورات: مسافات أقل ---------- */
body.courses-page .courses-section { padding: 40px 0 64px; }
body.courses-page .cta-section { padding: 0 0 64px; background: transparent; }

/* ---------- كارت المسار: أيقونة بعد الاسم في الفراغ المتبقي ---------- */
.course-card-head { align-items: center; }
.course-card-head h3 { margin: 0; flex: 1 1 auto; min-width: 0; }
.course-card-head .star8 { margin-bottom: 0; flex-shrink: 0; }
.course-card-head .track-icon {
  flex-shrink: 0; margin-inline-start: auto; width: 52px; height: 52px; padding: 7px;
  color: var(--gold-light); background: rgba(255,255,255,.07); border: 1px solid rgba(230,205,138,.35); border-radius: 16px;
}
.course-card { scroll-margin-top: 130px; }
.course-card-count { font-size: .8rem; font-weight: 700; color: var(--gold-dark); margin: 0 0 10px; }
body.courses-page .course-card-head { margin-bottom: 0; padding: 18px 22px; }
body.courses-page .course-card-body { padding: 18px 22px 20px; }
body.courses-page .course-card-body ul { margin-bottom: 16px; }
body.courses-page .course-card-body li { margin-bottom: 8px; }

@media (max-width: 640px) {
  header.site-header--float + .page-hero--v2 { padding-top: 110px; }
  .page-hero--v2 { padding-bottom: 26px; }
  html[lang="ar"] body.site-public .page-hero--v2 h1 { font-size: 2.1rem; }
  .page-hero--v2 .page-hero-lead { font-size: .88rem; margin-bottom: 14px; }
  .hero-search input { font-size: .9rem; padding-block: 12px; }
  /* أزرار المسارات: كلها ظاهرة (بتنزل سطر جديد)، بحجم أصغر */
  .track-chips { gap: 6px; }
  .track-chip { font-size: .76rem; padding: 6px 11px 6px 9px; gap: 6px; }
  .track-chip .track-icon-sm { width: 17px; height: 17px; }
  /* على الموبايل أول ٤ مسارات بس (بترتيب المدير)، والباقي في الكروت تحت */
  .track-chip:nth-child(n+5) { display: none; }
  .page-hero--v2 .breadcrumbs { margin-top: 12px; }
  body.courses-page .courses-section { padding: 26px 0 44px; }
  body.courses-page .cta-section { padding-bottom: 44px; }
  .course-card-head .track-icon { width: 46px; height: 46px; padding: 6px; border-radius: 14px; }
  body.courses-page #courses-list { gap: 14px; }
  body.courses-page .course-card-head { padding: 14px 16px; gap: 10px; }
  body.courses-page .course-card-head h3 { font-size: 1.12rem; }
  body.courses-page .course-card-body { padding: 14px 16px 16px; }
  body.courses-page .course-card-body li { margin-bottom: 6px; }
  body.courses-page .course-card-body ul { margin-bottom: 12px; }
}

/* =====================================================================
   صفحة المسار (category-details.html): كارت مختصر لكل دورة —
   رقم الدورة وعنوانها، نبذة قصيرة وجنبها الصورة، وتحتهم التسجيل/التفاصيل/المشاركة.
   التفاصيل الكاملة (المميزات، المحتوى، الفيديو) في صفحة الدورة نفسها.
   ===================================================================== */
#cd-courses-wrap { display: grid; gap: 16px; padding-top: 32px; padding-bottom: 32px; max-width: 960px; }

/* كمبيوتر/تابلت (B): صف مضغوط — الرقم والعنوان والنبذة والأزرار يمين، والصورة شمال (في العربي) */
.tc-card {
  background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 18px; scroll-margin-top: 130px; min-width: 0; position: relative;
  display: grid; gap: 6px 24px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas: "head media" "desc media" "actions media" "details details";
}
.tc-body { display: contents; }
.tc-head { grid-area: head; display: flex; align-items: center; gap: 12px; min-width: 0; }
.tc-num {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--gradient-green); color: var(--gold-light); font-weight: 800; font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(230,205,138,.35);
}
.tc-head-text { min-width: 0; }
.tc-ordinal { display: block; color: var(--gold-dark); font-size: .78rem; font-weight: 800; margin-bottom: 1px; }
html[lang="ar"] body.site-public .tc-title, .tc-title {
  font-family: var(--font-sub, "El Messiri", var(--font-body)); font-weight: 700; font-size: 1.2rem;
  line-height: 1.4; color: var(--deep-green); margin: 0; overflow-wrap: anywhere;
}
.tc-desc {
  grid-area: desc; margin: 0; color: var(--ink-soft); font-size: .93rem; line-height: 1.85; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-media {
  grid-area: media; position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden;
  background: var(--sage-mist); box-shadow: var(--shadow-soft);
}
.tc-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.tc-card:hover .tc-media img { transform: scale(1.03); }
.tc-play {
  position: absolute; inset: 0; margin: auto; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(14,74,52,.88); color: #fff; font-size: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.tc-ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, #1a6e4f 0%, #0d4430 70%, #082e21 100%); }
.tc-ph-icon { width: 34%; height: auto; max-width: 110px; color: var(--gold-light); opacity: .9; }
.tc-actions { grid-area: actions; align-self: end; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.tc-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tc-share-ico { width: 17px; height: 17px; flex-shrink: 0; }
.tc-details { grid-area: details; margin-top: 10px; }

@media (max-width: 900px) {
  .tc-card { grid-template-columns: minmax(0, 1fr) 220px; gap: 6px 18px; }
}

/* موبايل (M2): الصورة بانر فوق بعرض الكارت (البوستر يبان كامل) ورقم الدورة عليها،
   وتحتها العنوان والنبذة والأزرار */
@media (max-width: 640px) {
  #cd-courses-wrap { gap: 14px; padding-top: 20px; padding-bottom: 20px; }
  .tc-card {
    padding: 0; gap: 0; overflow: hidden; border-radius: 20px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "media" "head" "desc" "actions" "details";
  }
  .tc-media { aspect-ratio: 16 / 9; border-radius: 0; box-shadow: none; }
  .tc-head { padding: 14px 16px 0; }
  .tc-num { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; width: 36px; height: 36px; font-size: .95rem; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
  html[lang="ar"] body.site-public .tc-title, .tc-title { font-size: 1.12rem; }
  .tc-desc { padding: 6px 16px 0; font-size: .86rem; line-height: 1.8; }
  .tc-actions { margin: 12px 16px 16px; padding-top: 12px; border-top: 1px dashed var(--line); gap: 8px; flex-wrap: nowrap; }
  .tc-actions .btn { flex: 1 1 0; min-width: 0; padding: 10px 8px; font-size: .84rem; white-space: nowrap; }
  .tc-actions .tc-share { flex: 0 0 44px; padding: 10px 0; }
  .tc-actions .tc-share span { display: none; }
  .tc-details { margin: 0 16px 16px; }
}
@media (max-width: 360px) {
  .tc-actions { margin-inline: 12px; gap: 6px; }
  .tc-actions .btn { font-size: .76rem; padding: 9px 4px; }
  .tc-actions .tc-share { flex-basis: 40px; }
}

/* تفاصيل الدورة جوه الكارت (بتتفتح من "عرض التفاصيل" — واحدة بس في المرة) */
.tc-card.is-open { border-color: rgba(201,163,78,.55); box-shadow: var(--shadow-soft); }
.tc-details { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 22px; animation: tcOpen .25s var(--ease); min-width: 0; }
.tc-details[hidden] { display: none; }
@keyframes tcOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tc-d-sec { min-width: 0; }
html[lang="ar"] body.site-public .tc-d-title, .tc-d-title { font-family: var(--font-sub, "El Messiri", var(--font-body)); font-size: 1.08rem; font-weight: 700; color: var(--deep-green); margin: 0 0 10px; }
.tc-d-text { margin: 0; color: var(--ink-soft); line-height: 1.95; overflow-wrap: anywhere; }
.tc-d-video { position: relative; aspect-ratio: 16 / 9; max-width: 640px; border-radius: var(--radius-md); overflow: hidden; background: #0b2e22; }
.tc-d-video iframe, .tc-d-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tc-details .cd-learning-list { margin-top: 0; }
.tc-details .features-grid { margin: 0; }
.tc-d-link { justify-self: start; font-weight: 800; font-size: .9rem; color: var(--gold-dark); }
.tc-d-link:hover { color: var(--deep-green); }
@media (prefers-reduced-motion: reduce) { .tc-details { animation: none; } }
@media (max-width: 640px) {
  .tc-details { padding-top: 14px; gap: 18px; }
  .tc-d-title { font-size: 1rem; }
  .tc-d-text { font-size: .88rem; }
  .tc-details .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tc-details .feature-pill { padding: 12px 8px; }
  .tc-details .feature-pill .icon { font-size: 1.3rem; margin-bottom: 4px; }
  .tc-details .feature-pill .label { font-size: .8rem; }
}
