/* استخراج‌شده از template-parts/blog-archive-content.php — فقط در همان صفحه لود می‌شود (khaninejad_enqueue_assets) */
/* =========================================
   استایل‌های مشترک لیست مقالات (وبلاگ/آرشیوها)
   استفاده‌شده در: home.php و index.php
========================================= */
.blog-archive-container { 
    padding: 20px 15px; 
    flex: 1; 
    max-width: 1200px; 
    margin: 0 auto; 
    width: 100%; 
    direction: rtl;
    font-family: inherit;
}

/* هدر وبلاگ (باکس سئو) */
.blog-page-header {
    background: linear-gradient(135deg, var(--khaninejad-primary, #17181c) 0%, var(--khaninejad-primary-gradient, #2c2e34) 100%);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 25px;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 10px 25px rgba(36, 45, 60, 0.15);
    position: relative;
    overflow: hidden;
}
.blog-page-header::after {
    content: '📚';
    position: absolute;
    left: -10px;
    top: -20px;
    font-size: 120px;
    opacity: 0.05;
    transform: rotate(-15deg);
}
.blog-page-header h1 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #ffffff;
    z-index: 2;
    position: relative;
}
.blog-page-header p {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
    z-index: 2;
    position: relative;
}

/* جست‌وجوی داخلی وبلاگ */
.blog-search-form {
    position: relative;
    z-index: 2;
    max-width: 420px;
    margin: 22px auto 0;
    display: flex;
}
.blog-search-form input[type="search"] {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 12px 45px 12px 16px;
    font-size: 13px;
    font-family: inherit;
    background: rgba(255,255,255,0.95);
    color: var(--khaninejad-text-dark, #1a1b1e);
    outline: none;
}
.blog-search-form input[type="search"]:focus {
    box-shadow: 0 0 0 3px rgba(0, 84, 251, 0.4);
}
.blog-search-form button {
    position: absolute;
    top: 50%;
    left: 6px;
    transform: translateY(-50%);
    background: #17181C;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* فیلتر دسته‌بندی (چیپ افقی) */
.blog-cats-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 20px;
    margin-bottom: 5px;
    scrollbar-width: none;
}
.blog-cats-scroll::-webkit-scrollbar { display: none; }
.blog-cat-chip {
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 10px;
    white-space: nowrap;
    transition: all 0.25s;
}
.blog-cat-chip:hover,
.blog-cat-chip.is-active {
    border-color: #17181C;
    color: #17181C;
    background: rgba(0, 84, 251, 0.05);
}
.blog-cat-chip .chip-count {
    color: #94a3b8;
    font-weight: 600;
    margin-right: 3px;
}

/* گرید مقالات */
.blog-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 20px; 
}

/* کارت مقاله */
.blog-post-card { 
    background: #ffffff; 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); 
    border: 1px solid #f1f5f9; 
    transition: transform 0.4s ease, box-shadow 0.4s ease; 
    display: flex; 
    flex-direction: column; 
    position: relative;
}
.blog-post-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 35px rgba(0, 84, 251, 0.1); 
    border-color: #e2e8f0; 
}

/* ریبون مقاله ویژه (فقط روی پست اول صفحه اول وبلاگ) */
.blog-featured-ribbon {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    background: var(--khaninejad-primary, #17181c);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(255, 184, 4, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* تصویر مقاله */
.blog-post-image { 
    width: 100%; 
    height: 180px; 
    background: #f8fafc; 
    position: relative; 
    overflow: hidden; 
}
.blog-post-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.6s ease; 
}
.blog-post-card:hover .blog-post-image img { 
    transform: scale(1.08); 
}

/* نشانگر دسته‌بندی روی عکس */
.blog-category-badge { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: #DD0A18; 
    color: #ffffff; 
    padding: 4px 12px; 
    border-radius: 8px; 
    font-size: 12px; 
    font-weight: 800; 
    z-index: 2; 
    box-shadow: 0 4px 10px rgba(221, 10, 24, 0.3);
}

/* محتوای متنی مقاله */
.blog-post-content { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
}
.blog-post-title { 
    font-size: 15px; 
    font-weight: 800; 
    color: var(--khaninejad-text-dark, #1a1b1e); 
    margin-bottom: 10px; 
    line-height: 1.7; 
}
.blog-post-title a { 
    color: inherit; 
    text-decoration: none; 
    transition: color 0.3s; 
}
.blog-post-title a:hover { 
    color: #17181C; 
}
.blog-post-excerpt { 
    font-size: 13px; 
    color: #64748b; 
    line-height: 2; 
    margin-bottom: 16px; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-align: justify;
}

/* ردیف نویسنده (سیگنال E-E-A-T) */
.blog-post-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.blog-post-author-row img {
    border-radius: 50%;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.blog-post-author-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
}

/* متای مقاله (تاریخ، زمان مطالعه و دکمه) */
.blog-post-meta { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-top: auto; 
    padding-top: 15px; 
    border-top: 1px dashed #e2e8f0; 
    flex-wrap: wrap;
    gap: 8px;
}
.blog-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.blog-date, .blog-reading-time {
    font-size: 12px; 
    color: #94a3b8;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.blog-read-more { 
    color: #17181C; 
    font-weight: 800; 
    font-size: 12px; 
    text-decoration: none;
    display: inline-flex; 
    align-items: center; 
    gap: 5px; 
    background: rgba(0, 84, 251, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}
.blog-post-card:hover .blog-read-more {
    background: #17181C;
    color: #fff;
}

/* باکس CTA میان‌متنی (تبلیغ فروشگاه داخل گرید) */
.blog-cta-inline {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #17181c 0%, #2c2e34 100%);
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
    text-align: right;
    box-shadow: 0 10px 25px rgba(23, 24, 28, 0.15);
}
.blog-cta-inline h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.7;
}
.blog-cta-inline p {
    color: #d8d2fb;
    font-size: 12.5px;
    line-height: 1.9;
}
.blog-cta-inline a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--khaninejad-primary, #17181c);
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.25s;
}
.blog-cta-inline a:hover { transform: translateY(-2px); }

/* صفحه‌بندی (Pagination) */
.blog-pagination { display: flex; justify-content: center; margin-top: 40px; padding-bottom: 20px; }
.blog-pagination .page-numbers { display: flex; list-style: none; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0; }
.blog-pagination .page-numbers li { display: flex; }
.blog-pagination .page-numbers a, .blog-pagination .page-numbers span { display: flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--khaninejad-text-dark, #1a1b1e); font-size: 13px; font-weight: 700; border: 1px solid #f1f5f9; transition: all 0.25s; text-decoration: none; }
.blog-pagination .page-numbers a:hover { background: #17181C; color: #fff; border-color: #17181C; }
.blog-pagination .page-numbers .current { background: #17181C; color: #fff; border-color: #17181C; box-shadow: 0 4px 10px rgba(0, 84, 251, 0.2); }

/* رسپانسیو حرفه‌ای برای دسکتاپ (تبدیل مقاله اول به ویژگی ویژه) */
@media (min-width: 768px) {
    .blog-archive-container { padding: 40px 5%; }
    .blog-page-header { padding: 50px 30px; border-radius: 24px; margin-bottom: 30px; }
    .blog-page-header h1 { font-size: 32px; margin-bottom: 15px; }
    .blog-page-header p { font-size: 15px; }
    .blog-search-form { max-width: 480px; }

    .blog-cats-scroll { flex-wrap: wrap; overflow: visible; padding-bottom: 30px; }

    .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .blog-post-image { height: 220px; }
    
    /* ترفند ویژه UX: مقاله اول در دسکتاپ تمام‌عرض و بزرگ نمایش داده می‌شود */
    .blog-post-card:first-child { 
        grid-column: 1 / -1; 
        flex-direction: row; 
        align-items: stretch;
    }
    .blog-post-card:first-child .blog-post-image { 
        width: 55%; 
        height: auto; 
        min-height: 350px;
    }
    .blog-post-card:first-child .blog-post-content { 
        width: 45%; 
        padding: 40px; 
        justify-content: center;
    }
    .blog-post-card:first-child .blog-post-title { 
        font-size: 24px; 
        margin-bottom: 15px;
        line-height: 1.5;
    }
    .blog-post-card:first-child .blog-post-excerpt { 
        font-size: 15px; 
        -webkit-line-clamp: 4;
        margin-bottom: 20px;
    }

    .blog-cta-inline { flex-direction: row; align-items: center; justify-content: space-between; padding: 30px 40px; }
    .blog-cta-inline h3 { font-size: 20px; }
    .blog-cta-inline p { font-size: 13px; max-width: 480px; }
}

@media (min-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(3, 1fr); }
    /* حفظ استایل مقاله اول حتی در حالت 3 ستونه */
    .blog-post-card:first-child { grid-column: 1 / -1; }
}
