/* ملف: css/media-styles.css - النسخة النهائية الكاملة مع تطبيق التدرج اللوني المتباين */

/* أنماط الوسائط المتقدمة للموقع */

/* ===== أنماط الصفحة الرئيسية ===== */
.articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px;
}

@media (max-width: 768px) {
    .articles-container {
        padding: 5px;  /* 👈 مسافة أصغر للهواتف */
    }
}

@media (max-width: 480px) {
    .articles-container {
        padding: 3px;  /* 👈 مسافة أصغر للهواتف الصغيرة */
    }
}

.articles-grid {
    display: grid;
    gap: 10px;
    margin: 15px 0;
}


/* العرض في صفين (افتراضي) */
.articles-grid.two-rows {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* العرض في صف واحد */
.articles-grid.single-row {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 25px auto;
}

.article-preview {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    direction: rtl;
    text-align: right;
    position: relative;
    display: flex;
    flex-direction: column;
}

.article-preview:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); /* ظل أكثر نعومة وانتشاراً */
    border-color: var(--primary_color);
}

/* أنواع الوسائط المختلفة */
.media-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-preview:hover .media-container img {
    transform: scale(1.08);
}

.media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-container.youtube {
    background: linear-gradient(135deg, var(--error_color, #C75252) 0%, oklab(from var(--error_color) calc(l - 0.1) a b) 100%);
    color: white;
    flex-direction: column;
    gap: 12px;
}

.media-container.text-only {
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--primary_dark_color, #4e6556) 100%);
    color: white;
    flex-direction: column;
    gap: 8px;
}

.media-icon {
    font-size: 2.5em;
    opacity: 0.9;
}

.media-label {
    font-size: 1em;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
}

/* مؤشر نوع الوسائط */
.media-type-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.media-type-indicator.image {
    background: oklab(from var(--success_color) l a b / 0.9);
}

.media-type-indicator.video {
    background: oklab(from var(--info_color) l a b / 0.9);
}

.media-type-indicator.youtube {
    background: oklab(from var(--error_color) l a b / 0.9);
}

/* محتوى المقال في الصفحة الرئيسية */
.article-content {
    padding: 2px 12px; /* 5px للأعلى والأسفل، 12px لليمين واليسار */
}

.article-preview h3 {
    font-family: 'Cairo', serif;
    font-size: 1em;
    margin: 0 0 2px 0;
    line-height: 1.4;
    color: var(--text_color);
}

.article-preview h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-preview h3 a:hover {
    color: var(--primary_color);
}

.article-preview p {
    font-family: 'Noto Naskh Arabic', serif;
    color: var(--secondary_text_color);
    line-height: 1.6;
    margin: 6px 0;
    font-size: 1em;
    text-align: justify;
    direction: rtl;
}

.article-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 6px 0;
    padding: 6px 0 0 0;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: var(--secondary_text_color);
    flex-wrap: nowrap !important;
    gap: 15px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0 !important;
}

/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.read-more {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    color: white !important;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    margin-top: 10px;
    font-size: 0.9em;
    float: left;
    border: none;
}

.read-more:hover {
    background: linear-gradient(135deg, var(--secondary_color, #5C6B73) 0%, var(--primary_color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px oklab(from var(--secondary_color) l a b / 0.4);
}

/* نصوص الترحيب والعناوين */
.welcome-text {
    text-align: center;
    margin: 18px 0;
    padding: 18px;
    font-family: 'Cairo', sans-serif;
    color: var(--secondary_text_color);
    font-size: 0.95em;
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid var(--primary_color);
}

/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.section-title {
    text-align: center;
    margin: 10px 0 6px 0;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    color: white !important;
    border-radius: 8px;
    font-family: 'El Messiri', serif;
    font-size: 1.5em;
    box-shadow: 0 2px 10px oklab(from var(--primary_color) l a b / 0.3);
}

.archive-link {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, oklab(from var(--secondary_color) calc(l + 0.4) a b / 1) 0%, oklab(from var(--secondary_color) calc(l + 0.35) a b / 1) 100%);
    border-radius: 8px;
    border-left: 4px solid var(--secondary_color);
    box-shadow: 0 2px 10px oklab(from var(--secondary_color) l a b / 0.1);
}

.archive-link a {
    color: var(--secondary_color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    font-family: 'Cairo', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.archive-link a:hover {
    color: oklab(from var(--secondary_color) calc(l - 0.2) a b);
    transform: translateY(-1px);
}

/* ===== أنماط صفحة المقال (subject.php) ===== */

/* إعدادات الخطوط المحسنة */
.article-title {
    font-family: 'Amiri', serif !important;
    font-size: 1.9em !important;
    font-weight: 700 !important;
    color: var(--text_color) !important;
    text-align: center !important;
    margin: 25px 0 !important;
    line-height: 1.4 !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.article-content {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: var(--font-size, 18px);
    line-height: 1.8;
    color: #333;
    text-align: justify;
    margin: 5px 0;
}

/* إزالة التعارض مع إعدادات PHP */
#article-content {
    font-family: inherit;
    font-size: inherit;
}

/* تنسيق الفقرات في المقالات */
.article-content p {
    margin-bottom: 0.75em;
    text-indent: 1em;
    line-height: 1.8;
}

/* تنسيق إضافي للفقرات في المعاينات */
.article-preview p {
    margin-bottom: 1.2em;
    text-indent: 1.5em;
}

/* تحسين شامل لعرض الوسائط في المتن */
.article-content img,
#main img,
div[id="main"] img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    border-radius: 6px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
    margin: 12px auto;
    display: block;
    border: 1px solid #eee;
}

.article-content video,
#main video,
div[id="main"] video {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    margin: 18px auto;
    display: block;
    background: #000;
}

.article-content audio,
#main audio,
div[id="main"] audio {
    width: 100% !important;
    max-width: 500px !important;
    margin: 18px auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

.article-content iframe,
#main iframe,
div[id="main"] iframe {
    max-width: 100% !important;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    margin: 18px auto;
    display: block;
    border: none;
}

.article-content div[style*="position: relative"],
#main div[style*="position: relative"] {
    margin: 20px auto !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
}

/* قسم التنقل (Breadcrumb) المحدث */
.breadcrumb-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px;
    border-radius: 6px;
    margin: 18px 0;
    border-left: 4px solid var(--primary_color);
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
}

.breadcrumb-item {
    margin: 6px 0;
    font-size: 0.9em;
}

.breadcrumb-item i {
    color: var(--primary_color);
    margin-left: 6px;
}

/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.breadcrumb-item.subject-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: none;
}

.breadcrumb-item.subject-title i {
    color: #ffffff;
    margin-left: 8px;
    font-size: 1em;
}

/* أدوات التحكم في الخط */
.top-font-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 18px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #eee;
    flex-wrap: nowrap;
}

.top-font-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 8px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    text-decoration: none;
    color: #333;
    font-size: 0.7em;
    white-space: nowrap;
    flex-shrink: 0;
}

.top-font-btn:hover {
    background: var(--primary_color);
    color: white;
    border-color: var(--primary_color);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.top-font-btn i {
    font-size: 0.9em;
}

/* تحسين الصورة */
.article-image {
    text-align: center;
    margin: 25px 0;
}

.article-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    border: 2px solid #eee;
}

.article-author {
    text-align: left;
    font-style: italic;
    color: var(--light_text_color);
    margin-top: 25px;
    padding-top: 18px;
    border-top: 2px solid #eee;
    font-family: 'Cairo', sans-serif;
}

/* أدوات المقال المصغرة */
.article-tools-section {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.1);
    margin: 18px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: #f8f9fa;
    border: 2px solid #eee;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75em;
}

.tool-btn:hover {
    background: var(--primary_color);
    color: white;
    border-color: var(--primary_color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tool-btn i {
    font-size: 1.2em;
}

/* صندوق المشاركة */
.share-section {
    background: oklab(from var(--primary_color) calc(l + 0.35) a b / 0.5);
    padding: 18px;
    border-radius: 6px;
    border: 1px solid oklab(from var(--primary_color) calc(l + 0.2) a b);
    margin: 18px 0;
    text-align: center;
}

.share-section h3 {
    color: var(--primary_dark_color, #4e6556);
    margin-bottom: 12px;
    font-family: 'El Messiri', serif;
    font-size: 1.2em;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: white !important;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8em;
    white-space: nowrap;
}

.share-btn span {
    color: white !important;
}


.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* ===== بداية: تلوين أزرار المشاركة بألوانها الخاصة ===== */

/* فيسبوك */
.share-btn.facebook {
    background-color: #3b5998;
}
.share-btn.facebook:hover {
    background-color: #324b81; /* درجة أغمق عند التمرير */
}

/* تويتر (X) */
.share-btn.twitter {
    background-color: #1da1f2; /* يمكنك تغييره إلى #000000 للون X الأسود */
}
.share-btn.twitter:hover {
    background-color: #1a8cd8; /* درجة أغمق */
}

/* واتساب */
.share-btn.whatsapp {
    background-color: #25d366;
}
.share-btn.whatsapp:hover {
    background-color: #1ebe5a; /* درجة أغمق */
}

/* تليجرام */
.share-btn.telegram {
    background-color: #0088cc;
}
.share-btn.telegram:hover {
    background-color: #007ab8; /* درجة أغمق */
}

/* البريد الإلكتروني */
.share-btn.email {
    background-color: #7f7f7f; /* لون رمادي عام */
}
.share-btn.email:hover {
    background-color: #6a6a6a; /* درجة أغمق */
}

/* تأثيرات التفاعل العامة المشتركة (مهم جداً) */
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

/* ===== نهاية: تلوين أزرار المشاركة ===== */


/* التنقل بين المواضيع */
.navigation-section {
    margin: 30px 0;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #ddd;
}

.nav-link {
    padding: 18px;
    background: white;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 90px;
}

.nav-link:hover {
    background: oklab(from var(--primary_color) calc(l + 0.3) a b);
    color: var(--primary_dark_color, #4e6556);
}

.nav-link i {
    font-size: 1.8em;
    color: var(--primary_color);
    transition: color 0.3s ease;
}

.nav-link:hover i {
    color: var(--primary_dark_color, #4e6556);
}

.nav-link.prev {
    text-align: right;
    justify-content: flex-end;
}

.nav-link.next {
    text-align: left;
    justify-content: flex-start;
}

/* قسم التعليقات */
.comments-section {
    background: linear-gradient(135deg, oklab(from var(--secondary_color) calc(l + 0.4) a b / 1) 0%, oklab(from var(--secondary_color) calc(l + 0.35) a b / 1) 100%);
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
    border-left: 4px solid var(--secondary_color);
}

.comments-section h3 {
    color: var(--secondary_color);
    margin-bottom: 12px;
    font-family: 'El Messiri', serif;
    font-size: 1.2em;
}

.comment-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--secondary_color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: bold;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    border: none;
}

.comment-btn:hover {
    background: oklab(from var(--secondary_color) calc(l - 0.1) a b);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px oklab(from var(--secondary_color) l a b / 0.4);
}

/* --- تعديل --- : تطبيق التدرج اللوني المتباين على أزرار التعليقات */
.comment-btn.add,
.comment-btn.view {
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    border: none;
    color: white !important;
}

.comment-btn.add:hover,
.comment-btn.view:hover {
    background: linear-gradient(135deg, var(--secondary_color, #5C6B73) 0%, var(--primary_color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px oklab(from var(--secondary_color) l a b / 0.4);
}

/* الروابط الاجتماعية */
/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.social-section {
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
    text-align: center;
    color: white;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.social-section h3 {
    margin-bottom: 18px;
    color: white;
    font-family: 'El Messiri', serif;
    font-size: 1.2em;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 0.85em;
    white-space: nowrap;
}

.social-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.5);
}

.social-link i {
    font-size: 1.1em;
}

/* تحسين تحميل الصور */
.media-container img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-container img[loading="lazy"].loaded {
    opacity: 1;
}

/* أنماط البحث */
.search-container {
    max-width: 900px;
    margin: 18px auto;
    padding: 18px;
    font-family: 'Cairo', sans-serif;
}

.search-header {
    text-align: center;
    margin-bottom: 25px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border-left: 4px solid var(--primary_color);
}

.search-header h1 {
    font-family: 'El Messiri', serif;
    color: var(--text_color);
    margin-bottom: 8px;
    font-size: 1.8em;
}

.search-form-main {
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.search-form-main .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form-main input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.search-form-main input[type="text"]:focus {
    outline: none;
    border-color: var(--primary_color);
    box-shadow: 0 0 6px oklab(from var(--primary_color) l a b / 0.3);
}

.search-form-main select {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    min-width: 180px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.search-form-main select:focus {
    outline: none;
    border-color: var(--primary_color);
}

/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.search-form-main input[type="submit"] {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-width: 90px;
}

.search-form-main input[type="submit"]:hover {
    background: linear-gradient(135deg, var(--secondary_color, #5C6B73) 0%, var(--primary_color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px oklab(from var(--secondary_color) l a b / 0.4);
}

.search-results-header {
    background: oklab(from var(--success_color) calc(l + 0.3) a b / 0.5);
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 18px;
    border-left: 4px solid var(--success_color);
}

.search-results-header h2 {
    color: var(--success_color);
    margin: 0;
    font-family: 'El Messiri', serif;
    font-size: 1.3em;
}

.search-result-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    text-align: justify;
    direction: rtl;
}

.search-result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    border-color: var(--primary_color);
}

.search-result-number {
    color: var(--search_number_color, #607d6b);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.search-result-title {
    margin: 8px 0;
    font-size: 1.3em;
    text-align: center;
}

.search-result-title a {
    color: var(--text_color);
    text-decoration: none;
    font-family: 'Amiri', serif;
    line-height: 1.4;
}

.search-result-title a:hover {
    color: var(--primary_color);
}

.search-result-meta {
    color: var(--light_text_color);
    font-size: 0.85em;
    margin: 8px 0;
    text-align: center;
}

.search-result-meta a {
    color: var(--primary_color);
    text-decoration: none;
}

.search-result-meta a:hover {
    text-decoration: underline;
}

.search-result-content {
    line-height: 1.8;
    color: var(--text_color);
    font-size: 1em;
    margin: 12px 0;
    text-align: justify;
}

/* إصلاح تلوين البحث */
.search-highlight-title {
    background-color: var(--highlight_title_bg);
    color: var(--highlight_title_color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.search-highlight-body {
    background-color: var(--highlight_body_bg);
    color: var(--highlight_body_color);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.search-pagination {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.search-pagination a {
    color: var(--link_color);
    text-decoration: none;
    padding: 6px 10px;
    margin: 0 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.search-pagination a:hover {
    background: var(--primary_color);
    color: white;
}

.search-stats {
    text-align: left;
    margin: 20px 0;
    padding: 12px;
    background: linear-gradient(135deg, oklab(from var(--success_color) calc(l + 0.35) a b / 1) 0%, oklab(from var(--success_color) calc(l + 0.3) a b / 1) 100%);
    border-radius: 6px;
    color: oklab(from var(--success_color) calc(l - 0.2) a b);
    border-left: 4px solid var(--success_color);
    font-size: 0.9em;
}

.no-results {
    text-align: center;
    padding: 40px 18px;
    background: linear-gradient(135deg, oklab(from var(--warning_color) calc(l + 0.2) a b / 1) 0%, oklab(from var(--warning_color) calc(l + 0.1) a b / 1) 100%);
    border-radius: 6px;
    color: oklab(from var(--warning_color) calc(l - 0.4) a b);
    margin: 25px 0;
    border-left: 4px solid var(--warning_color);
}

.error-message {
    background: linear-gradient(135deg, oklab(from var(--error_color) calc(l + 0.2) a b / 1) 0%, oklab(from var(--error_color) calc(l + 0.1) a b / 1) 100%);
    color: oklab(from var(--error_color) calc(l - 0.2) a b);
    padding: 18px;
    border-radius: 6px;
    text-align: center;
    margin: 18px 0;
    border-left: 4px solid var(--error_color);
}

/* أنماط الأرشيف */
/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.archive-header {
    text-align: center;
    margin: 25px 0;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    color: white !important;
    border-radius: 8px;
    font-family: 'El Messiri', serif;
    font-size: 1em;
    box-shadow: 0 2px 10px oklab(from var(--primary_color) l a b / 0.3);
    border: none;
}

.archive-header h1 {
    font-family: 'El Messiri', serif;
    color: white !important;
    margin: 0;
    font-size: 1.5em;
}

.archive-stats {
    color: var(--light_text_color);
    font-size: 1em;
    font-family: 'Cairo', sans-serif;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin: 25px 0;
}

.archive-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.archive-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    border-color: var(--primary_color);
}

.archive-item h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
}

.archive-item h3 a {
    color: var(--text_color);
    text-decoration: none;
    font-family: 'Amiri', serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-item h3 a:hover {
    color: var(--primary_color);
}

.archive-item p {
    color: var(--light_text_color);
    line-height: 1.6;
    margin: 8px 0;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
}

.archive-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: #888;
    flex-wrap: wrap;
    gap: 8px;
}

.archive-date {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.archive-section {
    color: var(--primary_color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.archive-section:hover {
    text-decoration: underline;
}

.archive-views {
    background: var(--primary_color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* أنماط الأرشيف الكلاسيكي */
.archive-classic-container {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 900px;
    margin: 0 auto;
    padding: 18px;
}

.archive-classic-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 18px;
    border-radius: 6px;
    margin: 18px 0;
    text-align: center;
    border-left: 4px solid var(--primary_color);
}

.archive-classic-header h1 {
    font-family: 'El Messiri', serif;
    color: var(--text_color);
    font-size: 1.6em;
    margin: 0;
}

.archive-classic-content {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.archive-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.archive-item:hover {
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border-bottom: 1px solid transparent;
}

.archive-item:last-child {
    border-bottom: none;
}

.archive-item-title {
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.archive-bullet {
    color: var(--dots_color);
    font-size: 0.6em;
}

.archive-item-title a {
    color: var(--text_color);
    text-decoration: none;
    font-family: 'Amiri', serif;
    font-size: 1em;
    line-height: 1.4;
    flex: 1;
}

.archive-item-title a:hover {
    color: var(--link_hover_color);
}

.archive-item-meta {
    font-size: 0.85em;
    color: var(--light_text_color);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.archive-item-meta a {
    color: var(--link_hover_color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
}

.archive-item-meta a:hover {
    text-decoration: underline;
}

.meta-separator {
    color: var(--dots_color);
}

.archive-date {
    display: flex;
    align-items: center;
    gap: 3px;
}

.archive-pagination {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 6px;
    text-align: center;
    margin: 18px 0;
    border: 1px solid #eee;
}

/* إصلاح Pagination - منع كسر الأسطر */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding: 5px 0;
    white-space: nowrap;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap !important;
    white-space: nowrap;
    overflow-x: auto;
    padding: 5px 0;
}

.pagination-btn,
.pagination-num,
.current-page {
    color: var(--link_color);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 3px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid #ddd;
    background: white;
    font-size: 0.9em;
    flex-shrink: 0 !important;
    white-space: nowrap;
    min-width: auto;
}

.pagination-btn:hover,
.pagination-num:hover {
    background: var(--link_hover_color);
    color: white;
    border-color: var(--link_hover_color);
}

.current-page {
    background: var(--link_hover_color);
    color: white;
    font-weight: bold;
    border-color: var(--link_hover_color);
}

.pagination-ellipsis {
    color: var(--light_text_color);
    padding: 6px 3px;
    flex-shrink: 0;
}

.pagination-label {
    color: var(--light_text_color);
    font-weight: bold;
    padding: 6px 10px;
    font-size: 0.9em;
    flex-shrink: 0;
}

.archive-stats {
    color: var(--light_text_color);
    font-size: 0.85em;
    margin-top: 8px;
    line-height: 1.6;
}

/* تحسينات متجاوبة */
@media (max-width: 1200px) {
    .article-content img,
    .article-content video,
    .article-content audio,
    #main img,
    #main video,
    #main audio {
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .articles-grid.two-rows,
    .articles-grid.single-row {
        grid-template-columns: 1fr;
        max-width: 100%;
        margin: 6px 0;
    }

    .article-preview {
        margin: 0 8px;
    }

    .media-container {
        height: 180px;
    }

    .article-content {
    padding: 0px 18px 0px 18px; /* الترتيب: أعلى، يمين، أسفل، يسار */
    }

    .section-title {
        font-size: 1.3em;
        margin: 5px 0 4px 0;
        padding: 4px;
    }

    .article-title {
        font-size: 1.6em !important;
    }

    .breadcrumb-item.subject-title {
        font-size: 1.2em;
        padding: 10px 12px;
    }

    .top-font-btn {
        padding: 5px 6px;
        font-size: 0.65em;
        gap: 2px;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 5px;
    }

    .nav-links {
        grid-template-columns: 1fr;
    }

    .comment-buttons {
        flex-direction: column;
        align-items: center;
    }

    .comment-btn {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }

    .social-links {
        gap: 6px;
    }

    .social-link {
        flex: 1 1 calc(50% - 3px);
        min-width: 110px;
        max-width: 140px;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.8em;
    }

    .share-buttons {
        gap: 5px;
    }

    .share-btn {
        flex: 1 1 calc(50% - 2px);
        min-width: 100px;
        max-width: 130px;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.75em;
    }

    .article-content img,
    .article-content video,
    .article-content audio,
    #main img,
    #main video,
    #main audio {
        max-width: 100% !important;
        border-radius: 4px;
        margin: 8px auto;
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    }

    /* إصلاح Pagination للهواتف */
    .pagination-container,
    .pagination-links {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .pagination-btn,
    .pagination-num,
    .current-page {
        font-size: 0.8em;
        padding: 4px 8px;
        min-width: 32px;
    }
}

@media (max-width: 480px) {
    .pagination-container {
        gap: 2px;
    }

    .pagination-btn,
    .pagination-num,
    .current-page {
        font-size: 0.75em;
        padding: 3px 6px;
        min-width: 28px;
    }
}

/* ===== تمييز الأقسام الرئيسية والفرعية ===== */

/* الأقسام الرئيسية */
.main-side-menu > li {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 4px solid var(--primary_color);
    margin-bottom: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-side-menu > li > a {
    display: block;
    padding: 15px 18px;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--primary_color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.main-side-menu > li > a:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateX(-2px);
}

/* الأقسام الفرعية */
.sub-menu {
    background: white;
    border-radius: 0 0 6px 6px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    margin-top: -5px;
    padding-top: 5px;
}

.sub-menu li {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.sub-menu li:before {
    position: absolute;
    right: 15px;
    color: #ccc;
    font-size: 0.8em;
}

.sub-menu li a {
    display: block;
    padding: 8px 15px 8px 35px;
    font-size: 0.9em;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sub-menu li a:hover {
    background: #f5f5f5;
    color: var(--primary_color);
    padding-right: 20px;
}

/* عداد المقالات */
.sub-menu li a .count {
    float: left;
    background: var(--primary_color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
}

/* خلفية فاتحة متناسقة مع ألوان الموقع */
.social-icons {
    background: linear-gradient(135deg, oklab(from var(--primary_color) calc(l + 0.35) a b / 0.5) 0%, oklab(from var(--primary_color) calc(l + 0.3) a b / 0.5) 100%) !important;
    border: 1px solid oklab(from var(--primary_color) calc(l + 0.2) a b) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px oklab(from var(--primary_color) l a b / 0.1) !important;
    padding: 18px 12px !important;
    margin: 15px 0 !important;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* تنسيق الأيقونات مع الخلفية الجديدة */
/* --- تعديل --- : تطبيق التدرج اللوني المتباين */
.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--secondary_color, #5C6B73) 100%);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
    box-shadow: 0 2px 6px oklab(from var(--secondary_color) l a b / 0.3);
    border: none;
}

.social-icons a:hover {
    background: linear-gradient(135deg, var(--secondary_color, #5C6B73) 0%, var(--primary_color) 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px oklab(from var(--secondary_color) l a b / 0.4);
}
/* Hide specific icons based on screen size - إخفاء أيقونات محددة بناءً على حجم الشاشة */
@media (min-width: 769px) {
    .mobile-toggle-icon {
        display: none; /* إخفاء أيقونة التبديل الخاصة بالهاتف على الكمبيوتر */
    }
}
@media (max-width: 768px) {
    .dropdown-toggle-icon {
        display: none; /* إخفاء أيقونة القائمة المنسدلة الخاصة بالكمبيوتر على الهاتف */
    }
}

/* === الإصلاح النهائي لأزرار المشاركة على الهاتف === */
@media (max-width: 768px) {
    .share-buttons {
        display: flex !important;
        justify-content: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding: 0 10px !important;
        -webkit-overflow-scrolling: touch;
    }

    .share-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        flex: none !important;
        flex-shrink: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        font-size: 16px !important;
        display: flex !important;
    }

    .share-btn span {
        display: none !important;
    }

    .share-btn i {
        font-size: 14px !important;
        margin: 0 !important;
        line-height: 1 !important;
    }
}

/* =================================================== */
/* ==   أنماط جديدة لعرض المقالات بـ 3 أو 4 أعمدة   == */
/* =================================================== */

/* تنسيق لعرض ثلاثة أعمدة ثابتة */
.articles-grid.three-columns {
    grid-template-columns: repeat(3, 1fr); /* إنشاء 3 أعمدة متساوية */
}

/* تنسيق لعرض أربعة أعمدة ثابتة */
.articles-grid.four-columns {
    grid-template-columns: repeat(4, 1fr); /* إنشاء 4 أعمدة متساوية */
}


/* ======================================= */
/* ==   التصميم المتجاوب للأنماط الجديدة   == */
/* ======================================= */

/* للشاشات المتوسطة (مثل الأجهزة اللوحية) - نعرض عمودين */
@media (max-width: 992px) {
    .articles-grid.three-columns,
    .articles-grid.four-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* للشاشات الصغيرة (مثل الهواتف) - نعرض عموداً واحداً */
/* هنا نُضيف الكلاسات الجديدة إلى القاعدة الموجودة لديك بالفعل */
@media (max-width: 768px) {
    .articles-grid.three-columns,
    .articles-grid.four-columns {
        grid-template-columns: 1fr; /* عرض عمود واحد فقط */
    }
}
/* تصميم أفقي لقسم أخبار وتقارير بموضوع مميز */
.featured-horizontal-layout {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    background: #f9fafb; /* خلفية خفيفة لكسر وحدة اللون */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    padding: 24px;
    flex-wrap: wrap;
}

.featured-main-article {
    flex: 2 1 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 340px;
}

.featured-main-article .media-container {
    height: 275px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
}

.featured-content h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}
.featured-content .featured-excerpt {
    color: #555;
    margin-bottom: 14px;
    font-size: 1em;
    text-align: justify;
}
.featured-date-counter {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    color: var(--secondary_text_color, #6c6c6c);
    font-size: 0.95em;
    align-items: center;
}
.featured-content .read-more {
    background: linear-gradient(135deg, var(--primary_color, #607d6b) 0%, var(--secondary_color, #5c6b73) 100%);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-family: 'Cairo', sans-serif;
    transition: background .2s;
    font-size: 0.95em;
    margin-top: 8px;
    display: inline-block;
}
.featured-content .read-more:hover {
    background: linear-gradient(135deg, var(--secondary_color, #5c6b73) 0%, var(--primary_color, #607d6b) 100%);
}

.featured-side-list {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 210px;
    max-width: 340px;
}

.side-article-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    padding: 8px;
    transition: box-shadow .2s, transform .2s;
}

.side-article-item:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.11);
    transform: translateY(-2px);
}

.side-media img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    background: #ededed;
}

.side-article-title a {
    font-size: 1.03em;
    color: var(--primary_color, #607d6b);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Cairo',sans-serif;
}
.side-article-title a:hover {
    color: var(--secondary_color, #5c6b73);
}
@media (max-width: 992px) {
    .featured-horizontal-layout {
        flex-direction: column;
        gap: 12px;
        padding: 10px;
    }
    .featured-main-article .media-container {
        height: 200px;
    }
}


/* ---  قسم المقالات تصميم شريط التمرير الأفقي (Carousel) --- */

/* 1. الغلاف الرئيسي للقسم */
.carousel-section-wrapper {
    position: relative;
    width: 100%;
    padding: 0 40px; /* مساحة جانبية للأزرار على الشاشات الكبيرة */
    box-sizing: border-box; /* لضمان أن الحشوة لا تزيد العرض */
}

/* 2. حاوية التمرير (النافذة) - هذا هو الجزء الذي تم تصحيحه */
.horizontal-carousel-container {
    display: flex;
    overflow-x: auto; /* تفعيل التمرير الأفقي هنا */
    scroll-behavior: smooth; /* تمرير ناعم عند استخدام الأزرار */
    scroll-snap-type: x mandatory; /* لتحسين توقف التمرير عند العناصر */
    -webkit-overflow-scrolling: touch; /* لتحسين التمرير باللمس */
    scrollbar-width: none; /* إخفاء شريط التمرير في Firefox */
}

/* إخفاء شريط التمرير في متصفحات WebKit */
.horizontal-carousel-container::-webkit-scrollbar {
    display: none;
}

/* 3. المسار الذي يحمل العناصر */
.carousel-track {
    display: flex; /* يجعل العناصر تصطف أفقيًا */
    gap: 20px; /* المسافة بين العناصر */
    padding-bottom: 15px; /* مساحة للظل السفلي إذا وجد */
}

/* 4. كل عنصر داخل الشريط */
.carousel-item {
    flex: 0 0 24%; /* عرض 4 عناصر في الشاشة الكبيرة */
    min-width: 0;
    scroll-snap-align: start; /* يضمن توقف التمرير عند بداية العنصر */
}

/* تنسيق اسم الكاتب داخل الكاروسيل */
.carousel-item .author-name-preview {
    display: block;
    font-size: 0.85em;
    color: var(--secondary_text_color, #6c6c6c);
    margin-top: 5px;
}

/* 5. أزرار التنقل */
.carousel-nav {
    position: static; /* لا حاجة لتغييره */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    font-size: 1.2em;
    color: var(--primary_color);
}

.carousel-btn:hover {
    background-color: var(--primary_color);
    color: #fff;
    border-color: var(--primary_color);
}

/* الأزرار في تصميم RTL */
.carousel-btn.prev { right: -5px; }
.carousel-btn.next { left: -5px; }

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- تصميم متجاوب للشريط --- */

@media (max-width: 1200px) {
    .carousel-item { flex-basis: 31%; } /* عرض 3 عناصر */
}

@media (max-width: 992px) {
    .carousel-item { flex-basis: 48%; } /* عرض عنصرين */
}

@media (max-width: 768px) {
    .carousel-section-wrapper {
        padding: 0 10px; /* تقليل المساحة الجانبية على الهاتف */
    }
    .carousel-item {
        flex-basis: 60%; /* عرض عنصر ونصف تقريبا */
    }
    /* إخفاء الأزرار على الهواتف والاعتماد على السحب */
    .carousel-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .carousel-item {
        flex-basis: 85%; /* عرض عنصر واحد تقريبا */
    }
}




/* --- تصميم الشبكة المختلطة (لقضية رأي عام) --- */
.mixed-grid-background {
    background-color: #f8f9fa; /* لون خلفية مميز وخفيف */
    padding: 25px;
    margin: 40px 0;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.mixed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* شبكة من 3 أعمدة */
    grid-auto-rows: minmax(180px, auto); /* ارتفاع تلقائي للصفوف */
    gap: 20px;
}

/* المقال المميز (الأول) */
.mixed-grid .mixed-grid-featured {
    grid-column: span 2; /* يمتد على عرض عمودين */
    grid-row: span 2;    /* يمتد على ارتفاع صفين */
}

/* تعديلات على محتوى المقال المميز ليتناسب مع حجمه الكبير */
.mixed-grid .mixed-grid-featured .media-container {
    height: 320px; /* صورة أطول للمقال المميز */
}
.mixed-grid .mixed-grid-featured h3 {
    font-size: 1.7em; /* عنوان أكبر */
    line-height: 1.4;
}
.mixed-grid .mixed-grid-featured .featured-excerpt {
    font-size: 1em;
    color: var(--secondary_text_color);
    margin-top: 10px;
}

/* تصميم متجاوب للشبكة المختلطة */
@media (max-width: 992px) {
    .mixed-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mixed-grid .mixed-grid-featured {
        grid-column: span 2; /* يأخذ العرض الكامل */
        grid-row: span 1;    /* يعود لارتفاع صف واحد */
    }
    .mixed-grid .mixed-grid-featured .media-container {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .mixed-grid {
        grid-template-columns: 1fr; /* عمود واحد على الهواتف */
    }
    .mixed-grid .mixed-grid-featured,
    .mixed-grid .article-preview {
        grid-column: span 1; /* إعادة تعيين الامتداد */
        grid-row: span 1;
    }
    .mixed-grid .mixed-grid-featured .media-container {
        height: 220px;
    }
    .mixed-grid .mixed-grid-featured h3 {
        font-size: 1.4em;
    }
}
/* ================================== */
/* == أنماط قسم إحصاءات الموقع == */
/* ================================== */

.site-stats-container {
    padding: 30px 20px;
    margin: 30px 0;
    background: linear-gradient(135deg, var(--primary_color) 0%, var(--primary_dark_color, #4e6556) 100%);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.site-stats-container .section-title {
    color: #fff !important;
    background: transparent !important; /* إزالة الخلفية المزدوجة */
    box-shadow: none !important;
    padding-top: 0;
    margin-top: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 25px;
    margin-top: 10px;
}

.stat-box {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.stat-box:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 2em;
    color: #fff;
    opacity: 0.9;
}

.stat-content {
    text-align: right;
	flex: 1; /* ← السماح لهذا العنصر بالتمدد ليأخذ المساحة المتبقية */
    min-width: 0; /* ← حيلة احترافية لمنع العناصر المرنة من الخروج عن حاويتها */

}

.stat-number {
    font-family: 'Cairo', sans-serif;
    font-size: 1em;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.9em;
    color: #fff;
    opacity: 0.8;
}

/* تصميم متجاوب للإحصاءات */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    .stat-box {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 20px 15px;
    }
    .stat-content {
        text-align: center;
    }
}



/* ===== الفوتر الرئيسي ===== */
.site-footer {
    background: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
    color: #ecf0f1;
    margin-top: 10px;
    font-family: 'Cairo', sans-serif;
}

.footer-main {
    padding: 20px 0 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 180px 1fr 1fr 1fr;
    gap: 70px;
    align-items: start;
}

/* القسم الأول (الصورة) */
.footer-column:first-child {
    width: 180px;
    justify-self: start;
}

/* الأقسام الثلاثة الأخرى متساوية */
.footer-column:nth-child(2),
.footer-column:nth-child(3),
.footer-column:nth-child(4) {
    width: 100%;
    min-width: 0;
}

/* تحسين محاذاة العناوين */
.footer-column h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    white-space: nowrap;
}

/* للشاشات المتوسطة */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .footer-column:first-child {
        width: 100%;
    }
}

/* للشاشات الصغيرة */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}




/* أعمدة الفوتر */
.footer-column {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-column h3 {
    color: #fff;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color, #1673a3);
    display: inline-block;
}

.footer-column p {
    line-height: 1.8;
    color: #bdc3c7;
    margin-bottom: 15px;
    font-size: 0.95em;
}

/* شعار الفوتر بنفس طريقة الكود الأصلي */
.footer-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 8px;
}

.footer-logo a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.footer-logo img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.footer-logo a:hover img {
    opacity: 0.8;
    transform: scale(1.05);
}

/* قسم عن الموقع */
.footer-about p {
    font-size: 0.95em;
}

/* روابط التواصل الاجتماعي */
.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--primary-color, #1673a3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(22, 115, 163, 0.4);
}

/* الروابط في الفوتر */
.footer-links ul,
.footer-pages ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-pages li {
    margin-bottom: 12px;
}

.footer-links a,
.footer-pages a {
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.footer-links a:hover,
.footer-pages a:hover {
    color: #fff;
    padding-right: 8px;
}

.footer-links a i,
.footer-pages a i {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.footer-links a:hover i,
.footer-pages a:hover i {
    transform: translateX(-3px);
}

/* إحصائيات الموقع */
.footer-stats-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-stats {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-stats ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-stats li {
    color: #bdc3c7;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95em;
}

.footer-stats li:last-child {
    margin-bottom: 0;
}

.footer-stats i {
    color: var(--primary-color, #1673a3);
    font-size: 1.2em;
    width: 25px;
    text-align: center;
}

.footer-stats .stat-number {
    color: #fff;
    font-weight: 700;
    font-size: 1.1em;
}

.footer-stats .stat-label {
    color: #95a5a6;
    font-size: 0.9em;
}

/* الفوتر السفلي */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 0;
}

.footer-bottom-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    text-align: center;
}

.footer-bottom p {
    color: #95a5a6;
    margin: 0;
    font-size: 0.9em;
}

.footer-bottom a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #fff;
}

/* استجابة للأجهزة اللوحية */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        justify-items: center;
        text-align: center;
    }
    
    .footer-main {
        padding: 40px 0 25px;
    }
    
    .footer-column {
        animation-delay: 0s !important;
        width: 100%;
        max-width: 300px;
    }
    
    .footer-logo {
        margin: 0 auto 15px;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-links ul,
    .footer-pages ul {
        text-align: center;
    }
    
    .footer-links a,
    .footer-pages a {
        justify-content: center;
    }
    
    .footer-bottom-wrapper {
        flex-direction: column;
        text-align: center;
    }
}

/* استجابة للهواتف */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        justify-items: center;
        text-align: center;
    }
    
    .footer-main {
        padding: 35px 0 20px;
    }
    
    .footer-column {
        width: 100%;
        max-width: 280px;
    }
    
    .footer-column h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }
    
    .footer-logo {
        max-width: 120px;
        margin: 0 auto 15px;
    }
    
    .footer-logo img {
        max-width: 120px;
        border-radius: 8px;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-stats {
        padding: 15px;
        text-align: right;
    }
    
    .footer-stats li {
        font-size: 0.9em;
        justify-content: center;
    }
    
    .footer-links ul,
    .footer-pages ul {
        text-align: center;
    }
    
    .footer-links a,
    .footer-pages a {
        justify-content: center;
    }
    
    .footer-bottom-wrapper {
        flex-direction: column;
        text-align: center;
    }
}

/* للهواتف الصغيرة جداً */
@media (max-width: 480px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
        justify-items: center;
    }
    
    .footer-column {
        width: 100%;
        max-width: 100%;
        text-align: center;
    }
    
    .footer-logo {
        max-width: 110px;
        margin: 0 auto 15px;
    }
    
    .footer-logo img {
        max-width: 110px;
        border-radius: 8px;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* تأثيرات التحميل التدريجي */
.footer-column:nth-child(1) { animation-delay: 0.1s; }
.footer-column:nth-child(2) { animation-delay: 0.2s; }
.footer-column:nth-child(3) { animation-delay: 0.3s; }
.footer-column:nth-child(4) { animation-delay: 0.4s; }

/* تحسين قابلية القراءة */
.footer-column a {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* تأثيرات hover إضافية */
.footer-stats li:hover {
    transform: translateX(-3px);
    transition: transform 0.3s ease;
}

.footer-stats li:hover i {
    transform: scale(1.2);
}


/* قسم معلومات الكاتب */
.article-author-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid var(--primary-color, #1673a3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-image-link {
    flex-shrink: 0;
}

.author-image {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color, #ddd);
    transition: all 0.3s ease;
}

.author-image:hover {
    transform: scale(1.05);
    border-color: var(--primary-color, #1673a3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.author-name-box {
    font-size: 1.1em;
}

.author-label {
    color: var(--secondary-text-color, #666);
    font-weight: 600;
}

.author-name-link {
    color: var(--link-color, #1673a3);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-name-link:hover {
    color: var(--link-hover-color, #0d4b68);
    text-decoration: underline;
}

.author-person-name {
    color: var(--text-color, #333);
    font-weight: 700;
}

/* قسم أحدث مقالات الكاتب */
.author-recent-articles {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 3px solid var(--primary-color, #1673a3);
}

.recent-title {
    color: var(--title-color, #0d4b68);
    font-size: 1.3em;
    margin-bottom: 15px;
    font-family: 'Cairo', sans-serif;
}

.recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color, #ddd);
}

.recent-list li:last-child {
    border-bottom: none;
}

.recent-list li::before {
    content: '•';
    color: var(--primary-color, #1673a3);
    font-weight: bold;
    margin-left: 10px;
}

.recent-list a {
    color: var(--link-color, #1673a3);
    text-decoration: none;
    transition: all 0.3s ease;
}

.recent-list a:hover {
    color: var(--link-hover-color, #0d4b68);
    padding-right: 5px;
}

.article-category {
    color: var(--secondary-text-color, #666);
    font-size: 0.9em;
    font-style: italic;
}

/* استجابة للهواتف */
@media (max-width: 768px) {
    .article-author-section {
        flex-direction: column;
        text-align: center;
    }
    
    .author-image {
        width: 100px;
        height: 125px;
    }
    
    .author-name-box {
        font-size: 1em;
    }
}




/* توحيد خطوط صفحة الموسوعة */
.articles-grid .article-preview h3,
.articles-grid .article-preview h3 a {
    font-family: 'Cairo',sans-serif;
    font-size: 0.95em;
    color: var(--primary_color, #607d6b);
}

.articles-grid .article-preview h3 a:hover {
    color: var(--primary-color, #1673a3) !important;
}

