/* ==========================================
   Single Post Base - Zaban e Turki
   ========================================== */
body.single-post {
    overflow-x: hidden;
    background: #f8fafc; /* رنگ خاکستری ملایم */
}

body.single-post .zt-single-page,
body.single-post .zt-single-wrapper {
    width: 100%;
    max-width: 100%;
}

body.single-post .zt-single-wrapper {
    padding: 60px 16px;
    box-sizing: border-box;
}

body.single-post .zt-single-container {
    width: 100%;
    max-width: 850px; /* عرض مناسب برای خوانایی */
    margin: 0 auto;
    box-sizing: border-box;
    background: #ffffff;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05); /* سایه نرم‌تر */
}

/* تصویر شاخص */
body.single-post .zt-single-thumbnail {
    margin: -48px -48px 40px -48px; 
    border-radius: 24px 24px 0 0;
    overflow: hidden;
}

body.single-post .zt-single-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* عنوان و سربرگ */
body.single-post .zt-single-header {
    margin-bottom: 40px;
    text-align: center;
}

body.single-post .zt-single-title {
    margin: 0;
    color: #1e293b; /* رنگ سرمه‌ای اصلی */
    font-size: 38px;
    font-weight: 900;
    line-height: 1.5;
}

/* مخفی کردن متا دیتای پیش‌فرض قالب */
body.single-post .breadcrumb,
body.single-post .breadcrumbs,
body.single-post .entry-meta,
body.single-post .post-meta,
body.single-post .post-date,
body.single-post .post-author,
body.single-post .post-category,
body.single-post .cat-links,
body.single-post .byline,
body.single-post .posted-on,
body.single-post .entry-header .entry-meta {
    display: none !important;
}

/* ==========================================
   Typography & Content Elements
   ========================================== */
body.single-post .zt-single-content {
    width: 100%;
    color: #334155; 
    font-size: 18px;
    line-height: 2.1;
    overflow-wrap: break-word;
    word-break: normal;
}

body.single-post .zt-single-content p {
    margin: 0 0 24px;
}

body.single-post .zt-single-content h2,
body.single-post .zt-single-content h3,
body.single-post .zt-single-content h4 {
    margin: 48px 0 24px;
    color: #1e293b;
    font-weight: 800;
    line-height: 1.6;
}

body.single-post .zt-single-content h2 { font-size: 32px; }
body.single-post .zt-single-content h3 { font-size: 26px; }
body.single-post .zt-single-content h4 { font-size: 22px; }

/* تنظیمات لینک‌ها */
body.single-post .zt-single-content a,
body.single-post .zt-single-cta a,
body.single-post .zt-related-posts a,
body.single-post a {
    color: #1e293b;
    text-decoration: none;
}

body.single-post .zt-single-content a:hover,
body.single-post .zt-related-posts a:hover {
    color: #334155;
}

/* استایل کادر نکات مهم */
body.single-post .zt-single-content .zt-notice {
    background: #f8fafc;
    border-right: 4px solid #1e293b;
    padding: 24px;
    margin: 32px 0;
    border-radius: 12px;
}

/* =========================================
   Tables - Desktop Styles
   ========================================= */
/* کنترل کانتینرهای پیش‌فرض جداول وردپرس */
body.single-post .zt-single-content figure.wp-block-table,
body.single-post .zt-single-content .zt-table-responsive {
    width: 100%;
    max-width: 100%;
    margin: 40px 0;
    overflow-x: auto;
    border-radius: 16px;
    background: #ffffff;
    box-sizing: border-box;
}

body.single-post .zt-single-content table {
    width: 100% !important;
    max-width: 100%;
    table-layout: fixed; 
    border-collapse: collapse;
    margin: 0; /* حاشیه رو به کانتینر بالایی منتقل کردیم */
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

body.single-post .zt-single-content table th {
    background-color: #1e293b;
    color: #ffffff;
    padding: 16px;
    text-align: right;
    font-weight: bold;
    border-bottom: 2px solid #cbd5e1;
    box-sizing: border-box;
}

body.single-post .zt-single-content table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
    font-size: 16px;
    text-align: center;
    word-wrap: break-word; 
    overflow-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
}

body.single-post .zt-single-content table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

body.single-post .zt-single-content table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   Call to Action (CTA)
   ========================================== */
body.single-post .zt-single-cta { margin-top: 56px; }
body.single-post .zt-single-cta__inner { padding: 40px; border-radius: 20px; background: #1e293b; text-align: center; color: #ffffff; }
body.single-post .zt-single-cta__title { font-size: 28px; font-weight: 800; margin-bottom: 16px; color: #ffffff; }
body.single-post .zt-single-cta__text { font-size: 18px; margin-bottom: 32px; color: #f8fafc; }
body.single-post .zt-single-cta__button { display: inline-block; padding: 16px 36px; border-radius: 8px; background: #ffffff; color: #1e293b; font-weight: 800; text-decoration: none; transition: 0.3s; }
body.single-post .zt-single-cta__button:hover { background: #f8fafc; transform: translateY(-3px); }

/* ==========================================
   Related Posts
   ========================================== */
.zt-related-posts {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid #e2e8f0;
}
.zt-related-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 32px;
    color: #1e293b;
}
.zt-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.zt-related-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: 0.3s;
}
.zt-related-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.zt-related-thumb img { width: 100%; height: 180px; object-fit: cover; }
.zt-related-post-title { padding: 20px; font-size: 16px; font-weight: 700; color: #1e293b; }

/* =========================================
   استایل‌های بخش دیدگاه‌ها (کامنت‌ها)
   ========================================= */
body.single-post .zt-comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

body.single-post #respond {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

body.single-post #reply-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b; 
    margin-bottom: 1.5rem;
}

body.single-post .logged-in-as,
body.single-post .comment-notes {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

body.single-post .comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
}

body.single-post .comment-form input[type="text"],
body.single-post .comment-form input[type="email"],
body.single-post .comment-form input[type="url"],
body.single-post .comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #f8fafc; 
    color: #1e293b;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

body.single-post .comment-form input:focus,
body.single-post .comment-form textarea:focus {
    outline: none;
    border-color: #1e293b; 
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.1);
    background-color: #ffffff;
}

body.single-post .comment-form .form-submit {
    margin-top: 1.5rem;
    margin-bottom: 0;
    text-align: left; 
}

body.single-post .comment-form .submit {
    background-color: #1e293b; 
    color: #ffffff;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.single-post .comment-form .submit:hover {
    background-color: #334155; 
}

/* =========================================
   FAQ Section Styles
   ========================================= */
.zt-faq-section {
    margin: 40px 0;
    font-family: inherit;
    direction: rtl;
}
.zt-faq-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #1a2b4c;
    font-weight: 800;
}
.zt-faq-box {
    background-color: #ffffff;
    border: 1px solid #e1e5eb;
    border-right: 5px solid #1a2b4c;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px 25px;
    transition: all 0.3s ease;
    text-align: right;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03); 
}
.zt-faq-box:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-color: #1a2b4c;
}
.zt-faq-question {
    font-weight: bold;
    font-size: 1.15rem;
    color: #1a2b4c;
    margin-bottom: 12px;
    cursor: default;
}
.zt-faq-answer {
    color: #4a5568;
    line-height: 1.8;
    font-size: 1rem;
}
.zt-faq-answer p {
    margin-bottom: 0;
}

/* =========================================
   Responsive & Mobile Layout
   ========================================= */
@media screen and (max-width: 768px) {
    /* تنظیمات عمومی موبایل */
    body.single-post .zt-single-container { padding: 24px 16px; }
    body.single-post .zt-single-thumbnail { margin: -24px -16px 32px -16px; }
    body.single-post .zt-single-title { font-size: 28px; }
    .zt-related-grid { grid-template-columns: 1fr; }

    /* مهار کردن نگه‌دارنده جداول در موبایل برای جلوگیری قطعی از اسکرول */
    body.single-post .zt-single-content figure.wp-block-table,
    body.single-post .zt-single-content .zt-table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* تنظیمات ساختار جدول در موبایل */
    .zt-single-content table, 
    .zt-single-content tbody,
    .zt-single-content tr,
    .zt-single-content td {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .zt-single-content table, 
    .zt-single-content tbody {
        display: block;
    }
    
    .zt-single-content thead {
        display: none; /* مخفی کردن هدر در موبایل */
    }
    
    .zt-single-content tr {
        display: block;
        margin-bottom: 1.5rem;
        border: 1px solid #cbd5e1;
        border-radius: 12px;
        background-color: #ffffff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        overflow: hidden;
    }
    
    .zt-single-content td {
        display: block; /* تغییر از grid به block برای وسط‌چین شدن صحیح */
        border: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 12px 15px !important;
        text-align: center; /* کاملاً وسط‌چین */
        min-height: auto;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }
    
    .zt-single-content tr td:last-child {
        border-bottom: 0;
    }
    
    .zt-single-content td::before {
        content: attr(data-label);
        display: block; /* نمایش به صورت بلاک مجزا */
        font-weight: bold;
        color: #1e293b;
        text-align: center; /* وسط‌چین کردن عنوان */
        margin-bottom: 6px; /* ایجاد فاصله با مقدار سلول */
        line-height: 1.6;
    }
}
@media screen and (max-width: 768px) {
    /* کنترل کانتینر اصلی جدول */
    body.single-post .wp-block-table,
    body.single-post figure.wp-block-table,
    body.single-post .zt-table-responsive {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important; /* جلوگیری از اسکرول افقی */
        margin: 0 0 24px 0 !important;
        padding: 0 !important;
    }

    /* اعمال محدودیت شدید روی تمام اجزای جدول */
    body.single-post table,
    body.single-post table tbody,
    body.single-post table tr,
    body.single-post table td,
    body.single-post table th {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important; /* حذف حداقل عرض مزاحم */
        box-sizing: border-box !important;
        white-space: normal !important; /* جلوگیری از یکپارچه ماندن متن‌های طولانی */
        word-wrap: break-word !important;
        word-break: break-all !important; /* شکستن اجباری کلمات بسیار طولانی */
        overflow-wrap: anywhere !important;
    }

    /* ظاهر کارت‌مانند برای ردیف‌ها */
    body.single-post table tr {
        margin-bottom: 16px !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    /* تنظیمات داخل سلول‌ها */
    body.single-post table td {
        border: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding: 12px 16px !important;
        text-align: center !important;
    }

    body.single-post table tr td:last-child {
        border-bottom: none !important;
    }

    body.single-post table thead {
        display: none !important;
    }
}
