/* التنسيق العام للحاوية */
.category-posts-grid {
    padding: 20px; /* إبقاء البادينج العام للحاوية */
}

/* التنسيق العام لبطاقة المنشور */
.post-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
}

/* تنسيق الصورة المصغرة في البطاقة */
.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid #0073aa;
}

/* تنسيق محتوى المنشور في البطاقة */
.post-content {
    padding: 20px;
}

.post-title {
    margin: 0 0 10px;
    font-size: 1.4em;
    line-height: 1.3;
}

.post-title a {
    color: #2a2a2a;
    text-decoration: none;
}

.post-title a:hover {
    color: #0073aa;
}

.post-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.post-meta span {
    margin-right: 15px;
}

.post-excerpt {
    color: #444;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background 0.3s;
}

.read-more:hover {
    background: #005a87;
}

/* التقسيم إلى صفحات */
/* التنسيق العام */
.category-pagination {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* يسمح بعملية اللف للعناصر على الجوال */
    gap: 5px; /* مسافة بين الأزرار */
}

.category-pagination a,
.category-pagination span {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.3s;
    text-align: center;
    min-width: 40px; /* عرض ثابت للأرقام */
}

/* التنسيق النشط */
.category-pagination .current {
    background: #0073aa;
    color: #fff !important;
    border-color: #0073aa;
}

/* تنسيق الأزرار عند التحويم */
.category-pagination a:hover {
    background: #f5f5f5;
}

/* تنسيقات خاصة بالجوال */
@media (max-width: 480px) {
    .category-pagination a,
    .category-pagination span {
        padding: 8px 12px; /* تقليل الحشو */
        font-size: 14px; /* تصغير الخط */
        min-width: 35px; /* تصغير العرض */
    }

    /* إخفاء الأرقام الزائدة وعرض "..." */
    .category-pagination .page-numbers:not(.current):not(.prev):not(.next) {
        display: none;
    }

    .category-pagination .prev,
    .category-pagination .next {
        display: inline-block !important;
    }

    /* إضافة "..." بين الأزرار */
    .category-pagination .dots {
        display: inline-block;
        padding: 8px 5px;
    }
}

/* تصميم متجاوب (للحاوية العامة) */
@media (max-width: 768px) {
    .category-posts-grid {
        /* هذا قد يؤثر على كلا العرضين في الشاشات الصغيرة،
           اعتماداً على الهيكل يجب التأكد من التنسيق المطلوب هنا */
        display: flex;
        flex-direction: column;
    }
}

/* التبديل بين طرق العرض 
.view-toggle {
    margin-bottom: 30px;
    text-align: right;
}

.view-toggle button {
    padding: 8px 20px;
    border: 2px solid #0073aa;
    background: #fff;
    color: #0073aa;
    cursor: pointer;
    transition: all 0.3s;
}

.view-toggle button.active {
    background: #0073aa;
    color: #fff;
}*/


.view-toggle {
    margin-bottom: 30px;
    text-align: left;
}

.view-toggle button {
    background: none;
    border: none;
    padding: 5px;
    margin-left: 10px;
    margin-top:4px;
    color: #0073aa;
    font-size: 22px; /* تكبير الأيقونة */
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10%;
}

.view-toggle button:hover {
    background-color: rgba(0, 115, 170, 0.1); /* خلفية خفيفة عند التمرير */
}

.view-toggle button.active {
    background-color: #0073aa;
      background-color: rgba(0, 115, 170, 0.1); /* خلفية خفيفة عند التمرير */
    
    color: #fff;
    color: rgb(255, 193, 7);
    /*box-shadow: 0 0 5px rgba(0, 115, 170, 0.5); */
}



/* عرض البطاقات (الافتراضي) */
.category-posts.card-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    /* تم نقل تعريف الجريد والفجوة إلى هنا لتجنب التكرار مع .category-posts-grid */
}

/* عرض القائمة */
.category-posts.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* تعديل تنسيق البطاقة داخل عرض القائمة */
.category-posts.list-view .post-card {
    display: flex;
    align-items: center;
    /* تم نقل هذه التعديلات لخاصة بعرض القائمة هنا */
    background: #fff; /* قواعد قد تحتاج إلى تحديد هنا إذا كانت تختلف عن العرض الافتراضي */
    padding: 15px; /* قواعد قد تحتاج إلى تحديد هنا إذا كانت تختلف عن العرض الافتراضي */
    border-radius: 8px; /* قواعد قد تحتاج إلى تحديد هنا إذا كانت تختلف عن العرض الافتراضي */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* قواعد قد تحتاج إلى تحديد هنا إذا كانت تختلف عن العرض الافتراضي */
    overflow: visible; /* قد تحتاج لتغيير هنا للسماح بظهور الظلال أو غيرها */
    transition: none; /* قد لا تحتاج تحويل في عرض القائمة */
    transform: none; /* قد لا تحتاج تحويل في عرض القائمة */
}

/* تعديل تنسيق الصورة المصغرة داخل عرض القائمة */
.category-posts.list-view .post-thumbnail {
    flex: 0 0 200px; /* تحديد عرض ثابت للصورة */
    margin-right: 20px;
    /* قواعد قد تحتاج لتحديد حجم الصورة بداخلها أيضاً */
}

.category-posts.list-view .post-thumbnail img {
    width: 100%; /* اجعل الصورة تملأ الحاوية الجديدة */
    height: auto; /* اسمح بارتفاع تلقائي للحفاظ على نسبة العرض للارتفاع */
    object-fit: cover;
    border-bottom: none; /* قد تحتاج لإزالة الحد السفلي */
    border-radius: 4px; /* إضافة حواف مستديرة */
}

/* تعديل تنسيق المحتوى داخل عرض القائمة */
.category-posts.list-view .post-content {
     flex: 1; /* اجعل المحتوى يأخذ المساحة المتبقية */
     padding: 0; /* قد تحتاج لضبط البادينج */
}

/* تعديل تنسيق الأجزاء الأخرى داخل عرض القائمة إذا لزم الأمر */
.category-posts.list-view .post-title {
    font-size: 1.2em; /* قد تحتاج لحجم خط أصغر في القائمة */
    margin-bottom: 5px;
}

.category-posts.list-view .post-meta {
    margin-bottom: 5px;
}

.category-posts.list-view .post-excerpt {
    display: none; /* غالباً يتم إخفاء الملخص في عرض القائمة */
}

.category-posts.list-view .read-more {
    /* قد تحتاج لتعديل تنسيق زر "اقرأ المزيد" في عرض القائمة */
    padding: 5px 10px;
    font-size: 0.8em;
}



/* تنسيقات عامة للقائمة */
.category-posts.list-view .post-card {
    display: grid;
    grid-template-columns: 1fr 2fr; /* تقسيم الصورة والمحتوى */
    gap: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 25px;
}

/* الصورة في وضع القائمة */
.category-posts.list-view .post-thumbnail {
    position: relative;
    min-height: 200px; /* ارتفاع ثابت للصور */
}

.category-posts.list-view .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* اقتصاص الذكي للصورة */
    border-radius: 12px 0 0 12px;
}

/* محتوى النص */
.category-posts.list-view .post-content {
    padding: 20px 20px 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* اقتصاص العناوين الطويلة */
.post-title {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* عدد الأسطر */
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 15px 0;
    font-size: 1.4em;
}

/* اقتصاص النبذة */
.post-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* عدد الأسطر */
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #555;
    line-height: 1.6;
}

/* تصميم متجاوب للجوال */
@media (max-width: 768px) {
    .category-posts.list-view .post-card {
        grid-template-columns: 1fr; /* عمود واحد للجوال */
        gap: 0;
    }
    
    .category-posts.list-view .post-thumbnail {
        min-height: 150px;
        border-radius: 12px 12px 0 0;
    }
    
    .category-posts.list-view .post-thumbnail img {
        border-radius: 12px 12px 0 0;
    }
    
    .category-posts.list-view .post-content {
        padding: 20px;
    }
}



















/* مؤشر التحميل الأساسي */
.category-posts.loading {
    position: relative;
    min-height: 200px; /* لمنع القفزات المفاجئة في المحتوى */
}

/* طبقة التعتيم الخلفية */
.category-posts.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 998;
}

/* الدائرة المتحركة */
.category-posts.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 999;
}

/* رسوميات متحركة للدوران */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* تحسينات للعرض على الأجهزة المحمولة */
@media (max-width: 768px) {
    .category-posts.loading::after {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
}



























.news-list-item {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    border: 1px solid #eee;
    transition: background 0.3s ease;
}

.news-list-item:hover {
    background: #f9f9f9;
}

.news-thumbnail {
    position: relative;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}

.news-thumbnail-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-thumbnail:hover .thumbnail-overlay {
    opacity: 1;
}

.thumbnail-overlay .icon {
    width: 48px;
    height: 48px;
    fill: white;
}

.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #e74c3c;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.news-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.news-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
    color: #666;
    font-size: 0.9rem;
}

.news-meta .icon {
    width: 18px;
    height: 18px;
    margin-inline-end: 0.5rem;
    vertical-align: middle;
}

.news-title {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    line-height: 1.3;
}

.news-title a {
    color: #2c3e50;
    text-decoration: none;
}

.news-title a:hover {
    color: #e74c3c;
}

.news-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.news-read-more {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #e74c3c;
    font-weight: 500;
    text-decoration: none;
}

.news-read-more .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.news-read-more:hover .icon {
    transform: translateX(3px);
}

@media (max-width: 768px) {
    .news-list-item {
        grid-template-columns: 1fr;
    }
    
    .news-thumbnail-img {
        height: 180px;
    }
    
    .news-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .news-title {
        font-size: 1.2rem;
    }
}








