/* ==========================================================================
   فایل استایل اختصاصی صفحه مقاله (single.css)
   ========================================================================== */

/* کانتینر اصلی محتوای مقاله با فاصله از بالای هدر چسبان */
.content-container {
    max-width: 1200px;
    margin: 100px auto 40px auto;
    line-height: 1.9;
    padding: 0 15px;
}

/* استایل برادکرامب (Breadcrumbs) */
.single-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
}

.single-breadcrumb a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.2s ease;
}

.single-breadcrumb a:hover {
    color: #0369a1;
    text-decoration: underline;
}

.single-breadcrumb .delimiter {
    color: #94a3b8;
    font-size: 0.85rem;
}

.single-breadcrumb .current-page {
    color: #475569;
    font-weight: 500;
    max-width: 450px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* هدر مقاله */
.single-header {
    margin-bottom: 25px;
    text-align: right;
}

.single-post-title {
    color: #004a61;
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.4;
    margin-top: 0;
    margin-bottom: 20px;
}

/* متای مقاله */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: #64748b;
}

.post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta a {
    color: #2563eb;
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

/* تصویر شاخص مدرن */
.single-featured-image {
    width: 100%;
    max-height: 520px;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.single-featured-image img {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
}

/* متن بدنه مقاله */
.entry-content {
    font-size: 1.12rem;
    color: #334155;
    line-height: 2;
}

.entry-content h2 {
    font-size: 1.7rem;
    color: #004a61;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    text-align: right;
}

.entry-content h3 {
    font-size: 1.35rem;
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

/* ==========================================================================
   استایل کامل و متوازن جدول‌ها (رفع مشکل فضای خالی سمت چپ)
   ========================================================================== */

/* کادر بیرونی جدول در وردپرس */
.entry-content figure.wp-block-table,
.wp-block-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 35px 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
}

/* جدول اصلی جهت پر کردن ۱۰۰٪ عرض و تقسیم متوازن ستون‌ها */
.entry-content table,
.wp-block-table table {
    display: table !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    table-layout: fixed !important; /* گسترش تمام ستون‌ها در کل عرض */
}

/* هدر جدول */
.entry-content th,
.wp-block-table th {
    background-color: #2a4359 !important;
    color: #ffffff !important;
    font-family: 'YekanBakhFaNum-Bold', sans-serif !important;
    font-size: 1rem !important;
    padding: 16px 18px !important;
    text-align: right !important;
    border-bottom: 2px solid #1e293b !important;
    border-left: 1px solid rgba(255, 255, 255, 0.15) !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.entry-content th:last-child,
.wp-block-table th:last-child {
    border-left: none !important;
}

/* سلول‌های جدول */
.entry-content td,
.wp-block-table td {
    padding: 14px 18px !important;
    font-size: 0.98rem !important;
    color: #334155 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-left: 1px solid #f1f5f9 !important;
    text-align: right !important;
    white-space: normal !important;
    word-break: break-word !important;
}

.entry-content td:last-child,
.wp-block-table td:last-child {
    border-left: none !important;
}

/* رنگ بندی یکی در میان سطرها */
.entry-content tr:nth-child(even),
.wp-block-table tr:nth-child(even) {
    background-color: #f8fafc !important;
}

.entry-content tr:nth-child(odd),
.wp-block-table tr:nth-child(odd) {
    background-color: #ffffff !important;
}

.entry-content tr:hover,
.wp-block-table tr:hover {
    background-color: #f1f5f9 !important;
}

/* باکس درخواست مشاوره CTA */
.single-cta-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 30px;
    margin: 40px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-content {
    flex: 1;
    min-width: 280px;
}

.cta-content h3 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.cta-content p {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin: 0;
}

.cta-button {
    display: inline-block;
    background-color: #d4b76e;
    color: #0f172a;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cta-button:hover {
    background-color: #f59e0b;
    color: #ffffff;
}

/* باکس معرفی نویسنده */
.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    margin: 40px 0;
}

.author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.author-info .author-name {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.author-info .author-bio {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
}

/* ناوبری پست قبلی و بعدی */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.post-navigation a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.post-navigation a:hover {
    color: #0369a1;
    text-decoration: underline;
}

/* بخش مقالات مرتبط */
.related-posts-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.related-title {
    font-size: 1.4rem;
    color: #004a61;
    margin-bottom: 20px;
    text-align: right;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.related-post-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.related-post-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-post-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.related-post-card h4 {
    font-size: 1rem;
    color: #1e293b;
    padding: 12px 15px 5px 15px;
    margin: 0;
    line-height: 1.5;
}

.related-date {
    display block;
    padding: 0 15px 15px 15px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ریسپانسو برای تبلت و موبایل */
@media (max-width: 768px) {
    .content-container {
        margin-top: 80px;
    }

    .single-breadcrumb .current-page {
        max-width: 180px;
    }

    .single-post-title {
        font-size: 1.7rem;
    }

    .single-featured-image {
        max-height: 300px;
    }

    .single-cta-box {
        flex-direction: column;
        text-align: center;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .post-navigation {
        flex-direction: column;
        gap: 10px;
    }
}