/* ============================================
   استایل‌های اختصاصی بخش مقالات
   این فایل را به صفحه _Layout.cshtml اضافه کنید:
   <link rel="stylesheet" href="/css/blog.css" />
   ============================================ */

/* ============================================
   اصلاح مشکل لیست‌ها (مشکل شماره 3)
   بولت‌ها و شماره‌گذاری با فاصله مناسب
   ============================================ */

/* لیست‌های نامرتب (Bullet) */
.blog-detail .article-content ul,
.blog-detail .description ul {
    display: block !important;
    list-style-type: disc !important;
    padding-right: 2rem !important;
    padding-left: 0 !important;
    margin: 1rem 0 !important;
}

.blog-detail .article-content ul li,
.blog-detail .description ul li {
    display: list-item !important;
    line-height: 2 !important;
    margin-bottom: 0.75rem !important;
    padding-right: 0.5rem !important;
}

/* لیست‌های مرتب (Numbered) */
.blog-detail .article-content ol,
.blog-detail .description ol {
    display: block !important;
    list-style-type: decimal !important;
    padding-right: 2rem !important;
    padding-left: 0 !important;
    margin: 1rem 0 !important;
}

.blog-detail .article-content ol li,
.blog-detail .description ol li {
    display: list-item !important;
    line-height: 2 !important;
    margin-bottom: 0.75rem !important;
    padding-right: 0.5rem !important;
}

/* لیست‌های تو در تو - سطح دوم */
.blog-detail .article-content ul ul,
.blog-detail .article-content ol ul,
.blog-detail .description ul ul,
.blog-detail .description ol ul {
    list-style-type: circle !important;
    margin: 0.5rem 0 !important;
    padding-right: 1.5rem !important;
}

/* لیست‌های تو در تو - سطح سوم */
.blog-detail .article-content ul ul ul,
.blog-detail .article-content ol ul ul,
.blog-detail .description ul ul ul,
.blog-detail .description ol ul ul {
    list-style-type: square !important;
}

/* لیست‌های شماره‌دار تو در تو */
.blog-detail .article-content ol ol,
.blog-detail .article-content ul ol,
.blog-detail .description ol ol,
.blog-detail .description ul ol {
    list-style-type: lower-alpha !important;
    margin: 0.5rem 0 !important;
    padding-right: 1.5rem !important;
}

/* ============================================
   عنوان مقاله با تگ H1 (مشکل شماره 2)
   ============================================ */
.blog-detail .article-title,
.blog-detail .description h1 {
    font-size: 1.75rem !important;
    font-weight: bold !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
    color: #2f2f2f !important;
}

/* عناوین فرعی در محتوای مقاله */
.blog-detail .article-content h2,
.blog-detail .description h2 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1.5rem 0 1rem;
    color: #333;
    border-bottom: 2px solid #ff5858;
    padding-bottom: 0.5rem;
}

.blog-detail .article-content h3,
.blog-detail .description h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 1.25rem 0 0.75rem;
    color: #444;
}

.blog-detail .article-content h4,
.blog-detail .description h4 {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1rem 0 0.5rem;
    color: #555;
}

/* ============================================
   خلاصه مقاله
   ============================================ */
.blog-detail .article-summary {
    font-size: 1rem;
    line-height: 1.9;
    color: #555;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #ff5858;
}

/* ============================================
   پاراگراف‌ها و متن
   ============================================ */
.blog-detail .article-content p,
.blog-detail .description p {
    line-height: 2;
    margin-bottom: 1rem;
    text-align: justify;
    color: #333;
}

/* ============================================
   لینک‌ها در محتوای مقاله
   ============================================ */
.blog-detail .article-content a,
.blog-detail .description a {
    color: #ff5858;
    text-decoration: none;
    border-bottom: 1px dotted #ff5858;
    transition: all 0.3s;
}

.blog-detail .article-content a:hover,
.blog-detail .description a:hover {
    color: #cc4646;
    border-bottom-style: solid;
}

/* ============================================
   تصاویر در محتوای مقاله
   ============================================ */
.blog-detail .article-content img,
.blog-detail .description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ============================================
   بلوک نقل قول
   ============================================ */
.blog-detail .article-content blockquote,
.blog-detail .description blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-right: 4px solid #ff5858;
    background-color: #f9f9f9;
    font-style: italic;
    color: #555;
}

/* ============================================
   کد و پیش‌نمایش کد
   ============================================ */
.blog-detail .article-content code,
.blog-detail .description code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.blog-detail .article-content pre,
.blog-detail .description pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    direction: ltr;
    text-align: left;
}

.blog-detail .article-content pre code,
.blog-detail .description pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* ============================================
   جدول در محتوای مقاله
   ============================================ */
.blog-detail .article-content table,
.blog-detail .description table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

.blog-detail .article-content table th,
.blog-detail .article-content table td,
.blog-detail .description table th,
.blog-detail .description table td {
    padding: 0.75rem;
    border: 1px solid #ddd;
    text-align: right;
}

.blog-detail .article-content table th,
.blog-detail .description table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.blog-detail .article-content table tr:nth-child(even),
.blog-detail .description table tr:nth-child(even) {
    background-color: #fafafa;
}

/* ============================================
   دسته‌بندی و تگ‌ها
   ============================================ */
.blog-detail .meta .category-tag {
    display: inline-block;
    background-color: #ff5858;
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-left: 10px;
    transition: all 0.3s;
}

.blog-detail .meta .category-tag:hover {
    background-color: #cc4646;
}

.blog-detail .meta .category-tag a {
    color: #fff;
    text-decoration: none;
    border: none;
}

/* تگ‌ها و برچسب‌ها */
.article-tags {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.article-tags .badge {
    display: inline-block;
    background-color: #6c757d;
    color: #fff;
    padding: 5px 12px;
    border-radius: 3px;
    font-size: 12px;
    margin: 3px;
    transition: all 0.3s;
}

.article-tags .badge:hover {
    background-color: #ff5858;
}

/* ============================================
   مقالات مرتبط
   ============================================ */
.related-articles {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.related-articles h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: #333;
    position: relative;
    padding-bottom: 0.5rem;
}

.related-articles h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: #ff5858;
}

.related-articles .item {
    margin-bottom: 1rem;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.related-articles .item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

/* ============================================
   فیلتر دسته‌بندی در صفحه لیست
   ============================================ */
.category-filter {
    margin-bottom: 25px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.category-filter .category-title {
    font-weight: bold;
    margin-left: 15px;
    color: #333;
}

.category-filter .category-title i {
    margin-left: 5px;
    color: #ff5858;
}

.category-filter .category-item {
    display: inline-block;
    margin: 5px;
    padding: 8px 16px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
}

.category-filter .category-item:hover,
.category-filter .category-item.active {
    background-color: #ff5858;
    border-color: #ff5858;
    color: #fff;
}

/* ============================================
   کارت مقاله در لیست
   ============================================ */
.blog-content .item {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

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

.blog-content .item .pic {
    overflow: hidden;
}

.blog-content .item .pic img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s;
}

.blog-content .item:hover .pic img {
    transform: scale(1.08);
}

.blog-content .item .info {
    padding: 15px;
}

.blog-content .item .info .category-tag {
    display: inline-block;
    background-color: #ff5858;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    margin-bottom: 8px;
}

.blog-content .item .info .category-tag a {
    color: #fff;
    text-decoration: none;
}

/* ============================================
   صفحه‌بندی
   ============================================ */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination-box {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-box .item {
    margin: 0 3px;
}

.pagination-box .item a {
    display: block;
    min-width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination-box .item a:hover,
.pagination-box .item.active a {
    background-color: #ff5858;
    border-color: #ff5858;
    color: #fff;
}

.pagination-box .item.arrow a {
    background-color: #f8f9fa;
}

/* ============================================
   واکنشگرایی (Responsive)
   ============================================ */
@media (max-width: 768px) {
    .blog-detail .article-title,
    .blog-detail .description h1 {
        font-size: 1.4rem !important;
    }
    
    .blog-detail .article-content ul,
    .blog-detail .article-content ol,
    .blog-detail .description ul,
    .blog-detail .description ol {
        padding-right: 1.5rem !important;
    }
    
    .category-filter .category-item {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .blog-detail .article-title,
    .blog-detail .description h1 {
        font-size: 1.25rem !important;
    }
    
    .related-articles .item {
        margin-bottom: 15px;
    }
    
    .pagination-box .item a {
        min-width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 14px;
    }
}
