/* المتغيرات والأساسيات */
        :root {
            --primary-color: #272554;
            --accent-color: #D19F7D;
            --light-bg: #f4f5f7;
            --dark-bg: #13122b;
            --bronze-light: rgba(209, 159, 125, 0.08);
            --text-white: #ffffff;
    --transition: all 0.3s ease;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --article-font-size: 1.25rem;
        }

        .reading-content sup.footnote-ref {
            font-size: 0.72em;
            vertical-align: super;
            position: relative;
            top: 0.06em;
            line-height: 1;
            font-weight: 700;
            padding: 0 2px;
        }
        .reading-content sup.footnote-ref a {
            color: var(--accent-color);
            text-decoration: none;
        }
        .reading-content sup.footnote-ref a:hover {
            color: var(--primary-color);
            text-decoration: none;
        }

        .reading-content h1,
        .reading-content h2,
        .reading-content h3,
        .reading-content h4,
        .reading-content h5 {
            font-family: inherit;
            font-weight: 800;
            color: var(--primary-color);
            line-height: 1.35;
            margin: 1.2em 0 0.6em 0;
            padding-inline-start: 12px;
            border-inline-start: 4px solid var(--accent-color);
            scroll-margin-top: 110px;
        }
        .reading-content h1 { font-size: 1.55em; }
        .reading-content h2 { font-size: 1.35em; }
        .reading-content h3 { font-size: 1.2em; }
        .reading-content h4 { font-size: 1.1em; }
        .reading-content h5 { font-size: 1.02em; }

        .reading-content .footnotes-section {
            margin-top: 50px;
            padding-top: 18px;
            border-top: 1px solid #eee;
            font-size: 0.8em;
            color: #666;
        }
        .reading-content .footnotes-section h4 {
            margin: 0 0 12px 0;
            font-size: 1.05em;
            font-weight: 700;
            color: #333;
        }
        .reading-content .footnotes-section ol {
            list-style: none;
            margin: 0;
            padding: 0;
            line-height: 1.9;
        }
        .reading-content .footnotes-section li {
            margin-bottom: 10px;
        }
        .reading-content .footnotes-section li:target {
            background: var(--bronze-light);
            border-radius: 12px;
            padding: 10px 12px;
        }
        .reading-content .footnotes-section .footnote-text {
            color: #555;
        }
        .reading-content .footnotes-section a,
        .reading-content .footnotes-section a:hover {
            text-decoration: none;
        }
        .reading-content .footnotes-section .footnote-num {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 30px;
            height: 24px;
            padding: 0 8px;
            border-radius: 9px;
            background: var(--bronze-light);
            color: var(--primary-color);
            font-weight: 800;
            margin-inline-end: 8px;
            border: 1px solid rgba(209, 159, 125, 0.35);
        }
        .reading-content .footnotes-section .footnote-num:hover {
            background: rgba(209, 159, 125, 0.14);
            border-color: rgba(209, 159, 125, 0.5);
            color: var(--primary-color);
        }
        .reading-content .footnotes-section .footnote-dot {
            color: #999;
            margin-inline-end: 6px;
        }
        
        
    
/* alyamama-300 - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/alyamama-v2-arabic_latin-300.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* alyamama-regular - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/alyamama-v2-arabic_latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* alyamama-500 - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/alyamama-v2-arabic_latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* alyamama-600 - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/alyamama-v2-arabic_latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* alyamama-700 - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/alyamama-v2-arabic_latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* alyamama-800 - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/alyamama-v2-arabic_latin-800.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* alyamama-900 - arabic_latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Alyamama';
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/alyamama-v2-arabic_latin-900.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


        body { font-family: 'Alyamama', sans-serif; background-color: var(--light-bg); color: #333; }
        body.hindi-numbers-enabled {
    font-variant-numeric: proportional-nums;
    -webkit-font-feature-settings: "locl" 1, "pnum" 1;
    -moz-font-feature-settings: "locl" 1, "pnum" 1;
    font-feature-settings: "locl" 1, "pnum" 1;
}

        .section-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ddd; margin-bottom: 1.5rem; padding-bottom: 0.5rem; }
        .section-header h3 { color: var(--primary-color); font-weight: 700; margin: 0; position: relative; }
        .section-header h3::after { content: ''; position: absolute; bottom: -10px; right: 0; width: 100%; height: 3px; background-color: var(--accent-color); }

        .section-header-dark { border-bottom-color: rgba(255,255,255,0.1); }
        .section-header-dark h3 { color: var(--accent-color); }

        .navbar { background-color: var(--primary-color); box-shadow: 0 4px 10px rgba(0,0,0,0.15); z-index: 9999 !important;}
        .navbar-brand { color: var(--accent-color) !important; font-weight: 700; font-size: 1.8rem; }
        .nav-link { color: #fff !important; font-weight: 600; transition: 0.3s; }
        .nav-link:hover { color: var(--accent-color) !important; }

        /* --- تعديل قسم السلايدر فقط --- */
.hero-slider .carousel-item { 
    height: auto !important; /* إلغاء الـ 60vh والـ min-height */
    min-height: unset !important; 
    background: #000; 
}

.hero-slider img { 
    object-fit: cover; 
    height: auto !important; /* جعل الارتفاع مرناً يتبع الصورة */
    width: 100%; 
    opacity: 0.4; 
    display: block;
}

/* لضمان توسيط النص فوق الصورة بعد إلغاء الارتفاع الثابت */
.hero-caption { 
    top: 50%; 
    bottom: auto !important; 
    transform: translateY(-50%); 
}

        /* --- قسم دراسات ومقالات --- */
        .article-showcase {
            position: relative; 
            width: 100%; 
            aspect-ratio: 16 / 9; /* الحفاظ على الريشيو الأساسي لنظامك */
            overflow: hidden; 
            border-radius: 15px; 
            background: #000;
            display: block; 
        }
        .article-showcase img { width: 100%; height: 100%; object-fit: cover; position: absolute; transition: transform 0.8s ease; opacity: 0.85; }
        .article-showcase:hover img { transform: scale(1.05); opacity: 1; }
        .article-text-overlay {
            position: absolute; bottom: 0; left: 0; width: 100%; z-index: 2;
            background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
            padding: 50px 20px 20px;
        }
        
        .article-list-wrapper { display: flex; flex-direction: column; gap: 12px; height: 100%; }
        .article-list-item {
            display: flex; align-items: center; gap: 15px; padding: 12px 15px; border-radius: 8px; cursor: pointer; transition: 0.3s; background: #fff; border: 1px solid #eaeaea; text-decoration: none; color: inherit; flex: 1; 
        }
        .article-list-item:hover { background: #f8f9fa; border-color: var(--accent-color); transform: translateX(-5px); border-right: 4px solid var(--accent-color); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
        .article-list-item img { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; }

        /* --- قسم الصوتيات والكتاب --- */
        .audio-track {
            background: #fff; border-right: 4px solid var(--accent-color); padding: 15px; margin-bottom: 12px;
            display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-radius: 4px; transition: 0.2s;
        }
        .audio-track:hover { transform: translateX(-5px); background-color: #fcfcfc; }
        .author-box { text-align: center; padding: 15px; transition: 0.3s; cursor: pointer; }
        .author-box:hover { transform: translateY(-5px); }
        .author-box img { width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--accent-color); object-fit: cover; margin-bottom: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

        /* --- النافذة المرئية الرئيسية --- */
        .video-section {
            background-image: linear-gradient(135deg, var(--dark-bg) 0%, var(--primary-color) 100%);
            padding: 70px 0; color: #fff;
        }
        .main-video-player {
            position: relative; border-radius: 8px; overflow: hidden;
            background: #000; aspect-ratio: 16 / 9; box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
            border: 1px solid rgba(255,255,255,0.1); display: block;
        }
        .video-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; cursor: pointer; }
        .video-cover .video-bg { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: opacity 0.3s; }
        .video-cover:hover .video-bg { opacity: 0.8; }
        .play-btn-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 4.5rem; color: var(--accent-color); transition: 0.3s; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); z-index: 6; }
        .video-cover:hover .play-btn-overlay { transform: translate(-50%, -50%) scale(1.1); color: #fff; }
        .video-text-overlay { position: absolute; bottom: 0; left: 0; width: 100%; z-index: 6; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 70%, transparent 100%); pointer-events: none; padding-top: 50px; }
        .iframe-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; display: none; }
        .iframe-container iframe { width: 100%; height: 100%; border: none;  }

        .playlist-container { background: rgba(0,0,0,0.25); border-radius: 8px; padding: 15px; border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column; }
        .video-playlist { display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 0; margin: 0; }
        .video-list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); flex: 1; text-decoration: none; color: inherit; }
        .video-list-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(209, 159, 125, 0.5); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
        .video-list-item.active-video { background: rgba(209, 159, 125, 0.15); border-color: rgba(209, 159, 125, 0.3); border-right: 4px solid var(--accent-color); }
        .video-list-item .img-container { width: 110px; height: 70px; border-radius: 4px; overflow: hidden; flex-shrink: 0; position: relative; }
        .video-list-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
        .video-list-item:hover img { transform: scale(1.1); }
        .play-icon-hover { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.8); font-size: 1.5rem; opacity: 0; transition: 0.3s; }
        .video-list-item:hover .play-icon-hover { opacity: 1; color: var(--accent-color); }
        .video-list-item.active-video .play-icon-hover { opacity: 1; color: var(--accent-color); content: "\f04c"; } 

        .mini-video-player .play-btn-overlay { font-size: 3rem; }
        .mini-playlist { display: flex; flex-direction: column; gap: 10px; height: 100%; }
        .mini-list-item { display: flex; gap: 12px; padding: 10px; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; background: #fff; border: 1px solid #eee; text-decoration: none; color: inherit; flex: 1; align-items: center; }
        .mini-list-item:hover { background: #fff; border-color: var(--accent-color); transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
        .mini-list-item .img-container { width: 90px; height: 60px; border-radius: 4px; overflow: hidden; flex-shrink: 0; position: relative; }
        .mini-list-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
        .mini-list-item:hover img { transform: scale(1.1); }


        /* ============================================== */
        /* --- قسم الإصدارات (شامل الـ 4 أنماط) --- */
        /* ============================================== */
        
        .books-scroller { display: flex; overflow-x: auto; gap: 20px; padding: 20px 5px 40px 5px; scroll-snap-type: x mandatory; margin-bottom: 20px; }
        .books-scroller::-webkit-scrollbar { height: 6px; }
        .books-scroller::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 10px; }
        .books-scroller::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 10px; }

        /* 1. النمط الأصلي السابق (حر وبدون خلفية صندوق) */
        .publications-section-original { background: #fff; padding: 60px 0; border-top: 1px solid #eee; }
        .book-card-original { flex: 0 0 220px; scroll-snap-align: start; text-align: center; }
        .book-cover-original { position: relative; margin-bottom: 15px; transition: 0.3s; perspective: 1000px; }
        .book-cover-original img {
            width: 100%; height: 320px; object-fit: cover; border-radius: 2px 8px 8px 2px;
            box-shadow: -5px 10px 20px rgba(0,0,0,0.2), inset 4px 0 10px rgba(0,0,0,0.1); transition: 0.4s; border-left: 2px solid rgba(255,255,255,0.4);
        }
        .book-card-original:hover .book-cover-original img { transform: rotateY(-15deg) scale(1.05); box-shadow: -10px 15px 25px rgba(0,0,0,0.3); }
        .book-action-btn-original { background-color: var(--primary-color); color: #fff; border: none; padding: 6px 15px; font-size: 0.85rem; border-radius: 20px; transition: 0.3s; width: 100%; font-weight: bold;}
        .book-action-btn-original:hover { background-color: var(--accent-color); color: var(--primary-color); }


        /* 2. النمط الأول: خلفية رملية (الإصدارات العربية مع إحصائيات) */
        .publications-section-light { background-color: var(--bronze-light); padding: 60px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
        .book-card-v1 {
            flex: 0 0 250px; scroll-snap-align: start; text-align: center;
            background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #eaeaea; transition: 0.3s;
        }
        .book-card-v1:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.08); transform: translateY(-5px); border-color: var(--accent-color); }
        .book-cover-v1 { height: 320px; margin-bottom: 15px; perspective: 1000px; }
        .book-cover-v1 img {
            width: 100%; height: 100%; object-fit: cover; border-radius: 2px 8px 8px 2px;
            box-shadow: -4px 5px 12px rgba(0,0,0,0.15); transition: 0.4s; border-left: 3px solid rgba(255,255,255,0.6);
        }
        .book-card-v1:hover .book-cover-v1 img { transform: rotateY(-15deg) scale(1.03); box-shadow: -8px 12px 20px rgba(0,0,0,0.25); }
        .book-stats { 
            display: flex; justify-content: center; gap: 20px; color: #888; font-size: 0.8rem; 
            margin-bottom: 15px; border-top: 1px dashed #eee; padding-top: 12px;
        }
        .book-stats i { color: var(--accent-color); margin-left: 4px; }
        .book-actions-v1 { display: flex; gap: 8px; }
        .btn-read, .btn-download { flex: 1; padding: 8px; font-size: 0.85rem; border-radius: 4px; font-weight: bold; border: none; transition: 0.3s; cursor: pointer;}
        .btn-read { background: var(--primary-color); color: #fff; }
        .btn-read:hover { background: var(--accent-color); color: var(--primary-color); }
        .btn-download { background: #f0f0f0; color: var(--primary-color); border: 1px solid #ddd;}
        .btn-download:hover { background: var(--accent-color); color: #fff; border-color: var(--accent-color);}


        /* 3. النمط الثاني: خلفية زرقاء داكنة (الإصدارات الأجنبية Overlay داكن) */
        .publications-section-dark { background-color: var(--primary-color); padding: 60px 0; color: #fff; }
        .publications-section-dark .books-scroller::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
        
        .book-card-v2 {
            flex: 0 0 240px; scroll-snap-align: start;
            height: 350px; border-radius: 6px; overflow: hidden; position: relative;
            box-shadow: 0 10px 20px rgba(0,0,0,0.3); cursor: pointer; border: 1px solid rgba(255,255,255,0.1);
        }
        .book-card-v2 > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
        .book-card-v2:hover > img { transform: scale(1.1); filter: blur(3px); }
        .book-overlay-v2 {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(19, 18, 43, 0.85);
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            opacity: 0; transition: all 0.4s ease; padding: 20px; text-align: center;
        }
        .book-card-v2:hover .book-overlay-v2 { opacity: 1; }
        .book-overlay-v2 h6 { color: #fff; font-weight: bold; margin-bottom: 5px; transform: translateY(-20px); transition: 0.4s; line-height: 1.4;}
        .book-overlay-v2 p { color: var(--accent-color); font-size: 0.85rem; transform: translateY(-20px); transition: 0.4s; transition-delay: 0.1s; margin-bottom: 15px; margin-top: 10px}
        .book-card-v2:hover .book-overlay-v2 h6, .book-card-v2:hover .book-overlay-v2 p { transform: translateY(0); }
        .book-stats-v2 { 
            color: #ddd; font-size: 0.8rem; margin-bottom: 25px; display: flex; gap: 15px; 
            border-top: 1px solid rgba(255,255,255,0.2); padding-top: 10px;
        }
        .book-stats-v2 i { color: var(--accent-color); }
        .book-actions-v2 { display: flex; flex-direction: column; gap: 8px; width: 100%; transform: translateY(20px); transition: 0.4s; transition-delay: 0.2s;}
        .book-card-v2:hover .book-actions-v2 { transform: translateY(0); }
        .book-actions-v2 button { width: 100%; padding: 8px; font-size: 0.85rem; font-weight: bold; border-radius: 4px; border: none; cursor: pointer; transition: 0.3s;}
        .btn-read-v2 { background: var(--accent-color); color: var(--primary-color); }
        .btn-read-v2:hover { background: #fff; }
        .btn-download-v2 { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5) !important; }
        .btn-download-v2:hover { background: rgba(255,255,255,0.1); border-color: #fff !important;}
        
        
        .btn-download-custom {
  min-width: 115px;
  max-width: 200px;
  padding: 7px 7px !important;
  width: fit-content !important;
}

/* لجعل النص والمعلومات تأخذ مساحتها */
.file-info {
    flex-grow: 1; /* هذا سيجعل النصوص تأخذ كل المساحة المتاحة وتدفع الزر لليسار */
}

        
        /* 4. النمط الثالث (الجديد): خلفية بيضاء فاتحة (Overlay زجاجي فاتح) */
        .publications-section-white { background-color: #fff; padding: 60px 0; border-top: 1px solid #eee; }
        .book-card-v3 {
            flex: 0 0 240px; scroll-snap-align: start;
            height: 350px; border-radius: 8px; overflow: hidden; position: relative;
            box-shadow: 0 8px 25px rgba(0,0,0,0.08); cursor: pointer; border: 1px solid #eaeaea;
        }
        .book-card-v3 > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
        .book-card-v3:hover > img { transform: scale(1.1); }
        
        /* التأثير الزجاجي الفاتح (Glassmorphism) */
        .book-overlay-v3 {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(4px); /* تغبيش الخلفية */
            -webkit-backdrop-filter: blur(4px);
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            opacity: 0; transition: all 0.4s ease; padding: 20px; text-align: center;
        }
        .book-card-v3:hover .book-overlay-v3 { opacity: 1; }
        
        .book-overlay-v3 h6 { color: var(--primary-color); font-weight: bold; margin-bottom: 5px; transform: translateY(-20px); transition: 0.4s; line-height: 1.4;}
        .book-overlay-v3 p { color: #666; font-size: 0.85rem; transform: translateY(-20px); transition: 0.4s; transition-delay: 0.1s; margin-bottom: 15px;}
        .book-card-v3:hover .book-overlay-v3 h6, .book-card-v3:hover .book-overlay-v3 p { transform: translateY(0); }
        
        .book-stats-v3 { 
            color: #555; font-size: 0.8rem; margin-bottom: 25px; display: flex; gap: 15px; 
            border-top: 1px solid rgba(0,0,0,0.1); padding-top: 10px;
        }
        .book-stats-v3 i { color: var(--accent-color); }
        
        .book-actions-v3 { display: flex; flex-direction: column; gap: 8px; width: 100%; transform: translateY(20px); transition: 0.4s; transition-delay: 0.2s;}
        .book-card-v3:hover .book-actions-v3 { transform: translateY(0); }
        .book-actions-v3 button { width: 100%; padding: 8px; font-size: 0.85rem; font-weight: bold; border-radius: 4px; border: none; cursor: pointer; transition: 0.3s;}
        
        .btn-read-v3 { background: var(--primary-color); color: #fff; }
        .btn-read-v3:hover { background: var(--accent-color); color: var(--primary-color); }
        .btn-download-v3 { background: transparent; color: var(--primary-color); border: 1px solid rgba(39, 37, 84, 0.3) !important; }
        .btn-download-v3:hover { background: rgba(39, 37, 84, 0.05); border-color: var(--primary-color) !important;}


        /* --- الفوتر --- */
        footer { background-color: var(--dark-bg); color: #ccc; padding-top: 60px; border-top: 5px solid var(--accent-color); }
        footer h5 { color: var(--accent-color); font-weight: 700; margin-bottom: 20px; }
        footer a { color: #ccc; text-decoration: none; transition: 0.2s; line-height: 2; }
        footer a:hover { color: #fff; padding-right: 8px; }
        .social-links a { display: inline-block; width: 35px; height: 35px; background: rgba(255,255,255,0.05); color: var(--accent-color); text-align: center; line-height: 40px; border-radius: 50%; margin-left: 3px; transition: 0.3s; border: 1px solid rgba(209, 159, 125, 0.2); }
        .social-links a:hover { background: var(--accent-color); color: var(--primary-color); transform: translateY(-3px); }
        
         /* --- ويدجيت كتاب الأسبوع (في السايدبار) --- */
.widget-book-of-week {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1838 100%);
    border-radius: 8px;
    padding: 25px 20px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--accent-color);
}
.widget-book-cover {
    width: 110px;
    height: 160px;
    margin: 0 auto 15px;
    perspective: 1000px;
}
.widget-book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 6px 6px 2px;
    box-shadow: -5px 8px 15px rgba(0,0,0,0.4);
    border-left: 2px solid rgba(255,255,255,0.3);
    transition: transform 0.4s ease;
}
.widget-book-of-week:hover .widget-book-cover img {
    transform: rotateY(-15deg) scale(1.05);
}
.widget-btn-custom {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.85rem;
    padding: 8px 15px;
    border-radius: 20px;
    width: 100%;
    border: none;
    transition: 0.3s;
    margin-top: 10px;
}
.widget-btn-custom:hover {
    background-color: #fff;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* --- ويدجيت الكتب الأكثر تحميلاً (قائمة مصغرة) --- */
.widget-books-list .book-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}
.widget-books-list .book-list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.widget-books-list .book-list-item:hover {
    transform: translateX(-5px);
}
.widget-books-list .book-list-item img {
    width: 50px;
    height: 75px;
    object-fit: cover;
    border-radius: 2px 4px 4px 2px;
    box-shadow: -2px 3px 6px rgba(0,0,0,0.1);
    border-left: 1px solid rgba(255,255,255,0.5);
}
.widget-books-list .book-list-info h6 {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--primary-color);
    line-height: 1.4;
}
.widget-books-list .book-list-info small {
    font-size: 0.75rem;
    color: #888;
}
         /* ============================================== */
/* --- قسم المكتبة الصوتية المطور --- */
/* ============================================== */
.audio-main-player {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1838 100%);
    border-radius: 8px;
    padding: 40px 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.audio-wave-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
}
.audio-main-icon {
    width: 90px;
    height: 90px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    border: 1px solid rgba(209, 159, 125, 0.3);
    box-shadow: 0 0 20px rgba(209, 159, 125, 0.15);
    backdrop-filter: blur(5px);
    z-index: 2;
}
.audio-controls-main {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    width: 100%;
    justify-content: center;
    z-index: 2;
}
.audio-playlist-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}
.audio-list-item-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 12px 15px;
    transition: 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    flex: 1;
}
.audio-list-item-v2:hover {
    background: #f8f9fa;
    border-color: var(--accent-color);
    transform: translateX(-5px);
    border-right: 4px solid var(--accent-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.audio-list-item-v2.active-audio {
    background: rgba(209, 159, 125, 0.1);
    border-color: rgba(209, 159, 125, 0.3);
    border-right: 4px solid var(--accent-color);
}
.audio-info-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}
.audio-thumb {
    width: 65px;
    height: 65px;
    border-radius: 6px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.audio-item-actions {
    display: flex;
    gap: 8px;
}
.btn-audio-action {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    background: #f0f0f0;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none !important;
}
.btn-audio-action:hover {
    background: var(--accent-color);
    color: #fff;
}
.btn-audio-play {
    background: var(--primary-color);
    color: #fff;
}
.btn-audio-play:hover {
    background: var(--accent-color);
}
         /* ============================================== */
        /* --- بلك الأسئلة والأجوبة (FAQ) --- */
        /* ============================================== */
        .faq-section { padding: 80px 0; background-color: #fff; }
        .faq-item { 
            background: #fff; border: 1px solid #eee; border-radius: 12px; 
            margin-bottom: 15px; overflow: hidden; transition: 0.3s; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.02);
        }
        .faq-item:hover { border-color: var(--accent-color); transform: translateY(-2px); }
        .faq-trigger { 
            padding: 20px 25px; cursor: pointer; display: flex; 
            justify-content: space-between; align-items: center; 
            font-weight: 700; color: var(--primary-color); font-size: 1.1rem;
        }
        .faq-content { 
            padding: 0 25px; max-height: 0; overflow: hidden; 
            transition: all 0.4s ease; color: #666; line-height: 1.8; 
            background: #fafafa; font-size: 0.95rem;
        }
        .faq-item.active { border-color: var(--accent-color); box-shadow: 0 8px 20px rgba(209, 159, 125, 0.1); }
        .faq-item.active .faq-content { padding: 20px 25px 30px; max-height: 1000px; border-top: 1px solid #f0f0f0; }
        .faq-icon { 
            width: 30px; height: 30px; background: var(--bronze-light); 
            color: var(--accent-color); border-radius: 50%; display: flex; 
            align-items: center; justify-content: center; transition: 0.4s;
        }
        .faq-item.active .faq-icon { background: var(--accent-color); color: #fff; transform: rotate(180deg); }
        .pulse-indicator {
            width: 10px; height: 10px; background: var(--accent-color); 
            border-radius: 50%; display: inline-block; margin-left: 10px;
            box-shadow: 0 0 0 rgba(209, 159, 125, 0.4);
            animation: pulse-bronze 2s infinite;
        }
        @keyframes pulse-bronze {
            0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(209, 159, 125, 0.7); }
            70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(209, 159, 125, 0); }
            100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(209, 159, 125, 0); }
        }
        

/* 🎯 التنسيق العام الموحد */
#primaryNav a {
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition);
}

/* 💻 تنسيق سطح المكتب (Desktop) */
@media (min-width: 992px) {
    #primaryNav { 
        display: flex !important; 
        list-style: none; 
        margin: 0; 
        padding: 0; 
    }

    #primaryNav > li { 
        position: relative; 
        margin-left: 15px; 
    }

    #primaryNav > li > a {
        padding: 20px 15px;
        font-weight: 500;
        letter-spacing: 0.5px;
    }

    /* تأثير تمرير الماوس للعناصر الرئيسية */
    #primaryNav > li:hover > a {
        color: var(--accent-color);
    }

    /* القوائم المنسدلة */
    #primaryNav ul { 
        position: absolute; 
        top: 100%; 
        right: 0; 
        display: none; 
        background: var(--primary-color); 
        min-width: 180px; 
        z-index: 9999; 
        list-style: none; 
        padding: 10px 0;
        box-shadow: 0 15px 35px rgba(0,0,0,0.3);
        border-radius: 0 0 8px 8px;
        border-top: 3px solid var(--accent-color);
    }

    /* المستويات العميقة (تفتح لليسار) */
    #primaryNav ul li ul { 
        right: 96%; 
        top: -10px; 
        border-top: none; 
        border-right: 3px solid var(--accent-color);
        border-radius: 8px 0 8px 8px;
        margin-right: 2px;
    }

    #primaryNav li:hover > ul { 
        display: block !important;
        animation: fadeIn 0.3s ease-in-out;
    }

    /* روابط القوائم الداخلية */
    #primaryNav ul li a {
        padding: 12px 20px;
        font-size: 14px;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }

    #primaryNav ul li a:hover {
        background: var(--bronze-light);
        color: var(--accent-color);
        padding-right: 25px; /* تأثير زحزحة خفيف عند التحويم */
    }
}


/* 📱 تنسيق الجوال (Mobile) - نسخة مطورة بالألوان الجديدة */
@media (max-width: 991px) {
    #primaryNav { 
        display: block !important; 
        width: 100%; 
        list-style: none; 
        padding: 0; 
        margin: 0;
        background: var(--primary-color); /* اللون الكحلي الأساسي */
        border-top: 3px solid var(--accent-color); /* خط برونزي علوي للمسة فخامة */
		.hero-caption h1 { font-size: 1.3rem !important; }
    .hero-slider img { min-height: 280px; }
    }

    #primaryNav li { 
        width: 100%; 
        border-bottom: 1px solid rgba(209, 159, 125, 0.15); /* فاصل برونزي رقيق */
    }

    #primaryNav a {
        padding: 15px 20px;
        font-size: 15px;
        color: var(--text-white);
        display: block;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    /* لون مختلف عند الضغط على الرابط */
    #primaryNav a:active {
        background: var(--dark-bg);
        color: var(--accent-color);
    }

    #primaryNav ul { 
        position: static !important; 
        display: none; 
        background: rgba(0, 0, 0, 0.2) !important; /* خلفية داكنة لتمييز القائمة الفرعية */
        padding-right: 20px !important; /* إزاحة لليمين للتبعية */
        border: none !important;
        list-style: none;
    }

    /* ظهور القائمة الفرعية عند الفتح */
    #primaryNav li.m-open > ul { 
        display: block !important; 
        animation: fadeIn 0.4s ease;
    }

    /* تنسيق السهم (FontAwesome) */
    #primaryNav li.dropdown > a::after {
        content: '\f105'; 
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        float: left; /* يظهر جهة اليسار لأن النص عربي */
        transition: transform 0.3s ease;
        color: var(--accent-color);
    }

    /* تدوير السهم عند فتح القائمة */
    #primaryNav li.m-open > a::after {
        transform: rotate(90deg);
        color: var(--text-white);
    }
}

/* أنيميشن الدخول الناعم */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* 🔘 تنسيق زر الهامبرغر (Bootstrap Toggler) */
.navbar-toggler {
    background-color: var(--accent-color) !important; /* الخلفية البرونزية */
    border: none !important; /* إزالة الحدود الافتراضية */
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* التحكم في شكل الأيقونة (الشرطات الثلاث) */
/* ملاحظة: بوتستراب يستخدم صورة SVG كخلفية للأيقونة */
.navbar-toggler-icon {
    /* هذا الفلتر يحول لون الأيقونة الأسود/الأبيض إلى لون الكحلي الخاص بك */
    filter: invert(12%) sepia(48%) saturate(1512%) hue-rotate(218deg) brightness(92%) contrast(92%);
    width: 1.2em;
    height: 1.2em;
}

/* إزالة الـ Glow الأزرق عند الضغط على الزر */
.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(209, 159, 125, 0.4) !important; 
    outline: none;
}

/* تأثير عند تمرير الماوس (اختياري) */
.navbar-toggler:hover {
    background-color: var(--dark-bg) !important;
}
.navbar-toggler:hover .navbar-toggler-icon {
    filter: brightness(0) invert(1) !important; /* يحول الأيقونة للأبيض عند التحويم */
}

/* 1. جعل الحاوية مرنة تتبع ارتفاع الصورة */
.carousel-inner {
    height: auto !important;
}

.slider-wrapper {
    position: relative;
    overflow: hidden;
}

/* 2. جعل الصورة تأخذ عرض الشاشة بالكامل وارتفاع تلقائي */
.responsive-img {
    width: 100% !important;
    height: auto !important; /* هذا ما يمنع اللون الأسود */
    max-height: 80vh; /* لمنع الصورة من أن تصبح طويلة جداً في الشاشات العملاقة */
    object-fit: cover;
}

/* 3. جعل النص يظهر فوق الصورة (Overlay) بشكل متجاوب */
.custom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* تظليل خفيف للصورة لتوضيح النص */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

/* 4. تنسيق النصوص للجوال */
.main-title {
    font-size: 1.2rem; /* حجم ناعم للجوال */
    font-weight: bold;
    color: #fff;
    margin: 10px 0;
}

.main-title a {
    color: inherit;
    text-decoration: none;
}

.custom-overlay .badge {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.75rem;
}

.btn-sm-custom {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.8rem;
    padding: 5px 20px;
}

/* 5. تعديلات الشاشات الكبيرة (Desktop) */
@media (min-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    .responsive-img {
        min-height: 500px; /* ارتفاع أدنى للكمبيوتر ليظل السلايدر فخماً */
    }
}
/* --- تعديل السلايدر ليناسب الثيم الأصلي وصورك الخاصة --- */

/* للكمبيوتر (Desktop): نلتزم بجمالية الثيم الأصلي */
@media (min-width: 992px) {
    .hero-slider .carousel-item { 
        height: 60vh !important; /* الارتفاع الذي يفضله الثيم الأصلي */
        min-height: 500px;
        background: #000; 
    }
    .hero-slider img { 
        height: 100% !important; 
        object-fit: cover; /* لضمان عدم تمطط أغلفة الكتب */
    }
    .hero-caption {
        bottom: 20% !important; /* مكان النص الأصلي */
    }
}

/* للجوال (Mobile): هنا نعالج مشكلة "السواد" */
@media (max-width: 991px) {
    .hero-slider .carousel-item { 
        height: auto !important; /* نجعل الحاوية تنكمش على حجم غلاف الكتاب */
        min-height: unset !important;
    }
    .hero-slider img { 
        height: auto !important; 
        max-height: 70vh; /* لمنع الصورة من أن تصبح طويلة جداً */
    }
    /* توسيط النص فوق الغلاف في الجوال */
    .hero-caption {
        top: 50%;
        transform: translateY(-50%);
        bottom: auto !important;
    }
    /* تصغير الخط ليتناسب مع شاشة الجوال */
    .hero-caption h1 {
        font-size: 1.4rem !important;
    }
    .hero-caption p {
        font-size: 0.9rem !important;
    }
}
.archive-list-container { direction: rtl; text-align: right; }
        .archive-linear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 15px; margin-top: 25px; }
        
        /* الهيدر مع الخط البرونزي المعتمد على الـ accent-color */
        .section-header-bronze { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 30px; 
            padding-bottom: 15px; 
            border-bottom: 3px solid var(--accent-color); 
            direction: rtl; 
        }
        
        .archive-linear-card { 
            background: #fff; 
            border: 1px solid #f2f2f2; 
            border-radius: 15px; 
            padding: 15px; 
            display: flex; 
            align-items: center; 
            text-decoration: none !important; 
            transition: 0.3s; 
            box-shadow: 0 2px 10px rgba(0,0,0,0.02); 
            border-right: 0px solid var(--accent-color) !important; 
        }
        .archive-linear-card:hover { 
            transform: translateX(-8px); 
            border-right: 5px solid var(--accent-color) !important; 
            background: var(--light-bg); 
            box-shadow: 0 8px 25px rgba(0,0,0,0.05);
        }
        
        /* أيقونة الكرت مع خلفية برونزية خفيفة */
        .expert-icon-right { 
            width: 55px; height: 55px; 
            background: var(--bronze-light); 
            border-radius: 12px; 
            display: flex; align-items: center; justify-content: center; 
            color: var(--accent-color); 
            font-size: 1.4rem; 
            margin-left: 15px; 
            flex-shrink: 0; 
        }
        
        .expert-content-left h5 { color: var(--primary-color); font-weight: 700; font-size: 1rem; margin: 0 0 5px 0; }
        .expert-mini-stats { display: flex; gap: 12px; align-items: center; }
        .mini-stat { font-size: 0.72rem; color: #888; font-weight: 600; display: flex; align-items: center; gap: 4px; }
        .mini-stat i { color: var(--accent-color); font-size: 0.8rem; }
        
       

        @media (max-width: 768px) { .section-header-bronze { flex-direction: column; align-items: flex-start; gap: 15px; } }
/* تنسيق مساحات الإعلانات المضافة حديثاً */
        .ad-container {
            background: #ebecef;
            border: 1px dashed #c2c4c9;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            margin-bottom: 30px;
        }
        .ad-container::before {
            content: "إعلان سبونسر";
            position: absolute;
            top: 5px;
            right: 10px;
            font-size: 0.65rem;
            color: #999;
        }
        .ad-middle { width: 100%; min-height: 120px; }
        .ad-sidebar { width: 100%; min-height: 250px; }


/* ستايل تمييز كلمات البحث - هوية آفاق */
.search-highlight {
    background-color: rgba(209, 159, 125, 0.2) !important; /* لون برونزي شفاف */
    color: #272554 !important; /* لون كحلي غامق للنص */
    font-weight: bold;
    padding: 0 5px;
    border-radius: 4px;
    border-bottom: 2px solid #D19F7D; /* خط سفلي برونزي للتأكيد */
    display: inline-block;
}

/* تحسين شكل بطاقة البحث عند التمرير */
.search-card-item {
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.search-card-item:hover {
    transform: translateY(-3px);
    border-right: 4px solid #D19F7D !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}
/* ستايل كارت الكاتب آفاق 2026 */
.writer-card-pro {
    border-radius: 15px !important;
    transition: transform 0.3s ease;
}

.writer-img-wrapper {
    margin-top: -70px; /* رفع الصورة للأعلى لتتداخل مع خلفية الكرت */
    position: relative;
    z-index: 5;
    margin-bottom: 15px;
}

.writer-img-wrapper img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
}

.writer-brief-box {
    padding: 0 10px;
    max-height: 120px; /* لتجنب استطالة الكرت إذا كان النص طويلاً جداً */
    overflow-y: auto;
    scrollbar-width: thin;
}

.writer-social-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 0.85rem;
    transition: 0.3s;
    text-decoration: none;
}

.writer-social-link:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-3px);
}

.book-library-section { direction: rtl; text-align: right; clear: both; margin-bottom: 50px; }
        .book-grid-v3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 15px; }
        .book-card-v3 {
            background: #fff; border: 1px solid #f2f2f2; border-radius: 18px;
            display: flex; gap: 15px; transition: 0.3s ease;
            position: relative; text-decoration: none !important; align-items: stretch;
            box-shadow: 0 4px 15px rgba(0,0,0,0.02); height: 200px;
        }
        .book-card-v3:hover {
            border-right: 5px solid var(--accent-color) !important;
            transform: translateY(-5px);
            box-shadow: 0 12px 25px rgba(0,0,0,0.05);
            background: #fdfdfd;
        }
        .book-cover-v3 { 
            width: 110px; height: 165px; flex-shrink: 0; 
            border-radius: 10px; overflow: hidden; background: #f8f9fa; 
            box-shadow: 2px 4px 10px rgba(0,0,0,0.06);
        }
        .book-cover-v3 img { width: 100%; height: 100%; object-fit: cover; }
        .book-content-v3 { flex-grow: 1; display: flex; flex-direction: column; }
        .book-title-v3 { font-size: 1.05rem; color: var(--primary-color); font-weight: 700; margin-bottom: 2px; line-height: 1.3; }
        .book-subtitle-v3 { font-size: 0.8rem; color: #888; margin-bottom: 8px; font-weight: 500; height: 1.2rem; overflow: hidden; }
        .book-full-row { font-size: 0.75rem; color: #555; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
        .book-full-row i { color: var(--accent-color); width: 14px; text-align: center; font-size: 0.8rem; }
        .book-specs-v3 { 
            display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; 
            font-size: 0.68rem; color: #777; margin-bottom: 12px; margin-top: 5px;
            border-top: 1px solid #f9f9f9; padding-top: 5px;
        }
        .book-specs-v3 span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
        .book-specs-v3 i { color: var(--accent-color); width: 14px; text-align: center; font-size: 0.7rem; }
        .book-footer-v3 { display: flex; gap: 8px; margin-top: auto; }
        .btn-lib { 
            font-size: 0.72rem; padding: 5px 12px; border-radius: 8px; font-weight: 600; 
            text-decoration: none !important; display: flex; align-items: center; justify-content: center; flex: 1; 
        }
        .btn-lib-details { background: #f8f9fa; color: #555; border: 1px solid #eee; }
        .btn-lib-download { background: var(--accent-color); color: var(--primary-color); border: none; }
        .aafaq-pagination-wrapper { margin: 40px 0; width: 100%; }
        .aafaq-pagination-wrapper .page-link { border-radius: 8px; border: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.05); color: #333; padding: 8px 16px; margin: 0 3px; }
        .aafaq-pagination-wrapper .page-item.active .page-link { background: var(--accent-color); color: var(--primary-color); font-weight: bold; }
.audio-playlist-wrapper2 {
              display: flex;
              flex-direction: column;
              gap: 12px;
            }


/* تنسيقات بطاقة الخدمات */
.service-card {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    text-align: center;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card-accent {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 0 0 10px 10px;
}

.service-icon {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: block;
}

.service-card h5 {
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.service-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
}
/* ضبط أزرار سلايدر الأخبار الرئيسي */
/* الحاوية المشتركة للأزرار */
.carousel-control-prev,
.carousel-control-next {
    width: 45px;             /* حجم متناسق وأنيق */
    height: 45px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    border-radius: 50%;
    opacity: 0.8;
    z-index: 10;
    display: flex;           /* الخلطة السرية للتوسيط */
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: none;            /* التأكد من عدم وجود إطار افتراضي */
}

/* زر السابق (جهة اليمين - العودة للخلف) */
.carousel-control-prev {
    right: 20px;
    left: auto;
    background-color: var(--primary-color) !important; /* الأزرق الملكي */
}

/* زر التالي (جهة اليسار - التقدم للأمام) */
.carousel-control-next {
    left: 20px;
    right: auto;
    background-color: var(--accent-color) !important; /* البرونزي الفاخر */
}

/* ضبط الأيقونات وتوسيطها ومنع الانزياح */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 22px;
    height: 22px;
    background-size: 100% 100%;
    margin: 0 !important;   /* إلغاء أي هوامش تسبب عدم التوسط */
    display: block;
}

/* 💡 تصحيح اتجاه الأسهم للغة العربية */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    transform: rotate(180deg); /* قلب السهم ليتناسب مع اتجاه RTL */
}

/* تأثير التمرير (Hover) */
.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1); /* تكبير بسيط لإعطاء حيوية */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}


/*    الصفحة  */

/* ============================================== 
   1. الثوابت والمتغيرات (Global Variables)
   ============================================== */


body { 
    font-family: 'Alyamama', sans-serif; 
    background-color: var(--light-bg); 
    color: #333; 
    line-height: 1.8; 
}

/* ============================================== 
   2. الهيدر (Navbar)
   ============================================== */
.navbar { 
    background-color: var(--primary-color); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}
.navbar-brand { 
    color: var(--accent-color) !important; 
    font-weight: 700; 
    font-size: 1.8rem; 
}
.nav-link { 
    color: #fff !important; 
    font-weight: 600; 
    transition: 0.3s; 
    margin: 0 10px; 
}
.nav-link:hover { 
    color: var(--accent-color) !important; 
}

/* ============================================== 
   3. رأس صفحة البوست (Post Header)
   ============================================== */
.post-top-header { 
    background: white; 
    padding: 40px 0 30px; 
    border-bottom: 1px solid #eee; 
    margin-bottom: 40px; 
}
.breadcrumb { 
    font-size: 0.85rem; 
    margin-bottom: 15px; 
}
.breadcrumb-item a { 
    color: var(--accent-color); 
    text-decoration: none; 
}
.post-title { 
    color: var(--primary-color); 
    font-weight: 800; 
    font-size: 2.6rem; 
    margin-bottom: 15px; 
    line-height: 1.3; 
}
.post-subtitle { 
    color: var(--text-muted); 
    font-size: 1.25rem; 
    font-weight: 400; 
    margin-bottom: 25px; 
    border-right: 4px solid var(--accent-color); 
    padding-right: 15px; 
}

.post-meta-bar { 
    display: flex; 
    gap: 25px; 
    flex-wrap: wrap; 
    font-size: 0.9rem; 
    color: #777; 
    border-top: 1px solid #f0f0f0; 
    padding-top: 20px; 
}
.post-meta-bar span i { 
    color: var(--accent-color); 
    margin-left: 6px; 
}

/* ============================================== 
   4. الميديا (صور/سلايدر/فيديو)
   ============================================== */
.media-container { 
    border-radius: 15px; 
    overflow: hidden; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.12); 
    margin-bottom: 40px; 
    background: #000; 
    position: relative; 
}
.post-slider .carousel-item { 
    height: 550px; 
}
.post-slider img { 
    object-fit: cover; 
    width: 100%; 
    height: 100%; 
}

/* مشغل الفيديو الذكي */
.video-wrapper { 
    position: relative; 
    padding-bottom: 56.25%; 
    height: 0; 
}
.video-wrapper iframe { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    border: none; 
}

/* ============================================== 
   5. المحتوى التحريري (Typography)
   ============================================== */
/* الحاوية الجديدة للمقال */

.article-content {
    font-size: var(--article-font-size) !important;
    line-height: 1.8; /* كبار السن يحتاجون مسافات واسعة بين الأسطر لراحة العين */
 
}
.hindi-test-zone {
    font-family: 'Alyamama', sans-serif;
    font-size: 1.5rem;
    line-height: 2;
    /* السر هنا لخط اليمامة */
    font-feature-settings: "locl" 1, "pnum" 1;
    -webkit-font-feature-settings: "locl" 1, "pnum" 1;
}
.article-content h2, .article-content h3 { 
    color: var(--primary-color); 
    font-weight: 700; 
    margin: 45px 0 20px; 
    position: relative; 
}
.article-content h2::after { 
    content: ''; 
    display: block; 
    width: 50px; 
    height: 3px; 
    background: var(--accent-color); 
    margin-top: 10px; 
}


/* 1. تنسيق النصوص الاحترافي (لراحة كبار السن) */
.article-content {
    font-size: var(--article-font-size, 1.25rem) !important;
    line-height: 1.9 !important; /* تباعد أسطر مريح جداً للعين */
    color: #2d2d2d;
    text-align: right !important; /* الالتزام بالمحاذاة اليمينية */
}

.article-content p {
    margin-bottom: 28px; /* متنفس كافٍ بين الأفكار */
}


/* 2. أداة التحكم بحجم الخط (يسار + دوائر برونزية) */
.article-resizer-wrapper {
    display: flex;
    justify-content: flex-end; /* لليسار في RTL */
    margin: 15px 0 30px;
}

.resizer-btn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50% !important;
    border: 1.5px solid var(--accent-color) !important;
    background: transparent !important;
    color: var(--accent-color) !important;
    margin-right: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.resizer-btn:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    transform: translateY(-3px);
}

/* 3. ضبط ريشيو المعرض ومنع الزووم */
#postSlider .carousel-item {
    aspect-ratio: 620 / 348 !important;
    height: auto !important;
}

#postSlider img {
    object-fit: fill !important; /* عرض الصورة كاملة دون قص أو زووم */
    width: 100% !important;
    height: 100% !important;
}


/* ============================================== 
   6. قوالب الأنواع الخاصة
   ============================================== */
/* الكتاب */
.book-details-box { 
    background: white; 
    border-radius: 12px; 
    padding: 30px; 
    display: flex; 
    gap: 30px; 
    margin-bottom: 40px; 
    border: 1px solid #eee; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.03); 
}
.book-cover-3d { 
    width: 160px; 
    flex-shrink: 0; 
    perspective: 1000px; 
}
.book-cover-3d img { 
    width: 100%; 
    border-radius: 4px; 
    box-shadow: -8px 8px 20px rgba(0,0,0,0.25); 
    border-left: 4px solid rgba(255,255,255,0.3); 
    transition: 0.4s; 
}
.book-cover-3d:hover img { 
    transform: rotateY(-10deg) scale(1.02); 
}

/* الصوتيات */
.audio-player-card { 
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a1838 100%); 
    color: white; 
    padding: 30px; 
    border-radius: 15px; 
    margin-bottom: 40px; 
    display: flex; 
    align-items: center; 
    gap: 25px; 
    box-shadow: 0 10px 25px rgba(39, 37, 84, 0.3); 
}
.audio-pulse { 
    width: 60px; 
    height: 60px; 
    background: var(--accent-color); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.5rem; 
    animation: pulse-glow 2s infinite; 
}
@keyframes pulse-glow { 
    0% { box-shadow: 0 0 0 0 rgba(209, 159, 125, 0.6); } 
    70% { box-shadow: 0 0 0 15px rgba(209, 159, 125, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(209, 159, 125, 0); } 
}

/* الأسئلة والأجوبة */
.faq-answer-block { 
    background: #fdfaf8; 
    border-right: 6px solid var(--accent-color); 
    padding: 35px; 
    border-radius: 10px; 
    margin: 40px 0; 
    position: relative; 
}
.faq-answer-block::before { 
    content: "\f128"; 
    font-family: "Font Awesome 6 Free"; 
    font-weight: 900; 
    position: absolute; 
    top: -15px; 
    right: -15px; 
    width: 40px; 
    height: 40px; 
    background: var(--accent-color); 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.2rem; 
}

/* ============================================== 
   7. التحميلات والسايدبار
   ============================================== */
.download-zone { 
    background: white; 
    border-radius: 15px; 
    padding: 30px; 
    border: 1px solid #e0e0e0; 
    margin-top: 60px; 
}
.file-card { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 18px; 
    border: 1px solid #f0f0f0; 
    border-radius: 10px; 
    margin-bottom: 12px; 
    transition: 0.3s; 
}
.file-card:hover { 
    border-color: var(--accent-color); 
    background: #fdfaf8; 
    transform: translateX(-5px); 
}
.btn-download { 
    background: var(--primary-color); 
    color: white; 
    border: none; 
    padding: 10px 25px; 
    border-radius: 30px; 
    font-weight: bold; 
    transition: 0.3s; 
}
.btn-download:hover { 
    background: var(--accent-color); 
    color: var(--primary-color); 
}

.author-widget { 
    background: white; 
    border-radius: 15px; 
    padding: 30px; 
    text-align: center; 
    border-top: 5px solid var(--accent-color); 
    margin-bottom: 35px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); 
}
.author-img { 
    width: 110px; 
    height: 110px; 
    border-radius: 50%; 
    border: 5px solid var(--light-bg); 
    margin-bottom: 15px; 
    object-fit: cover; 
}
.author-bio { 
    font-size: 0.9rem; 
    color: #666; 
    margin-bottom: 20px; 
}

.sticky-sidebar { 
    position: sticky; 
    top: 90px; 
}

/* ============================================== 
   8. الفوتر (Footer)
   ============================================== */
footer { 
    background-color: var(--dark-bg); 
    color: #ccc; 
    padding: 70px 0 0; 
    border-top: 6px solid var(--accent-color); 
}
footer h5 { 
    color: var(--accent-color); 
    font-weight: 700; 
    margin-bottom: 25px; 
}
footer a { 
    color: #aaa; 
    text-decoration: none; 
    transition: 0.2s; 
    display: block; 
    margin-bottom: 10px; 
}
footer a:hover { 
    color: #fff; 
    transform: translateX(-5px); 
}
.footer-bottom { 
    background-color: rgba(0,0,0,0.3); 
    padding: 20px 0; 
    margin-top: 50px; 
    font-size: 0.85rem; 
}

/* ============================================== 
   9. الاستجابة (Responsive)
   ============================================== */
@media (max-width: 991px) { 
    .post-title { font-size: 2rem; } 
    .post-slider .carousel-item { height: 350px; } 
}



/* 🎯 التنسيق العام الموحد */
#primaryNav a {
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition);
}

/* 💻 تنسيق سطح المكتب (Desktop) */
@media (min-width: 992px) {
    #primaryNav { 
        display: flex !important; 
        list-style: none; 
        margin: 0; 
        padding: 0; 
    }

    #primaryNav > li { 
        position: relative; 
        margin-left: 15px; 
    }

    #primaryNav > li > a {
        padding: 20px 15px;
        font-weight: 500;
        letter-spacing: 0.5px;
    }

    /* تأثير تمرير الماوس للعناصر الرئيسية */
    #primaryNav > li:hover > a {
        color: var(--accent-color);
    }

    /* القوائم المنسدلة */
    #primaryNav ul { 
        position: absolute; 
        top: 100%; 
        right: 0; 
        display: none; 
        background: var(--primary-color); 
        min-width: 180px; 
        z-index: 9999; 
        list-style: none; 
        padding: 10px 0;
        box-shadow: 0 15px 35px rgba(0,0,0,0.3);
        border-radius: 0 0 8px 8px;
        border-top: 3px solid var(--accent-color);
    }

    /* المستويات العميقة (تفتح لليسار) */
    #primaryNav ul li ul { 
        right: 96%; 
        top: -10px; 
        border-top: none; 
        border-right: 3px solid var(--accent-color);
        border-radius: 8px 0 8px 8px;
        margin-right: 2px;
    }

    #primaryNav li:hover > ul { 
        display: block !important;
        animation: fadeIn 0.3s ease-in-out;
    }

    /* روابط القوائم الداخلية */
    #primaryNav ul li a {
        padding: 12px 20px;
        font-size: 14px;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }

    #primaryNav ul li a:hover {
        background: var(--bronze-light);
        color: var(--accent-color);
        padding-right: 25px; /* تأثير زحزحة خفيف عند التحويم */
    }
}


/* 📱 تنسيق الجوال (Mobile) - نسخة مطورة بالألوان الجديدة */
@media (max-width: 991px) {
    #primaryNav { 
        display: block !important; 
        width: 100%; 
        list-style: none; 
        padding: 0; 
        margin: 0;
        background: var(--primary-color); /* اللون الكحلي الأساسي */
        border-top: 3px solid var(--accent-color); /* خط برونزي علوي للمسة فخامة */
		.hero-caption h1 { font-size: 1.3rem !important; }
    .hero-slider img { min-height: 280px; }
    }

    #primaryNav li { 
        width: 100%; 
        border-bottom: 1px solid rgba(209, 159, 125, 0.15); /* فاصل برونزي رقيق */
    }

    #primaryNav a {
        padding: 15px 20px;
        font-size: 15px;
        color: var(--text-white);
        display: block;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    /* لون مختلف عند الضغط على الرابط */
    #primaryNav a:active {
        background: var(--dark-bg);
        color: var(--accent-color);
    }

    #primaryNav ul { 
        position: static !important; 
        display: none; 
        background: rgba(0, 0, 0, 0.2) !important; /* خلفية داكنة لتمييز القائمة الفرعية */
        padding-right: 20px !important; /* إزاحة لليمين للتبعية */
        border: none !important;
        list-style: none;
    }

    /* ظهور القائمة الفرعية عند الفتح */
    #primaryNav li.m-open > ul { 
        display: block !important; 
        animation: fadeIn 0.4s ease;
    }

    /* تنسيق السهم (FontAwesome) */
    #primaryNav li.dropdown > a::after {
        content: '\f105'; 
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        float: left; /* يظهر جهة اليسار لأن النص عربي */
        transition: transform 0.3s ease;
        color: var(--accent-color);
    }

    /* تدوير السهم عند فتح القائمة */
    #primaryNav li.m-open > a::after {
        transform: rotate(90deg);
        color: var(--text-white);
    }
}

/* أنيميشن الدخول الناعم */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* 🔘 تنسيق زر الهامبرغر (Bootstrap Toggler) */
.navbar-toggler {
    background-color: var(--accent-color) !important; /* الخلفية البرونزية */
    border: none !important; /* إزالة الحدود الافتراضية */
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* التحكم في شكل الأيقونة (الشرطات الثلاث) */
/* ملاحظة: بوتستراب يستخدم صورة SVG كخلفية للأيقونة */
.navbar-toggler-icon {
    /* هذا الفلتر يحول لون الأيقونة الأسود/الأبيض إلى لون الكحلي الخاص بك */
    filter: invert(12%) sepia(48%) saturate(1512%) hue-rotate(218deg) brightness(92%) contrast(92%);
    width: 1.2em;
    height: 1.2em;
}

/* إزالة الـ Glow الأزرق عند الضغط على الزر */
.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(209, 159, 125, 0.4) !important; 
    outline: none;
}

/* تأثير عند تمرير الماوس (اختياري) */
.navbar-toggler:hover {
    background-color: var(--dark-bg) !important;
}
.navbar-toggler:hover .navbar-toggler-icon {
    filter: brightness(0) invert(1) !important; /* يحول الأيقونة للأبيض عند التحويم */
}

/* 1. جعل الحاوية مرنة تتبع ارتفاع الصورة */
.carousel-inner {
    height: auto !important;
}

.slider-wrapper {
    position: relative;
    overflow: hidden;
}

/* 2. جعل الصورة تأخذ عرض الشاشة بالكامل وارتفاع تلقائي */
.responsive-img {
    width: 100% !important;
    height: auto !important; /* هذا ما يمنع اللون الأسود */
    max-height: 80vh; /* لمنع الصورة من أن تصبح طويلة جداً في الشاشات العملاقة */
    object-fit: cover;
}

/* 3. جعل النص يظهر فوق الصورة (Overlay) بشكل متجاوب */
.custom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* تظليل خفيف للصورة لتوضيح النص */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

/* 4. تنسيق النصوص للجوال */
.main-title {
    font-size: 1.2rem; /* حجم ناعم للجوال */
    font-weight: bold;
    color: #fff;
    margin: 10px 0;
}

.main-title a {
    color: inherit;
    text-decoration: none;
}

.custom-overlay .badge {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.75rem;
}

.btn-sm-custom {
    background-color: var(--accent-color);
    color: var(--primary-color);
    font-size: 0.8rem;
    padding: 5px 20px;
}

/* 5. تعديلات الشاشات الكبيرة (Desktop) */
@media (min-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    .responsive-img {
        min-height: 500px; /* ارتفاع أدنى للكمبيوتر ليظل السلايدر فخماً */
    }
}
/* --- تعديل السلايدر ليناسب الثيم الأصلي وصورك الخاصة --- */

/* للكمبيوتر (Desktop): نلتزم بجمالية الثيم الأصلي */
@media (min-width: 992px) {
    .hero-slider .carousel-item { 
        height: 60vh !important; /* الارتفاع الذي يفضله الثيم الأصلي */
        min-height: 500px;
        background: #000; 
    }
    .hero-slider img { 
        height: 100% !important; 
        object-fit: cover; /* لضمان عدم تمطط أغلفة الكتب */
    }
    .hero-caption {
        bottom: 20% !important; /* مكان النص الأصلي */
    }
}

/* للجوال (Mobile): هنا نعالج مشكلة "السواد" */
@media (max-width: 991px) {
    .hero-slider .carousel-item { 
        height: auto !important; /* نجعل الحاوية تنكمش على حجم غلاف الكتاب */
        min-height: unset !important;
    }
    .hero-slider img { 
        height: auto !important; 
        max-height: 70vh; /* لمنع الصورة من أن تصبح طويلة جداً */
    }
    /* توسيط النص فوق الغلاف في الجوال */
    .hero-caption {
        top: 50%;
        transform: translateY(-50%);
        bottom: auto !important;
    }
    /* تصغير الخط ليتناسب مع شاشة الجوال */
    .hero-caption h1 {
        font-size: 1.4rem !important;
    }
    .hero-caption p {
        font-size: 0.9rem !important;
    }
}


.play-overlay i {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.5));
}
.video-play-trigger:hover .play-overlay i {
    transform: scale(1.1);
    color: #fff !important;
}
/* تأثير النبض لزر التشغيل */
@keyframes pulse-play {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
.play-overlay { animation: pulse-play 2s infinite; }

/* --- حل مشكلة الارتفاع المفرط في السلايدر --- */

/* 1. تحديد ارتفاع ثابت للحاوية لكي لا تتمدد للأسفل */
#postSlider .carousel-inner {
    background-color: #1a1838; /* لون خلفية داكن في حال كانت الصورة لا تغطي كامل العرض */
}

/* 2. ضبط الصورة لكي تملأ المساحة المحددة دون أن تتمطط (Stretching) */
#postSlider .carousel-item img {
    height: 500px !important;
    width: 100%;
    object-fit: cover; /* أهم سطر: يقوم بقص الزوائد والحفاظ على تناسق الأبعاد */
    object-position: center top; /* يجعل التركيز على الجزء العلوي من الصورة (الوجه والعناوين) */
}

/* 3. ضبط السلايدر في الجوال ليكون أصغر قليلاً */
@media (max-width: 768px) {
    #postSlider .carousel-inner, 
    #postSlider .carousel-item img {
        height: 350px !important;
    }
}
/* ============================================== 
   10. حلول برمجية لمشاكل التداخل (Fixes)
   ============================================== */

/* رفع رتبة الهيدر لأعلى طبقة ممكنة فوق كل المحتويات */
.navbar.sticky-top {
    z-index: 10000 !important; /* رتبة أعلى من السايد بار والـ SmartMenus */
    background-color: var(--primary-color) !important;
}

/* ضمان ظهور القوائم المنسدلة فوق السايد بار */
#primaryNav ul {
    z-index: 10001 !important;
}

/* ضبط السايد بار ليكون تحت مستوى الهيدر عند التمرير لكي لا يغطيه */
.sticky-sidebar {
    position: sticky !important;
    top: 100px !important; /* المسافة من أعلى الشاشة لكي لا يصطدم بالهيدر */
    z-index: 900 !important; /* رتبة أقل من الهيدر لضمان المرور تحته */
}

/* حل تداخل الطبقات في الجوال */
@media (max-width: 991px) {
    .navbar-collapse {
        z-index: 10000 !important;
        background-color: var(--primary-color);
        position: relative;
    }
}

/* تحسين شكل الفاصل بين القائمة والبوست */
.post-top-header {
    position: relative;
    z-index: 1; /* لضمان عدم تداخله مع ظل الهيدر */
}
/* منع أي مشغل عائم من الظهور عند المرور على زر التحميل */
.btn-download-audio {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

/* إذا كان المشغل يظهر بسبب SmartMenus، نحدد استثناء لروابط التحميل */
.sm-clean a.btn-download-audio:hover {
    background-color: var(--accent-color) !important;
    transform: none !important;
}

/* التأكد من أن الهيدر لا يختفي خلف السايد بار */
.navbar.sticky-top {
    z-index: 9999 !important;
}


    /* تنسيقات كارت الكتاب المحدث لصفحة البوست */
    .book-details-post-v3 {
        background: #fff;
        border: 1px solid #f2f2f2;
        border-radius: 20px;
        padding: 25px;
        display: flex;
        gap: 30px;
        transition: 0.3s ease;
        position: relative;
        align-items: stretch;
        box-shadow: 0 10px 30px rgba(0,0,0,0.05);
        margin-bottom: 40px;
        border-right: 6px solid var(--accent-color) !important;
    }
    .book-cover-post-v3 { 
        width: 180px; 
        height: 270px; 
        flex-shrink: 0; 
        border-radius: 12px; 
        overflow: hidden; 
        background: #f8f9fa; 
        box-shadow: 5px 10px 20px rgba(0,0,0,0.15);
    }
    .book-cover-post-v3 img { width: 100%; height: 100%; object-fit: cover; }
    
    .book-content-post-v3 { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
    .book-title-post-v3 { font-size: 1.6rem; color: var(--primary-color); font-weight: 800; margin-bottom: 5px; line-height: 1.2; }
    
    /* تنسيق العنوان الفرعي */
    .book-subtitle-post-v3 { font-size: 1.1rem; color: #6c757d; margin-bottom: 15px; font-weight: 500; border-right: 3px solid var(--accent-color); padding-right: 10px; }

    .book-full-row-post { font-size: 1rem; color: #444; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
    .book-full-row-post i { color: var(--accent-color); width: 20px; text-align: center; }
    
    .book-specs-post-v3 { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 12px 25px; 
        font-size: 0.95rem; 
        color: #666; 
        margin-top: 10px;
        padding-top: 15px;
        border-top: 1px solid #f0f0f0;
    }
    .book-specs-post-v3 span { display: flex; align-items: center; gap: 10px; }
    .book-specs-post-v3 i { color: var(--accent-color); width: 20px; text-align: center; font-size: 1.1rem; }
    
    @media (max-width: 768px) {
        .book-details-post-v3 { flex-direction: column; align-items: center; text-align: center; height: auto; }
        .book-specs-post-v3 { grid-template-columns: 1fr; }
        .book-subtitle-post-v3 { border-right: 0; border-bottom: 2px solid var(--accent-color); padding-right: 0; padding-bottom: 5px; }
    }

    /* تنسيقات إضافية لضبط الصفحة */
    .post-top-header { background: white; padding: 40px 0; border-bottom: 1px solid #eee; margin-bottom: 40px; }
    .post-title { color: var(--primary-color); font-weight: 800; font-size: 2.4rem; margin-bottom: 15px; }
    .post-subtitle { color: #6c757d; font-size: 1.2rem; border-right: 4px solid var(--accent-color); padding-right: 15px; }
    .post-meta-bar { display: flex; gap: 20px; font-size: 0.9rem; color: #777; margin-top: 20px; }
    .post-meta-bar i { color: var(--accent-color); margin-left: 5px; }
    
    .article-container { background: #fff; border-radius: 15px; border: 1px solid #f0f0f0; }
    .video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 15px; overflow: hidden; }
    .video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
    
    /* موازنة الصور داخل السلايدر في الجوال */
    @media (max-width: 768px) {
        .carousel-inner img { height: 300px !important; }
        .post-title { font-size: 1.8rem; }
    }

    /* تحسين شكل روابط المرفقات لتناسب رشاقة الصفحة */
    .attachment-list a {
        color: var(--primary-color) !important;
        text-decoration: none !important;
        font-weight: 600;
        transition: 0.3s;
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
    .attachment-list a:hover {
        color: var(--accent-color) !important;
    }
    /* إذا كانت الدالة تولد أزرار، فهذا التنسيق سيجعلها برونزية راقية */
    .attachment-list .btn {
        background: var(--accent-color) !important;
        color: var(--primary-color) !important;
        border: none;
        border-radius: 30px;
        padding: 8px 25px;
        font-weight: bold;
    }
.latest-stories-section { direction: rtl; margin-bottom: 50px; }
        .featured-card-spirit {
            background: #fff; border-radius: 20px; border: 1px solid #f0f0f0; padding: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.05); height: 100%; transition: var(--transition);
            display: flex; flex-direction: column;
        }
        .featured-card-spirit h4 { color: var(--primary-color); font-weight: 800; font-size: 1.3rem; line-height: 1.4; margin: 15px 0 10px; }
        .side-stories-list { height: 100%; display: flex; flex-direction: column; gap: 12px; }
        .side-item-spirit {
            background: #fff; border: 1px solid #eaeaea; border-radius: 12px; padding: 12px;
            display: flex; align-items: center; gap: 15px; text-decoration: none !important; transition: var(--transition);
        }
        .side-item-spirit:hover { border-right: 4px solid var(--accent-color); background: #fdfaf8; transform: translateX(-5px); }
        .side-item-spirit img { width: 100px; height: 75px; object-fit: cover; border-radius: 8px; }
        .meta-spirit { display: flex; gap: 15px; font-size: 0.75rem; color: #888; margin-top: auto; }
        .meta-spirit span i { color: var(--accent-color); margin-left: 5px; }
        
/* ========================================================== */
/* --- بلوك الفيديو المطور (نسخة آفاق 2026 - التجاوب الذهبي) --- */
/* ========================================================== */
.video-section-final-v2 { direction: rtl; text-align: right; }

.featured-video-pro {
    position: relative; 
    border-radius: 10px; 
    overflow: hidden;
    aspect-ratio: 4 / 3.1; /* الحجم شبه المربع المتناسق للكمبيوتر */
    background: #000; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    display: block; 
    text-decoration: none !important;
    height: 100%;
    max-width: 100% !important;
}

.featured-video-pro img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover !important; 
    opacity: 0.8; 
    transition: 0.6s ease;
}

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

.video-overlay-pro {
    position: absolute; 
    bottom: 0; 
    right: 0; 
    width: 100%;
    background: linear-gradient(to top, rgba(19, 18, 43, 0.98) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    padding: 60px 25px 25px; 
    z-index: 3; 
    text-align: right;
}

.playlist-wrapper-pro { display: flex; flex-direction: column; gap: 12px; height: 100%; }

.video-item-pro {
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding: 12px;
    background: #fff; 
    border: 1px solid #f0f0f0; 
    border-radius: 15px;
    transition: var(--transition); 
    text-decoration: none !important;
    direction: rtl;
}

.video-item-pro:hover { 
    border-right: 5px solid var(--accent-color) !important; 
    transform: translateX(-5px);
    background: #fdfdfd; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.thumb-box-pro { 
    width: 95px; 
    height: 70px; 
    flex-shrink: 0; 
    border-radius: 10px; 
    overflow: hidden; 
    position: relative; 
}

@media (min-width: 992px) { 
    .thumb-box-pro { width: 125px; height: 90px; } 
}

.thumb-box-pro img { width: 100%; height: 100%; object-fit: cover; }

.video-item-info { flex-grow: 1; overflow: hidden; text-align: right; }

.video-item-title { 
    color: var(--primary-color); 
    font-weight: 700; 
    font-size: 0.95rem; 
    margin-bottom: 5px; 
    line-height: 1.4; 
    text-align: right;
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
}

/* ========================================================== */
/* 📱 ضبط الترتيب الرأسي وحماية المارجن والمحاذاة القياسية للموقع */
/* ========================================================== */
@media (max-width: 1199px) {
    
    /* 🎯 صمام أمان لإعطاء رابط "المزيد" مساحة تنفس مريحة ومنعه من الالتصاق بالحافة اليسرى */
    .video-section-final-v2 .section-header a {
        margin-left: 15px !important; /* إزاحة أمان بكسلية متناسقة مع حواف الموقع */
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    /* ضمان أن الهيدر نفسه يأخذ مساحة داخلية متوازنة في الشاشات الـ Responsive */
    .video-section-final-v2 .section-header {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* 1. جعل الـ Row يرتد رأسياً مع الحفاظ على خواص مارجن بوتستراب السالب الموزون */
    .video-section-final-v2 .row {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 2. إعطاء الأعمدة العرض الكامل وترك حواشي الـ Gutter الافتراضية تحاذي العناصر */
    .video-col-main, 
    .video-section-final-v2 .col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: calc(var(--bs-gutter-x) * .5) !important;
        padding-right: calc(var(--bs-gutter-x) * .5) !important;
        margin-bottom: 24px !important;
    }
    
    /* 3. جعل أبعاد الفيديو سينمائية مرنة وحرة الارتفاع */
    .featured-video-pro { 
        aspect-ratio: 16 / 9 !important; 
        height: auto !important;
    } 
    
    .playlist-wrapper-pro {
        height: auto !important;
    }
    
    /* 4. تهيئة الحواشي الداخلية للنصوص لتتناسب مع الارتفاع الجديد للفيديو */
    .video-overlay-pro {
        padding: 35px 15px 15px !important; 
    }
    
    .video-overlay-pro h4 {
        font-size: 1.1rem !important; 
        line-height: 1.3 !important;
    }
    
    .video-item-info { text-align: right; }
}
/* ============================================== */
/* --- بلوك الفيديو الخفيف (Interactive Pro) --- */
/* ============================================== */
.interactive-video-widget {
    background: #fff; border-radius: 20px; padding: 15px;
    display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch;
    direction: rtl; border: 1px solid #f0f0f0;
}

.player-main-col { flex: 1; min-width: 320px; }

.player-wrapper-pro {
    position: relative; border-radius: 15px; overflow: hidden;
    aspect-ratio: 16 / 9; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.player-wrapper-pro img { width: 100%; height: 100%; object-fit: cover !important; opacity: 0.8; }

.playlist-side-col { 
    width: 320px; display: flex; flex-direction: column; gap: 10px; 
    max-height: 450px; overflow-y: auto; padding-left: 5px;
}

/* ستايل العناصر المصغرة في القائمة التفاعلية */
.interactive-item {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    background: #f9fafb; border: 1px solid #f0f0f0; border-radius: 12px;
    cursor: pointer; transition: var(--transition); border-right: 4px solid transparent;
}

.interactive-item:hover, .interactive-item.active-video {
    background: #fff; border-right: 4px solid var(--accent-color) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); transform: translateX(-5px);
}

.interactive-item .thumb-box { width: 85px; height: 60px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.interactive-item h6 { 
    font-size: 0.85rem; color: var(--primary-color); font-weight: 700; 
    margin: 0; line-height: 1.4; text-align: right;
}

/* استجابة الشاشات (Responsive) */
@media (max-width: 991px) {
    .playlist-side-col { width: 100%; max-height: none; }
    .interactive-video-widget { padding: 10px; }
}
/* 🎯 أيقونة التشغيل المتجاوبة */
.play-btn-responsive {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    opacity: 0.75;
    z-index: 10;
    color: var(--accent-color) !important;
    transition: var(--transition);
    pointer-events: none; /* لكي لا تعيق الضغط على الصورة */
    font-size: 2.8rem; /* حجم الجوال الاحترافي */
}

@media (min-width: 992px) {
    .play-btn-responsive {
        font-size: 4.5rem; /* الحجم الكبير للديسكتوب */
    }
}

/* تأثير عند التحويم */
.featured-video-pro:hover .play-btn-responsive,
.player-wrapper-pro:hover .play-btn-responsive {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
    color: var(--accent-color);
}
/* ============================================== */
/* --- معرض صور وفيديو المادة (Post Gallery) --- */
/* ============================================== */
.post-gallery-slider {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    
}

.post-gallery-slider .carousel-inner {
    height: 300px; /* ارتفاع الجوال */
}

@media (min-width: 992px) {
    .post-gallery-slider .carousel-inner {
        height: 550px; /* ارتفاع الديسكتوب الفخم */
    }
}

.post-gallery-slider .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover !important; /* لضمان ملء المساحة بدون تشويه */
    opacity: 0.9;
}

/* تأثير التظليل للعنوان فوق الصورة */
.gallery-video-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 30px 20px 20px;
    text-align: right;
    z-index: 5;
}

/* الاستفادة من أيقونة التشغيل الموحدة التي صممناها سابقاً */
.post-gallery-slider .play-btn-responsive {
    color: var(--accent-color) !important;
    text-shadow: 0 0 20px rgba(0,0,0,0.5);
}


/* 🎯 ضبط المعرض ليتبع الريشيو 620x348 */
#postSlider.post-gallery-slider .carousel-inner,
.gallery-ifrm-container {
    aspect-ratio: 620 / 348 !important;
    height: auto !important;
    width: 100% !important;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

/* 🎯 تنظيف الواجهة عند تشغيل الفيديو */
.video-playing .carousel-indicators,
.video-playing .carousel-control-prev,
.video-playing .carousel-control-next,
.video-playing .gallery-video-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: 0.3s ease;
}

/* ضمان تغطية المحتوى بالكامل */
.post-gallery-slider .carousel-item img,
.post-gallery-slider iframe {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
/* 🎯 ضبط الصور لتأخذ نفس شكل الإطار بدقة وإلغاء الزووم */
.post-gallery-slider .carousel-item img {
    object-fit: fill !important; /* هذا السطر يلغي الزووم ويجبر الصورة على أبعاد الـ 16:9 */
    transform: none !important; /* إلغاء أي تأثير تكبير عند التحويم */
    opacity: 1 !important;
}


/* 🎯 ضبط الصور لملء الريشيو 620x348 ومنع الزووم */
.post-gallery-slider .carousel-item img {
    object-fit: fill !important; /* إلغاء الزووم والقص */
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
}

/* تنظيف خلفية المشغل */
.post-gallery-slider .carousel-inner {

    border-radius: 20px;
}
