/* ===================================
   صفحة القسم (Category)
   =================================== */

/* التخطيط - المحتوى + الشريط الجانبي */
.archive-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    margin-top: 2rem;
}

.archive-content {
    min-width: 0;
}

.archive-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* رأس القسم */
.archive-header {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border-right: 5px solid var(--primary-color);
}

.archive-title {
    font-size: 2.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.archive-title i {
    color: var(--accent-color);
}

.archive-description {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* شبكة المقالات - 2 في كل صف */
.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* بطاقة المقال في القسم */
.category-post-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.category-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-post-thumbnail {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: var(--bg-primary);
}

.category-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-post-card:hover .category-post-thumbnail img {
    transform: scale(1.1);
}

.category-post-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-post-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.category-post-title a {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.category-post-title a:hover {
    color: var(--primary-color);
}

.category-post-meta {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.category-post-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.category-post-meta i {
    color: var(--accent-color);
}

.category-post-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    flex: 1;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.read-more-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateX(-3px);
}

/* قائمة الأقسام الأخرى */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 0.75rem;
}

.categories-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.categories-list li a:hover {
    background: var(--primary-color);
    color: white;
    padding-right: 1.25rem;
}

.categories-list li a i {
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.categories-list li a:hover i {
    color: white;
}

.cat-count {
    margin-right: auto;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* رسالة عدم وجود مقالات */
.no-posts-found {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

.no-posts-found i {
    color: var(--primary-color);
    opacity: 0.3;
    margin-bottom: 2rem;
}

.no-posts-found h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.no-posts-found p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* الترقيم */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 3rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.pagination .page-numbers {
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* استجابة الموبايل */
@media (max-width: 992px) {
    .archive-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .archive-sidebar {
        position: static;
        max-height: none;
    }
    
    .category-posts-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .archive-header {
        padding: 2rem 1.5rem;
    }
    
    .archive-title {
        font-size: 1.8rem;
    }
    
    .category-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .category-post-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .category-post-meta {
        font-size: 0.85rem;
        gap: 0.75rem;
    }
}

/* تمييز القسم الحالي */
.categories-list li.current-cat a {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.categories-list li.current-cat a i {
    color: white;
}

.categories-list li.current-cat .cat-count {
    color: rgba(255, 255, 255, 0.8);
}

/* ===================================
   تحسينات أقسام التحميل
   =================================== */
.download-header {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.1), rgba(34, 153, 84, 0.1));
    border-right: 5px solid #27ae60;
}

.download-card {
    position: relative;
}

.download-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(39, 174, 96, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.download-overlay i {
    color: white;
    font-size: 1.8rem;
}

.download-card:hover .download-overlay {
    opacity: 1;
}

.download-btn-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn-card:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    color: white;
    transform: translateX(-3px);
}

.meta-size {
    color: #27ae60 !important;
    font-weight: 600;
}

/* سحابة الوسوم */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tag-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tag-link.current-tag {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.tag-count {
    font-size: 0.75rem;
    opacity: 0.8;
}
