/**
 * news-page.css
 * ملف التنسيق الشامل لصفحة الأخبار
 * بوابة الوحدة العربية للأخبار
 * =========================================
 * الأقسام:
 *  1. Breadcrumb
 *  2. أدوات البحث والفلترة
 *  3. بطاقات الأخبار
 *  4. الشريط الجانبي
 *  5. ترقيم الصفحات
 *  6. الموبايل — media queries شاملة
 * =========================================
 */


/* =========================================
   1. Breadcrumb
   ========================================= */
   .breadcrumb-container {
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumb-item a {
    color: #CC0000;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #960000;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #666;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #aaa;
}


/* =========================================
   2. أدوات البحث والفلترة
   ========================================= */
.filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.search-input-wrapper {
    flex: 2;
    min-width: 200px;
}

.search-input-wrapper .form-control {
    border-radius: 8px 0 0 8px;
    border-color: #ddd;
    height: 44px;
    font-size: 14px;
}

.search-input-wrapper .btn {
    border-radius: 0 8px 8px 0;
    height: 44px;
    padding: 0 16px;
    background: #CC0000;
    border-color: #CC0000;
}

.search-input-wrapper .btn:hover {
    background: #960000;
    border-color: #960000;
}

#categoryFilter,
#countryFilter {
    flex: 1;
    min-width: 140px;
    height: 44px;
    border-radius: 8px;
    border-color: #ddd;
    font-size: 13.5px;
    color: #444;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#categoryFilter:focus,
#countryFilter:focus {
    border-color: #CC0000;
    box-shadow: 0 0 0 2px rgba(204,0,0,0.1);
}

.filter-container .btn-secondary {
    height: 44px;
    padding: 0 20px;
    border-radius: 8px;
    background: #444;
    border-color: #444;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-container .btn-secondary:hover {
    background: #222;
    border-color: #222;
    transform: translateY(-1px);
}


/* =========================================
   3. بطاقات الأخبار
   ========================================= */
.featured-item-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.featured-item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #CC0000;
}

/* صورة البطاقة */
.featured-item-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
}

.featured-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.featured-item-card:hover .featured-item-image img {
    transform: scale(1.05);
}

.featured-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 60%);
    pointer-events: none;
}

/* محتوى البطاقة */
.featured-item-content {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* التصنيف */
.featured-item-category {
    display: inline-block;
    background: rgba(204,0,0,0.08);
    color: #CC0000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(204,0,0,0.15);
    margin-bottom: 8px;
    align-self: flex-start;
}

/* العنوان */
.featured-item-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-item-title a:hover {
    color: #CC0000;
}

/* الملخص */
.featured-item-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* الميتا */
.featured-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #888;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.featured-item-meta > div {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.featured-item-meta > div:hover {
    color: #CC0000;
}

.featured-item-meta i {
    font-size: 11px;
    opacity: 0.7;
}


/* =========================================
   4. الشريط الجانبي
   ========================================= */
.sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    transition: box-shadow 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.widget-header {
    background: linear-gradient(135deg, #CC0000 0%, #960000 100%);
    padding: 13px 18px;
    border-bottom: 3px solid #d4af37;
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-content {
    padding: 14px;
}

/* =========================================
   الأخبار الأكثر قراءة — بطاقة صورة كاملة
   ========================================= */
.trending-card {
    display: block;
    position: relative;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
}

.trending-card:last-child {
    margin-bottom: 0;
}

.trending-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.trending-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.trending-card:hover img {
    transform: scale(1.06);
}

/* الـ Overlay التدريجي */
.trending-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.88) 0%,
        rgba(0,0,0,0.45) 50%,
        rgba(0,0,0,0.05) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    transition: background 0.3s ease;
}

.trending-card:hover .trending-overlay {
    background: linear-gradient(
        to top,
        rgba(150,0,0,0.85) 0%,
        rgba(0,0,0,0.4) 60%,
        rgba(0,0,0,0.05) 100%
    );
}

.trending-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.45;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.trending-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.trending-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255,255,255,0.82);
}

.trending-meta i {
    font-size: 10px;
    color: #d4af37;
}


/* =========================================
   5. ترقيم الصفحات
   ========================================= */
.pagination-wrapper {
    margin-top: 32px;
    margin-bottom: 16px;
}

.pagination {
    gap: 4px;
}

.page-link {
    border-radius: 8px;
    border: 1px solid #ddd;
    color: #444;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 14px;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.page-link:hover {
    background: rgba(204,0,0,0.08);
    border-color: #CC0000;
    color: #CC0000;
}

.page-item.active .page-link {
    background: #CC0000;
    border-color: #CC0000;
    color: #fff;
    box-shadow: 0 3px 10px rgba(204,0,0,0.25);
}

.page-item.disabled .page-link {
    color: #ccc;
    background: #fafafa;
    border-color: #eee;
}


/* =========================================
   6. الموبايل — Media Queries شاملة
   ========================================= */

/* ── تابلت (768px - 991px) ───────────────── */
@media (max-width: 991px) {
    .sidebar {
        position: static;
        margin-top: 32px;
    }

    .filter-container {
        gap: 10px;
    }

    .search-input-wrapper {
        flex: 1 1 100%;
    }

    #categoryFilter,
    #countryFilter {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
}

/* ── موبايل (أقل من 767px) ──────────────── */
@media (max-width: 767px) {
    /* البطاقات — كامل العرض */
    .col-12.col-md-6 {
        padding-left: 0;
        padding-right: 0;
    }

    .featured-item-image {
        height: 210px;
    }

    .featured-item-title {
        font-size: 14px;
    }

    .featured-item-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .featured-item-meta {
        gap: 8px;
        font-size: 11px;
    }

    /* الفلتر */
    .filter-container {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .search-input-wrapper,
    #categoryFilter,
    #countryFilter,
    .filter-container .btn-secondary {
        width: 100%;
        flex: unset;
        min-width: unset;
    }

    .filter-container .btn-secondary {
        width: 100%;
    }

    /* الترقيم */
    .page-link {
        padding: 7px 11px;
        font-size: 13px;
        min-width: 36px;
    }

    /* السايدبار */
    .trending-img {
        width: 62px;
        height: 50px;
    }

    .trending-title {
        font-size: 12.5px;
    }
}

/* ── موبايل صغير (أقل من 480px) ─────────── */
@media (max-width: 480px) {
    .featured-item-image {
        height: 155px;
    }

    .featured-item-content {
        padding: 12px;
    }

    .featured-item-title {
        font-size: 13.5px;
    }

    .featured-item-excerpt {
        display: none; /* نخفي الملخص على الشاشات الصغيرة جداً لتوفير المساحة */
    }

    .featured-item-meta {
        gap: 6px;
    }

    .breadcrumb {
        font-size: 12px;
    }
}


/* =========================================
   الفلتر — صف واحد على كل الشاشات
   ========================================= */
.news-filter-bar {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 14px 18px;
}

.news-filter-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-filter-inner .form-control {
    flex: 1;
    height: 42px;
    border-radius: 8px;
    border-color: #ddd;
    font-size: 13.5px;
    color: #444;
    min-width: 0;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.news-filter-inner .form-control:focus {
    border-color: #CC0000;
    box-shadow: 0 0 0 2px rgba(204,0,0,0.1);
}

.btn-filter {
    height: 42px;
    padding: 0 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, #CC0000 0%, #960000 100%);
    border: none;
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(204,0,0,0.2);
}

.btn-filter:hover {
    background: linear-gradient(135deg, #960000 0%, #700000 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(204,0,0,0.3);
    color: #fff;
}

.btn-filter i {
    font-size: 13px;
}

/* موبايل — صف واحد متوازن */
@media (max-width: 767px) {
    .news-filter-bar {
        padding: 10px 12px;
    }

    .news-filter-inner {
        gap: 8px;
    }

    /* الفلترين يأخذان مساحة متساوية */
    .news-filter-inner .form-control {
        flex: 1 1 0;
        min-width: 0;
        height: 38px;
        font-size: 12px;
    }

    /* الزر بحجم ثابت صغير — أيقونة فقط على الموبايل */
    .btn-filter {
        flex: 0 0 42px;
        width: 42px;
        height: 38px;
        padding: 0;
        justify-content: center;
        font-size: 0; /* إخفاء النص */
        gap: 0;
    }

    .btn-filter i {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .news-filter-inner .form-control {
        font-size: 11.5px;
    }
}