/**
 * Unified Archive Pages CSS - جميع صفحات الأرشيف في ملف واحد
 * @package Kora_Plus_Pro
 * @version 25.8
 * يشمل: Search + Author + Category + Tag + Archive + Mobile Layouts
 */

/* ✅ إخفاء time badges في الصفحة الرئيسية */
body.home .post-date-badge,
body.home .post-date-badge-enhanced,
body.home .time-badge-on-img {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ========================================
   === صفحة البحث ===
   ======================================== */
.search-page {
    padding: 40px 0;
}

.search-header {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    padding: 40px;
    border-radius: 15px;
    border-right: 6px solid var(--highlight, var(--primary, #00A859));
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.search-title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.search-title {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0;
}

.search-query {
    color: var(--highlight, var(--primary, #00A859));
}

.search-count {
    background: var(--highlight, var(--primary, #00A859));
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
}

.search-form-inline {
    display: flex;
    gap: 10px;
    max-width: 600px;
}

.search-form-inline input {
    flex: 1;
    padding: 15px 20px;
    border: 3px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.search-form-inline input:focus {
    outline: none;
    border-color: var(--highlight, var(--primary, #00A859));
    box-shadow: 0 0 0 4px rgba(0,168,89,0.1);
}

.search-form-inline button {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form-inline button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,168,89,0.3);
}

/* نتائج البحث */
.search-results {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.search-results.posts-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.search-results.posts-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.search-results.posts-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

.search-result-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.search-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.result-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-result-item:hover .result-thumb img {
    transform: none;
}

.result-cat {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary, #00A859);
    color: #fff;
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.result-cat a {
    color: #fff;
    text-decoration: none;
}

.result-date {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.result-content {
    padding: 20px;
}

.result-title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
    margin: 0 0 12px;
}

.result-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s;
}

.result-title a:hover {
    color: var(--primary, #00A859);
}

.result-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.result-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 2px solid #f8f9fa;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary, #00A859);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.read-more-btn:hover {
    background: var(--accent, #ff6b00);
    transform: translateX(-3px);
}

/* لا توجد نتائج */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px;
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.no-results h2 {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 15px;
}

.no-results p {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
}

/* ========================================
   === صفحة الكاتب ===
   ======================================== */
.author-page {
    padding: 40px 0;
    margin: 0 0 40px;
}

.author-page .container {
    position: relative;
}

.author-cover {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    margin: 15px 0 25px;
}

.author-header {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    padding: 40px;
    border-radius: 15px;
    border-right: 6px solid var(--primary, #00A859);
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 32px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.author-job {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.author-tagline {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
}

.author-bio {
    color: #444;
    line-height: 1.9;
    margin-top: 10px;
    margin-bottom: 20px;
}

.author-bio p {
    margin: 0;
}

.author-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 20px;
}

.author-stats .stat-item {
    background: #f7f9f9;
    border: 1px solid #eef2f2;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-stats .stat-number {
    font-weight: 700;
    color: var(--primary, #00A859);
}

.author-stats .stat-label {
    font-size: 14px;
    font-weight: 700;
    color: #999;
}

.follow-btn {
    display: inline-block;
    background: var(--primary, #00A859);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
}

.author-social {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.author-social .social-link {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f3f4;
    color: #333;
    text-decoration: none;
    transition: transform .15s ease;
}

.author-social .social-link:hover {
    transform: translateY(-2px);
}

.author-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 20px 0 10px;
}

.author-filters .filter-link {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e6e9ec;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.author-filters .filter-link.active {
    background: var(--primary, #00A859);
    color: #fff;
    border-color: var(--primary, #00A859);
}

.author-posts-section {
    margin-top: 20px;
}

.author-posts-section .section-heading {
    font-size: 28px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0 0 30px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--primary, #00A859);
}

.author-posts {
    display: grid;
    gap: 16px;
}

.author-posts.posts-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.author-posts.posts-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.author-posts.posts-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

.author-post-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .15s ease, transform .15s ease;
}

.author-post-item:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,.06);
    transform: translateY(-2px);
}

.author-post-item .post-thumb {
    position: relative;
    overflow: hidden;
}

.author-post-item .post-thumb img {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* ✅ Category badge - يستخدم Primary Color */
.author-post-item .post-cat {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 168, 89, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.author-post-item .post-date-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #fff;
    color: #222;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.author-post-item .post-content-wrap {
    padding: 14px;
}

.author-post-item .post-title {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
}

.author-post-item .post-excerpt {
    color: #666;
    font-size: 13px;
    margin-top: 6px;
}

/* ========================================
   === صفحة التصنيف ===
   من category.css + mobile-category-layouts.css
   ======================================== */

/**
 * Category Page Styles
 * @package Kora_Plus_Pro
 */

.category-page {
    padding: 20px 0 40px 0;
}

.category-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 35px 40px;
    border-radius: 18px;
    border-right: 5px solid var(--primary, #00A859);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

/* ✅ إضافة فراغ بين الهيدر وعنوان القسم وإطار مميز للعنوان - موبايل فقط */
@media (max-width: 768px) {
    .category-page {
        padding-top: 50px; /* فراغ 50 بكسل من الأعلى على الموبايل */
    }
    
    .category-header {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
        padding: 25px 20px !important;
        border-radius: 20px !important;
        border: 3px solid var(--primary, #00A859) !important;
        box-shadow: 0 8px 30px rgba(0,168,89,0.2), 
                    0 4px 15px rgba(0,168,89,0.1),
                    inset 0 1px 0 rgba(255,255,255,0.8) !important;
        margin-bottom: 30px !important;
        position: relative;
        overflow: hidden;
    }
    
    .category-header::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        border: 2px solid rgba(0,168,89,0.15);
        border-radius: 18px;
        pointer-events: none;
    }
    
    .category-title-wrapper {
        margin-bottom: 15px !important;
    }
    
    .category-title {
        font-size: 26px !important;
        font-weight: 900 !important;
        background: linear-gradient(135deg, #00A859 0%, #00c46e 100%) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
        padding: 15px 20px !important;
        border-radius: 15px !important;
        background-color: rgba(0,168,89,0.08) !important;
        border: 2px solid rgba(0,168,89,0.2) !important;
        box-shadow: 0 4px 15px rgba(0,168,89,0.15),
                    inset 0 1px 0 rgba(255,255,255,0.5) !important;
        display: inline-block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        position: relative;
        overflow: hidden;
    }
    
    .category-title::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 60px;
        height: 60px;
        background: radial-gradient(circle, rgba(0,168,89,0.1) 0%, transparent 70%);
        border-radius: 50%;
        transform: translate(30%, -30%);
    }
    
    .category-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 80px;
        height: 4px;
        background: linear-gradient(90deg, transparent, #00A859, transparent);
        border-radius: 2px;
    }
    
    .category-count {
        margin-top: 15px !important;
        display: block !important;
        width: fit-content !important;
    }
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0,168,89,0.05) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.category-title {
    font-size: 32px;
    font-weight: 900;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.category-count {
    background: linear-gradient(135deg, var(--primary, #00A859) 0%, #00c46e 100%);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0,168,89,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.category-count::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.category-count:hover::before {
    left: 100%;
}

.category-description {
    color: #555;
    font-size: 17px;
    line-height: 1.9;
    position: relative;
    z-index: 1;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(0,168,89,0.1);
}

.category-description p {
    margin: 0 0 12px 0;
}

.category-description p:last-child {
    margin-bottom: 0;
}

/* === الأقسام ذات الصلة === */
.related-categories {
    margin-bottom: 35px;
}

.related-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary, #00A859);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    background: var(--related-bg, #ffffff);
    border: 2px solid #e9ecef;
    border-radius: var(--related-border-radius, 14px);
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    gap: 15px;
}

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--related-hover, #00A859) 0%, var(--related-hover, #00c46e) 100%);
}

.category-item:hover::before,
.category-item.active::before {
    width: 100%;
}

.category-item:hover,
.category-item.active {
    background: var(--related-hover, #00A859);
    border-color: var(--related-hover, #00A859);
    box-shadow: 0 8px 24px rgba(0,168,89,0.4);
}

.category-item .cat-name {
    font-size: var(--related-font-size, 17px);
    font-weight: 800;
    color: var(--related-text, #1a1a1a);
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: right;
    line-height: 1.4;
}

.category-item:hover .cat-name,
.category-item.active .cat-name {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.category-item .cat-count {
    background: var(--related-count-bg, #1a365d);
    color: var(--related-count-text, #ffffff);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 900;
    min-width: 50px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(26, 54, 93, 0.35);
    white-space: nowrap;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 32px;
}

.category-item:hover .cat-count,
.category-item.active .cat-count {
    background: rgba(255,255,255,0.3);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255,255,255,0.4);
}

.category-item .cat-count {
    border-radius: 50px;
    padding-left: 14px;
    padding-right: 14px;
}

/* أنماط العرض المختلفة */
.categories-grid {
    gap: var(--related-gap, 15px);
}

.related-style-grid .categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.related-style-grid[data-cols="2"] .categories-grid {
    grid-template-columns: repeat(2, 1fr);
}

.related-style-grid[data-cols="3"] .categories-grid {
    grid-template-columns: repeat(3, 1fr);
}

.related-style-grid[data-cols="4"] .categories-grid {
    grid-template-columns: repeat(4, 1fr);
}

.related-style-grid[data-cols="5"] .categories-grid {
    grid-template-columns: repeat(5, 1fr);
}

.related-style-grid[data-cols="6"] .categories-grid {
    grid-template-columns: repeat(6, 1fr);
}

.related-style-horizontal .categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--related-gap, 15px);
}

.related-style-horizontal .category-item {
    flex: 0 1 auto;
    min-width: 180px;
}

.related-style-vertical .categories-grid {
    display: flex;
    flex-direction: column;
    gap: var(--related-gap, 15px);
}

.related-style-vertical .category-item {
    width: 100%;
}

.related-style-cards .categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--related-gap, 15px);
}

.related-style-cards[data-cols="2"] .categories-grid {
    grid-template-columns: repeat(2, 1fr);
}

.related-style-cards[data-cols="3"] .categories-grid {
    grid-template-columns: repeat(3, 1fr);
}

.related-style-cards[data-cols="4"] .categories-grid {
    grid-template-columns: repeat(4, 1fr);
}

.related-style-cards[data-cols="5"] .categories-grid {
    grid-template-columns: repeat(5, 1fr);
}

.related-style-cards[data-cols="6"] .categories-grid {
    grid-template-columns: repeat(6, 1fr);
}

.related-style-cards .category-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    text-align: right;
    min-height: 120px;
}

.related-style-cards .category-item .cat-name {
    font-size: 18px;
    margin-bottom: 10px;
    width: 100%;
}

.related-style-cards .category-item .cat-count {
    align-self: flex-end;
    margin-top: auto;
}

@media (max-width: 768px) {
    .category-item {
        padding: 14px 18px;
        gap: 12px;
    }
    
    .category-item .cat-name {
        font-size: 15px;
    }
    
    .category-item .cat-count {
        font-size: 13px;
        padding: 6px 12px;
        min-width: 45px;
        height: 28px;
    }
    
    .related-style-grid[data-cols] .categories-grid,
    .related-style-cards[data-cols] .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-style-horizontal .category-item {
        min-width: 150px;
    }
}

/* === المقالات === */
.category-posts {
    display: grid;
    gap: 10px;
    margin-bottom: 40px;
}

.category-posts.posts-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.category-posts.posts-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.category-posts.posts-row-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 100%;
    container-type: inline-size;
}

/* التصميم العادي الافتراضي */
.category-post-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

/* التصميم المميز - يعمل فقط عند التفعيل */
.category-posts.premium-visual .category-post-item {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1),
                inset 0 1px 0 rgba(255,255,255,0.8),
                0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(0,168,89,0.1);
}

/* التأثيرات المميزة - فقط مع التصميم المميز */
.category-posts.premium-visual .category-post-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #00A859 0%, 
        #00c46e 25%, 
        #ffb800 50%, 
        #ff6b47 75%, 
        #00A859 100%);
    z-index: 1;
}

.category-posts.premium-visual .category-post-item::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, 
        rgba(0,168,89,0.3) 0%, 
        transparent 50%, 
        rgba(0,168,89,0.1) 100%);
    z-index: 1;
}

/* صورة المقال - التصميم العادي */
.post-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(230, 230, 230, 0.3);
    border-radius: 10px 10px 0 0;
    cursor: pointer;
}

.post-thumb:hover {
    opacity: 0.95;
}

/* صورة المقال - التصميم المميز */
.category-posts.premium-visual .post-thumb {
    background: linear-gradient(135deg, 
        rgba(0,168,89,0.03) 0%, 
        rgba(230, 230, 230, 0.1) 100%);
    border-radius: 14px 14px 0 0;
}

.category-posts.premium-visual .post-thumb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0,0,0,0.01) 100%);
    z-index: 1;
    pointer-events: none;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    text-decoration: none;
    cursor: pointer;
}

.post-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.read-more-section {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.read-more-btn-simple {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,168,89,0.25);
    border: 1px solid rgba(255,255,255,0.2);
}

.read-more-btn-simple .read-text {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.read-more-btn-simple .read-arrow {
    font-size: 12px;
    font-weight: 900;
}

.category-posts.premium-visual .read-more-section {
    background: linear-gradient(135deg, #f8f9fa, #ffffff),
                radial-gradient(circle at 50% 0%, rgba(0,168,89,0.05) 0%, transparent 70%);
    border-top: 1px solid rgba(0,168,89,0.15);
}

.category-posts.premium-visual .read-more-btn-simple {
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e)),
                linear-gradient(145deg, rgba(255,255,255,0.1), transparent);
    box-shadow: 0 4px 12px rgba(0,168,89,0.3),
                inset 0 1px 0 rgba(255,255,255,0.2);
}

.post-date-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--primary, rgba(0, 168, 89, 0.95)), var(--primary-light, rgba(0, 196, 110, 0.9)));
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(20px);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 168, 89, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.post-date-badge .date-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}


.post-date-badge-enhanced {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, 
            var(--date-badge-color, rgba(26, 26, 26, 0.95)), 
            rgba(50, 50, 50, 0.9)),
            radial-gradient(circle at 30% 30%, 
            rgba(255,255,255,0.1) 0%, 
            transparent 70%);
    color: #fff;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    backdrop-filter: blur(15px);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25),
                inset 0 1px 0 rgba(255,255,255,0.2),
                0 1px 0 rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.15);
}

.post-date-badge-enhanced::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 100%);
    border-radius: 20px;
}

.post-date-badge-enhanced .date-icon {
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.post-content-wrap {
    padding: 10px;
    background: #fff;
}

.category-posts.premium-visual .post-content-wrap {
    padding: 10px;
    background: linear-gradient(145deg, #ffffff, #fafbfc),
                radial-gradient(circle at 90% 10%, 
                    rgba(0,168,89,0.02) 0%, 
                    transparent 50%);
    position: relative;
}

.category-posts.premium-visual .post-content-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0,168,89,0.2) 50%, 
        transparent 100%);
}

.post-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary, #00A859);
}

.post-author-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--author-bg-color, #f8f9fa), #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-posts.premium-visual .post-author-info {
    margin: 16px 0;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--author-bg-color, #f8f9fa), #ffffff),
                radial-gradient(circle at 80% 20%, 
                    rgba(0,168,89,0.04) 0%, 
                    transparent 60%);
    border: 1px solid rgba(0,168,89,0.1);
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06),
                inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
}

.category-posts.premium-visual .post-author-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0,168,89,0.3) 50%, 
        transparent 100%);
    border-radius: 15px 15px 0 0;
}

.author-avatar {
    display: flex;
    align-items: center;
}

.author-avatar .rounded-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--primary, #00A859);
    box-shadow: 0 2px 6px rgba(0,168,89,0.2);
}

.author-name {
    color: #1a1a1a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-date-info {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
    background: rgba(0,168,89,0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.post-date-info .date-icon {
    font-size: 12px;
    opacity: 0.8;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
    background: rgba(0,168,89,0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.views-icon {
    font-size: 12px;
    opacity: 0.8;
}

.post-meta-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #999;
}

.post-meta-info svg {
    width: 14px;
    height: 14px;
    color: var(--primary, #00A859);
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.7;
    margin-top: 12px;
}

.post-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f8f9fa;
    font-size: 13px;
    color: #999;
    font-weight: 600;
}

.post-reading-time,
.post-comments {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0,168,89,0.1);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary, #00A859);
}

.post-reading-time:hover,
.post-comments:hover {
    background: var(--primary, #00A859);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,168,89,0.3);
}

.category-posts.style2 .post-thumb {
    height: 240px;
}

.category-posts.style2 .post-title {
    font-size: 16px;
}

.category-posts.style3 .post-thumb {
    height: 220px;
}

.category-posts.style3 .post-title {
    font-size: 16px;
}

.category-posts.style3 .post-content-wrap {
    padding: 10px;
}

/* === الترقيم التقليدي === */
.pagination-wrapper {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-wrapper .page-numbers li {
    display: inline-block;
    margin: 0;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    padding: 0 18px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 3px solid #e9ecef;
    border-radius: 10px;
    color: #666;
    font-weight: 800;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    cursor: pointer;
}

.pagination .page-numbers:hover {
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    border-color: var(--primary, #00A859);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,168,89,0.3);
}

.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    border-color: var(--primary, #00A859);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,168,89,0.4);
}

.pagination .prev,
.pagination .next {
    font-size: 22px;
    min-width: 60px;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    border-color: #1a1a1a;
    color: #fff;
}

.pagination .prev:hover,
.pagination .next:hover {
    background: linear-gradient(135deg, var(--accent, #ff6b00), #ff8533);
    border-color: var(--accent, #ff6b00);
}

.pagination .dots {
    min-width: 40px;
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
}

@media (max-width: 576px) {
    .pagination .page-numbers {
        min-width: 45px;
        height: 45px;
        font-size: 14px;
    }
    
    .pagination .prev,
    .pagination .next {
        min-width: 55px;
    }
}

/* === زر تحميل المزيد === */
.load-more-wrapper {
    margin: 40px 0;
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

.load-more-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 45px;
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,168,89,0.4);
    overflow: hidden;
}

.load-more-btn svg {
    flex-shrink: 0;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
}

.load-more-btn:hover::before {
    width: 300px;
    height: 300px;
}

.load-more-btn:hover {
    box-shadow: 0 12px 35px rgba(0,168,89,0.5);
}

.load-more-btn:disabled {
    background: linear-gradient(135deg, #95a5a6, #b0bec5);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
}

.btn-loading {
    display: inline-flex;
    gap: 5px;
    margin-left: 8px;
}

.btn-loading span {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

/* === Infinite Scroll === */
.infinite-scroll-trigger {
    height: 1px;
    visibility: hidden;
}

.infinite-scroll-loader {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary, #00A859);
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px;
    margin: 30px 0;
}

.loader-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0,168,89,0.2);
    border-top-color: var(--primary, #00A859);
    border-radius: 50%;
    margin-bottom: 15px;
}

.scroll-end {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 25px;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border-radius: 12px;
    color: #666;
    font-weight: 600;
}

.scroll-end svg {
    color: var(--primary, #00A859);
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.no-posts p {
    font-size: 18px;
    color: #999;
    margin: 0;
}

@media (max-width: 1200px) {
    .category-posts.posts-row-4 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .post-author-info {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }
    
    .author-name {
        font-size: 11px;
    }
}

@media (max-width: 992px) {
    .category-posts.posts-row-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .post-date-badge-enhanced {
        padding: 8px 12px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .category-page {
        padding-top: 20px;
    }
    
    .category-header {
        padding: 25px 20px;
        margin-top: 20px;
        border-radius: 15px;
    }
    
    .category-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .category-title {
        font-size: 26px;
        line-height: 1.4;
    }
    
    .category-count {
        padding: 8px 20px;
        font-size: 14px;
        align-self: flex-start;
    }
    
    .category-description {
        font-size: 15px;
        line-height: 1.8;
        padding-top: 12px;
        margin-top: 12px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-posts.posts-row-3,
    .category-posts.posts-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-thumb {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-posts.posts-row-2,
    .category-posts.posts-row-3,
    .category-posts.posts-row-4 {
        grid-template-columns: 1fr;
    }
    
    .post-thumb {
        height: 220px;
    }
}

/* === Mobile Category Layouts === */
@media (max-width: 768px) {
    body.mobile-layout-style1 .category-posts {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    body.mobile-layout-style1 .category-post-item {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    body.mobile-layout-style1 .post-thumb {
        width: 100% !important;
        height: auto !important;
        min-height: 200px !important;
        aspect-ratio: 16 / 9 !important;
    }
    
    body.mobile-layout-style1 .post-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    body.mobile-layout-style1 .post-content-wrap {
        width: 100% !important;
        padding: 15px !important;
    }
    
    body.mobile-layout-style1 .post-title {
        font-size: 17px !important;
    }
    
    body.mobile-layout-style2 .category-posts {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    body.mobile-layout-style2 .category-post-item {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
    }
    
    body.mobile-layout-style2 .post-thumb {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
        flex-shrink: 0 !important;
        aspect-ratio: unset !important;
    }
    
    body.mobile-layout-style2 .post-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    body.mobile-layout-style2 .post-content-wrap {
        flex: 1 !important;
        width: auto !important;
        padding: 15px !important;
    }
    
    body.mobile-layout-style2 .post-title {
        font-size: 15px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    body.mobile-layout-style2 .post-date-badge {
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        color: #999 !important;
        padding: 0 !important;
        font-size: 12px !important;
    }
    
    body.mobile-layout-style2 .post-date-badge::before {
        content: '';
        display: none;
    }
    
    body.mobile-layout-style2 .post-cat {
        display: none !important;
    }
    
    body.mobile-layout-style3 .category-posts {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    body.mobile-layout-style3 .category-post-item {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    body.mobile-layout-style3 .post-thumb {
        width: 100% !important;
        height: 140px !important;
        min-height: 140px !important;
        max-height: 140px !important;
        aspect-ratio: 16 / 9 !important;
    }
    
    body.mobile-layout-style3 .post-thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    body.mobile-layout-style3 .post-content-wrap {
        width: 100% !important;
        padding: 12px !important;
    }
    
    body.mobile-layout-style3 .post-title {
        font-size: 13px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        min-height: 40px !important;
    }
}

/* ========================================
   === الترقيم الموحد ===
   ======================================== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    padding: 0 18px;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 3px solid #e9ecef;
    border-radius: 10px;
    color: #666;
    font-weight: 800;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    cursor: pointer;
}

.pagination .page-numbers:hover {
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    border-color: var(--primary, #00A859);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,168,89,0.3);
}

.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--primary, #00A859), var(--primary-light, #00c46e));
    border-color: var(--primary, #00A859);
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,168,89,0.4);
}

.pagination .prev,
.pagination .next {
    font-size: 22px;
    min-width: 60px;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    border-color: #1a1a1a;
    color: #fff;
}

.pagination .prev:hover,
.pagination .next:hover {
    background: linear-gradient(135deg, var(--accent, #ff6b00), #ff8533);
    border-color: var(--accent, #ff6b00);
}

.pagination .dots {
    min-width: 40px;
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
}

/* ========================================
   === Responsive ===
   ======================================== */
@media (max-width: 992px) {
    .search-results.posts-row-4,
    .author-posts.posts-row-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .search-page,
    .author-page {
        padding-top: 80px;
    }
    
    .search-header,
    .author-header {
        padding: 25px;
    }
    
    .search-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .search-title {
        font-size: 22px;
    }
    
    .search-form-inline {
        flex-direction: column;
    }
    
    .author-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .author-stats {
        justify-content: center;
    }
    
    .author-social {
        justify-content: center;
    }
    
    .search-results.posts-row-3,
    .search-results.posts-row-4,
    .author-posts.posts-row-3,
    .author-posts.posts-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .search-results.posts-row-2,
    .search-results.posts-row-3,
    .search-results.posts-row-4,
    .author-posts.posts-row-2,
    .author-posts.posts-row-3,
    .author-posts.posts-row-4 {
        grid-template-columns: 1fr;
    }
    
    .result-thumb,
    .author-post-item .post-thumb {
        height: 200px;
    }
}

