/*
Theme Name: الجزائر برس (Aljazair Press)
Theme URI: https://aljazairpress.dz
Author: Aljazair Press Dev
Description: قالب ووردبريس إخباري عربي متكامل - يتضمن بنر إعلاني بجانب الشعار، شريط آخر الأخبار المميز، ميجا منيو (Mega Menu)، ومنشئ الصفحة الرئيسية المرئي والمتقدم (Module 21) بالسحب والإفلات مع تعدد التخطيطات والنسخ الاحتياطية والتحكم بالأجهزة، ومحرر المقالات الصحفي الاحترافي، ومكتبة تصاميم أقسام الفيديو (19 تصميماً) وأيقونات التشغيل (25 شكلاً) مع مزايا خاصة: تمرير ملون، حجم بالبكسل، إزاحة، ظل، وتوزيع أيقونات متنوعة على البطاقات، وقسم عام جديد لإعدادات أيقونات الفيديو في لوحة إعدادات القالب (الأيقونة الأصلية المحفوظة + 25 شكلاً + مظهر كامل + مواضع عرض + معاينة حية)، ونظام المقالات ذات الصلة (5 آليات اختيار و8 تصاميم وتحكم يدوي بالسحب والإفلات) مع رابط المقال المختصر الثابت أسفل المحتوى.
Version: 4.1.1
Requires at least: 5.8
Requires PHP: 7.4
Text Domain: aljazair-press
Domain Path: /languages
*/

:root {
    --primary-dark: #0b1e33;
    --primary-blue: #15406b;
    --accent-gold: #d9822b;
    --accent-red: #d93025;
    --accent-green: #2ecc71;
    --bg-light: #f4f6f9;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body.dark-mode {
    --bg-light: #0b1320;
    --card-bg: #132033;
    --text-dark: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #243652;
}

/* v4.0.0 — المرحلة الثانية (1): الوضع الليلي الفوري بلا وميض أبيض FOUC.
   السكربت المبكر في head يضع data-theme="dark" على html قبل طباعة CSS،
   فتتبدل متغيرات الألوان الأساسية من أول إطار رسم — ثم يزامن JavaScript
   الكلاس القديم body.dark-mode فور جهوز DOM فيعمل كل تنسيق المكونات القديم. */
html[data-theme="dark"] {
    --bg-light: #0b1320;
    --card-bg: #132033;
    --text-dark: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #243652;
    color-scheme: dark;
}

/* أيقونتا زر التبديل: قمر في الوضع الفاتح، شمس في الوضع الليلي */
.dark-mode-btn .ajp-icon-sun { display: none; }
.dark-mode-btn .ajp-icon-moon { display: block; }
body.dark-mode .dark-mode-btn .ajp-icon-sun { display: block; }
body.dark-mode .dark-mode-btn .ajp-icon-moon { display: none; }

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.25s ease;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 0. الشريط الأعلى للبحث والطقس والبث */
.utility-bar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    font-size: 13px;
}

.utility-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-box-mini {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 14px;
    background: var(--bg-light);
}

.search-box-mini input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    width: 180px;
}

.search-box-mini button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
}

.weather-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.weather-city {
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.live-stream-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--text-muted);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e1;
}

/* 1. الشريط العلوي الداكن */
.top-bar {
    background-color: var(--primary-dark);
    color: #ffffff;
    font-size: 13px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar-left a {
    color: #ffffff;
    font-size: 15px;
}

/* 2. منطقة الشعار + البنر الإعلاني بجانب الشعار */
.main-header {
    background-color: var(--card-bg);
    padding: 18px 0;
    border-bottom: 3px solid var(--accent-red);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.site-logo {
    flex-shrink: 0;
}

.site-logo h1 {
    font-size: 30px;
    color: var(--primary-blue);
    font-weight: 800;
}

.site-logo img {
    max-height: 85px;
    width: auto;
    display: block;
}

body.dark-mode .site-logo h1 {
    color: #ffffff;
}

/* حاوية البنر الإعلاني بجانب الشعار (728x90 متجاوب) */
.header-banner-slot {
    flex: 1;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.header-banner-slot img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.header-banner-placeholder {
    width: 100%;
    min-height: 90px;
    background: linear-gradient(135deg, #0b1e33 0%, #15406b 100%);
    border: 1px dashed rgba(217, 130, 43, 0.7);
    border-radius: 8px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    gap: 15px;
}

.banner-ad-tag {
    background: var(--accent-gold);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.header-banner-placeholder h4 {
    font-size: 16px;
    font-weight: 800;
}

.header-banner-placeholder p {
    font-size: 12px;
    color: #cbd5e1;
}

.banner-cta-btn {
    background: var(--accent-red);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* 3. القائمة الرئيسية + ميجا منيو المقالات بالصور (Mega Menu) */
.main-nav {
    background-color: var(--primary-dark);
    color: #ffffff;
    position: relative;
    z-index: 995;
    width: 100%;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    /* v4.1.0 — القائمة تملأ المساحة فتُثبَّت أدوات اليسار
       (الوضع الليلي/المزيد/الفيديو/البحث) في الطرف الأيسر كالمرجع */
    flex: 1 1 auto;
    min-width: 0;
}

.nav-menu > li {
    position: static; /* للسماح للميجا منيو بالامتداد بعرض الحاوية */
}

.nav-menu > li.has-classic-sub {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 15px 18px;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu > li.menu-item-has-children > a::after,
.nav-menu > li.has-mega-posts > a::after {
    content: '▾';
    font-size: 12px;
    opacity: 0.85;
}

.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-category-ancestor > a,
.nav-menu > li:hover > a {
    background-color: var(--primary-blue);
    border-bottom: 3px solid var(--accent-gold);
}

/* القائمة المنسدلة الكلاسيكية للروابط غير التصنيفية */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background-color: var(--primary-dark);
    border-top: 3px solid var(--accent-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.22s ease;
    z-index: 1000;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu .sub-menu li a:hover {
    background-color: var(--primary-blue);
    color: var(--accent-gold);
    padding-right: 22px;
}

/* ============================================================
   لوحة الميجا منيو — تصميم صحفي داكن احترافي (v2.2.0) مستوحى من المرجع البصري:
   خلفية داكنة، أزرار تصنيفات فرعية مستديرة، صف أفقي من 5 بطاقات،
   صورة 16:9 بزوايا دائرية + تاريخ أحمر + عنوان أبيض، وتأثير مرور ناعم
   (رفع + ظل + حد أحمر + تكبير الصورة + تدرّج داكن) بنفس لغة بطاقات الأرشيف v2.1.0.
   الآلية الحالية محفوظة كما هي: الفتح عبر hover/focus-within بلا أي JS.
   ============================================================ */
.mega-menu-panel {
    position: absolute;
    top: 100%;
    right: 15px;
    left: 15px;
    background: linear-gradient(180deg, #0e1d33 0%, #0a1524 100%);
    color: #f1f5f9;
    border-top: 2px solid var(--accent-gold);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 24px 48px rgba(3, 10, 20, 0.5);
    padding: 18px 20px 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    /* تأخير الإخفاء قليلاً يمنع الوميض عند الانتقال بين تصنيفات الهيدر */
    transition: opacity 0.28s ease 0.08s, transform 0.28s ease 0.08s, visibility 0s linear 0.36s;
    z-index: 1001;
}

.nav-menu > li.has-mega-posts:hover > .mega-menu-panel,
.nav-menu > li.has-mega-posts:focus-within > .mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.mega-subcats-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mega-subcats-strip span {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.55);
}

.mega-subcat-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    padding: 5px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.mega-subcat-pill:hover {
    background: rgba(217, 130, 43, 0.18);
    border-color: var(--accent-gold);
    color: #ffffff;
}

.mega-posts-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.mega-post-card {
    background: #11233d;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.mega-post-thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--primary-dark);
    overflow: hidden;
    flex-shrink: 0;
}

.mega-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* تدرّج داكن فوق الصورة عند المرور لإبراز العمق */
.mega-post-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.45) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* بديل المقالات بلا صورة — يحافظ على تناسق ارتفاع البطاقات */
.mega-post-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.55);
    background: linear-gradient(145deg, var(--primary-dark), var(--primary-blue));
}

.mega-post-body {
    padding: 11px 13px 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    align-items: flex-start;
}

.mega-post-body h4 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.55;
}

.mega-post-body h4 a {
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

/* تأثير المرور — حارس للأجهزة التي لا تدعم التمرير (اللمس يبقى كامل الوصول) */
@media (hover: hover) and (pointer: fine) {
    .mega-post-card:hover {
        transform: translateY(-4px);
        border-color: rgba(217, 48, 37, 0.55);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
    }
    .mega-post-card:hover .mega-post-thumb img {
        transform: scale(1.06);
    }
    .mega-post-card:hover .mega-post-thumb::after {
        opacity: 1;
    }
    .mega-post-card:hover .mega-post-body h4 a {
        color: #ff8177;
    }
}

/* الإبراز نفسه عبر لوحة المفاتيح (لا يعتمد على المرور) */
.mega-post-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(217, 48, 37, 0.55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
}
.mega-post-card:focus-within .mega-post-body h4 a {
    color: #ff8177;
}

@media (prefers-reduced-motion: reduce) {
    .mega-menu-panel,
    .mega-post-card,
    .mega-post-thumb img,
    .mega-post-thumb::after,
    .mega-subcat-pill,
    .mega-post-body h4 a {
        transition: none !important;
    }
    .mega-menu-panel,
    .mega-post-card:hover,
    .mega-post-card:focus-within,
    .mega-post-card:hover .mega-post-thumb img {
        transform: none;
    }
}

/* تكيّف الشبكة: 5 على الواسع مطابق للمرجع ثم 4 ثم 3 — اللوحة تخفى ≤768 كما هي سلفاً */
@media (max-width: 1199px) {
    .mega-posts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 992px) {
    .mega-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .mega-post-body h4 {
        font-size: 14px;
    }
}

.dark-mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* 4. تمييز شريط آخر الأخبار (Elevated Highlighted Breaking Bar) */
.breaking-bar-wrap {
    margin: 16px auto 6px;
}

.breaking-bar {
    background: linear-gradient(90deg, #0b1e33 0%, #153960 50%, #0b1e33 100%);
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 16px rgba(11, 30, 51, 0.18);
    border-right: 5px solid var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.breaking-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e11d48 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.45);
}

.live-radar {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffffff;
    display: inline-block;
}

.live-radar::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: radarPing 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
    0% { transform: scale(0.7); opacity: 1; }
    100% { transform: scale(1.9); opacity: 0; }
}

.breaking-ticker-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.breaking-ticker-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 40px;
    width: max-content;
    animation: tickerMoveRTL 40s linear infinite;
}

.breaking-ticker-track:hover {
    animation-play-state: paused;
}

.breaking-item {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.breaking-item:hover {
    color: var(--accent-gold);
}

.breaking-time-pill {
    background: rgba(255, 255, 255, 0.14);
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.breaking-sep {
    color: var(--accent-gold);
    font-weight: 800;
}

.breaking-date {
    font-size: 12px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes tickerMoveRTL {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

/* 5. الكروسيل الإخباري التفاعلي */
.hero-carousel-section {
    margin: 20px 0;
    position: relative;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    height: 430px;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 30, 51, 0.95) 10%, rgba(11, 30, 51, 0.45) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 35px;
    color: #ffffff;
}

.carousel-overlay .cat-badge-gold {
    align-self: flex-start;
    margin-bottom: 12px;
}

.carousel-overlay h2 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 10px;
    max-width: 850px;
}

.carousel-overlay h2 a:hover {
    color: var(--accent-gold);
}

.carousel-overlay p {
    font-size: 15px;
    color: #cbd5e1;
    max-width: 750px;
    margin-bottom: 12px;
}

.carousel-meta {
    font-size: 13px;
    color: #94a3b8;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(11, 30, 51, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.carousel-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}

.carousel-prev { right: 18px; }
.carousel-next { left: 18px; }

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 30px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.carousel-dot.active {
    width: 26px;
    border-radius: 6px;
    background: var(--accent-gold);
}

/* 6. الترويسة المشتركة لأقسام التصنيفات */
.newsroom-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin: 26px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* v3.7.0 — نظام المسافات الموحد بين أقسام الصفحة الرئيسية فقط (لا يؤثر على الأرشيف):
   بدلاً من تراكم margin 26px + padding 25px + حشوة أسفل افتراضية (~75px بين المحتوى)،
   مصدر واحد لكل مسافة عبر متغيرات، وقيم افتراضية متوازنة قابلة للتعديل
   من لوحة التحكم: المنشئ ← نموذج التخطيط ← «تصميم الصفحة». */
body.home .newsroom-section {
    padding: var(--ajp-sec-pt, 16px) var(--ajp-sec-px, 20px) var(--ajp-sec-pb, 16px);
    margin: var(--ajp-sec-gap, 16px) 0;
}
body.home .hpb-section {
    margin-bottom: var(--ajp-sec-gap, 16px);
}
body.home .hpb-section > .newsroom-section {
    margin-block: 0;
}
body.home .hpb-section:last-child {
    margin-bottom: 0;
}
@media (max-width: 640px) {
    body.home .newsroom-section {
        margin: var(--ajp-sec-gap-m, 12px) 0;
        padding: var(--ajp-sec-pt-m, 12px) var(--ajp-sec-px-m, 14px) var(--ajp-sec-pb-m, 12px);
    }
    body.home .hpb-section { margin-bottom: var(--ajp-sec-gap-m, 12px); }
    body.home .hpb-section:last-child { margin-bottom: 0; }
}

.newsroom-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.newsroom-title-wrap .sub-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.newsroom-title-wrap h2 {
    font-size: 25px;
    font-weight: 800;
    color: var(--text-dark);
}

.view-all-link {
    color: var(--accent-red);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.cat-badge-gold {
    display: inline-block;
    background-color: var(--accent-gold);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* الستايل 1: غرفة الأخبار */
.newsroom-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: start;
}

.newsroom-main-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.newsroom-main-card h3 {
    font-size: 23px;
    line-height: 1.45;
    font-weight: 800;
    margin-bottom: 10px;
}

.newsroom-main-card h3 a:hover { color: var(--primary-blue); }

.newsroom-main-card p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.newsroom-main-meta {
    font-size: 13px;
    color: #94a3b8;
}

.newsroom-side-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.newsroom-side-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.newsroom-side-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.newsroom-side-thumb {
    width: 140px;
    height: 95px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.newsroom-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.newsroom-side-info { flex: 1; }

.side-time {
    display: block;
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.newsroom-side-info h4 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 5px;
}

.side-date {
    display: block;
    font-size: 12px;
    color: #94a3b8;
}

/* الستايل 2: شبكة بطاقات رباعية */
.cat-style-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.style-card-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
}

.style-card-box img {
    width: 100%;
    height: 175px;
    object-fit: cover;
}

.style-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.style-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* الستايل 3: مجلة أفقية */
.cat-style-magazine {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.mag-card {
    display: flex;
    gap: 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    align-items: center;
}

.mag-card img {
    width: 180px;
    height: 125px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.mag-card-content h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
}

.mag-card-content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* 7. قسم الفيديو المميز */
.video-showcase-section {
    background: linear-gradient(135deg, #091728 0%, #132c4a 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 30px 25px;
    margin: 30px 0;
    box-shadow: 0 10px 30px rgba(9, 23, 40, 0.25);
    border-top: 4px solid var(--accent-red);
}

.video-showcase-section .newsroom-header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.video-showcase-section .newsroom-title-wrap h2 {
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-badge-live {
    background: var(--accent-red);
    color: #ffffff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 700;
}

.video-showcase-section .sub-label,
.video-showcase-section .view-all-link {
    color: var(--accent-gold);
}

.video-grid-layout {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 25px;
}

.video-featured-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.video-featured-card img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.video-featured-card:hover img {
    transform: scale(1.03);
    opacity: 0.7;
}

.play-icon-large {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    background: var(--accent-red);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 0 10px rgba(217, 48, 37, 0.3);
    transition: 0.3s;
}

.video-featured-caption {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 25px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
}

.video-featured-caption h3 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 8px;
}

.video-side-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-side-card {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    align-items: center;
    transition: 0.25s;
}

.video-side-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-gold);
}

.video-thumb-wrap {
    position: relative;
    width: 150px;
    height: 92px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.video-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon-small {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: rgba(217, 48, 37, 0.9);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.video-side-info h4 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 6px;
    color: #f8fafc;
}

/* شريط التصنيفات الفرعية داخل صفحات الأقسام */
.subcategories-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.subcat-chip {
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.subcat-chip:hover {
    background-color: var(--accent-gold);
}

/* ============================================================
   شبكة بطاقات معاينة المقالات — صفحات الأرشيف والتصنيفات (v2.1.0)
   5 بطاقات بالضبط في الصف الواسع، مصغرة 16:9، تاريخ أحمر، عنوان بارز،
   تأثير مرور ناعم: رفع + ظل + حد أحمر خافت + تكبير الصورة + تدرّج داكن.
   ============================================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-card-thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--primary-dark);
    overflow: hidden;
    flex-shrink: 0;
}

.post-card-thumb-frame {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.post-card-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* تدرّج داكن فوق الصورة يظهر عند المرور لإبراز العمق */
.post-card-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.45) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* بديل مجلات بلا صورة: يحافظ على تناسق ارتفاع البطاقات */
.post-card-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.55);
    background: linear-gradient(145deg, var(--primary-dark), var(--primary-blue));
}

.post-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-grow: 1;
    align-items: flex-start;
}

.post-card-date {
    color: var(--accent-red);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
}

.post-card-title {
    margin: 0;
    font-size: 16.5px;
    font-weight: 800;
    line-height: 1.55;
}

.post-card-title a {
    color: var(--text-dark);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

/* تأثير المرور — حارس للأجهزة التي لا تدعم التمرير (اللمس يبقى كامل الوصول) */
@media (hover: hover) and (pointer: fine) {
    .post-card:hover {
        transform: translateY(-4px);
        border-color: rgba(217, 48, 37, 0.45);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    }
    .post-card:hover .post-card-thumb-frame img {
        transform: scale(1.06);
    }
    .post-card:hover .post-card-thumb::after {
        opacity: 1;
    }
    .post-card:hover .post-card-title a {
        color: var(--accent-red);
    }
}

/* نفس الإبراز عبر لوحة المفاتيح (لا يعتمد على المرور) */
.post-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(217, 48, 37, 0.45);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}
.post-card:focus-within .post-card-title a {
    color: var(--accent-red);
}

body.dark-mode .post-card:hover,
body.dark-mode .post-card:focus-within {
    border-color: rgba(217, 48, 37, 0.55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .post-card,
    .post-card-thumb-frame img,
    .post-card-thumb::after,
    .post-card-title a {
        transition: none !important;
    }
    .post-card:hover {
        transform: none;
    }
}

/* تكيّف الشبكة: 5 أعمدة على الواسع ثم 3 ثم 2 ثم 1 — كل البطاقات تبقى ظاهرة ومرتبة عمودياً */
@media (max-width: 1199px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .post-card-body {
        padding: 10px 12px 12px;
    }
    .post-card-title {
        font-size: 15px;
    }
    .post-card-date {
        font-size: 11.5px;
    }
}
@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

.single-article,
.archive-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin: 25px 0;
}

.site-footer {
    background: var(--primary-dark);
    color: #ffffff;
    text-align: center;
    padding: 25px 0;
    margin-top: 40px;
}

@media (max-width: 992px) {
    .newsroom-grid,
    .video-grid-layout,
    .cat-style-magazine {
        grid-template-columns: 1fr;
    }
    .cat-style-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .carousel-slide {
        height: 340px;
    }
}

@media (max-width: 768px) {
    .breaking-date,
    .mega-menu-panel {
        display: none !important;
    }
    .cat-style-cards-grid {
        grid-template-columns: 1fr;
    }
    .carousel-overlay h2 {
        font-size: 20px;
    }
}

/* ============================================================
   Module 21 – منشئ الصفحة الرئيسية: أنماط العناصر الجديدة بالواجهة الأمامية
   (تعتمد متغيرات القالب --card-bg/--border-color/--text-dark لتحترم الوضع الليلي)
   ============================================================ */

.hpb-section { position: relative; }

.hpb-plain-section { margin: 0 0 8px; }

/* إخفاء الأقسام حسب الجهاز (يولّد المنشئ قواعد ألوان/أعمدة لكل قسم) */
@media (min-width: 769px) {
    .hpb-hide-desktop { display: none !important; }
}
@media (max-width: 992px) {
    .hpb-hide-tablet { display: none !important; }
}
@media (max-width: 768px) {
    .hpb-hide-mobile { display: none !important; }
}

/* شريط تنبيه معاينة المدير */
.hpb-preview-notice {
    background: var(--accent-gold);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 12px 0;
}
.hpb-preview-notice a { color: #fff; text-decoration: underline; }

/* ---- قائمة مدمجة ---- */
.hpb-compact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.hpb-compact-item {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

.hpb-compact-thumb { flex: 0 0 86px; }
.hpb-compact-thumb img { width: 86px; height: 62px; object-fit: cover; border-radius: 6px; }
.hpb-compact-info h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 4px; }
.hpb-compact-info h4 a { color: var(--text-dark); }
.hpb-compact-info h4 a:hover { color: var(--primary-blue); }
.hpb-compact-date { font-size: 11.5px; color: var(--text-muted); }

/* ---- بطاقات صورة غلاف ---- */
.hpb-overlay-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hpb-overlay-card {
    position: relative;
    height: 260px;
    border-radius: 9px;
    overflow: hidden;
    background: var(--primary-dark);
}

.hpb-overlay-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.hpb-overlay-card:hover img { transform: scale(1.05); }

.hpb-overlay-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 40px 14px 12px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.88) 70%);
}

.hpb-overlay-caption h3 { font-size: 15.5px; line-height: 1.55; margin: 6px 0; }
.hpb-overlay-caption h3 a { color: #ffffff; }
.hpb-overlay-caption p {
    color: #dbe6f2;
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 4px;
}
.hpb-overlay-date { color: #c3d2e2; font-size: 11px; }
.hpb-overlay-caption .cat-badge-gold { font-size: 10px; }

/* ---- عناوين فقط ---- */
.hpb-headlines {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
}

.hpb-headline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px dashed var(--border-color);
}

.hpb-headline-item:last-child { border-bottom: 0; }
.hpb-headline-num {
    flex: 0 0 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hpb-headline-item a { flex: 1; color: var(--text-dark); font-size: 15px; font-weight: 700; line-height: 1.6; }
.hpb-headline-item a:hover { color: var(--primary-blue); }
.hpb-headline-date { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }

/* ---- الأكثر قراءة ---- */
.hpb-mostread-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.hpb-mostread-item {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
}

.hpb-mostread-num {
    flex: 0 0 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-gold);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hpb-mostread-thumb { flex: 0 0 76px; }
.hpb-mostread-thumb img { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; }
.hpb-mostread-info h4 { font-size: 14px; line-height: 1.55; margin-bottom: 4px; }
.hpb-mostread-info h4 a { color: var(--text-dark); }
.hpb-mostread-info h4 a:hover { color: var(--primary-blue); }
.hpb-mostread-meta { font-size: 11px; color: var(--text-muted); }

/* ---- الخبر الرئيسي بعرض كامل ---- */
.hpb-hero-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: var(--primary-dark);
}

.hpb-hero-card img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.hpb-hero-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 60px 22px 18px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.92) 72%);
}

.hpb-hero-caption h2 { font-size: 24px; line-height: 1.5; margin: 8px 0; }
.hpb-hero-caption h2 a { color: #ffffff; }
.hpb-hero-caption h2 a:hover { color: #f6c47f; }
.hpb-hero-caption p { color: #d9e4f0; font-size: 14px; line-height: 1.7; margin-bottom: 6px; max-width: 760px; }
.hpb-hero-meta { color: #c3d2e2; font-size: 12px; }

/* ---- الخبر الرئيسي مقسوم ---- */
.hpb-hero-split {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.hpb-hero-split > a img, .hpb-hero-split-img img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
}

.hpb-hero-split-body { padding: 22px 24px; align-self: center; }
.hpb-hero-split-body h2 { font-size: 21px; line-height: 1.55; margin: 10px 0; }
.hpb-hero-split-body h2 a { color: var(--text-dark); }
.hpb-hero-split-body h2 a:hover { color: var(--primary-blue); }
.hpb-hero-split-body p { color: var(--text-muted); font-size: 14px; line-height: 1.8; margin-bottom: 8px; }
.hpb-hero-split-body .hpb-hero-meta { color: var(--text-muted); font-size: 12px; }

/* ---- شريط آخر الأخبار المتحرك ---- */
.hpb-ticker-section { margin-bottom: 8px; }

.hpb-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    padding: 9px 14px;
    overflow: hidden;
}

.hpb-ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 13px;
    border-radius: 7px;
    white-space: nowrap;
}

.hpb-ticker-viewport { flex: 1; overflow: hidden; }

.hpb-ticker-track {
    display: flex;
    gap: 34px;
    white-space: nowrap;
    animation: hpbTickerRTL 45s linear infinite;
    width: max-content;
}

.hpb-ticker:hover .hpb-ticker-track { animation-play-state: paused; }

@keyframes hpbTickerRTL {
    from { transform: translateX(0); }
    to { transform: translateX(50%); }
}

.hpb-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-size: 13.5px;
    font-weight: 700;
}

.hpb-ticker-item:hover { color: var(--primary-blue); }

.hpb-ticker-all { color: var(--primary-blue); font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* ---- بنر إعلاني ---- */
.hpb-ads-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    overflow: hidden;
}

.hpb-ads-box img { max-width: 100%; height: auto; display: block; }

.hpb-ads-placeholder {
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

/* ---- النشرة البريدية ---- */
.hpb-newsletter {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
    border-radius: 10px;
    padding: 30px 24px;
    text-align: center;
    color: #ffffff;
}

.hpb-newsletter-icon { font-size: 34px; display: block; margin-bottom: 8px; }
.hpb-newsletter-text { font-size: 15px; margin-bottom: 16px; color: #e3edf8; }

.hpb-newsletter-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin: 0 auto;
}

.hpb-newsletter-form input[type="email"] {
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
}

.hpb-newsletter-form button {
    background: var(--accent-gold);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.hpb-newsletter-form button:hover { background: #bf6f1f; }
.hpb-newsletter-success { background: rgba(46,204,113,.18); color: #b9f4d0; padding: 9px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }
.hpb-newsletter-info { background: rgba(255,255,255,.14); color: #eef4fb; padding: 9px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }
.hpb-newsletter-error { background: rgba(217,48,37,.28); color: #ffd9d6; padding: 9px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }

/* ---- صندوق مخصص ---- */
.hpb-custom-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    font-size: 14.5px;
    line-height: 1.9;
}

/* ---- استجابة الأجهزة لعناصر المنشئ ---- */
@media (max-width: 992px) {
    .hpb-compact-list, .hpb-mostread-grid { grid-template-columns: 1fr; }
    .hpb-overlay-grid { grid-template-columns: repeat(2, 1fr); }
    .hpb-hero-card img { height: 300px; }
    .hpb-hero-caption h2 { font-size: 20px; }
    .hpb-hero-split { grid-template-columns: 1fr; }
    .hpb-hero-split img { height: 240px; }
}

@media (max-width: 768px) {
    .hpb-overlay-grid { grid-template-columns: 1fr; }
    .hpb-overlay-card { height: 220px; }
    .hpb-ticker-label { font-size: 11px; padding: 5px 9px; }
    .hpb-newsletter-form { flex-direction: column; }
    .hpb-hero-caption h2 { font-size: 17px; }
    .hpb-hero-card img { height: 240px; }
}

/* ============================================================
   Module 21 — التحكم الكامل في الصفحة: الفوتر المطور، زر العودة
   للأعلى، إخفاء المناطق على الهاتف، وحالة البث المباشر
   ============================================================ */

/* إخفاء مناطق الهيدر/الفوتر على الهاتف (من إعدادات الصفحة الكاملة) */
@media (max-width: 768px) {
    .hpb-zone-m-hide { display: none !important; }
}

/* ودجات الفوتر (تُفعّل من إعدادات الصفحة الكاملة في المنشئ) */
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.footer-widgets.cols-1 { grid-template-columns: 1fr; }
.footer-widgets.cols-2 { grid-template-columns: repeat(2, 1fr); }
.footer-widgets.cols-4 { grid-template-columns: repeat(4, 1fr); }

.footer-widget-inner { font-size: 13.5px; line-height: 1.8; color: #c9d6e5; }
.footer-widget-inner a { color: #f6c47f; text-decoration: none; }
.footer-widget-inner a:hover { color: #ffd89a; }
.footer-widget-title {
    color: #ffffff;
    font-size: 15.5px;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-gold);
    display: inline-block;
}

@media (max-width: 768px) {
    .footer-widgets { grid-template-columns: 1fr !important; }
}

/* زر العودة إلى الأعلى (من إعدادات الفوتر) */
.hpb-backtotop {
    position: fixed;
    bottom: 22px;
    left: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--primary-blue);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(11, 30, 51, .35);
    z-index: 999;
    transition: background .2s, transform .2s;
}

.hpb-backtotop:hover { background: var(--accent-gold); transform: translateY(-2px); }

/* حالة البث المباشر (إعدادات الشريط العلوي) */
.live-stream-btn.is-live {
    background: var(--accent-red);
}

.live-stream-btn.is-live .live-dot {
    background: #ffffff;
    animation: livePulse 1.1s infinite;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); }
    50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
}

/* ============================================================
   Module 21 v1.7 — أشكال السلايدر الجديدة + أشكال التصنيفات الجديدة
   + ضبط التصميمات القديمة (نص دائم الظهور مع الصور)
   ============================================================ */

/* ---------- صور الشرائح المشتركة ---------- */
.hpb-slide-img-wrap {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hpb-slide-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s;
}

.carousel-slide:hover .hpb-slide-img-wrap img { transform: scale(1.03); }

.hpb-slide-img-fallback {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.hpb-slide-panel {
    background: var(--card-bg);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    text-align: right;
}

.hpb-slide-panel .cat-badge-gold { align-self: flex-start; margin-bottom: 6px; }

.hpb-slide-panel h2 { font-size: 21px; line-height: 1.5; font-weight: 800; margin-bottom: 8px; }
.hpb-slide-panel h2 a { color: var(--text-dark); }
.hpb-slide-panel h2 a:hover { color: var(--primary-blue); }

.hpb-slide-panel p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 10px;
}

.hpb-slide-panel .carousel-meta { font-size: 12.5px; color: #94a3b8; }

.hpb-slide-more {
    align-self: flex-start;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 2px;
}

.hpb-slide-more:hover { color: var(--accent-gold); }

/* ---------- 1) سلايدر مقسوم: صورة يمين + لوح نص يسار ---------- */
.hpb-slide-split {
    display: flex !important;
    align-items: stretch;
}

.hpb-slide-split .hpb-slide-img-wrap { flex: 0 0 55%; }

/* ---------- 2) سلايدر بطاقات نصية: صورة أعلى + لوح نص أسفل ---------- */
.hpb-slide-cover {
    display: flex !important;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 18px rgba(11, 30, 51, .10);
}

.hpb-slide-cover .hpb-slide-img-wrap { flex: 1 1 auto; min-height: 0; }
.hpb-slide-cover .hpb-slide-panel { flex: 0 0 auto; }

/* ---------- 3) سلايدر التلاشي السينمائي ---------- */
.hpb-slider-fade .carousel-track {
    display: grid !important;
    transform: none !important;
}

.hpb-slider-fade .carousel-slide {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity .8s ease;
    pointer-events: none;
}

.hpb-slider-fade .carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.hpb-slider-fade .carousel-overlay {
    background: linear-gradient(180deg, rgba(11,30,51,0) 30%, rgba(11,30,51,.85) 100%);
    padding: 34px;
}

/* ---------- 4) سلايدر المصغّرات التفاعلية ---------- */
.hpb-slider-thumbs-strip {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.hpb-slider-thumb {
    flex: 0 0 150px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    text-align: right;
    transition: border-color .25s, box-shadow .25s;
    font-family: inherit;
}

.hpb-slider-thumb img {
    width: 100%;
    height: 66px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin-bottom: 6px;
}

.hpb-slider-thumb span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-dark);
    font-weight: 700;
}

.hpb-slider-thumb.active {
    border-color: var(--accent-gold);
    box-shadow: 0 3px 10px rgba(246, 196, 127, .35);
}

/* ---------- 5) شبكة موزاييك ---------- */
.hpb-mosaic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px;
    gap: 12px;
}

.hpb-mosaic-item {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    background: var(--primary-dark);
}

.hpb-mosaic-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.hpb-mosaic-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.hpb-mosaic-item:hover img { transform: scale(1.04); }

.hpb-mosaic-img-link { display: block; width: 100%; height: 100%; }

.hpb-mosaic-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.hpb-mosaic-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 42px 14px 10px;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.9) 75%);
}

.hpb-mosaic-caption h3 { font-size: 14.5px; line-height: 1.5; margin: 5px 0; }
.hpb-mosaic-caption h3 a { color: #ffffff; }
.hpb-mosaic-featured .hpb-mosaic-caption h3 { font-size: 19px; }
.hpb-mosaic-caption p { color: #dbe6f2; font-size: 12.5px; line-height: 1.6; margin-bottom: 4px; }
.hpb-mosaic-date { color: #c3d2e2; font-size: 11px; }
.hpb-mosaic-caption .cat-badge-gold { font-size: 10px; }

/* ---------- 6) قائمة غنية بالتفاصيل ---------- */
.hpb-rich-list { display: flex; flex-direction: column; }

.hpb-rich-item {
    display: flex;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.hpb-rich-item:first-child { padding-top: 0; }
.hpb-rich-item:last-child { border-bottom: 0; padding-bottom: 0; }

.hpb-rich-thumb { flex: 0 0 220px; }

.hpb-rich-thumb img {
    width: 220px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
}

.hpb-rich-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }

.hpb-rich-body .cat-badge-gold { margin-bottom: 8px; }

.hpb-rich-body h3 { font-size: 17px; line-height: 1.55; font-weight: 800; margin-bottom: 7px; }
.hpb-rich-body h3 a { color: var(--text-dark); }
.hpb-rich-body h3 a:hover { color: var(--primary-blue); }

.hpb-rich-body p { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }

.hpb-rich-meta { font-size: 12px; color: #94a3b8; }

/* ---------- 7) الخط الزمني للأخبار ---------- */
.hpb-timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 34px; }

.hpb-tl-item {
    position: relative;
    display: flex;
    gap: 13px;
    padding: 0 20px 20px 0;
    border-right: 2px solid var(--border-color);
}

.hpb-tl-item::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--accent-gold);
}

.hpb-tl-marker { flex: 0 0 auto; }

.hpb-tl-time {
    display: inline-block;
    background: var(--primary-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.hpb-tl-thumb { flex: 0 0 96px; }

.hpb-tl-thumb img {
    width: 96px;
    height: 92px;
    object-fit: cover;
    border-radius: 7px;
}

.hpb-tl-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.hpb-tl-body .cat-badge-gold { margin-bottom: 6px; font-size: 10px; }
.hpb-tl-body h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 5px; }
.hpb-tl-body h4 a { color: var(--text-dark); }
.hpb-tl-body h4 a:hover { color: var(--primary-blue); }
.hpb-tl-body p { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 5px; }
.hpb-tl-date { font-size: 11px; color: #94a3b8; }

/* ---------- 8) المجلة العمودية (مميز + قائمة) ---------- */
.hpb-stack-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 24px;
    align-items: start;
}

.hpb-stack-feat > a { display: block; }

.hpb-stack-feat img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 9px;
    margin-bottom: 14px;
}

.hpb-stack-feat-body { display: flex; flex-direction: column; align-items: flex-start; }
.hpb-stack-feat-body .cat-badge-gold { margin-bottom: 8px; }
.hpb-stack-feat-body h3 { font-size: 20px; line-height: 1.5; font-weight: 800; margin-bottom: 8px; }
.hpb-stack-feat-body h3 a { color: var(--text-dark); }
.hpb-stack-feat-body h3 a:hover { color: var(--primary-blue); }
.hpb-stack-feat-body p { font-size: 14px; color: var(--text-muted); line-height: 1.7; margin-bottom: 9px; }
.hpb-stack-date { font-size: 12.5px; color: #94a3b8; }

.hpb-stack-list { display: flex; flex-direction: column; gap: 15px; }

.hpb-stack-item {
    display: flex;
    gap: 13px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.hpb-stack-item:last-child { border-bottom: 0; padding-bottom: 0; }

.hpb-stack-thumb { flex: 0 0 110px; }

.hpb-stack-thumb img {
    width: 110px;
    height: 78px;
    object-fit: cover;
    border-radius: 7px;
}

.hpb-stack-item-body h4 { font-size: 14.5px; line-height: 1.55; margin-bottom: 5px; }
.hpb-stack-item-body h4 a { color: var(--text-dark); }
.hpb-stack-item-body h4 a:hover { color: var(--primary-blue); }

/* ---------- ضبط التصميمات القديمة ---------- */
.hpb-overlay-img-link { display: block; width: 100%; height: 100%; }
.hpb-overlay-img-link img { width: 100%; height: 100%; object-fit: cover; }
.hpb-overlay-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.style-card-body .cat-badge-gold { align-self: flex-start; margin-bottom: 9px; }

.hpb-card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 9px;
}

.mag-card-content .cat-badge-gold { display: inline-block; margin-bottom: 9px; }

/* ---------- استجابة الأجهزة للتصميمات الجديدة ---------- */
@media (max-width: 992px) {
    .hpb-mosaic-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
    .hpb-timeline { grid-template-columns: 1fr; }
    .hpb-stack-grid { grid-template-columns: 1fr; }
    .hpb-slide-split .hpb-slide-img-wrap { flex: 0 0 45%; }
    .hpb-slide-panel h2 { font-size: 18px; }
}

@media (max-width: 768px) {
    .hpb-mosaic-grid { grid-template-columns: 1fr; grid-auto-rows: 170px; }
    .hpb-mosaic-item:first-child { grid-column: span 1; grid-row: span 1; }
    .hpb-mosaic-featured .hpb-mosaic-caption h3 { font-size: 15px; }
    .hpb-rich-item { flex-direction: column; gap: 12px; }
    .hpb-rich-thumb, .hpb-rich-thumb img { width: 100%; flex: none; }
    .hpb-rich-thumb img { height: 170px; }
    .hpb-tl-thumb { display: none; }
    .hpb-slide-split { flex-direction: column; }
    .hpb-slide-split .hpb-slide-img-wrap { min-height: 180px; }
    .hpb-slide-panel { padding: 18px; }
    .hpb-slide-panel h2 { font-size: 16px; }
    .hpb-slider-thumbs-strip { display: none; }
    .hpb-stack-feat img { height: 210px; }
}

/* ============================================================
   Module 21 v1.8 — تحصين التخطيط (ضد التشوه) + 6 تصميمات جديدة
   ============================================================ */

/* ---------- تحصين عام: لا انكماش للصور ولا فيض للنصوص ---------- */
.newsroom-side-info,
.hpb-compact-info,
.hpb-mostread-info,
.hpb-tl-body,
.hpb-stack-item-body,
.hpb-rich-body,
.mag-card-content,
.style-card-body,
.hpb-alt-body,
.hpb-photo-caption,
.hpb-minimal-item {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.mag-card > a { flex: 0 0 180px; }
.hpb-tl-item { overflow: hidden; }

.style-card-box h3 a,
.hpb-stack-item-body h4 a,
.hpb-tl-body h4 a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 6) سلايدر سينمائي بعدّاد شرائح ---------- */
.hpb-slide-cinema {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.hpb-cinema-counter {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    z-index: 3;
    background: rgba(11, 30, 51, .72);
    color: var(--accent-gold, #f6c47f);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(246, 196, 127, .45);
}

.hpb-cinema-bar {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.92) 60%);
    padding: 46px 30px 20px;
}

.hpb-cinema-bar h2 { font-size: 22px; line-height: 1.5; margin: 6px 0; }
.hpb-cinema-bar h2 a { color: #fff; }
.hpb-cinema-bar p { color: #dbe6f2; font-size: 13.5px; line-height: 1.65; margin-bottom: 6px; max-width: 75%; }
.hpb-cinema-bar .carousel-meta { color: #c3d2e2; font-size: 12px; }
.hpb-cinema-bar .cat-badge-gold { font-size: 11px; }

.hpb-slider-cinema .carousel-dot {
    width: 26px;
    height: 4px;
    border-radius: 3px;
}

/* ---------- 7) سلايدر بطاقتين معاً ---------- */
.hpb-slide-two-up { background: transparent; }

.hpb-slide-pair {
    display: flex;
    gap: 14px;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

.hpb-pair-card {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 16px rgba(11, 30, 51, .10);
}

.hpb-pair-card .hpb-slide-img-wrap { flex: 1 1 auto; min-height: 0; }

.hpb-pair-panel {
    flex: 0 0 auto;
    background: var(--card-bg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hpb-pair-panel .cat-badge-gold { margin-bottom: 6px; font-size: 10px; }

.hpb-pair-panel h3 { font-size: 15.5px; line-height: 1.5; margin-bottom: 5px; }
.hpb-pair-panel h3 a { color: var(--text-dark); }
.hpb-pair-panel h3 a:hover { color: var(--primary-blue); }

.hpb-pair-panel p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpb-pair-panel .carousel-meta { font-size: 11.5px; color: #94a3b8; }

/* ---------- 8) سلايدر مكدّس ثلاثي الأبعاد ---------- */
.hpb-slider-stack .carousel-track {
    display: grid !important;
    transform: none !important;
}

.hpb-slider-stack .carousel-slide {
    grid-area: 1 / 1;
    opacity: 0;
    transform: scale(.9) translateY(18px);
    transition: opacity .7s ease, transform .7s ease;
    pointer-events: none;
    z-index: 1;
}

.hpb-slider-stack .carousel-slide.behind {
    opacity: .45;
    transform: scale(.955) translateY(12px);
    pointer-events: none;
    z-index: 2;
}

.hpb-slider-stack .carousel-slide.active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    z-index: 3;
}

.hpb-slide-stack {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.hpb-stack-slide-info {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(11,30,51,0) 0%, rgba(11,30,51,.9) 65%);
    padding: 44px 28px 18px;
}

.hpb-stack-slide-info h2 { font-size: 20px; line-height: 1.5; margin: 5px 0; }
.hpb-stack-slide-info h2 a { color: #fff; }
.hpb-stack-slide-info p { color: #dbe6f2; font-size: 13px; line-height: 1.65; margin-bottom: 5px; max-width: 70%; }
.hpb-stack-slide-info .carousel-meta { color: #c3d2e2; font-size: 12px; }

/* ---------- 9) صفوف متناوبة بالصورة ---------- */
.hpb-alt-list { display: flex; flex-direction: column; gap: 20px; }

.hpb-alt-item {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.hpb-alt-item.hpb-alt-reverse { flex-direction: row-reverse; }

.hpb-alt-thumb { flex: 0 0 240px; }

.hpb-alt-thumb img {
    width: 240px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.hpb-alt-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.hpb-alt-body .cat-badge-gold { margin-bottom: 8px; }

.hpb-alt-body h3 { font-size: 17px; line-height: 1.55; font-weight: 800; margin-bottom: 7px; }
.hpb-alt-body h3 a { color: var(--text-dark); }
.hpb-alt-body h3 a:hover { color: var(--primary-blue); }

.hpb-alt-body p { font-size: 13.5px; color: var(--text-muted); line-height: 1.7; margin-bottom: 8px; }
.hpb-alt-meta { font-size: 12px; color: #94a3b8; margin-bottom: 8px; }

.hpb-alt-more {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 2px;
}

.hpb-alt-more:hover { color: var(--accent-gold); }

/* ---------- 10) جدار صور بنص ظاهر ---------- */
.hpb-photo-wall {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hpb-photo-card {
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.hpb-photo-img-link { display: block; width: 100%; }

.hpb-photo-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}

.hpb-photo-card:hover img { transform: scale(1.04); }

.hpb-photo-fallback {
    width: 100%;
    height: 190px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.hpb-photo-caption {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hpb-photo-caption .cat-badge-gold { margin-bottom: 7px; font-size: 10px; }

.hpb-photo-caption h3 { font-size: 14.5px; line-height: 1.5; margin-bottom: 5px; }
.hpb-photo-caption h3 a { color: var(--text-dark); }
.hpb-photo-caption h3 a:hover { color: var(--primary-blue); }

.hpb-photo-caption p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpb-photo-date { font-size: 11px; color: #94a3b8; }

/* ---------- 11) شبكة نصية أنيقة بدون صور ---------- */
.hpb-minimal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.hpb-minimal-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-inline-start: 4px solid var(--accent-gold);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: box-shadow .2s, transform .2s;
}

.hpb-minimal-item:hover {
    box-shadow: 0 6px 18px rgba(11, 30, 51, .10);
    transform: translateY(-2px);
}

.hpb-minimal-item .cat-badge-gold { margin-bottom: 8px; font-size: 10px; }

.hpb-minimal-item h3 { font-size: 15.5px; line-height: 1.55; margin-bottom: 6px; }
.hpb-minimal-item h3 a { color: var(--text-dark); }
.hpb-minimal-item h3 a:hover { color: var(--primary-blue); }

.hpb-minimal-item p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hpb-minimal-date { font-size: 11px; color: #94a3b8; margin-top: auto; }

/* ---------- استجابة الأجهزة لتصميمات v1.8 ---------- */
@media (max-width: 992px) {
    .hpb-photo-wall { grid-template-columns: repeat(2, 1fr); }
    .hpb-alt-thumb { flex: 0 0 200px; }
    .hpb-alt-thumb img { width: 200px; height: 130px; }
}

@media (max-width: 768px) {
    .hpb-photo-wall { grid-template-columns: 1fr; }
    .hpb-photo-card img, .hpb-photo-fallback { height: 200px; }
    .hpb-alt-item, .hpb-alt-item.hpb-alt-reverse { flex-direction: column; align-items: flex-start; }
    .hpb-alt-thumb, .hpb-alt-thumb img { width: 100%; flex: none; }
    .hpb-alt-thumb img { height: 180px; }
    .hpb-minimal-grid { grid-template-columns: 1fr; }
    .hpb-slide-pair { flex-direction: column; }
    .hpb-pair-card .hpb-slide-img-wrap { min-height: 150px; }
    .hpb-cinema-bar p, .hpb-stack-slide-info p { max-width: 100%; }
    .hpb-cinema-bar { padding: 34px 16px 14px; }
    .hpb-cinema-bar h2 { font-size: 17px; }
    .hpb-cinema-counter { top: 10px; inset-inline-start: 10px; font-size: 11px; }
    .hpb-stack-slide-info { padding: 34px 16px 14px; }
    .hpb-stack-slide-info h2 { font-size: 16px; }
}

/* ============================================================
   v1.8.1 — حماية من صور الرموز المحقونة (Twemoji/Jetpack):
   إضافات الموقع قد تستبدل رمز التاريخ 📅 بصورة <img class="emoji">
   بلا قياس حجم فتُسحق عمودياً إلى كبسولة عملاقة بجوار التاريخ.
   القالب لم يعد يطبع أي رمز، وهذه القاعدة تقيّد أي صورة محقونة.
   ============================================================ */
.emoji,
.wp-smiley,
.side-date img,
.hpb-el-date img,
.carousel-meta img {
    height: 1em !important;
    width: auto !important;
    max-width: 1em !important;
    vertical-align: -0.15em;
}

/* ============================================================
   v1.8.2 — الفوتر الاحترافي:
   شريط علوي بأربعة أعمدة (عن الموقع + التواصل، الأقسام، الصفحات،
   أحدث الأخبار) + شريط سفلي للحقوق + منطقة ودجات اختيارية.
   الخلفية على .site-footer حتى تحترم إعداد لون الفوتر من المنشئ.
   ============================================================ */
.site-footer {
    background: linear-gradient(180deg, #0c1a2e 0%, #091423 100%);
    color: #cfd8e3;
    text-align: start;
    padding: 0;
    margin-top: 40px;
    border-top: 4px solid var(--accent-red);
}

.footer-widgets-band {
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 30px 0;
}

.footer-main {
    padding: 44px 0 36px;
}

.footer-cols {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: 34px;
}

.footer-cols.footer-cols-3 { grid-template-columns: 1.5fr 1fr 1.3fr; }
.footer-cols.footer-cols-2 { grid-template-columns: 1.5fr 1fr; }
.footer-cols.footer-cols-1 { grid-template-columns: 1fr; }

.footer-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 15px;
}

.footer-brand-mark {
    background: linear-gradient(135deg, var(--accent-red), #8f1015);
    color: #ffffff;
    font-weight: 800;
    font-size: 21px;
    width: 47px;
    height: 47px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -1px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.footer-logo {
    font-size: 21px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
}

.footer-tagline {
    font-size: 12px;
    color: #8fa3bd;
    display: block;
    margin-top: 3px;
}

.footer-desc {
    font-size: 13.5px;
    color: #aeb9c9;
    line-height: 1.95;
    margin: 0 0 18px;
}

.footer-social {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.footer-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #cfd8e3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.footer-social-btn:hover {
    background: var(--accent-red);
    color: #ffffff;
    transform: translateY(-3px);
}

.footer-social-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.footer-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 18px;
    padding-bottom: 10px;
    position: relative;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 44px;
    height: 3px;
    background: var(--accent-red);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #aeb9c9;
    font-size: 13.5px;
    text-decoration: none;
    transition: color 0.2s ease, padding 0.2s ease;
    display: inline-block;
}

.footer-links a::before {
    content: '‹';
    margin-inline-end: 7px;
    color: var(--accent-red);
    font-weight: 700;
}

.footer-links a:hover {
    color: #ffffff;
    padding-inline-start: 4px;
}

.footer-news {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-news li {
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-news li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.footer-news a {
    color: #cfd8e3;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.65;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
}

.footer-news a:hover {
    color: #ffffff;
}

.footer-news-date {
    font-size: 11.5px;
    color: #7186a0;
    display: block;
    margin-top: 3px;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.32);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 16px 0;
}

.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copy {
    margin: 0;
    font-size: 13px;
    color: #8fa3bd;
}

.footer-credit {
    margin: 0;
    font-size: 12.5px;
    color: #66798f;
}

@media (max-width: 992px) {
    .footer-cols,
    .footer-cols.footer-cols-3,
    .footer-cols.footer-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
    .footer-about {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .footer-cols,
    .footer-cols.footer-cols-3,
    .footer-cols.footer-cols-2 {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-main { padding: 34px 0 28px; }
    .footer-bottom-row { justify-content: center; text-align: center; }
}

/* ===== v2.4.0: صفحات 404 / بحث / تعليقات / ترقيم / إتاحة ===== */
.screen-reader-text{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}
.skip-link:focus{clip:auto;clip-path:none;height:auto;width:auto;margin:0;padding:10px 16px;background:var(--accent-gold);color:#fff;z-index:100000;top:6px;right:6px}
.error-404{text-align:center;padding:50px 0}
.error-404 .error-code{font-size:96px;font-weight:800;color:var(--accent-red);line-height:1}
.error-404 h1{margin:10px 0}
.error-404 .search-form{margin:20px auto;max-width:420px}
.error-home{display:inline-block;margin-top:10px;padding:10px 22px;background:var(--primary-dark);color:#fff;border-radius:6px;text-decoration:none}
.error-recent{list-style:none;max-width:560px;margin:10px auto;text-align:right}
.error-recent li{padding:8px 0;border-bottom:1px solid var(--border-color)}
.no-results{padding:30px 0;color:var(--text-muted)}
.navigation.pagination{margin:30px 0;text-align:center}
.navigation.pagination .nav-links{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.navigation.pagination .page-numbers{padding:8px 14px;border:1px solid var(--border-color);border-radius:6px;background:var(--card-bg);color:var(--text-dark);text-decoration:none}
.navigation.pagination .page-numbers.current{background:var(--accent-gold);border-color:var(--accent-gold);color:#fff}
.comments-area{margin:30px auto;max-width:860px}
.comments-title,.comment-reply-title{font-size:20px;margin-bottom:14px;border-right:4px solid var(--accent-gold);padding-right:10px}
.comment-list{list-style:none;padding:0}
.comment-list .comment-body{background:var(--card-bg);border:1px solid var(--border-color);border-radius:8px;padding:14px;margin-bottom:12px}
.comment-list .children{list-style:none;margin-right:28px}
.comment-meta{font-size:13px;color:var(--text-muted);margin-bottom:6px}
.comment-form label{display:block;font-weight:700;margin-bottom:4px}
.comment-form textarea,.comment-form input[type=text],.comment-form input[type=email],.comment-form input[type=url]{width:100%;padding:10px;border:1px solid var(--border-color);border-radius:6px;background:var(--card-bg);color:var(--text-dark);font:inherit}
.comment-form .submit{padding:10px 24px;border:0;border-radius:6px;background:var(--accent-gold);color:#fff;font:inherit;font-weight:700;cursor:pointer}

/* ===== v2.5.0: نوع المقال / فتات الخبز / تحديث / الكاتب ===== */
.ajp-breadcrumbs{margin:14px 0;font-size:13px;color:var(--text-muted)}
.ajp-breadcrumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:4px;padding:0}
.ajp-breadcrumbs li+li:before{content:'‹';margin:0 6px;color:var(--text-muted)}
.ajp-breadcrumbs a{color:var(--primary-blue);text-decoration:none}
.ajp-breadcrumbs a:hover{text-decoration:underline}
.ajp-type-badge{display:inline-block;padding:2px 10px;margin-bottom:8px;border-radius:4px;background:var(--primary-blue);color:#fff;font-size:12px;font-weight:700;text-decoration:none}
.ajp-type-opinion{background:#7c3aed}.ajp-type-analysis{background:#0e7490}.ajp-type-report{background:#b45309}.ajp-type-sponsored{background:#64748b}
.ajp-updated{margin:6px 0 14px;font-size:13px;color:var(--text-muted)}
.ajp-author-box{display:flex;gap:14px;align-items:flex-start;margin:26px 0;padding:16px;border:1px solid var(--border-color);border-radius:10px;background:var(--card-bg)}
.ajp-author-box img,.ajp-author-header img{border-radius:50%;flex-shrink:0}
.ajp-author-box a{color:var(--primary-blue);text-decoration:none}
.ajp-author-box p{margin:4px 0;color:var(--text-muted);font-size:14px;line-height:1.7}
.ajp-author-more{font-size:13px;font-weight:700}
.ajp-author-header{display:flex;gap:20px;align-items:center;margin:10px 0 26px;padding:20px;border-radius:10px;background:var(--card-bg);border:1px solid var(--border-color)}
.ajp-author-header h1{font-size:26px;margin-bottom:6px}
.ajp-author-bio{line-height:1.8}
.ajp-author-stats{margin-top:6px;font-size:13px;color:var(--text-muted)}
@media(max-width:600px){.ajp-author-header{flex-direction:column;text-align:center}}


/* ===== v3.4.1: تحسينات HTML5/CSS3 والإتاحة والتجاوب ===== */
img, picture, video, canvas {
    max-width: 100%;
}

iframe, embed, object {
    max-width: 100%;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
}

[id] {
    scroll-margin-top: 5rem;
}

/* تحسين قابلية قراءة العناوين دون فرض قياسات على تصاميم المنشئ.
   v3.9.2: حُذف `.single-article > h1` من القائمة — balance كان يمنع
   سطر العنوان من الاكتمال في صفحة المقال (بقية العناوين كما هي) */
@supports (text-wrap: balance) {
    .archive-header h1,
    .archive-header h2,
    .post-card-title {
        text-wrap: balance;
    }
}

/* احترام إعداد تقليل الحركة على مستوى النظام، بما في ذلك العناصر المضافة ديناميكياً. */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto !important;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* فيديوهات وتضمينات بنسبة عرض مناسبة للشاشات الصغيرة. */
.wp-block-embed,
.wp-block-video,
.dz-article-content video {
    max-width: 100%;
}

.wp-block-embed iframe {
    max-width: 100%;
}


/* v3.4.2 — تحسينات الوصول والتجاوب للواجهة العامة */
:where(button, input, select, textarea) {
    font: inherit;
}

:where(img, video, iframe, embed, object) {
    max-width: 100%;
}

img {
    height: auto;
}

:where(.main-nav, .site-footer, .main-header) a:focus-visible,
:where(.carousel-wrapper) button:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
}

/* لا نفرض ارتفاعاً ثابتاً على المحتوى العربي عند تكبير الخط. */
html {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 600px) {
    .container {
        padding-inline: 12px;
    }
    .search-box-mini input {
        min-width: 0;
        width: min(42vw, 180px);
    }
    .wp-block-embed iframe,
    .dz-article-content iframe {
        width: 100%;
        max-width: 100%;
    }
}


/* ============================================================
   Aljazair Press 3.4.3 — Mobile navigation + responsive polish
   لا يغيّر بنية منشئ الصفحة الرئيسية أو تخطيطات سطح المكتب.
   ============================================================ */
.mobile-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}
.mobile-nav-toggle:hover,
.mobile-nav-toggle[aria-expanded="true"] {
    background: var(--primary-blue);
    border-color: var(--accent-gold);
}
.mobile-nav-toggle:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 3px;
}
.mobile-nav-toggle-icon {
    display: inline-flex;
    width: 18px;
    flex-direction: column;
    gap: 4px;
}
.mobile-nav-toggle-icon span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
}
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon span:first-child {
    transform: translateY(6px) rotate(45deg);
}
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon span:nth-child(2) {
    opacity: 0;
}
.mobile-nav-toggle[aria-expanded="true"] .mobile-nav-toggle-icon span:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

/* قواعد عامة للوسائط والمحتوى الطويل دون فرض ارتفاعات على المحتوى */
#main-content,
.dz-article-content,
.entry-content {
    min-width: 0;
    overflow-wrap: anywhere;
}
.dz-article-content figure,
.entry-content figure {
    max-width: 100%;
    margin-inline: auto;
}
.dz-article-content img,
.entry-content img,
.wp-block-image img {
    max-width: 100%;
    height: auto;
}
.dz-article-content table,
.entry-content table,
.wp-block-table {
    max-width: 100%;
}
.dz-article-content table,
.entry-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}
.dz-article-content pre,
.entry-content pre {
    max-width: 100%;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}
.dz-article-content iframe,
.entry-content iframe,
.wp-block-embed__wrapper iframe {
    max-width: 100%;
}

@media (max-width: 768px) {
    .main-nav .container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .mobile-nav-toggle {
        display: inline-flex;
        order: 0;
    }
    .main-nav .dark-mode-btn {
        order: 1;
        flex: 0 0 38px;
    }
    .main-nav .nav-menu {
        display: none;
        order: 2;
        flex: 0 0 100%;
        width: 100%;
        max-height: min(68vh, 520px);
        overflow-y: auto;
        overscroll-behavior: contain;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        margin-top: 4px;
        padding: 6px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 10px;
        background: #0b1e33;
        box-shadow: 0 14px 28px rgba(0,0,0,.2);
    }
    .main-nav.is-mobile-open .nav-menu {
        display: flex;
    }
    .nav-menu > li,
    .nav-menu > li.has-classic-sub {
        position: relative;
        width: 100%;
    }
    .nav-menu > li > a {
        min-height: 46px;
        padding: 11px 13px;
        border-left: 0;
        border-bottom: 1px solid rgba(255,255,255,.09);
    }
    .nav-menu > li.current-menu-item > a,
    .nav-menu > li.current-category-ancestor > a,
    .nav-menu > li:hover > a,
    .nav-menu > li:focus-within > a {
        border-bottom-color: rgba(217,130,43,.65);
    }
    /* القوائم الفرعية تظهر ضمن التدفق على الهاتف بدلاً من القوائم العائمة. */
    .nav-menu .sub-menu {
        display: block;
        position: static;
        min-width: 0;
        width: 100%;
        padding: 0 12px 7px 0;
        border: 0;
        border-right: 2px solid var(--accent-gold);
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(255,255,255,.045);
    }
    .nav-menu .sub-menu li a {
        padding: 10px 12px;
        border-bottom-color: rgba(255,255,255,.06);
    }
    .nav-menu .mega-menu-panel {
        display: none !important;
    }
    /* إبقاء روابط التصنيفات الفرعية التي توجد داخل لوحة الميجا منيو متاحة للهاتف. */
    .nav-menu .mega-menu-panel.has-mobile-subcats {
        display: block !important;
        position: static;
        inset: auto;
        width: 100%;
        padding: 8px 12px 10px;
        border: 0;
        border-right: 2px solid var(--accent-gold);
        border-radius: 0;
        box-shadow: none;
        background: rgba(255,255,255,.045);
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .nav-menu .mega-menu-panel .mega-posts-grid,
    .nav-menu .mega-menu-panel > p {
        display: none !important;
    }
    .nav-menu .mega-menu-panel .mega-subcats-strip {
        display: flex;
        gap: 7px;
        margin: 0;
        padding: 0;
        border: 0;
    }
    .nav-menu .mega-menu-panel .mega-subcats-strip span {
        flex: 0 0 100%;
    }
    .main-header .container {
        gap: 14px;
    }
    .header-banner-slot {
        flex: 1 1 100%;
        max-width: none;
        min-height: 0;
    }
    .header-banner-placeholder {
        min-height: 76px;
        padding: 11px 13px;
    }
    .header-banner-placeholder h4 {
        font-size: 14px;
    }
    .header-banner-placeholder p {
        display: none;
    }
    .breaking-bar {
        align-items: stretch;
        gap: 8px;
        padding: 9px 10px;
    }
    .breaking-label {
        flex: 0 0 auto;
        padding: 8px 5px;
        margin: 0;
        font-size: 12px;
    }
    .breaking-ticker-viewport {
        min-width: 0;
        flex: 1 1 auto;
    }
    .site-footer {
        padding: 22px 12px;
    }
}

@media (max-width: 480px) {
    .site-logo img {
        max-height: 68px;
        max-width: min(72vw, 220px);
    }
    .header-banner-placeholder {
        align-items: flex-start;
        flex-direction: column;
    }
    .banner-cta-btn {
        padding: 6px 11px;
    }
    .breaking-label {
        font-size: 11px;
    }
    .breaking-bar {
        border-right-width: 3px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-nav-toggle-icon span {
        transition: none !important;
    }
}

/* ============================================================
   Aljazair Press 3.4.4 — editorial typography & reading comfort
   تحسين التسلسل الطباعي وبطاقات الأرشيف ومتن المقال، دون تغيير
   إعدادات المنشئ أو فرض تصميم على الأقسام التي يديرها المحرر.
   ============================================================ */
:root {
    --ajp-font-body: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
    --ajp-reading-width: 78ch;
    --ajp-reading-line: 1.95;
    --ajp-card-radius: 14px;
    --ajp-soft-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}

body {
    font-family: var(--ajp-font-body);
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}

/* عنوان صفحة التصنيف/الأرشيف */
.archive-header {
    padding: clamp(18px, 2.8vw, 30px);
}
.archive-header > h1,
.archive-header > h2 {
    margin: 0 0 14px;
    color: var(--text-dark);
    font-size: clamp(22px, 2.3vw, 31px);
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: -.02em;
}
.archive-header > h1::after,
.archive-header > h2::after {
    content: '';
    display: block;
    width: clamp(54px, 8vw, 82px);
    height: 4px;
    margin-top: 11px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
}
.subcategories-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 17px;
    color: var(--text-muted);
    font-size: 13px;
}
.subcategories-bar > strong {
    margin-inline-end: 3px;
    color: var(--text-dark);
    font-weight: 800;
}
.subcat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-light);
    color: var(--text-dark);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.4;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.subcat-chip:hover,
.subcat-chip:focus-visible {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: #fff;
}

/* بطاقات الأخبار: ارتفاعات أكثر اتزاناً وعناوين أسهل قراءة */
.posts-grid {
    align-items: stretch;
}
.post-card {
    min-width: 0;
    border-radius: var(--ajp-card-radius);
    box-shadow: 0 2px 10px rgba(15, 23, 42, .035);
}
.post-card-thumb {
    isolation: isolate;
}
.post-card-thumb-frame img {
    aspect-ratio: 16 / 9;
}
.post-card-body {
    align-items: stretch;
    gap: 8px;
    padding: 13px 14px 15px;
}
.ajp-type-badge {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    min-height: 24px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 5px;
    background: rgba(21, 64, 107, .09);
    color: var(--primary-blue);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
}
body.dark-mode .ajp-type-badge {
    background: rgba(148, 163, 184, .14);
    color: #cbdcf2;
}
.post-card-date {
    font-size: 12px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}
.post-card-title {
    font-size: clamp(14px, 1.1vw, 16px);
    line-height: 1.7;
    letter-spacing: -.01em;
}
.post-card-title a {
    min-height: 0;
    overflow-wrap: break-word;
}

/* قراءة المقال: لا نفرض عرضاً ضيقاً على الصور أو الفيديو أو الجداول */
/* v3.9.1: عنوان المقال بأحجام متوازنة عبر متغيرات CSS (تجاوزها من إعدادات القالب).
   الافتراضي: حاسوب 32px / لوحي 27px / هاتف 24px — بلا تباعد أحرف سلبي يضر بالعربية
   v3.9.2: لا text-wrap إطلاقاً — balance كان يقصّر كل الأسطر ليجعلها متساوية
   فيبقى جزء من السطر فارغاً. الالتفاف الطبيعي يملأ كل سطر حتى آخر الحاوية */
.single-article > h1 {
    margin-block: 12px 16px;
    font-size: clamp(var(--ajp-title-min, 24px), 2.2vw, var(--ajp-title-max, 32px));
    font-weight: var(--ajp-title-weight, 700);
    line-height: var(--ajp-title-line, 1.45);
    letter-spacing: 0;
}
.dz-article-subtitle {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: clamp(16px, 1.55vw, 20px);
    font-weight: 600;
    line-height: 1.8;
}
.dz-article-content {
    max-width: 100%;
    color: var(--text-dark);
    font-size: 17px;
    line-height: var(--ajp-reading-line);
    overflow-wrap: break-word;
    word-break: normal;
}
.dz-article-content > * {
    max-width: 100%;
}
.dz-article-content p {
    margin-block: 0 1.15em;
    line-height: inherit;
}
.dz-article-content h2,
.dz-article-content h3,
.dz-article-content h4 {
    margin-block: 1.65em .65em;
    color: var(--text-dark);
    font-weight: 900;
    line-height: 1.55;
    text-wrap: pretty;
}
.dz-article-content h2 {
    padding-inline-start: 13px;
    border-inline-start: 4px solid var(--accent-red);
    font-size: clamp(21px, 2.1vw, 27px);
}
.dz-article-content h3 {
    font-size: clamp(18px, 1.8vw, 22px);
}
.dz-article-content h4 {
    font-size: 18px;
}
.dz-article-content ul,
.dz-article-content ol {
    margin: 0 1.25em 1.35em 0;
    padding: 0 1em 0 0;
}
.dz-article-content li {
    margin-block: .35em;
    padding-inline-start: .2em;
}
.dz-article-content blockquote {
    margin: 1.5em 0;
    padding: 15px 19px;
    border-inline-start: 4px solid var(--accent-gold);
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 1.02em;
    font-weight: 600;
}
.dz-article-content blockquote > :last-child {
    margin-bottom: 0;
}
.dz-article-content a:not(.wp-element-button) {
    color: var(--primary-blue);
    text-decoration: underline;
    text-decoration-color: rgba(21, 64, 107, .35);
    text-underline-offset: 3px;
}
body.dark-mode .dz-article-content a:not(.wp-element-button) {
    color: #8fc2ff;
    text-decoration-color: rgba(143, 194, 255, .45);
}
.dz-article-content hr {
    margin-block: 2em;
    border: 0;
    border-top: 1px solid var(--border-color);
}
.dz-article-content figcaption {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}
.dz-article-content .wp-block-image,
.dz-article-content figure {
    margin-block: 1.5em;
}
.dz-article-content table th,
.dz-article-content table td {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    line-height: 1.65;
}
.dz-article-content table th {
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 800;
}

@media (max-width: 768px) {
    .archive-header {
        padding: 17px 15px;
        margin-block: 16px;
    }
    .post-card-body {
        padding: 10px 11px 12px;
    }
    .post-card-title {
        font-size: 14px;
        line-height: 1.65;
    }
    .dz-article-content {
        font-size: 16px;
        line-height: 1.9;
    }
    .single-article > h1 {
        font-size: var(--ajp-title-mobile, 24px);
    }
}
@media (max-width: 480px) {
    .subcategories-bar {
        gap: 6px;
    }
    .subcategories-bar > strong {
        flex: 0 0 100%;
    }
    .post-card-title a {
        -webkit-line-clamp: 4;
    }
    .dz-article-content blockquote {
        padding: 12px 14px;
    }
}



/* ============================================================
   v3.4.5 — تحسين صفحات الأرشيف والتصنيفات
   وصف التصنيف، عدّاد النتائج، وتنقل فرعي دلالي ومتجاوب.
   لا يغيّر تخطيطات منشئ الصفحة الرئيسية أو إعدادات الأقسام.
   ============================================================ */
.archive-description {
    max-width: 78ch;
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.9;
}
.archive-description > :last-child { margin-bottom: 0; }
.archive-description a {
    color: var(--primary-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}
body.dark-mode .archive-description a { color: #8fc2ff; }
.archive-results-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 0;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.subcategories-bar {
    width: 100%;
    min-width: 0;
}
.subcat-chip {
    min-height: 36px;
    text-align: center;
    overflow-wrap: anywhere;
}
.no-results {
    margin: 24px 0;
    padding: 22px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-muted);
    line-height: 1.8;
    text-align: center;
}
.posts-grid > .post-card { min-width: 0; }
@media (max-width: 600px) {
    .archive-description { font-size: 14px; }
    .subcategories-bar { align-items: stretch; }
    .subcategories-bar > strong { flex-basis: 100%; }
    .subcat-chip { flex: 0 1 auto; }
}

/* ============================================================
   v3.4.7 — طبقة صقل بصري للواجهة التحريرية
   تحسين رؤوس الأقسام وبطاقات الأخبار مع احترام ألوان الوضع الليلي
   وخيارات عناوين الأقسام والتخطيطات المحفوظة في منشئ الصفحة.
   ============================================================ */
:root {
    --ajp-section-radius: 14px;
    --ajp-card-shadow: 0 5px 18px rgba(15, 23, 42, .055);
    --ajp-card-shadow-hover: 0 13px 28px rgba(15, 23, 42, .12);
}

/* رأس موحّد للأقسام التقليدية وأقسام منشئ الصفحة الرئيسية */
.newsroom-section {
    border-radius: var(--ajp-section-radius);
    border-color: color-mix(in srgb, var(--border-color) 82%, transparent);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .035);
}

.newsroom-header {
    align-items: center;
    gap: 14px;
    padding-bottom: 13px;
    border-bottom-width: 1px;
    border-image: linear-gradient(90deg, var(--border-color), var(--accent-gold)) 1;
}

.newsroom-title-wrap {
    min-width: 0;
}

.newsroom-title-wrap .sub-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 5px;
    padding: 3px 9px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--accent-gold) 13%, var(--card-bg));
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .01em;
}

.newsroom-title-wrap h2 {
    position: relative;
    max-width: 100%;
    font-size: clamp(19px, 2vw, 25px);
    font-weight: 900;
    line-height: 1.45;
    text-wrap: balance;
}

/* لمسة العنوان الافتراضية لا تتجاوز خيارات العنوان المخصصة */
.hpb-section:not(.hpb-title-underline):not(.hpb-title-bar):not(.hpb-title-boxed):not(.hpb-title-icon) .newsroom-title-wrap h2::after,
.newsroom-section:not(.video-showcase-section) .newsroom-title-wrap h2::after {
    display: block;
    width: 42px;
    height: 3px;
    margin-top: 7px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    content: "";
}

.view-all-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid color-mix(in srgb, var(--accent-red) 24%, var(--border-color));
    border-radius: 7px;
    background: color-mix(in srgb, var(--accent-red) 5%, var(--card-bg));
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 800;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.view-all-link:hover,
.view-all-link:focus-visible {
    border-color: var(--accent-red);
    background: var(--accent-red);
    color: #fff;
    transform: translateY(-1px);
}

/* صقل بطاقات القوائم دون تغيير ترتيبها أو بياناتها */
.hpb-section .hpb-hs-side-item,
.hpb-section .hpb-cr-card,
.hpb-section .hpb-cs-item,
.hpb-section .hpb-fb-item,
.hpb-section .hpb-dual-item,
.hpb-section .hpb-compact-item,
.hpb-section .hpb-rich-item,
.hpb-section .hpb-mostread-item,
.hpb-section .hpb-tl-item {
    min-width: 0;
    border-radius: 11px;
    box-shadow: 0 2px 9px rgba(15, 23, 42, .035);
    transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.hpb-section .hpb-hs-side-info h4,
.hpb-section .hpb-cr-body h3,
.hpb-section .hpb-cs-body h3,
.hpb-section .hpb-fb-item-body h3,
.hpb-section .hpb-dual-body h3,
.hpb-section .hpb-compact-info h4,
.hpb-section .hpb-rich-body h3 {
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.hpb-section .hpb-hs-side-thumb img,
.hpb-section .hpb-cr-card img,
.hpb-section .hpb-cs-thumb img,
.hpb-section .hpb-fb-item img,
.hpb-section .hpb-dual-thumb img,
.hpb-section .hpb-compact-thumb img,
.hpb-section .hpb-rich-thumb img,
.hpb-section .hpb-mostread-thumb img,
.hpb-section .hpb-tl-thumb img {
    border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
    .hpb-section .hpb-hs-side-item:hover,
    .hpb-section .hpb-cr-card:hover,
    .hpb-section .hpb-cs-item:hover,
    .hpb-section .hpb-fb-item:hover,
    .hpb-section .hpb-dual-item:hover,
    .hpb-section .hpb-compact-item:hover,
    .hpb-section .hpb-rich-item:hover,
    .hpb-section .hpb-mostread-item:hover,
    .hpb-section .hpb-tl-item:hover {
        border-color: color-mix(in srgb, var(--primary-blue) 34%, var(--border-color));
        box-shadow: var(--ajp-card-shadow-hover);
    }
}

.hpb-section .hpb-mz-item,
.hpb-section .hpb-fb-hero,
.hpb-section .hpb-hs-hero-img img,
.hpb-section .hpb-featured-band {
    border-radius: 12px;
}

/* الوضع الليلي: ظلال أهدأ وحدود واضحة على الخلفيات الداكنة */
body.dark-mode .newsroom-section {
    box-shadow: 0 5px 20px rgba(0, 0, 0, .16);
}
body.dark-mode .hpb-section .hpb-hs-side-item,
body.dark-mode .hpb-section .hpb-cr-card,
body.dark-mode .hpb-section .hpb-cs-item,
body.dark-mode .hpb-section .hpb-fb-item,
body.dark-mode .hpb-section .hpb-dual-item,
body.dark-mode .hpb-section .hpb-compact-item,
body.dark-mode .hpb-section .hpb-rich-item,
body.dark-mode .hpb-section .hpb-mostread-item,
body.dark-mode .hpb-section .hpb-tl-item {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .13);
}

/* أحجام لمس مناسبة وتكديس رأس القسم على الهواتف */
@media (max-width: 640px) {
    .newsroom-section {
        margin-block: 18px;
        padding: 16px 13px;
        border-radius: 11px;
    }
    .newsroom-header {
        align-items: flex-start;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    .newsroom-title-wrap h2 {
        font-size: clamp(18px, 5vw, 22px);
    }
    .newsroom-header .view-all-link {
        min-height: 34px;
        padding-inline: 9px;
        font-size: 11px;
    }
    .hpb-section .hpb-hs-side-item,
    .hpb-section .hpb-cs-item,
    .hpb-section .hpb-dual-item {
        border-radius: 9px;
    }
}

@media (max-width: 380px) {
    .newsroom-header {
        flex-wrap: wrap;
        align-items: center;
    }
    .newsroom-header .view-all-link {
        margin-inline-start: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .view-all-link,
    .hpb-section .hpb-hs-side-item,
    .hpb-section .hpb-cr-card,
    .hpb-section .hpb-cs-item,
    .hpb-section .hpb-fb-item,
    .hpb-section .hpb-dual-item,
    .hpb-section .hpb-compact-item,
    .hpb-section .hpb-rich-item,
    .hpb-section .hpb-mostread-item,
    .hpb-section .hpb-tl-item {
        transition: none !important;
    }
}

/* ============================================================
   Aljazair Press 3.4.8 — طبقة الهوية البصرية التحريرية
   تحسين الهيدر، وضوح التنقل، رؤوس الأقسام وبطاقات الأخبار
   مع احترام ألوان القالب والوضع الليلي والتخطيطات الحالية.
   ============================================================ */
:root {
    --ajp-radius-sm: 8px;
    --ajp-radius-md: 13px;
    --ajp-radius-lg: 18px;
    --ajp-shadow-soft: 0 5px 22px rgba(11, 30, 51, .065);
    --ajp-shadow-hover: 0 12px 28px rgba(11, 30, 51, .13);
    --ajp-focus-ring: 0 0 0 3px rgba(21, 105, 190, .28);
}

/* الهيدر: هوية أكثر هدوءاً ومساحة تنفس أفضل للشعار والإعلان */
.main-header {
    position: relative;
    isolation: isolate;
    padding-block: clamp(14px, 2.2vw, 24px);
    border-bottom-width: 3px;
    border-image: linear-gradient(90deg, var(--accent-red), var(--accent-gold), var(--accent-red)) 1;
}
.main-header::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold), var(--accent-red));
    z-index: -1;
}
.site-logo a { display: inline-flex; align-items: center; min-height: 58px; }
.site-logo img {
    max-width: min(100%, 280px);
    max-height: 88px;
    object-fit: contain;
    transition: transform .22s ease;
}
.site-logo a:hover img { transform: translateY(-2px); }
.site-logo h1 {
    margin: 0;
    line-height: 1.35;
    letter-spacing: -.45px;
}
.header-banner-slot {
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    box-shadow: 0 3px 12px rgba(11, 30, 51, .045);
}
.header-banner-slot > a { display: block; width: 100%; }
.header-banner-slot img { width: 100%; object-fit: contain; }
.header-banner-placeholder {
    border: 0;
    border-radius: var(--ajp-radius-sm);
    background: linear-gradient(115deg, #0b1e33 0%, #15406b 62%, #1b5689 100%);
}
.banner-cta-btn { transition: transform .2s ease, filter .2s ease; }
.banner-cta-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* شريط المعلومات: فصل بصري واضح دون زيادة ارتفاعه */
.utility-bar { min-height: 42px; }
.utility-bar .container { gap: 12px; }
.search-box-mini {
    min-height: 34px;
    border-radius: 999px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.search-box-mini:focus-within {
    border-color: var(--primary-blue);
    box-shadow: var(--ajp-focus-ring);
}
.search-box-mini input { min-width: 0; }
.search-box-mini button { min-width: 30px; min-height: 28px; }

/* القائمة: حالات تفاعل موحدة وواضحة للفأرة ولوحة المفاتيح */
.main-nav { box-shadow: 0 4px 13px rgba(5, 19, 35, .12); }
.nav-menu > li > a {
    min-height: 52px;
    justify-content: center;
    position: relative;
    transition: background-color .18s ease, color .18s ease;
}
.nav-menu > li > a::before {
    content: "";
    position: absolute;
    inset-inline: 18px;
    bottom: 0;
    height: 2px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .2s ease;
}
.nav-menu > li:hover > a::before,
.nav-menu > li:focus-within > a::before,
.nav-menu > li.current-menu-item > a::before,
.nav-menu > li.current-menu-ancestor > a::before { transform: scaleX(1); }
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a,
.nav-menu > li.current-category-ancestor > a { color: #fff; }
.nav-menu .sub-menu {
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    box-shadow: 0 15px 32px rgba(0, 0, 0, .24);
}
.nav-menu .sub-menu li a { min-height: 42px; transition: background-color .18s ease, padding .18s ease; }
.dark-mode-btn,
.mobile-nav-toggle {
    min-width: 42px;
    min-height: 42px;
    border-radius: 9px;
    transition: background-color .2s ease, transform .2s ease;
}
.dark-mode-btn:hover,
.mobile-nav-toggle:hover { transform: translateY(-1px); }

/* رؤوس أقسام الأخبار: علامة تحريرية ثابتة وعنوان أوضح */
.newsroom-section {
    border-radius: var(--ajp-radius-md);
    box-shadow: var(--ajp-shadow-soft);
    overflow: clip;
}
.newsroom-header {
    position: relative;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}
.newsroom-header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: 0;
    width: clamp(58px, 10%, 112px);
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
}
.newsroom-title-wrap .sub-label {
    letter-spacing: .15px;
    line-height: 1.6;
}
.newsroom-title-wrap h2 {
    line-height: 1.45;
    letter-spacing: -.3px;
    text-wrap: balance;
}
.view-all-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid color-mix(in srgb, var(--accent-red) 24%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-red) 5%, var(--card-bg));
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.view-all-link:hover {
    color: #fff;
    background: var(--accent-red);
    border-color: var(--accent-red);
    transform: translateY(-1px);
}

/* بطاقات الأخبار: اتساق الزوايا والنصوص دون تغيير تخطيط الشبكات */
.post-card,
.newsroom-main-card,
.newsroom-side-item,
.mag-card,
.style-card {
    border-radius: var(--ajp-radius-md);
    overflow: hidden;
}
.post-card {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(11, 30, 51, .035);
}
.post-card-thumb-frame { overflow: hidden; background: var(--bg-light); }
.post-card-thumb-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card-body { gap: 7px; }
.post-card-date { display: inline-flex; align-items: center; gap: 5px; line-height: 1.6; }
.post-card-title { line-height: 1.65; text-wrap: pretty; }
.cat-badge-gold {
    width: fit-content;
    max-width: 100%;
    border-radius: 5px;
    line-height: 1.55;
}
.newsroom-side-item,
.mag-card,
.newsroom-main-card {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}
.newsroom-side-thumb img,
.mag-card > a img,
.newsroom-main-card > a img { display: block; width: 100%; object-fit: cover; }

/* وضوح الوصول: لا نعتمد على اللون وحده لإظهار العنصر النشط */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #2385d1;
    outline-offset: 3px;
    box-shadow: var(--ajp-focus-ring);
}
.skip-link:focus { z-index: 100000; }

/* الوضع الليلي: إبقاء التباين والحدود متوازنين */
body.dark-mode .main-header,
body.dark-mode .newsroom-section,
body.dark-mode .post-card,
body.dark-mode .newsroom-side-item,
body.dark-mode .mag-card,
body.dark-mode .newsroom-main-card { border-color: var(--border-color); }
body.dark-mode .header-banner-slot { background: #101c2d; }
body.dark-mode .view-all-link { background: rgba(217, 48, 37, .1); }
body.dark-mode .view-all-link:hover { background: var(--accent-red); }

@media (max-width: 900px) {
    .main-header .container { gap: 16px; }
    .header-banner-slot { max-width: 100%; flex-basis: 100%; }
    .nav-menu > li > a { padding-inline: 13px; }
}
@media (max-width: 640px) {
    .main-header { padding-block: 13px; }
    .main-header .container { justify-content: center; }
    .site-logo { width: 100%; display: flex; justify-content: center; }
    .site-logo img { max-height: 72px; max-width: min(78vw, 250px); }
    .header-banner-slot { min-height: 64px; }
    .header-banner-placeholder { min-height: 64px; padding: 10px 12px; }
    .header-banner-placeholder h4 { font-size: 14px; }
    .header-banner-placeholder p { font-size: 11px; }
    .top-bar { padding-block: 6px; }
    .top-bar .container { justify-content: center; text-align: center; }
    .top-bar-right { justify-content: center; flex-wrap: wrap; gap: 5px 12px; }
    .newsroom-section { box-shadow: 0 3px 14px rgba(11, 30, 51, .05); }
    .newsroom-header { gap: 8px; }
    .newsroom-title-wrap { min-width: 0; }
    .newsroom-title-wrap h2 { overflow-wrap: anywhere; }
    .view-all-link { min-height: 35px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .site-logo img,
    .banner-cta-btn,
    .search-box-mini,
    .nav-menu > li > a,
    .nav-menu > li > a::before,
    .nav-menu .sub-menu li a,
    .dark-mode-btn,
    .mobile-nav-toggle,
    .view-all-link { transition: none !important; }
}

/* ============================================================
   v3.4.9 — صقل تجربة قراءة المقال والتفاصيل التحريرية
   تحسينات محصورة بصفحة المقال ومكوناتها؛ لا تغيّر بيانات المقال
   أو إعدادات محرر التصميم أو مواضع الويدجات.
   ============================================================ */
.single-article {
    min-width: 0;
}
/* v3.9.2: أُزيلت قاعدة text-wrap: balance نهائياً — كانت تجعل كل أسطر
   العنوان متساوية القصر فلا يكتمل السطر. العنوان الآن يلتف طبيعياً ويملأ
   كل سطر بالكامل، وتحذير v3.9.1 (إزالة max-width:30ch) ما زال سارياً */
.dz-article-meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-block: 12px 18px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}
.dz-article-meta-line a {
    color: var(--primary-blue);
    text-decoration: none;
    text-underline-offset: 3px;
}
.dz-article-meta-line a:hover { text-decoration: underline; }
.dz-article-meta-line time { font-variant-numeric: tabular-nums; }
.dz-article-content {
    font-size: clamp(16px, 1.15vw, 18px);
    line-height: 2;
    letter-spacing: 0;
}
.dz-article-content p { text-wrap: pretty; }
.dz-article-content h2 {
    position: relative;
    padding-block: 2px;
    border-inline-start-width: 4px;
}
.dz-article-content h2::after {
    content: "";
    display: block;
    width: min(74px, 18%);
    height: 2px;
    margin-top: 9px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    opacity: .8;
}
.dz-article-content img,
.dz-article-content video {
    height: auto;
    border-radius: 9px;
}
.dz-article-content figure figcaption {
    padding-inline: 8px;
}
.dz-article-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    -webkit-overflow-scrolling: touch;
}
.dz-article-content pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-light);
    direction: ltr;
    text-align: left;
}
.dz-article-content :not(pre) > code {
    padding: .12em .4em;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-light);
    font-size: .88em;
    direction: ltr;
    unicode-bidi: isolate;
}
.dz-article-content blockquote {
    position: relative;
    box-shadow: 0 5px 18px rgba(11, 30, 51, .045);
}
.ajp-author-box,
.ajp-author-header {
    box-shadow: 0 5px 20px rgba(11, 30, 51, .045);
}
.ajp-author-box img { width: 64px; height: 64px; object-fit: cover; }
.ajp-author-box a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ajp-breadcrumbs { line-height: 1.8; }
.ajp-breadcrumbs a { text-underline-offset: 3px; }
.ajp-breadcrumbs a:hover { text-decoration-thickness: 2px; }
.dz-article-source,
.dz-sources {
    overflow-wrap: anywhere;
}
body.dark-mode .dz-article-content pre,
body.dark-mode .dz-article-content :not(pre) > code {
    background: #0d1929;
    border-color: var(--border-color);
    color: #e2e8f0;
}
body.dark-mode .dz-article-content blockquote,
body.dark-mode .ajp-author-box,
body.dark-mode .ajp-author-header {
    box-shadow: 0 5px 20px rgba(0, 0, 0, .14);
}
@media (max-width: 640px) {
    .dz-article-meta-line { gap: 5px 9px; font-size: 12px; }
    .dz-article-content { font-size: 16px; line-height: 1.95; }
    .dz-article-content h2 { margin-block: 1.4em .6em; }
    .ajp-author-box { gap: 10px; padding: 12px; }
    .ajp-author-box img { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
    .dz-article-content a,
    .ajp-breadcrumbs a,
    .ajp-author-box a { transition: none !important; }
}



/* ============================================================
   v3.5.0 — مؤشر تقدم قراءة المقال
   عنصر خفيف ثابت أعلى نافذة العرض، متوافق مع RTL والوضع الليلي.
   ============================================================ */
.ajp-reading-progress {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 99990;
    width: 100%;
    height: 3px;
    overflow: hidden;
    pointer-events: none;
    background: rgba(100, 116, 139, .16);
    background: color-mix(in srgb, var(--text-muted, #64748b) 16%, transparent);
}
.ajp-reading-progress__bar {
    display: block;
    width: 0;
    height: 100%;
    margin-inline-start: auto;
    background: linear-gradient(90deg, var(--accent-gold, #e2ad45), var(--primary-blue, #123b68));
    transition: width .12s linear;
    will-change: width;
}
body.admin-bar .ajp-reading-progress { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .ajp-reading-progress { top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .ajp-reading-progress__bar { transition: none; }
}


/* ============================================================
   v3.5.1 — فهرس عناوين المقال التلقائي
   يُنشأ عند وجود عنوانين أو أكثر، مع زر إظهار/إخفاء واضح.
   ============================================================ */
.ajp-article-toc {
    margin: 0 0 24px;
    padding: 16px 18px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-inline-start: 4px solid var(--accent-gold, #d9822b);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: var(--text-dark, #1e293b);
}
.ajp-article-toc__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ajp-article-toc__title { margin: 0; font-size: 17px; font-weight: 800; }
.ajp-article-toc__toggle {
    border: 1px solid var(--border-color, #e2e8f0); border-radius: 7px;
    padding: 6px 11px; background: transparent; color: inherit;
    font: inherit; font-size: 13px; cursor: pointer;
}
.ajp-article-toc__toggle:focus-visible,
.ajp-article-toc a:focus-visible { outline: 3px solid var(--accent-gold, #d9822b); outline-offset: 3px; }
.ajp-article-toc__list { margin: 12px 0 0; padding: 0 22px 0 0; }
.ajp-article-toc__list li { margin: 7px 0; line-height: 1.7; }
.ajp-article-toc__list li.is-sub { margin-inline-start: 18px; font-size: .94em; }
.ajp-article-toc a { color: inherit; text-decoration: none; }
.ajp-article-toc a:hover { color: var(--primary-blue, #15406b); text-decoration: underline; }
/* v3.5.2 — إبراز عنوان الفقرة الحالية أثناء القراءة */
.ajp-article-toc__list li.is-current {
    border-inline-start: 3px solid var(--accent-gold, #d9822b);
    padding-inline-start: 9px;
    font-weight: 800;
}
.ajp-article-toc__list li.is-current a { color: var(--primary-blue, #15406b); }
body.dark-mode .ajp-article-toc__list li.is-current a { color: var(--accent-gold, #e2b85c); }
body.dark-mode .ajp-article-toc { background: var(--card-bg, #132033); }
@media (max-width: 600px) {
    .ajp-article-toc { padding: 13px 14px; margin-bottom: 19px; }
    .ajp-article-toc__title { font-size: 16px; }
}

/* v3.5.2 — فهرس المقال: تمييز القسم الجاري أثناء التمرير */


/* ============================================================
   v3.5.3 — أدوات القراءة وتقدير مدة المقال
   تحكم فعلي بحجم النص مع حفظ التفضيل محلياً.
   ============================================================ */
.ajp-article-reading-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
    color: var(--text-muted, #64748b);
    font-size: 13px;
}
.ajp-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.6;
}
.ajp-reading-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 18px 0 12px;
    padding: 9px 11px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: var(--text-dark, #1e293b);
}
.ajp-reading-tools[hidden] { display: none !important; }
.ajp-reading-tools__label {
    margin-inline-end: 4px;
    color: var(--text-muted, #64748b);
    font-size: 13px;
    font-weight: 700;
}
.ajp-reading-tools__button,
.ajp-reading-tools__reset {
    min-width: 38px;
    min-height: 34px;
    padding: 5px 10px;
    border: 1px solid var(--border-color, #dbe2ea);
    border-radius: 7px;
    background: var(--bg-light, #f8fafc);
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.ajp-reading-tools__reset { font-size: 12px; font-weight: 600; }
.ajp-reading-tools__button:hover:not(:disabled),
.ajp-reading-tools__reset:hover {
    border-color: var(--accent-gold, #d6a343);
    background: color-mix(in srgb, var(--accent-gold, #d6a343) 10%, var(--card-bg, #fff));
}
.ajp-reading-tools__button:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.ajp-reading-tools__button:focus-visible,
.ajp-reading-tools__reset:focus-visible {
    outline: 3px solid var(--accent-gold, #d6a343);
    outline-offset: 2px;
}
body.dark-mode .ajp-reading-tools {
    background: var(--card-bg, #132033);
    color: var(--text-dark, #e5edf6);
}
body.dark-mode .ajp-reading-tools__button,
body.dark-mode .ajp-reading-tools__reset {
    background: rgba(255,255,255,.05);
    border-color: var(--border-color, #334155);
}
@media (max-width: 600px) {
    .ajp-reading-tools { gap: 6px; padding: 8px; }
    .ajp-reading-tools__label { flex-basis: 100%; }
}


/* v3.5.4 — نموذج البحث المتقدم */
.ajp-advanced-search{display:flex;align-items:stretch;gap:8px;flex-wrap:wrap;width:100%;margin:16px 0}
.ajp-advanced-search .ajp-search-field{flex:1 1 240px;min-width:0}
.ajp-advanced-search input[type="search"],.ajp-advanced-search select{box-sizing:border-box;width:100%;min-height:44px;padding:10px 13px;border:1px solid var(--border-color);border-radius:8px;background:var(--card-bg);color:var(--text-dark);font:inherit}
.ajp-advanced-search .ajp-search-filter{flex:0 1 175px;min-width:135px}
.ajp-advanced-search .search-submit{min-height:44px;padding:9px 22px;border:0;border-radius:8px;background:var(--primary-blue);color:#fff;font:inherit;font-weight:700;cursor:pointer}
.ajp-advanced-search input:focus-visible,.ajp-advanced-search select:focus-visible,.ajp-advanced-search button:focus-visible{outline:3px solid var(--accent-gold);outline-offset:2px}
@media(max-width:640px){.ajp-advanced-search{display:grid;grid-template-columns:1fr 1fr}.ajp-advanced-search .ajp-search-field{grid-column:1/-1}.ajp-advanced-search .ajp-search-filter{min-width:0}.ajp-advanced-search .search-submit{grid-column:1/-1}}


/* v3.5.5 — اقتراحات البحث الفورية */
.ajp-advanced-search { position: relative; }
.ajp-live-search-results { position: absolute; z-index: 1200; top: calc(100% + 8px); right: 0; left: 0; max-height: min(70vh, 460px); overflow: auto; background: var(--card-bg); color: var(--text-dark); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 16px 38px rgba(0,0,0,.18); text-align: right; }
.ajp-live-search-results[hidden] { display: none !important; }
.ajp-live-search-list { display: grid; }
.ajp-live-search-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); min-width: 0; }
.ajp-live-search-item:last-child { border-bottom: 0; }
.ajp-live-search-item:hover, .ajp-live-search-item:focus-visible { background: var(--bg-light); outline: 2px solid var(--accent-gold); outline-offset: -2px; }
.ajp-live-search-thumb { width: 76px; height: 56px; flex: 0 0 76px; object-fit: cover; border-radius: 7px; background: var(--bg-light); }
.ajp-live-search-placeholder { display: grid; place-items: center; color: var(--text-muted); font-size: 12px; }
.ajp-live-search-copy { display: grid; gap: 3px; min-width: 0; }
.ajp-live-search-category { color: var(--accent-red); font-size: 11px; font-weight: 800; }
.ajp-live-search-title { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ajp-live-search-date { color: var(--text-muted); font-size: 11px; }
.ajp-live-search-message { margin: 0; padding: 16px; color: var(--text-muted); font-size: 13px; }
.ajp-live-search-message.is-error { color: var(--accent-red); }
.ajp-live-search-more { display: block; width: 100%; padding: 12px; border: 0; border-top: 1px solid var(--border-color); background: var(--bg-light); color: var(--primary-blue); font: inherit; font-weight: 800; cursor: pointer; }
.ajp-live-search-more:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: -3px; }
body.dark-mode .ajp-live-search-more { color: #f4c36b; }
@media (max-width: 600px) { .ajp-live-search-results { max-height: 60vh; } .ajp-live-search-thumb { width: 64px; height: 50px; flex-basis: 64px; } .ajp-live-search-title { font-size: 13px; } }

/* v3.5.6 — تمييز تنقل لوحة المفاتيح في اقتراحات البحث */
.ajp-live-search-item:focus-visible { position: relative; z-index: 1; background: var(--bg-light); outline: 2px solid var(--accent-gold); outline-offset: -2px; }

/* ============================================================
   v3.7.1 — صقل الهوية الإخبارية للرئيسية وصفحة المقال
   ============================================================ */
:root {
    --ajp-article-width: 1080px;
    --ajp-media-width: 960px;
}

body.home {
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary-blue) 4%, var(--bg-light)) 0, var(--bg-light) 260px);
}
body.home .newsroom-section {
    border-color: color-mix(in srgb, var(--border-color) 86%, var(--primary-blue));
    box-shadow: var(--ajp-shadow-soft);
}
body.home .newsroom-header {
    margin-bottom: clamp(16px, 2vw, 22px);
}
body.home .newsroom-title-wrap .sub-label {
    color: var(--primary-blue);
    font-size: 11px;
    letter-spacing: .02em;
}
body.home .newsroom-title-wrap h2 {
    font-size: clamp(21px, 2.2vw, 28px);
    line-height: 1.35;
}
body.home .view-all-link { min-height: 40px; }
body.home .post-card {
    box-shadow: 0 3px 14px rgba(11, 30, 51, .045);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
body.home .post-card-thumb-frame { background: var(--bg-light); }
body.home .post-card-body { padding: 15px 16px 17px; }
body.home .post-card-title {
    font-size: clamp(16px, 1.2vw, 18px);
    line-height: 1.65;
}
body.home .post-card-title a { -webkit-line-clamp: 3; }
body.home .newsroom-main-card img {
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
}
body.home .newsroom-side-thumb {
    display: block;
    width: 132px;
    height: auto;
    aspect-ratio: 16 / 10;
}
body.home .style-card-box {
    background: var(--card-bg);
    box-shadow: 0 3px 14px rgba(11, 30, 51, .04);
}
body.home .style-card-box img {
    height: auto;
    aspect-ratio: 16 / 9;
}
body.home .mag-card {
    background: var(--card-bg);
    box-shadow: 0 3px 14px rgba(11, 30, 51, .04);
}
body.home .mag-card img {
    width: 180px;
    height: auto;
    aspect-ratio: 16 / 10;
}
body.home .post-card:focus-within {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent-red) 55%, var(--border-color));
    box-shadow: var(--ajp-shadow-hover);
}
body.dark-mode.home .newsroom-section,
body.dark-mode.home .post-card,
body.dark-mode.home .style-card-box,
body.dark-mode.home .mag-card { box-shadow: 0 4px 18px rgba(0, 0, 0, .16); }

.single-article {
    max-width: var(--ajp-article-width);
    margin-inline: auto;
    padding: clamp(24px, 3.6vw, 44px);
    border-radius: 18px;
    box-shadow: var(--ajp-shadow-soft);
}
.single-article.dz-article-full { max-width: 1280px; }
/* v3.9.1: أُزيلت هذه القاعدة التي كانت السبب الجذري لتضخم العنوان:
   clamp(29px,3.5vw,43px) + max-width:26ch = خط 43px داخل مساحة 26 حرفاً فقط،
   فيتكدّس العنوان في 5–6 أسطر ضخمة. العنوان الآن يُدار من القاعدة الأساسية أعلاه */
.single-article .dz-article-subtitle {
    max-width: 70ch;
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.75;
}
.single-article .dz-article-meta-line {
    width: fit-content;
    margin-block: 14px 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    color: color-mix(in srgb, var(--text-muted) 88%, var(--text-dark));
    line-height: 1.7;
}
.single-article .ajp-article-reading-meta {
    margin-block: -2px 22px;
    padding-inline-start: 12px;
}
.single-article .dz-article-featured { margin-block: 24px; }
.single-article .dz-article-featured .dz-featured-img {
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(11, 30, 51, .1);
}
.single-article .dz-article-featured .dz-featured-caption {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    color: var(--text-muted);
    line-height: 1.7;
}
.single-article .apd-hero {
    margin-bottom: 26px;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(11, 30, 51, .14);
}
/* v4.0.0 — أدوات القراءة والفهرس على نفس عرض مساحة المقال (توازن الحواف) */
.single-article .ajp-reading-tools,
.single-article .ajp-article-toc {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}
/* v4.0.0 — المرحلة الأولى (إصلاح توزيع نص المقال):
   كانت القاعدة القديمة تحصر كل فقرة في 78ch وتوسطها (margin-inline:auto)
   فيظهر النص محشوراً في منتصف المساحة بحواف فارغة كبيرة على الجانبين.
   الآن: حاوية النص تمتد بكامل عرض مساحة المقال، مع هوامش داخلية مريحة،
   والمحاذاة لليمين. الخطوط وأحجامها وارتفاع الأسطر كما هي تماماً (3.9.2). */
.single-article .dz-article-content {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    box-sizing: border-box;
    padding-inline: 24px;
    font-size: clamp(18px, 1.4vw, 20px);
    line-height: 1.9;
}
.single-article .dz-article-content p {
    text-align: right;
}
/* استثناءات صريحة: الاقتباسات وتعليقات الصور وبرامج الجدول لا تتأثر
   بقاعدة محاذاة الفقرات (نفس سلوك 3.9.2 حرفياً) */
.single-article .dz-article-content blockquote p { text-align: start; }
.single-article .dz-article-content figcaption,
.single-article .dz-article-content figcaption p { text-align: center; }
.single-article .dz-article-content h2,
.single-article .dz-article-content h3 { scroll-margin-top: 90px; }
.single-article .dz-article-content figure img { box-shadow: 0 6px 20px rgba(11, 30, 51, .08); }
/* v4.0.0 — كتل المقال الشقيقة تمتد بنفس عرض مساحة المقال (توحيد الحواف) */
.single-article .apd-shortlink,
.single-article .apd-related,
.single-article .dz-article-related,
.single-article .apd-tags,
.single-article .apd-pn {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}
/* ============================================================
   v3.9.2 — شريط مشاركة المقال: أنماط المكوّن كاملة هنا في style.css
   السبب الجذري الذي أُصلح: كانت كل قواعد هذا الشريط في fb-composer.css
   الذي لا يُحمَّل إلا للمحررين — فيرى الزائر وسوم الشريط عارية بلا تنسيق:
   صندوق ضخم وأيقونات صغيرة متراكبة في زاوية واحدة. المكوّن الآن واحد
   وموحّد للزائر والمحرر، وفي الوضعين الفاتح والداكن.
   ============================================================ */
.dz-art-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 16px;
    margin: 0 0 22px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 3px 14px rgba(11, 30, 51, .045);
}
.single-article .dz-art-bar {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    margin-block: 0 22px;
}
.dz-ab-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}
.dz-ab-share-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-inline-end: 6px;
    color: var(--text-dark);
    font-size: 14.5px;
    font-weight: 800;
    white-space: nowrap;
}
.dz-ab-share-label svg { color: var(--text-muted); }
.dz-ab-net {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, filter .15s, box-shadow .15s;
}
.dz-ab-net svg { display: block; }
.dz-ab-net:hover { transform: translateY(-2px); filter: brightness(1.07); }
.dz-ab-net:focus-visible { outline: 2px solid var(--primary-blue); outline-offset: 2px; }
.dz-ab-fb { background: #1877f2; }
.dz-ab-x  { background: #16191d; }
.dz-ab-wa { background: #25d366; }
.dz-ab-tg { background: #229ed9; }
.dz-ab-ms { background: linear-gradient(135deg, #00b2ff, #006aff); }
.dz-ab-em { background: #5b6b82; }
body.dark-mode .dz-ab-x { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.dz-ab-ms.is-done { box-shadow: 0 0 0 3px rgba(26, 156, 83, .45); }
.dz-ab-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.dz-ab-tools:empty { display: none; }
.dz-ab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-light);
    color: var(--text-dark);
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.dz-ab-btn svg { flex: 0 0 auto; }
.dz-ab-btn:hover {
    border-color: var(--primary-blue);
    background: color-mix(in srgb, var(--primary-blue) 8%, var(--card-bg));
    color: var(--primary-blue);
}
.dz-ab-btn:focus-visible { outline: 2px solid var(--accent-red); outline-offset: 2px; }
.dz-ab-toggle { background: #1b2430; border-color: #1b2430; color: #fff; }
.dz-ab-toggle:hover { background: #0e1720; border-color: #0e1720; color: #fff; }
.dz-ab-toggle .dz-ab-t-open,
.dz-ab-toggle .dz-ab-t-close { display: inline-flex; align-items: center; gap: 7px; }
.dz-ab-toggle .dz-ab-t-close { display: none; }
.dz-ab-toggle .dz-ab-x { font-weight: 900; font-size: 12px; line-height: 1; }
.dz-ab-toggle.is-open { background: var(--accent-red); border-color: var(--accent-red); }
.dz-ab-toggle.is-open:hover { background: #c62828; border-color: #c62828; }
.dz-ab-toggle.is-open .dz-ab-t-open { display: none; }
.dz-ab-toggle.is-open .dz-ab-t-close { display: inline-flex; }
.dz-ab-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color .15s, color .15s, box-shadow .15s;
}
.dz-ab-round:hover { border-color: var(--primary-blue); color: var(--primary-blue); }
.dz-ab-round:focus-visible { outline: 2px solid var(--accent-red); outline-offset: 2px; }
.dz-ab-round.is-done { box-shadow: 0 0 0 3px rgba(26, 156, 83, .4); color: #1a9c53; border-color: #1a9c53; }
@media (max-width: 640px) {
    .dz-art-bar { justify-content: center; padding: 10px 12px; }
    .dz-ab-share { justify-content: center; }
}
.single-article .dz-article-share {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
}
.single-article .apd-share-extra {
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border-color: var(--border-color) !important;
    background: var(--bg-light) !important;
    color: var(--primary-blue) !important;
}
.single-article .apd-share-extra:hover {
    border-color: var(--primary-blue) !important;
    background: color-mix(in srgb, var(--primary-blue) 10%, var(--card-bg)) !important;
}
/* v3.9.2: صندوق الكاتب على نمط المرجع التحريري المطلوب (لقطة 26-11):
   بطاقة محايدة بلا تدرج ذهبي، صورة دائرية بإطار أخضر، الاسم + شارة الدور
   الحمراء في صف واحد، النبذة تحت الاسم مباشرة، وروابط في سطر مستقل.
   المحاذاة والترتيب يلتزمان RTL تلقائياً، ويتكدّس عمودياً على الهاتف */
.single-article .ajp-author-box {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 22px 24px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--ajp-shadow-soft);
}
.single-article .apd-author-avatar { flex: 0 0 auto; }
.single-article .apd-author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-green);
    object-fit: cover;
    background: var(--bg-light);
    box-shadow: 0 4px 12px rgba(11, 30, 51, .12);
}
.single-article .apd-author-info {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}
.single-article .ajp-author-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}
.single-article .ajp-author-box strong {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
}
.single-article .ajp-author-box strong a { color: var(--text-dark); }
.single-article .apd-author-role {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
.single-article .ajp-author-bio {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.9;
}
.single-article .ajp-author-box p { color: var(--text-muted); line-height: 1.85; }
.single-article .ajp-author-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.single-article .ajp-author-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-light);
    color: var(--primary-blue);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.single-article .ajp-author-links a:hover {
    border-color: var(--primary-blue);
    background: color-mix(in srgb, var(--primary-blue) 8%, var(--card-bg));
    color: var(--primary-blue);
    text-decoration: none;
}
.single-article .ajp-author-links a:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}
.single-article .apd-author-more {
    align-self: flex-start;
    color: var(--primary-blue);
    font-size: 13.5px;
    font-weight: 800;
}
@media (max-width: 640px) {
    .single-article .ajp-author-box { flex-direction: column; align-items: center; text-align: center; }
    .single-article .apd-author-avatar img { width: 72px; height: 72px; }
    .single-article .apd-author-info { align-items: center; }
    .single-article .ajp-author-head,
    .single-article .ajp-author-links { justify-content: center; }
}
.single-article .apd-tag {
    border-color: var(--border-color);
    background: var(--bg-light);
    color: var(--text-muted);
}
.single-article .apd-tag:hover {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: #fff;
}
.single-article .apd-tag-cat {
    border-color: var(--primary-blue);
    background: var(--primary-blue);
    color: #fff;
}
.single-article .apd-pn-card {
    border-color: var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 3px 14px rgba(11, 30, 51, .04);
}
.single-article .apd-pn-title { color: var(--text-dark); }
.single-article .apd-pn-card:hover { border-color: var(--accent-gold); }
body.dark-mode .single-article,
body.dark-mode .comments-area { box-shadow: 0 5px 22px rgba(0, 0, 0, .18); }
body.dark-mode .single-article .dz-art-bar,
body.dark-mode .single-article .apd-pn-card { box-shadow: 0 4px 18px rgba(0, 0, 0, .16); }
body.dark-mode .single-article .dz-featured-img,
body.dark-mode .single-article .dz-article-content figure img { box-shadow: 0 8px 24px rgba(0, 0, 0, .24); }
body.dark-mode.home .newsroom-title-wrap .sub-label,
body.dark-mode.home .view-all-link { color: #93c5fd; }
body.dark-mode .single-article .dz-article-meta-line a,
body.dark-mode .comments-area .comment-meta a,
body.dark-mode .comments-area .comment-list .reply a { color: #93c5fd; }
body.dark-mode .single-article .apd-share-extra { color: #93c5fd !important; }

.comments-area {
    width: 100%;
    max-width: 100%;
    margin-block: 34px;
    margin-inline: 0;
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: var(--ajp-shadow-soft);
}
.comments-title,
.comment-reply-title {
    margin-bottom: 20px;
    padding-inline-start: 12px;
    border-inline-start: 4px solid var(--accent-gold);
    color: var(--text-dark);
    font-size: 22px;
    line-height: 1.5;
}
.comment-list .comment-body {
    padding: 18px;
    border-color: var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
}
.comment-list .children { margin-inline-start: 28px; }
.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    line-height: 1.7;
}
.comment-meta .comment-author { color: var(--text-dark); font-weight: 800; }
.comment-meta a { color: var(--primary-blue); }
.comment-content { margin-top: 10px; line-height: 1.85; }
.comment-content p { margin-block: 0 .8em; }
.comment-list .reply a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--card-bg);
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}
.comment-form {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-light);
}
.comment-form label { color: var(--text-dark); font-size: 13px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    min-height: 44px;
    border-color: var(--border-color);
    border-radius: 9px;
    background: var(--card-bg);
    color: var(--text-dark);
}
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form .submit {
    min-height: 44px;
    padding: 11px 24px;
    border-radius: 9px;
    background: var(--primary-blue);
}
.comment-form .submit:hover { background: var(--primary-dark); }

@media (max-width: 782px) {
    body.home .newsroom-header { flex-wrap: wrap; gap: 10px; }
    body.home .newsroom-title-wrap h2 { font-size: 21px; }
    body.home .view-all-link { min-height: 36px; }
    body.home .post-card-body { padding: 12px 13px 14px; }
    body.home .newsroom-side-thumb { width: 104px; }
    body.home .mag-card img { width: 132px; }

    .single-article {
        margin-block: 18px;
        padding: 22px 18px;
        border-radius: 14px;
    }
    .single-article > h1 { font-size: clamp(24px, 4.6vw, 27px); }
    .single-article .dz-article-meta-line { width: 100%; }
    .single-article .dz-article-content { font-size: 18px; line-height: 1.85; padding-inline: 14px; }
    .single-article .ajp-author-box { gap: 12px; padding: 16px; }
    .single-article .apd-author-avatar img { width: 56px; height: 56px; }
    .comments-area { margin-block: 24px; padding: 20px 16px; }
    .comment-list .children { margin-inline-start: 14px; }
    .comment-form { padding: 16px; }
}
@media (max-width: 480px) {
    .single-article { padding: 18px 14px; }
    .single-article .dz-article-meta-line { font-size: 11.5px; }
    .single-article .dz-art-bar { justify-content: center; }
    .single-article .apd-pn-thumb { width: 72px; }
    .comments-area { padding: 18px 13px; }
    .comments-title,
    .comment-reply-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    body.home .post-card,
    .single-article .dz-featured-img,
    .single-article .apd-pn-card { transition: none !important; }
}
@media print {
    .single-article,
    .comments-area { max-width: none; padding: 0; border: 0; box-shadow: none; }
    .single-article .dz-article-content { max-width: none; font-size: 11pt; line-height: 1.6; }
    .comment-form { display: none; }
}

/* ============================================================
   Aljazair Press 3.9.1/3.9.2 — مواصفة عنوان المقال المفرد النهائية
   ------------------------------------------------------------
   هذه هي القاعدة الحاكمية الوحيدة بعد تنظيف القواعد الخمس المتضاربة
   أعلاه (38px/43px و26ch/30ch ووزن 900 وتباعد أحرف سالب).
   الأحجام (نطاقات طلب العميل):
     حاسوب كبير 32px / حاسوب محمول 30px (2.2vw عند 1366px)
     لوحي 27px  / هاتف 24px
   والقيم كلها قابلة للتجاوز من إعدادات «صفحة المقال» في لوحة القالب
   عبر نفس المتغيرات: --ajp-title-max / --ajp-title-min / --ajp-title-mobile /
   --ajp-title-weight / --ajp-title-line
   ============================================================ */
.single-article > h1 {
    font-size: clamp(var(--ajp-title-min, 24px), 2.2vw, var(--ajp-title-max, 32px));
    line-height: var(--ajp-title-line, 1.45);
    letter-spacing: 0;
    word-spacing: normal;
    overflow-wrap: break-word;
}
@media (max-width: 1024px) {
    .single-article > h1 {
        font-size: var(--ajp-title-tablet, 27px);
    }
}
@media (max-width: 640px) {
    .single-article > h1 {
        font-size: var(--ajp-title-mobile, 24px);
    }
}

/* ============================================================
   Aljazair Press 4.0.0 — PHASE 1: ARTICLE LAYOUT & CHROME FIXES
   ------------------------------------------------------------
   1) قواعد الحاويات القياسية المطلوبة في البرومبت الرئيسي — مطبَّقة
      على المحددات الفعلية للقالب (dz-article-content داخل single-article)
      وعلى المحددات القياسية المذكورة (entry-content / ajp-article-content /
      ajp-article-body) لضمان التوافق مع أي قالب ابن أو إضافة.
   2) الكلاس الموحد .ajp-article-toolbar لشريط أدوات المقال — ظاهر
      افتراضياً دون أي اعتماد على JavaScript، ومعادلات صريحة لكل خصائص
      display/visibility/opacity/position/z-index/overflow/pointer-events
      التي قد تخفي الشريط في بعض المتصفحات أو إضافات المتصفح.
   3) هوامش داخلية مريحة: 24px للحاسوب و 14px للهواتف (<768px).
   الخطوط والأحجام وارتفاع الأسطر وأوزانها غير ممسوصة إطلاقاً.
   ============================================================ */
.single-post .entry-content,
.single-post .ajp-article-content,
.single-post .ajp-article-body {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
    box-sizing: border-box !important;
    padding-inline: 24px !important;
}
.single-post .entry-content p,
.single-post .ajp-article-content p,
.single-post .ajp-article-body p {
    text-align: right !important;
}
@media (max-width: 767px) {
    .single-post .entry-content,
    .single-post .ajp-article-content,
    .single-post .ajp-article-body {
        padding-inline: 14px !important;
    }
}

/* --- الكلاس الموحد لشريط أدوات المقال (حفظ + مادة مصورة + نسخ الرابط + مشاركة) ---
   يُطبَّق على عنصر .dz-art-bar الموجود فعلاً في inc/fb-composer.php.
   الظهور افتراضي بلا JavaScript، مع إلغاء أي سبب محتمل للإخفاء:
   display / visibility / opacity / position / z-index / overflow /
   pointer-events / clip-path / filter / transform / max-height */
.ajp-article-toolbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    flex-wrap: wrap;
    position: static;
    z-index: auto;
    overflow: visible;
    pointer-events: auto;
    transform: none;
    clip-path: none;
    filter: none;
    max-height: none;
    contain: none;
}
/* احترام الإخفاء المقصود فقط (لا فرض ظهور على عنصر مخفي عمداً) */
.ajp-article-toolbar[hidden],
.ajp-article-toolbar.is-off {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/* زر نسخ الرابط وأدوات الشريط تبقى قابلة للنقر فوق كل العناصر */
.ajp-article-toolbar .dz-ab-tools,
.ajp-article-toolbar .dz-ab-share { pointer-events: auto; }
.ajp-article-toolbar .dz-ab-btn,
.ajp-article-toolbar .dz-ab-round,
.ajp-article-toolbar .dz-ab-net,
.ajp-article-toolbar .dz-ab-toggle { pointer-events: auto; cursor: pointer; }

/* ============================================================
   Aljazair Press 4.0.0 — PHASE 2: READER EXPERIENCE
   ------------------------------------------------------------
   1) صندوق النقاط الرئيسية / ملخص الخبر (ajp-takeaways)
   2) بطاقة التوثيق التحريري (ajp-editorial-credit)
   3) شريط الإجراءات العائم للهواتف (ajp-mobile-actions) + toast
   كلها متوافقة RTL والوضع الليلي، وبلا أي تغيير في الخطوط.
   ============================================================ */

/* --- 1) النقاط الرئيسية --- */
.ajp-takeaways {
    margin: 0 0 26px;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    border-inline-start: 4px solid var(--accent-gold);
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: var(--ajp-shadow-soft, 0 6px 22px rgba(11, 30, 51, .05));
}
.ajp-takeaways__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent-gold);
}
.ajp-takeaways__title {
    margin: 0;
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
}
.ajp-takeaways__list {
    margin: 0;
    padding: 0 20px 0 0;
}
.ajp-takeaways__list li {
    margin: 7px 0;
    padding-inline-start: 4px;
    color: var(--text-dark);
    font-size: 1em;
    line-height: 1.9;
}
.ajp-takeaways__list li::marker { color: var(--accent-gold); }
body.dark-mode .ajp-takeaways { background: var(--card-bg); border-color: var(--border-color); }
body.dark-mode .ajp-takeaways__list li { color: var(--text-dark); }

/* --- 2) بطاقة التوثيق التحريري --- */
.ajp-editorial-credit {
    margin: 26px 0;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
}
.ajp-credit-title {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0;
}
.ajp-credit-grid { display: grid; gap: 7px; margin: 0; }
.ajp-credit-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ajp-credit-row dt {
    min-width: 110px;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
}
.ajp-credit-row dd {
    margin: 0;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
}
.ajp-credit-row dd a { color: var(--primary-blue); }
.ajp-credit-row dd a:hover { text-decoration: underline; }
.ajp-credit-role { color: var(--text-muted); font-weight: 600; font-size: 13px; }
body.dark-mode .ajp-editorial-credit { background: var(--card-bg); }
body.dark-mode .ajp-credit-row dd { color: var(--text-dark); }

/* --- 3) شريط الإجراءات العائم للهواتف --- */
/* مخفي تماماً على الحاسوب: لا يظهر إلا على الشاشات ≤768px */
.ajp-mobile-actions {
    display: none !important;
}
@media (max-width: 768px) {
    .ajp-mobile-actions {
        display: flex !important;
        position: fixed;
        inset-inline: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 9800;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: color-mix(in srgb, var(--card-bg) 92%, transparent);
        backdrop-filter: blur(10px);
        box-shadow: 0 10px 30px rgba(11, 30, 51, .18);
    }
}
.ajp-mobile-actions[hidden] { display: none !important; }
.ajp-ma-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 4px 9px;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--bg-light);
    color: var(--text-dark);
    font: inherit;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.ajp-ma-btn:active { transform: scale(.94); }
.ajp-ma-btn:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 2px; }
.ajp-ma-btn.is-done { border-color: var(--accent-green); color: var(--accent-green); }
.ajp-ma-btn.is-wa { color: #25d366; border-color: color-mix(in srgb, #25d366 45%, var(--border-color)); }
.ajp-ma-btn.is-fb { color: #1877f2; border-color: color-mix(in srgb, #1877f2 45%, var(--border-color)); }
.ajp-ma-sep {
    width: 1px;
    align-self: stretch;
    margin: 4px 2px;
    background: var(--border-color);
}
/* رسالة النجاح/الفشل العائمة — فوق الشريط، بلا حجب للنص */
.ajp-ma-toast {
    position: fixed;
    inset-inline: 16px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 9801;
    padding: 10px 16px;
    border-radius: 12px;
    background: #0b1e33;
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}
.ajp-ma-toast[hidden] { display: none !important; }
.ajp-ma-toast.is-error { background: var(--accent-red); }
@media (max-width: 768px) {
    /* مساحة تنفس أسفل المقال حتى لا يغطي الشريط آخر سطر عند النهاية */
    .single-article { padding-bottom: calc(22px + 64px); }
}
body.dark-mode .ajp-ma-btn { background: rgba(255, 255, 255, .06); border-color: var(--border-color); color: var(--text-dark); }
body.dark-mode .ajp-mobile-actions { background: color-mix(in srgb, var(--card-bg) 94%, transparent); }
body.dark-mode .ajp-ma-toast { background: #1b2a44; }

/* ============================================================
   v4.0.3 — الوضع الليلي: عناوين متن المقال كانت داكنة على خلفية داكنة.
   editorial-frontend.css يثبّت ألوان h2/h3/dz-lead (#0b1e33 / #15406b)
   بلا طبقة ليلية، ويُحمَّل بعد style.css فتتجاوز قواعده متغيرات الليل.
   الإصلاح هنا فقط للنص الموضوع على خلفية الصفحة الداكنة مباشرة —
   مكونات الصناديق الفاتحة (إحصاءات/تنبيهات/جداول) تبقى كما هي لأنها
   مقروءة أصلاً في الوضعين. لا تغيير إطلاقاً في الوضع الفاتح.
   ============================================================ */
body.dark-mode .dz-article-content h2,
html[data-theme="dark"] .dz-article-content h2 {
    color: var(--text-dark);
}
body.dark-mode .dz-article-content h3,
html[data-theme="dark"] .dz-article-content h3 {
    color: #a9c7e8;
}
body.dark-mode .dz-article-content .dz-lead,
html[data-theme="dark"] .dz-article-content .dz-lead {
    color: var(--text-dark);
}

/* ============================================================
   v4.0.5 — البطاقة الموحدة «الكاتب والتوثيق التحريري»
   ------------------------------------------------------------
   تجمع بطاقة الكاتب وبطاقة التوثيق التحريري في مكوّن صحفي واحد
   متناسق مع هوية القالب. بديل عن البطاقتين المنفصلتين القديمتين
   (.ajp-author-box و .ajp-editorial-credit) دون حذفهما — تبقيان
   متاحتين لأي استدعاء خارجي. البنية: منطقة كاتب + منطقة توثيق
   تحريري، تتوزع أفقياً على الحاسوب وتتجمع عمودياً على الهاتف.
   ============================================================ */

.single-article .ajp-author-editorial-card {
    width: 100%;
    max-width: 100%;
    margin: 26px 0;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--ajp-shadow-soft, 0 6px 22px rgba(11, 30, 51, .05));
    overflow: hidden;
}

/* رأس البطاقة: شارة + عنوان */
.single-article .ajp-ae-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-blue) 6%, var(--card-bg)) 0%, var(--card-bg) 100%);
    border-bottom: 1px solid var(--border-color);
}
.single-article .ajp-ae-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary-blue);
    color: #fff;
    flex: 0 0 auto;
}
.single-article .ajp-ae-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    /* ضمان وراثة اللون في كل المتصفحات حتى لو لم يُورث currentColor */
    fill: none;
    stroke: currentColor;
    color: #fff;
}
.single-article .ajp-ae-title {
    margin: 0;
    color: var(--text-dark);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.5;
}

/* جسم البطاقة: توزيع أفقي بين الكاتب والتوثيق */
.single-article .ajp-ae-body {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
}
.single-article .ajp-ae-author,
.single-article .ajp-ae-editorial {
    padding: 20px 22px;
    min-width: 0;
}
.single-article .ajp-ae-editorial {
    border-inline-start: 1px solid var(--border-color);
    background: var(--bg-light);
}

/* عنوان كل قسم */
.single-article .ajp-ae-section-title {
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-gold);
    color: var(--text-dark);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0;
}

/* ============ منطقة الكاتب ============ */
.single-article .ajp-ae-author-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}
.single-article .ajp-ae-author-row:last-of-type {
    margin-bottom: 0;
}
.single-article .ajp-ae-author-row--multi {
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}
.single-article .ajp-ae-avatar {
    flex: 0 0 auto;
}
.single-article .ajp-ae-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--accent-green);
    object-fit: cover;
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(11, 30, 51, .12);
    display: block;
}
.single-article .ajp-ae-author-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}
.single-article .ajp-ae-author-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-width: 0;
}
.single-article .ajp-ae-author-name {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text-dark);
}
.single-article .ajp-ae-author-name a {
    color: var(--text-dark);
    text-decoration: none;
}
.single-article .ajp-ae-author-name a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.single-article .ajp-ae-author-role {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-red);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}
.single-article .ajp-ae-bio {
    margin: 0;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.85;
}
.single-article .ajp-ae-author-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}
.single-article .ajp-ae-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.single-article .ajp-ae-link:hover {
    border-color: var(--primary-blue);
    background: color-mix(in srgb, var(--primary-blue) 8%, var(--card-bg));
    color: var(--primary-blue);
    text-decoration: none;
}
.single-article .ajp-ae-link:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}
.single-article .ajp-ae-link-archive {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}
.single-article .ajp-ae-link-archive:hover {
    background: var(--primary-dark, #0a1a2c);
    border-color: var(--primary-dark, #0a1a2c);
    color: #fff;
}
.single-article .ajp-ae-count {
    margin: 12px 0 0;
    padding: 8px 12px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--accent-gold) 10%, var(--card-bg));
    color: var(--text-dark);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
}

/* ============ منطقة التوثيق التحريري ============ */
.single-article .ajp-ae-grid {
    display: grid;
    gap: 9px;
    margin: 0;
}
.single-article .ajp-ae-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.single-article .ajp-ae-row dt {
    min-width: 100px;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 700;
    flex: 0 0 auto;
}
.single-article .ajp-ae-row dd {
    margin: 0;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.7;
    flex: 1 1 auto;
    min-width: 0;
}
.single-article .ajp-ae-row dd a {
    color: var(--primary-blue);
    text-decoration: none;
}
.single-article .ajp-ae-row dd a:hover {
    text-decoration: underline;
}
.single-article .ajp-ae-row time {
    color: var(--text-dark);
}

/* ============ الوضع الليلي ============ */
body.dark-mode .single-article .ajp-author-editorial-card,
html[data-theme="dark"] .single-article .ajp-author-editorial-card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
body.dark-mode .single-article .ajp-ae-header,
html[data-theme="dark"] .single-article .ajp-ae-header {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary-blue) 14%, var(--card-bg)) 0%, var(--card-bg) 100%);
}
body.dark-mode .single-article .ajp-ae-editorial,
html[data-theme="dark"] .single-article .ajp-ae-editorial {
    background: color-mix(in srgb, var(--bg-light) 80%, transparent);
}
body.dark-mode .single-article .ajp-ae-avatar img,
html[data-theme="dark"] .single-article .ajp-ae-avatar img {
    background: var(--bg-light);
}
body.dark-mode .single-article .ajp-ae-count,
html[data-theme="dark"] .single-article .ajp-ae-count {
    background: color-mix(in srgb, var(--accent-gold) 16%, var(--card-bg));
}

/* ============ التجاوب مع الهاتف واللوحي ============ */
@media (max-width: 768px) {
    .single-article .ajp-ae-body {
        grid-template-columns: 1fr;
    }
    .single-article .ajp-ae-editorial {
        border-inline-start: 0;
        border-top: 1px solid var(--border-color);
    }
    .single-article .ajp-ae-header {
        padding: 12px 16px;
    }
    .single-article .ajp-ae-author,
    .single-article .ajp-ae-editorial {
        padding: 16px;
    }
    .single-article .ajp-ae-title {
        font-size: 15.5px;
    }
    .single-article .ajp-ae-author-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .single-article .ajp-ae-author-info {
        align-items: center;
    }
    .single-article .ajp-ae-author-head,
    .single-article .ajp-ae-author-links {
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .single-article .ajp-ae-avatar img {
        width: 60px;
        height: 60px;
    }
    .single-article .ajp-ae-author-name {
        font-size: 15.5px;
    }
    .single-article .ajp-ae-row dt {
        min-width: 88px;
        font-size: 11.5px;
    }
    .single-article .ajp-ae-row dd {
        font-size: 13px;
    }
}

/* ============================================================
   v4.0.5 — إصلاح توافق أيقونات وأزرار شريط أدوات المقال عبر المتصفحات
   ------------------------------------------------------------
   السبب الجذري المُحدَّد من الكود:
   1) أزرار dz-ab-* تحتوي SVG داخلية بنمط stroke="currentColor"، لكن
      بعض المتصفحات (خاصة Safari وiOS) لا تُورّث currentColor بشكل
      موثوق عبر عناصر SVG المضمنة في أزرار، فلا تظهر الأيقونة.
   2) النقر داخل عنصر SVG (على <path>) يعتمد على Element.closest()
      الذي قد لا يعمل على عناصر SVG في إصدارات Safari/iOS القديمة،
      فيفشل معالج النقر ولا يُنفّذ الحفظ.
   3) أيقونة dz-ab-x (✕) نصية داخل span — قد تظهر مربعة على بعض
      الأنظمة إن لم يُحمَّل الخط العربي.

   الإصلاح:
   - pointer-events: none على كل SVG داخل الأزرار: النقر دائماً يقع
     على الزر نفسه (button) لا على عناصر SVG الداخلية، فيعمل في كل
     المتصفحات دون اعتماد على closest() من داخل SVG.
   - فرض stroke و fill صريح من اللون الموروث على SVG داخل الأزرار،
     فلا تعتمد على currentColor وحده.
   - ضمان ظهور الأيقونة بأبعاد ثابتة وعرضها كـ inline-flex.
   - إضافة fallback لوني خلف الأيقونة (background) يضمن رؤية الزر
     حتى لو فشل تحميل SVG تماماً في متصفح نادر.
   ============================================================ */
.dz-ab-btn svg,
.dz-ab-round svg,
.dz-ab-net svg,
.dz-ab-toggle svg {
    pointer-events: none !important;
    display: inline-block;
    flex: 0 0 auto;
    /* الإصرار على وراثة اللون: يضمن ظهور الأيقونة في Safari وiOS */
    color: inherit;
    fill: none;
    stroke: currentColor;
}
/* الأيقونات المعبأة (network icons تستخدم fill) */
.dz-ab-net svg,
.dz-ab-fb svg,
.dz-ab-x svg,
.dz-ab-wa svg,
.dz-ab-tg svg,
.dz-ab-ms svg {
    fill: currentColor;
    stroke: none;
}
/* زر «حفظ»: ضمان ظهوره بوضوح حتى لو فشل تحميل SVG */
.dz-ab-save {
    position: relative;
    min-width: 40px;
    min-height: 40px;
}
.dz-ab-save > span {
    pointer-events: none;
}
/* زر «مادة مصورة»: نفس الضمان */
.dz-ab-toggle {
    position: relative;
    min-width: 40px;
    min-height: 40px;
}
.dz-ab-toggle > span {
    pointer-events: none;
}
.dz-ab-toggle .dz-ab-t-open > span:not(.dz-ab-x),
.dz-ab-toggle .dz-ab-t-close > span {
    pointer-events: none;
}
/* زر نسخ الرابط الدائري */
.dz-ab-copy {
    position: relative;
}
.dz-ab-copy svg {
    pointer-events: none !important;
}
/* التركيز الواضح على كل الأزرار في كل المتصفحات */
.dz-ab-btn:focus-visible,
.dz-ab-round:focus-visible,
.dz-ab-net:focus-visible,
.dz-ab-toggle:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}
