/* رأس صفحة الدورة العامة — الخيار G (reports/course-hero-options-3.html) + موضع الاسم D (reports/course-title-position-options.html)
   الحاسوب: يميناً الأستاذ · التقييم · الوصف · المزايا، يساراً (.course-buy-col) اسم المادة ثم صورة الفيديو الأول (▶ → الاشتراك) ثم السعر والزر.
   الهاتف (≤700px): الاسم، ثم الصورة، ثم السعر، ثم المعلومات.
   المحددات أقوى من أنماط الصفحة المضمّنة، فلا يلزم حذفها. */

.course-header-box .course-hero { grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.course-header-box .course-hero .course-hero-info { order: 1; min-width: 0; }
.course-header-box .course-hero .course-buy-col { order: 2; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }

/* الخيار D: اسم المادة فوق صورة الفيديو في عمود الشراء */
.course-header-box .course-buy-col > .course-hero-main-col { order: 0; text-align: center; }
.course-header-box .course-buy-col > .course-enroll-card { order: 1; }
.course-header-box .course-buy-col .course-hero-title { margin: 0; text-align: center; font-size: 1.6rem; line-height: 1.25; }
.course-header-box .course-buy-col .course-hero-title-en { text-align: center; margin-top: 2px; }

/* المعلومات: عمود واحد مرتّب يميناً (الاسم ← الأستاذ · التقييم ← الوصف ← المزايا) */
.course-header-box .course-hero .course-hero-row { flex-direction: column; align-items: stretch; gap: 0.25rem; }
.course-header-box .course-hero .course-hero-main-col,
.course-header-box .course-hero .course-hero-side { order: 0; max-width: none; margin-top: 0; text-align: right; }
.course-header-box .course-hero .course-hero-instructor { display: block; margin: 0 0 4px; }
.course-header-box .course-hero .course-hero-rating { justify-content: flex-start; }

/* المزايا داخل الرأس (الخيار C — reports/course-hero-gap-options.html): سطر لكل ميزة بخط فاصل خفيف،
   والبث يحمل ملاحظته تحته. القائمة أطول فتملأ الفراغ بجانب عمود الشراء. */
.course-header-box .course-hero-info .course-benefits-section { margin-top: 0.9rem; padding: 0; border: 0; background: none; box-shadow: none; }
.course-header-box .course-hero-info .course-benefits-title { font-size: 0.95rem; margin-bottom: 0.3rem; }
.course-header-box .course-hero-info .course-benefits-grid { display: flex; flex-direction: column; gap: 0; }
.course-header-box .course-hero-info .benefit-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: center;
  padding: 0.5rem 0; border-top: 1px solid #eef1f5; white-space: normal; }
.course-header-box .course-hero-info .benefit-card:first-child { border-top: 0; }
.course-header-box .course-hero-info .benefit-icon { width: 30px; height: 30px; }
.course-header-box .course-hero-info .benefit-card:has(.benefit-when) .benefit-icon { grid-row: 1 / span 2; }
.course-header-box .course-hero-info .benefit-icon.live-dot { background: #fef2f2; }
.course-header-box .course-hero-info .benefit-title { grid-column: 2; font-size: 0.92rem; }
.course-header-box .course-hero-info .benefit-when { grid-column: 2; font-size: 0.8rem; line-height: 1.5; }

/* سطر «تواصل معنا عبر إنستغرام» آخر سطر في قائمة المزايا، بنفس الفاصل والأيقونة */
.course-header-box .course-hero-info #contact-box { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: center;
  margin: 0; padding: 0.5rem 0; border-top: 1px solid #eef1f5; text-align: right; font-size: 0.88rem; color: #475569; }
.course-header-box .course-hero-info .contact-ico { width: 30px; height: 30px; border-radius: 8px; background: #fdf2f8; color: #d62976;
  display: flex; align-items: center; justify-content: center; }

/* بطاقة الشراء: صورة الفيديو الأول ثم السعر والزر */
.course-header-box .course-enroll-card { padding: 0 0 1rem; overflow: hidden; min-width: 0; width: 100%; box-sizing: border-box; gap: 0.6rem; background: #fff; }
.course-enroll-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #e2e8f0; }
.course-enroll-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* مشغّل الفيديو التقديمي (js/course-intro.js): YouTube مخفي تحت الصورة، يظهر عند التشغيل */
.ci { overflow: hidden; background: #000; }
.ci-frame, .ci-frame iframe, .ci-hit { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ci-frame { opacity: 0; transition: opacity .2s; }
/* إطار YouTube أطول من الحاوية: الفيديو (16:9) يبقى كاملًا في الوسط، والشريطان الأسودان أعلاه وأسفله —
   حيث يرسم YouTube العنوان والقناة وزر المشاركة والشعار — خارج المساحة الظاهرة */
.ci-frame iframe { inset: auto; top: -25%; left: 0; height: 150%; }
/* ملفنا (data-intro-src): <video> يملأ البطاقة كالصورة؛ في الشاشة الكاملة يظهر كاملًا بلا قص */
.ci-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.ci:fullscreen .ci-frame video, .ci.ci-fb .ci-frame video { object-fit: contain; }
.ci.is-on .ci-frame { opacity: 1; }
.ci-hit { display: none; z-index: 1; cursor: pointer; }
.ci.is-on .ci-hit { display: block; }
.ci-cover { position: absolute; inset: 0; z-index: 2; padding: 0; border: 0; background: none; cursor: pointer; display: block; width: 100%; height: 100%; }
.ci-cover:focus-visible { outline: 3px solid #fbbf24; outline-offset: -3px; }
.ci-cover:hover .course-enroll-play { background: #f8fafc; }
.ci.is-on .ci-cover { display: none; }   /* عند الإيقاف تبقى اللقطة التي توقف عندها الفيديو (طلب المالك) */
.ci.is-loading .course-enroll-play svg { visibility: hidden; }
.ci.is-loading .course-enroll-play::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid #cbd5e1; border-top-color: #12305c; animation: ci-spin .7s linear infinite; }
@keyframes ci-spin { to { transform: rotate(360deg); } }
.ci-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: none; align-items: center; gap: 6px; padding: 6px 8px;
  background: rgba(15, 23, 42, .82); color: #fff; font-size: 12px; }
.ci.is-on .ci-bar { display: flex; opacity: 0; transition: opacity .2s; }
.ci.is-on.bar-on .ci-bar, .ci.is-on.is-paused .ci-bar, .ci.is-on:has(.ci-bar :focus-visible) .ci-bar { opacity: 1; }
.ci-b { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer; }
.ci-b:hover { background: rgba(255, 255, 255, .12); }
.ci-b:focus-visible, .ci-seek:focus-visible, .ci-sound:focus-visible { outline: 2px solid #fbbf24; outline-offset: 1px; }
.ci-t { white-space: nowrap; font-variant-numeric: tabular-nums; opacity: .9; }
.ci-seek { flex: 1; min-width: 40px; height: 4px; accent-color: #fff; cursor: pointer; }
.ci-sound { position: absolute; z-index: 4; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 14px; border: 0; border-radius: 8px; background: #fff; color: #0f172a; font: inherit; font-weight: 700; cursor: pointer; }
.ci-sound[hidden] { display: none; }
.ci:fullscreen { aspect-ratio: auto; }
.ci.ci-fb { position: fixed; inset: 0; z-index: 10000; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; }
@media (prefers-reduced-motion: reduce) { .ci-frame, .ci-bar { transition: none; } .ci.is-loading .course-enroll-play::after { animation-duration: 2s; } }
.course-enroll-play { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #12305c;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18); }
.course-enroll-play svg { margin-inline-start: 3px; }
.course-enroll-thumb:hover .course-enroll-play { background: #f8fafc; }
.course-enroll-thumb:focus-visible { outline: 3px solid #fbbf24; outline-offset: -3px; }
.course-header-box .course-enroll-card .course-pay-btn { margin: 0 1rem; align-self: stretch; display: flex; align-items: center; justify-content: center; text-align: center; }

/* ═══ الخيار P5 (reports/course-hero-options.html) — 2026-10-23 ═══
   يمين: بطاقة «عن الدورة» (الاسم ← الأستاذ والتقييم ← الوصف) ثم بطاقة المزايا. يسار: بطاقة الشراء (الصورة، السعر، زر كحلي).
   الاسم نُقل في HTML من عمود الشراء إلى .course-about-card. سطر إنستغرام مخفي (زر واتساب العائم يكفي). */
.course-header-box .course-hero { grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; }
.course-header-box .course-about-card { background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; padding: 18px 20px; text-align: right; }
.course-header-box .course-about-card .course-hero-main-col { margin: 0 0 6px; text-align: right; }
.course-header-box .course-about-card .course-hero-title { margin: 0; font-size: 1.9rem; line-height: 1.25; color: #0f172a; text-align: right; }
.course-header-box .course-about-card .course-hero-title-en { display: block; margin-top: 2px; font-size: 0.9rem; font-weight: 600; color: #64748b; text-align: right; }
.course-header-box .course-about-card .course-hero-bio { margin-bottom: 0; }
.course-header-box .course-hero-info .course-benefits-section { margin-top: 12px; background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; padding: 14px 18px; }
.course-header-box .course-hero-info .course-benefits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.course-header-box .course-hero-info .benefit-card,
.course-header-box .course-hero-info .benefit-card:first-child { grid-template-columns: 30px minmax(0, 1fr); padding: 8px 10px; border: 1px solid #eef1f5; border-radius: 8px; background: #fff; }
.course-header-box .course-hero-info .benefit-card:has(.live-dot) { grid-column: 1 / -1; background: #fef2f2; border-color: #fecaca; }
.course-header-box .course-hero-info .benefit-icon.live-dot { background: transparent; }
.course-header-box .course-hero-info #contact-box { display: none; }
.course-header-box .course-enroll-card { border: 1px solid #e5e9f0; border-radius: 12px; }
.course-header-box .course-enroll-card .course-pay-btn { background: #12305c !important; color: #fff !important; border: 0 !important; border-radius: 8px !important; box-shadow: none !important; }
.course-header-box .course-enroll-card .course-pay-btn:hover { background: #0f2850 !important; }

@media (max-width: 700px) {
  .course-header-box .course-hero { grid-template-columns: 1fr; gap: 1rem; text-align: right; }
  .course-header-box .course-about-card { padding: 14px 16px; }
  .course-header-box .course-about-card .course-hero-title { font-size: 1.45rem; }
  .course-header-box .course-hero-info .course-benefits-section { padding: 12px; }
  .course-header-box .course-hero-info #contact-box { display: none; }
  .course-header-box .course-hero .course-buy-col { order: 1; }
  .course-header-box .course-hero .course-hero-info { order: 2; }
  .course-header-box .course-buy-col > .course-enroll-card { width: 100%; }
  .course-header-box .course-buy-col .course-hero-title,
  .course-header-box .course-buy-col .course-hero-title-en { text-align: center; }
  .course-header-box .course-hero .course-hero-bio,
  .course-header-box .course-hero .course-hero-side { text-align: right; }
  .course-header-box .course-hero .course-hero-rating { justify-content: flex-start; }
  /* بلا فراغ وخط زائد تحت آخر سطر، ومسافة قصيرة قبل «محتوى الدورة» */
  .course-header-box .course-hero { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
  .course-content > .course-header-box { margin-bottom: 12px; padding-bottom: 12px; }
  .course-content > .course-header-box + .cc { margin-top: 12px; }

  /* المزايا على الهاتف (الخيار A — reports/course-benefits-phone-options.html):
     البث شريط أحمر فاتح بعرض كامل، والأربع مربعات 2×2، وإنستغرام سطر صغير في الوسط */
  .course-header-box .course-hero-info .course-benefits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .course-header-box .course-hero-info .benefit-card { grid-template-columns: 26px minmax(0, 1fr); column-gap: 7px; padding: 7px 8px;
    border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
  .course-header-box .course-hero-info .benefit-card:first-child { border: 1px solid #e5e7eb; }
  .course-header-box .course-hero-info .benefit-icon { width: 26px; height: 26px; }
  .course-header-box .course-hero-info .benefit-title { font-size: 0.8rem; line-height: 1.35; }
  .course-header-box .course-hero-info .benefit-card:has(.live-dot) { grid-column: 1 / -1; background: #fef2f2; border-color: #fecaca; }
  .course-header-box .course-hero-info .benefit-card:has(.live-dot) .benefit-title { color: #991b1b; font-size: 0.88rem; }
  .course-header-box .course-hero-info .benefit-icon.live-dot { background: transparent; }
  .course-header-box .course-hero-info #contact-box { display: none; }   /* P5: سطر إنستغرام مخفي */
  .course-header-box .course-hero-info .contact-ico { display: none; }
}
