/* =========================================================
   منظمة نعمة — العناصر الاحترافية داخل المقالات والمشاريع
   (تُحمَّل في الموقع وفي معاينة المحرر بلوحة التحكم)
   ========================================================= */
.prose .mc-counters, .prose .mc-progress, .prose .mc-callout, .prose .mc-buttons, .prose .mc-columns, .prose .mc-quote,
.prose .mc-timeline, .prose .mc-steps, .prose .mc-accordion, .prose .mc-gallery, .prose .mc-facts, .prose .mc-donate, .prose .md-table { margin: 2rem 0; }

/* العدادات */
.mc-counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.mc-item { display: grid; justify-items: center; gap: .2rem; text-align: center; padding: 1.4rem 1rem; border-radius: 18px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand, #08788d) 8%, #fff), #fff); border: 1px solid var(--line, #dfe6e2); }
.mc-item .ico { width: 34px; height: 34px; padding: 7px; border-radius: 12px; background: var(--accent-soft, #eef6d6); color: var(--brand, #08788d); margin-bottom: .3rem; }
.mc-item b { font: 800 clamp(1.7rem, 4vw, 2.3rem)/1.1 var(--font-display, sans-serif); color: var(--brand, #08788d); font-variant-numeric: tabular-nums; direction: ltr; }
.mc-item > span { color: var(--ink-soft, #5b7279); font-size: .95rem; line-height: 1.5; }

/* أشرطة التقدم */
.mc-progress { list-style: none; padding: 0 !important; display: grid; gap: 1rem; }
.mc-progress li { display: grid; grid-template-columns: 1fr auto; gap: .35rem; margin: 0 !important; }
.mc-progress li::marker { content: none; }
.mp-label { font-weight: 600; } .mp-val { font: 700 .95rem var(--font-display, sans-serif); color: var(--brand, #08788d); }
.mp-track { grid-column: 1 / -1; height: 10px; border-radius: 10px; background: color-mix(in srgb, var(--brand, #08788d) 10%, #fff); overflow: hidden; }
.mp-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--brand-2, #00afc6), var(--accent, #b8d034)); transform-origin: var(--o, right); }
html[dir="ltr"] .mp-fill { --o: left; }
.js .mc-progress li.reveal .mp-fill { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.16,1,.3,1) .2s; }
.js .mc-progress li.is-in .mp-fill { transform: scaleX(1); }

/* صناديق التنبيه */
.mc-callout { display: flex; gap: .9rem; padding: 1.1rem 1.3rem; border-radius: 16px; border: 1px solid; border-inline-start-width: 5px; }
.mc-callout .mc-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.mc-callout .mc-ic .ico { width: 20px; height: 20px; }
.mc-callout > div > :last-child { margin-bottom: 0; }
.mc-title { display: block; margin-bottom: .25rem; font-family: var(--font-display, sans-serif); }
.mc-note { background: #eef8fa; border-color: #b9e3ea; } .mc-note .mc-ic { background: #d6f0f4; color: #08788d; }
.mc-tip { background: #f5f9e6; border-color: #d9e8a6; } .mc-tip .mc-ic { background: #e7f2c2; color: #5d7413; }
.mc-success { background: #ecf7ee; border-color: #b8dfc0; } .mc-success .mc-ic { background: #d4eeda; color: #2f7d32; }
.mc-warning { background: #fff6e8; border-color: #f2d49b; } .mc-warning .mc-ic { background: #fbe6bd; color: #9a5b00; }

/* الأزرار */
.mc-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.prose .mc-buttons a { text-decoration: none; }

/* الأعمدة */
.mc-columns { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 1.6rem; }
.mc-columns > div > :first-child { margin-top: 0; }
@media (max-width: 700px) { .mc-columns { grid-template-columns: 1fr; } }

/* اقتباس شخص */
.mc-quote { position: relative; margin: 2rem 0; padding: 1.8rem 1.8rem 1.4rem; border-radius: 22px; background: linear-gradient(150deg, var(--deep, #0a4a56), var(--brand, #08788d)); color: #fff; }
.mc-quote > svg { position: absolute; top: -18px; inset-inline-start: 1.4rem; width: 46px; height: 46px; color: var(--accent, #b8d034); }
.mc-quote blockquote { margin: 0; padding: 0; border: 0; background: none; font: 500 1.2rem/1.8 var(--font-display, sans-serif); color: #fff; }
.mc-quote blockquote p { margin: 0 0 .5rem; }
.mc-quote figcaption { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; }
.mc-quote figcaption b { display: block; } .mc-quote figcaption small { color: rgba(255,255,255,.75); }
.mc-quote .avatar { width: 42px; height: 42px; background: rgba(255,255,255,.15); }

/* الخط الزمني */
.mc-timeline { list-style: none; padding: 0 !important; position: relative; display: grid; gap: 1.2rem; }
.mc-timeline::before { content: ""; position: absolute; top: .5rem; bottom: .5rem; inset-inline-start: 7px; width: 2px; background: var(--line, #dfe6e2); }
.mc-timeline li { position: relative; padding-inline-start: 2.2rem; margin: 0 !important; }
.mc-timeline li::marker { content: none; }
.mc-timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45rem; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand, #08788d); }
.mc-timeline li.is-in::before { background: var(--accent, #b8d034); }
.mt-date { display: inline-block; font: 700 .85rem var(--font-display, sans-serif); color: var(--brand, #08788d); background: color-mix(in srgb, var(--brand, #08788d) 9%, #fff); padding: .1rem .6rem; border-radius: 999px; margin-bottom: .3rem; }
.mc-timeline b { display: block; } .mc-timeline p, .mc-steps p { margin: .2rem 0 0; color: var(--ink-soft, #5b7279); font-size: .98rem; }

/* الخطوات */
.mc-steps { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; counter-reset: s; }
.mc-steps li { display: flex; gap: .8rem; padding: 1.1rem; border-radius: 16px; background: #fff; border: 1px solid var(--line, #dfe6e2); margin: 0 !important; }
.mc-steps li::marker { content: none; }
.ms-n { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink, #16333b); color: var(--accent, #b8d034); font: 800 1rem var(--font-display, sans-serif); }

/* الأسئلة القابلة للطي */
.mc-accordion { display: grid; gap: .6rem; }
.mc-faq { border-radius: 14px; border: 1px solid var(--line, #dfe6e2); background: #fff; }
.mc-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .95rem 1.2rem; font-weight: 700; cursor: pointer; }
.mc-faq summary::-webkit-details-marker { display: none; }
.mc-faq > div { padding: 0 1.2rem 1rem; color: var(--ink-soft, #5b7279); }
.mc-faq .faq-toggle { position: relative; width: 28px; height: 28px; border-radius: 50%; background: #f1f4f2; flex: none; }
.mc-faq .faq-toggle::before, .mc-faq .faq-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: currentColor; transition: transform .3s; }
.mc-faq .faq-toggle::after { transform: rotate(90deg); }
.mc-faq[open] .faq-toggle::after { transform: rotate(0); }

/* معرض الصور داخل المقالة */
.mc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.mc-gallery a { aspect-ratio: 1; border-radius: 12px; overflow: hidden; display: block; }
.mc-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; margin: 0 !important; border-radius: 0 !important; }
.mc-gallery a:hover img { transform: scale(1.07); }

/* مربع المعلومات */
.mc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--line, #dfe6e2); border-radius: 16px; overflow: hidden; background: #fff; }
.mc-facts-title { grid-column: 1 / -1; padding: .8rem 1.1rem; background: var(--ink, #16333b); color: #fff; font: 700 1rem var(--font-display, sans-serif); }
.mc-facts > div:not(.mc-facts-title) { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line, #dfe6e2); border-inline-end: 1px solid var(--line, #dfe6e2); }
.mc-facts dt { font-size: .85rem; color: var(--ink-soft, #5b7279); } .mc-facts dd { margin: 0; font-weight: 700; }

/* دعوة للتبرع */
.mc-donate { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; padding: 1.4rem 1.6rem; border-radius: 20px;
  background: linear-gradient(120deg, var(--accent-soft, #eef6d6), #fff); border: 1px solid color-mix(in srgb, var(--accent, #b8d034) 50%, #fff); }
.mc-donate strong { font: 700 1.2rem var(--font-display, sans-serif); display: block; margin-bottom: .2rem; }
.mc-donate p { margin: 0; color: var(--ink-soft, #5b7279); }
.prose .mc-donate a.btn { text-decoration: none; }

/* الجداول */
.md-table { overflow-x: auto; border: 1px solid var(--line, #dfe6e2); border-radius: 14px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.md-table th, .md-table td { padding: .7rem .9rem; text-align: start; border-bottom: 1px solid var(--line, #dfe6e2); }
.md-table th { background: color-mix(in srgb, var(--brand, #08788d) 8%, #fff); font-weight: 700; }
.md-table tr:last-child td { border-bottom: 0; }
.prose mark { background: color-mix(in srgb, var(--accent, #b8d034) 40%, #fff); padding: 0 .2em; border-radius: 4px; }

/* =====================================================================
   مشغّل الفيديو ومعرض الفيديوهات
   ===================================================================== */
.vp { margin: 2rem 0; }
.vp-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm, 14px); overflow: hidden; background: #04222a; box-shadow: 0 24px 50px -28px rgba(4, 34, 42, .55); isolation: isolate; }
.vp--r9x16 .vp-frame { aspect-ratio: 9 / 16; max-width: 380px; margin-inline: auto; }
.vp--r9x16 figcaption { max-width: 380px; margin-inline: auto; }
.vp--r1x1 .vp-frame { aspect-ratio: 1; max-width: 560px; margin-inline: auto; }
.vp--r4x3 .vp-frame { aspect-ratio: 4 / 3; }
.vp--r21x9 .vp-frame { aspect-ratio: 21 / 9; }
.vp-cover { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; cursor: pointer; background: none; color: #fff; display: block; }
.vp-poster { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.2s cubic-bezier(.16, 1, .3, 1), filter .6s; }
.vp-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, var(--brand-2, #00afc6), transparent 55%), linear-gradient(135deg, #04323c, var(--brand, #08788d)); }
.vp-art img { width: 22%; max-width: 110px; height: auto; opacity: .18; }
.vp-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4, 30, 37, .78), rgba(4, 30, 37, .05) 55%), radial-gradient(circle at center, transparent 30%, rgba(4, 30, 37, .35)); transition: opacity .4s; }
.vp-play { position: absolute; top: 50%; left: 50%; width: clamp(64px, 9vw, 92px); aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: var(--accent, #b8d034); color: #0b2a31; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .55); transition: transform .45s cubic-bezier(.16, 1, .3, 1); }
.vp-play svg { position: relative; width: 40%; height: 40%; margin-left: 8%; }
.vp-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent, #b8d034); animation: vp-pulse 2.4s cubic-bezier(.2, .7, .2, 1) infinite; }
.vp-ring--2 { animation-delay: 1.2s; }
@keyframes vp-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
.vp-cover:hover .vp-play, .vp-cover:focus-visible .vp-play { transform: translate(-50%, -50%) scale(1.1); }
.vp-cover:hover .vp-poster { transform: scale(1.07); filter: saturate(1.15); }
.vp-cover:focus-visible { outline: 3px solid var(--accent, #b8d034); outline-offset: -3px; }
.vp-meta { position: absolute; inset-inline: 0; bottom: 0; display: flex; align-items: flex-end; gap: .7rem; padding: clamp(.9rem, 2.5vw, 1.5rem); text-align: start; }
.vp-title { font: 700 clamp(1rem, 2vw, 1.35rem)/1.35 var(--font-display, inherit); text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }
.vp-badge { flex: none; font: 700 .7rem/1 system-ui, sans-serif; letter-spacing: .04em; padding: .35rem .6rem; border-radius: 99px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(8px); color: #fff; }
.vp-media { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; background: #000; }
.vp.is-playing .vp-cover { visibility: hidden; }
.vp figcaption { margin-top: .7rem; color: var(--ink-soft, #5b7279); font-size: .92rem; text-align: center; }
/* الطفو في زاوية الشاشة أثناء التمرير */
.vp.is-float .vp-media { position: fixed; inset: auto; bottom: 18px; inset-inline-end: 18px; width: min(380px, 42vw); height: auto; aspect-ratio: 16 / 9; z-index: 95; border-radius: 14px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .6); animation: vp-pop .45s cubic-bezier(.16, 1, .3, 1); }
.vp--r9x16.is-float .vp-media { width: 200px; aspect-ratio: 9 / 16; }
.vp.is-float .vp-cover { visibility: visible; opacity: .35; }
.vp-close { position: fixed; z-index: 96; bottom: calc(18px + min(380px, 42vw) * 9 / 16 - 16px); inset-inline-end: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #fff; color: #0b2a31; font-size: 1.3rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.vp--r9x16 .vp-close { bottom: calc(18px + 200px * 16 / 9 - 16px); }
@keyframes vp-pop { from { opacity: 0; transform: translateY(30px) scale(.9); } }

/* معرض الفيديوهات */
.vg { margin: 2.2rem 0; }
.vg-head { margin: 0 0 1rem; }
.vg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 1rem; }
.vg-card { display: grid; align-content: start; gap: .55rem; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.vg-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #04222a; }
.vg-thumb > img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.16, 1, .3, 1); }
.vg-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4, 30, 37, .6), transparent 55%); }
.vg-play { position: absolute; z-index: 1; top: 50%; left: 50%; width: 54px; height: 54px; transform: translate(-50%, -50%) scale(.92); display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #0b2a31; transition: transform .4s cubic-bezier(.16, 1, .3, 1), background .3s; }
.vg-play svg { width: 42%; height: 42%; margin-left: 8%; }
.vg-thumb .vp-badge { position: absolute; z-index: 1; top: .6rem; inset-inline-start: .6rem; }
.vg-card:hover .vg-thumb > img { transform: scale(1.07); }
.vg-card:hover .vg-play, .vg-card:focus-visible .vg-play { transform: translate(-50%, -50%) scale(1.08); background: var(--accent, #b8d034); }
.vg-card:focus-visible { outline: 3px solid var(--accent, #b8d034); outline-offset: 3px; border-radius: 14px; }
.vg-title { font-weight: 700; line-height: 1.45; }
.vg-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: clamp(.5rem, 3vw, 2rem); }
.vg-modal[hidden] { display: none; }
.vgm-backdrop { position: absolute; inset: 0; background: rgba(2, 18, 22, .9); backdrop-filter: blur(10px); animation: vgm-fade .3s ease; }
.vgm-box { position: relative; width: min(1100px, 100%); animation: vgm-in .45s cubic-bezier(.16, 1, .3, 1); }
.vgm-top { display: flex; align-items: center; gap: .8rem; color: #fff; margin-bottom: .7rem; }
.vgm-title { flex: 1; font-size: 1.05rem; }
.vgm-count { font: 700 .85rem system-ui, sans-serif; opacity: .7; }
.vgm-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.5rem; cursor: pointer; }
.vgm-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
.vgm-stage.is-vertical { aspect-ratio: 9 / 16; height: min(80vh, 760px); margin-inline: auto; }
.vgm-nav { position: absolute; top: 55%; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; color: #0b2a31; font-size: 1.8rem; line-height: 1; cursor: pointer; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); transform: translateY(-50%); }
.vgm-prev { inset-inline-start: -24px; } .vgm-next { inset-inline-end: -24px; }
html[dir="rtl"] .vgm-nav { transform: translateY(-50%) scaleX(-1); }
.vg-modal.is-single .vgm-nav, .vg-modal.is-single .vgm-count { display: none; }
@keyframes vgm-fade { from { opacity: 0; } }
@keyframes vgm-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@media (max-width: 700px) {
  .vgm-prev { inset-inline-start: 6px; } .vgm-next { inset-inline-end: 6px; }
  .vgm-nav { width: 40px; height: 40px; top: auto; bottom: -56px; transform: none; }
  html[dir="rtl"] .vgm-nav { transform: scaleX(-1); }
  .vgm-stage.is-vertical { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { .vp-ring { animation: none; opacity: 0; } }
.article-video .vp { margin: 0; } .article-video .vp-frame { border-radius: var(--radius, 22px); }
.article-cover .vp-poster, .article-cover .vp-art img { max-height: none; border-radius: 0; box-shadow: none; }
.article-cover .vp-art img { width: 22%; }
.detail-video { margin: 0; } .detail-video .vp-frame { border-radius: var(--radius, 22px); box-shadow: var(--shadow-lg); }
.vp.is-float .vp-frame { isolation: auto; overflow: visible; }
@media (max-width: 1180px) and (min-width: 701px) { .vgm-prev { inset-inline-start: 10px; } .vgm-next { inset-inline-end: 10px; } }
