/* =============================================
   استایل اصلی وبلاگ – مدرن، ساده و شیک
   ============================================= */

/* ---------- فونت ---------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* ---------- پایه ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f0f4f8;
    color: #2d3748;
    line-height: 1.8;
    direction: rtl;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: #3182ce;
    transition: color 0.2s;
}
a:hover {
    color: #2b6cb0;
}

/* ---------- کانتینر ---------- */
.blog-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- هدر ---------- */
.blog-header {
    position: relative;
    height: 200px;                     /* ارتفاع ثابت مطابق تصویر */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);  /* رنگ پیش‌فرض */
    background-size: cover;
    background-position: center;
    border-bottom: 4px solid #63b3ed;
    overflow: hidden;
}

.blog-header .container {
    position: relative;
    z-index: 2;
}

.blog-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.blog-header p {
    font-size: 1rem;
    opacity: 0.9;
}


/* ---------- چیدمان سه‌ستونه ---------- */
.blog-row {
    display: flex;
    gap: 1.8rem;
    padding: 2rem 0;
    max-width: 1300px;
    margin: 0 auto;
    width: 95%;
}

.blog-sidebar-left {
    flex: 1;
    min-width: 230px;
    order: 3;
}
.blog-main {
    flex: 2.8;
    min-width: 0;
    order: 2;
}
.blog-sidebar-right {
    flex: 1;
    min-width: 230px;
    order: 1;
}

/* ---------- ویجت‌های سایدبار ---------- */
.widget {
    background: #fff;
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}
.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.widget h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.widget ul {
    list-style: none;
    padding: 0;
}
.widget li {
    padding: 0.4rem 0;
    border-bottom: 1px dashed #edf2f7;
}
.widget li:last-child {
    border-bottom: none;
}
.widget a {
    color: #4a5568;
    transition: 0.2s;
}
.widget a:hover {
    color: #3182ce;
    padding-right: 5px;
}

.widget ul li a img {
    transition: transform 0.2s ease;
}
.widget ul li:hover a img {
    transform: scale(1.05);
}

/* تگ‌ها در سایدبار */
.tagcloud .badge {
    display: inline-block;
    margin: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.7em;
    border-radius: 20px;
    background: #edf2f7;
    color: #2d3748;
    transition: 0.2s;
}
.tagcloud .badge:hover {
    background: #3182ce;
    color: #fff;
}

/* ---------- کارت‌های خبر ---------- */
.blog-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.8rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
    transition: transform 0.25s, box-shadow 0.25s;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.1);
}
.blog-card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 3px solid #e2e8f0;
}

.blog-card-img1 {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: contain; /* فقط در صورت نیاز به برش یکنواخت، ولی برای نمایش کامل از contain استفاده کنید */
    border-bottom: 3px solid #e2e8f0;
}
.blog-card-body {
    padding: 1.3rem 1.5rem;
}
.blog-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.blog-title a {
    color: #1a202c;
}
.blog-title a:hover {
    color: #3182ce;
}
.blog-meta {
    font-size: 0.82rem;
    color: #718096;
    margin-bottom: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}
.blog-excerpt {
    color: #4a5568;
    margin-bottom: 1rem;
    line-height: 1.9;
}
.btn-readmore {
    background: #3182ce;
    color: #fff;
    border: none;
    padding: 0.4rem 1.3rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.btn-readmore:hover {
    background: #2b6cb0;
    transform: scale(1.03);
}
.blog-tags {
    margin-top: 0.6rem;
}

/* ---------- فوتر ---------- */
.blog-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    padding: 1.2rem;
    color: #718096;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 992px) {
    .blog-row {
        flex-direction: column;
    }
    .blog-sidebar-left { order: 2; }
    .blog-main       { order: 1; }
    .blog-sidebar-right{ order: 3; }
}

@media (max-width: 576px) {
    .blog-header h1 {
        font-size: 1.6rem;
    }
    .blog-card-body {
        padding: 1rem;
    }
    .blog-title {
        font-size: 1.15rem;
    }
}


.blog-meta .comment-count {
    background: #f0f0f0;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-weight: bold;
}

/* ========== استایل جداول داخل خبر ========== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 1rem 0;
}

.blog-table,
.blog-content table {             /* هر جدولی که داخل متن خبر باشد */
    border-collapse: collapse;
    width: 100%;
    min-width: 400px;
    direction: rtl;               /* راست‌چین */
}

.blog-table th,
.blog-table td,
.blog-content th,
.blog-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: right;
    vertical-align: top;
}

/* راه‌راه */
.blog-table tr:nth-child(even),
.blog-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

.blog-table tr:nth-child(odd),
.blog-content tr:nth-child(odd) {
    background-color: #ffffff;
}

.blog-table tr:hover,
.blog-content tr:hover {
    background-color: #f1f1f1;
}

/* ---------- Mobile-First: اندازه فونت وبلاگ ---------- */
@media (max-width: 768px) {
    body { font-size: 0.9rem; }

    .blog-header h1   { font-size: 1.6rem; }
    .blog-title       { font-size: 1.2rem; }
    .blog-card-body   { font-size: 0.9rem; }
    .btn-readmore     { font-size: 0.8rem; }

    .widget h4        { font-size: 1rem; }
    .widget           { font-size: 0.85rem; }
}

@media (max-width: 450px) {
    .blog-header h1 { font-size: 1.4rem; }
    .blog-title     { font-size: 1.1rem; }
}


/* ========== نوار منو ========== */
.blog-nav {
    background: var(--primary, #3498db);
    border-bottom: 3px solid rgba(255,255,255,0.2);
}

.blog-nav .container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.blog-nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-weight: 500;
    transition: background 0.2s;
}

.blog-nav a:hover {
    background: rgba(255,255,255,0.2);
}

.blog-nav a.active {
    background: rgba(255,255,255,0.3);
    font-weight: 700;
}

/* استایل اسلایدر و کپشن */
.slider-container {
    position: relative;
    width: 100%;
    background: #1e3c72;
}
.slider-container .item {
    position: relative;
    padding-bottom: 25%; /* نسبت ابعاد 4:1 */
    overflow: hidden;
}
.slider-container .item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* کپشن اسلایدر - نوار شفاف در پایین تصویر */
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.4); /* خیلی شفاف (۰.۴ = ۴۰٪ کدورت) */
    backdrop-filter: blur(1px);     /* محو شدن بسیار کم (اختیاری) */
    color: white;
    text-align: center;
    padding: 4px 12px;
    direction: rtl;
    z-index: 2;
    box-sizing: border-box;
    /* اگر می‌خواهید حاشیه‌های گرد داشته باشد */
    border-radius: 0;
    /* حذف سایه یا هر استایل اضافه */
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

.slide-caption h2 {
    font-size: 0.6rem;      /* سایز کوچک برای موبایل */
    margin: 0 0 4px;
    font-weight: bold;
}

.slide-caption p {
    font-size: 0.5rem;
    margin: 0;
    opacity: 0.6;
}

/* برای نمایشگرهای بزرگتر (دسکتاپ) می‌توانید سایز را کمی بزرگتر کنید */
@media (min-width: 768px) {
    .slide-caption {
        padding: 12px 20px;
    }
    .slide-caption h2 {
        font-size: 1rem;
    }
    .slide-caption p {
        font-size: 0.8rem;
    }
}

/* اگر می‌خواهید ارتفاع نوار کمتر باشد (حدود یک دهم تصویر)، 
   می‌توانید padding را کم کنید و از line-height استفاده کنید */
.slide-caption {
    line-height: 1.1;
}


@media (max-width: 768px) {
    .slider-container .item {
        padding-bottom: 40%;
    }
    .slide-caption {
        bottom: 8%;
        padding: 8px 12px;
    }
    .slide-caption h2 {
        font-size: 1.2rem;
    }
    .slide-caption p {
        font-size: 0.8rem;
    }
}

.blog-title-bar {
    background: #1e3c72;
    color: white;
    text-align: center;
    padding: 10px;
    border-bottom: 1px solid #ffc107;
}
.blog-title-bar h1 {
    margin: 0;
    font-size: 1.4rem;
}
.blog-title-bar p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
}