.post-card-image{display:block;margin:.5rem 0}
.post-card-image img{display:block;width:100%;max-width:480px;max-height:260px;object-fit:cover;border-radius:.6rem}
/* صورة مصغّرة لفيديو: نسبة 16:9 مع قصّ الأشرطة السوداء التي تضيفها المنصة أعلى الصورة وأسفلها */
.post-card-image--video img{aspect-ratio:16/9;max-height:none}
.post-gallery{margin-top:1.5rem}
.post-gallery-list{list-style:none;margin:.75rem 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:.75rem}
.post-gallery-list li:focus{outline:3px solid var(--tm-focus);outline-offset:2px}
.post-gallery-list figure{margin:0}
.post-gallery-list img,.post-gallery-list video{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:.5rem}
.post-gallery-list figcaption{margin-top:.3rem;font-size:.9rem;opacity:.85;overflow-wrap:anywhere}
.post-gallery-more{display:block;margin:1rem auto 0;min-height:44px;padding:.6rem 1.25rem;font:inherit;font-weight:700;cursor:pointer;color:var(--tm-text);background:var(--tm-card);border:2px solid var(--tm-primary);border-radius:.6rem}
.post-gallery-more:hover{background:color-mix(in srgb,var(--tm-primary) 15%,transparent)}
.post-gallery-more:focus-visible{outline:3px solid var(--tm-focus);outline-offset:2px}
html[data-theme="dark"] .post-gallery-more{border-color:var(--tm-primary)}
html[data-theme="dark"] .post-gallery-list li:focus,html[data-theme="dark"] .post-gallery-more:focus-visible{outline-color:var(--tm-focus)}
.post-gallery-item{position:relative;display:block;width:100%;padding:0;font:inherit;color:inherit;cursor:pointer;border:1px solid var(--tm-border);border-radius:.5rem;overflow:hidden;background:var(--tm-head)}
.post-gallery-item:hover{border-color:var(--tm-primary)}
.post-gallery-item:focus-visible{outline:3px solid var(--tm-focus);outline-offset:2px}
.post-gallery-item img,.post-gallery-item video{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;pointer-events:none;border-radius:0}
.post-gallery-play{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:2.6rem;color:#fff;background:rgba(0,0,0,.28);pointer-events:none}
.post-gallery-badge{position:absolute;top:.4rem;inset-inline-start:.4rem;padding:.05rem .55rem;border-radius:.4rem;font-size:.78rem;color:#fff;background:rgba(0,0,0,.72);pointer-events:none}
html[data-theme="dark"] .post-gallery-item:focus-visible{outline-color:var(--tm-focus)}
.pm-lb{position:fixed;inset:0;z-index:2000;display:none;flex-direction:column;background:rgba(0,0,0,.92);color:#fff}
.pm-lb.is-open{display:flex}
.pm-lb-bar{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.6rem .75rem}
.pm-lb-count{font-size:.95rem}
.pm-lb-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:0 .5rem}
.pm-lb-stage img,.pm-lb-stage video{max-width:100%;max-height:100%;object-fit:contain}
.pm-lb-caption{margin:0;padding:.6rem 1rem 0;text-align:center;font-size:1rem;overflow-wrap:anywhere}
.pm-lb-nav{display:flex;justify-content:center;gap:.75rem;padding:.75rem}
.pm-lb-btn{min-width:44px;min-height:44px;padding:.4rem 1rem;font:inherit;font-size:1rem;cursor:pointer;color:#fff;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.55);border-radius:.6rem}
.pm-lb-btn:hover{background:rgba(255,255,255,.28)}
.pm-lb-btn[disabled]{opacity:.4;cursor:not-allowed}
.pm-lb-btn:focus-visible{outline:3px solid #ffb255;outline-offset:2px}
.post-gallery-img{cursor:zoom-in}
.post-gallery-video{display:block;width:100%;aspect-ratio:4/3;object-fit:contain;background:#000;border-radius:.5rem}

/* وسيط واحد فقط في المقال (صورة واحدة أو فيديو واحد): عرض أكبر بدل المصغّرة */
.post-gallery--single .post-gallery-list{grid-template-columns:minmax(0,1fr)}
.post-gallery--single .post-gallery-list figure{max-width:100%}
.post-gallery--single .post-gallery-item{border-radius:.7rem}
.post-gallery--single .post-gallery-list img{width:100%;height:auto;aspect-ratio:auto;max-height:min(80vh,720px);object-fit:contain;border-radius:.7rem}
.post-gallery--single .post-gallery-item img,.post-gallery--single .post-gallery-item video{aspect-ratio:16/9;height:auto;max-height:min(80vh,720px);object-fit:contain;background:#000}
.post-gallery--single .post-gallery-play{font-size:3.6rem}
.post-gallery--single .post-gallery-list figcaption{font-size:1rem;margin-top:.5rem}
@media (max-width:520px){.post-gallery--single .post-gallery-play{font-size:2.8rem}}

/* روابط المقال (إدراج رابط) في نهاية المقال: قائمة غير محدودة، لكل رابط وصفه */
.post-links{list-style:none;margin:1.4em 0;padding:0}
.post-link{margin:.5em 0}

/* ملخص بطاقة المقال وزر «اقرأ المزيد» في الصفحة الرئيسية */
.post-summary{margin:.5em 0}
.post-readmore{margin:.5em 0 0}
.read-more{display:inline-block;padding:.4em 1em;border:1px solid currentColor;border-radius:.5rem;text-decoration:none;font-weight:700}
.read-more:hover,.read-more:focus-visible{text-decoration:underline}

/* نسخ الرابط ومشاركة المقال داخل المقال */
.post-share{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin:1.5em 0}
.post-share-btn{font:inherit;font-weight:700;cursor:pointer;color:inherit;background:var(--tm-card);padding:.45em 1.1em;border:1px solid var(--tm-field-border);border-radius:.5rem}
.post-share-btn:hover{background:color-mix(in srgb,var(--tm-primary) 12%,transparent)}
.post-share-btn:focus-visible,.post-share-menu a:focus-visible{outline:3px solid var(--tm-focus);outline-offset:2px}
html[data-theme="dark"] .post-share-btn:focus-visible,html[data-theme="dark"] .post-share-menu a:focus-visible{outline-color:var(--tm-focus)}
.post-share-menu{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.5rem;flex-basis:100%}
.post-share-menu[hidden]{display:none}
.post-share-menu a{display:inline-block;padding:.35em .9em;border:1px solid var(--tm-field-border);border-radius:.5rem;text-decoration:none}
.post-share-menu a:hover{background:color-mix(in srgb,var(--tm-primary) 12%,transparent)}
.post-share-general{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.post-share-direct{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
.post-share-direct-title{font-weight:700}
.post-share-direct .post-share-menu{flex-basis:auto}
.post-share-status{flex-basis:100%;margin:0;min-height:1.2em;font-size:.9rem}
@media print{.post-share,.post-readmore{display:none}}

/* أزرار طباعة المقال وتصدير PDF (للمشرف فقط) */
.post-export-actions{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 1.2em}
.post-export-btn{display:inline-block;padding:7px 16px;border:1px solid currentColor;border-radius:8px;text-decoration:none;font-weight:700}
.post-export-btn:hover,.post-export-btn:focus-visible{text-decoration:underline}
@media print{.post-export-actions{display:none}}
/* وصف الصورة: نص لقارئات الشاشة فقط. إخفاء بصري قياسي (sr-only): النص يبقى في شجرة الوصول
   ويُقرأ، لكنه لا يظهر على الصورة ولا بجانبها. لا نستعمل opacity/display/visibility لأنها قد تُظهره أو تُخفيه عن القارئ */
.pm-lb-desc{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;cursor:default;user-select:none}
/* فيديو مستورد من رابط (YouTube / Facebook / X): مُضمَّن داخل المنشور مع رابط الأصل */
.post-embeds{margin-top:1.5rem;display:grid;gap:1.25rem}
.post-embed{margin:0}
.post-embed-frame{position:relative;width:100%;aspect-ratio:16/9;border-radius:.6rem;overflow:hidden;background:color-mix(in srgb,var(--tm-primary) 12%,transparent)}
.post-embed-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.post-embed--x .post-embed-frame{aspect-ratio:auto;max-width:550px;height:560px}
.post-embed-note{margin:.5rem 0;padding:.75rem 1rem;border:1px solid var(--tm-field-border);border-radius:.6rem;background:var(--tm-head)}
.post-embed-link{margin:.5rem 0 0}
.post-embed-link a{font-weight:700}
.post-embed figcaption{margin-top:.3rem;font-size:.9rem;opacity:.85;overflow-wrap:anywhere}
