:root {
    --color-transparent: transparent;
    --color-2563eb: #2563eb;
    --color-rgba-2563eb-05: rgba(37, 99, 235, 0.5);
    --color-rgba-2563eb-01: rgba(37, 99, 235, 0.1);
    --color-rgba-2563eb-03: rgba(37, 99, 235, 0.3);
    --color-rgba-0f172a-05: rgba(15, 23, 42, 0.5);
    --color-rgba-0f172a-095: rgba(15, 23, 42, 0.95);
    --color-ffffff: #ffffff;
    --color-fff: #fff;
    --color-white: white;
    --color-rgba-white-015: rgba(255, 255, 255, 0.15);
    --color-rgba-white-02: rgba(255,255,255,0.2);
    --color-rgba-white-085: rgba(255, 255, 255, 0.85);
    --color-rgba-white-01: rgba(255,255,255,0.1);
    --color-rgba-white-05: rgba(255,255,255,0.5);
    --color-rgba-black-03: rgba(0,0,0,0.3);
    --color-rgba-black-003: rgba(0,0,0,0.03);
    --color-rgba-black-002: rgba(0,0,0,0.02);
    --color-d9d9d9: #d9d9d9;
    --color-ededed: #ededed;
    --color-64748b: #64748b;
    --color-f1f5f9: #f1f5f9;
    --color-334155: #334155;
    --color-1e293b: #1e293b;
    --color-f8fafc: #f8fafc;
    --color-e2e8f0: #e2e8f0;
    --color-475569: #475569;
    --color-cbd5e1: #cbd5e1;
    --color-1d4ed8: #1d4ed8;
}

/* ==================================================
   متغیرهای رنگی (برای درک بهتر)
   رنگ اصلی: #2563eb (آبی مدرن)
   رنگ متن تیره: #1e293b (خاکستری سربی)
   رنگ پس‌زمینه ملایم: #f1f5f9
================================================== */

/* ==================================================
   1. Scroll Progress Bar
================================================== */
#scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-transparent);
    z-index: 99999;
}

#scroll-progress-bar {
    height: 4px;
    background: var(--color-2563eb); /* آبی مدرن */
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--color-rgba-2563eb-05); /* درخشش ملایم */
}

/* ==================================================
   2. Hero Section
================================================== */
.custom-single-hero {
    position: relative;
    width: 100%;
    height: 480px;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: -100px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* گرادینت سرمه‌ای تیره */
    background: linear-gradient(to bottom, var(--color-rgba-0f172a-05) 0%, var(--color-rgba-0f172a-095) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-ffffff);
    max-width: 900px;
    padding: 0 20px;
    transform: translateY(-20px);
}

.hero-category a {
    background-color: var(--color-rgba-white-015);
    backdrop-filter: blur(5px);
    border: 1px solid var(--color-rgba-white-02);
    color: var(--color-fff);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
    transition: 0.3s;
}

.hero-category a:hover {
    background-color: var(--color-2563eb);
    border-color: var(--color-2563eb);
}

.hero-title {
    color: var(--color-ffffff);
    font-size: 36px;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px var(--color-rgba-black-03);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
    color: var(--color-rgba-white-085);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-rgba-white-01);
    padding: 6px 14px;
    border-radius: 50px; /* کپسولی */
}

.meta-item.author img {
    border-radius: 50%;
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-rgba-white-05);
}
@media (max-width: 450px) {
    .custom-single-hero {
        margin-bottom: 0;
    }
    .single-post #primary {
         box-shadow: 0 0px 0px var(--color-white);
    }
    #page .site-content {
        background: var(--color-white);
    }
}
.wp-block-image img {
    border-radius: 15px;
}
.ast-related-posts-wrapper .ast-related-post {
    padding: 5px;
    border: 1px solid var(--color-d9d9d9);
    border-radius: 15px;
    background: var(--color-ededed);
    box-shadow: 0px 0px 5px 5px var(--color-d9d9d9);
    transition: all linear 0.1s;
    img{
        border-radius: 15px;
    }
}
.ast-related-posts-wrapper .ast-related-post:hover{
    transform: scale(1.02);
}
.ast-related-post-content .entry-header .ast-related-post-title a{
    transition: all linear 0.1s;
}
.ast-related-post-content .entry-header .ast-related-post-title a:hover{
    font-weight: bold;
}

/* ==================================================
   3. Main Content Card
================================================== */
.single-post .ast-container {
    position: relative;
    z-index: 10;
}
.comment-form-url{
    display: none;
}

.ast-separate-container .post-navigation {
    display: none;
}
.site .ast-single-related-posts-container {

    margin-top: 0;
}
.single-post #primary {
    background: var(--color-ffffff);
    border-radius: 20px;
    box-shadow: 0 -10px 40px var(--color-rgba-black-003), 0 20px 40px var(--color-rgba-black-003);
    margin-bottom: 50px;
    padding: 0;
    overflow: hidden;
}

/* Breadcrumbs */
.ast-breadcrumbs-wrapper {
    padding: 20px 50px;
    font-size: 13px;
    color: var(--color-64748b);
    border-bottom: 1px solid var(--color-f1f5f9);
    background: var(--color-ffffff);
}
.ast-breadcrumbs-wrapper a {
    color: var(--color-64748b);
    transition: 0.2s;
}
.ast-breadcrumbs-wrapper a:hover {
    color: var(--color-2563eb);
}

.single-post .entry-content {
    padding: 5px 70px;
}

.entry-content p {
    font-size: 18px;
    line-height: 2;
    color: var(--color-334155); /* خاکستری متین */
    margin-bottom: 2em;
    text-align: justify;
}

/* هدینگ‌ها */
.entry-content h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-1e293b);
    margin-top: 25px;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}
/* خط کوچک زیر تیتر بجای کنارش */
.entry-content h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--color-2563eb);
    margin-top: 10px;
    border-radius: 2px;
}

.entry-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-1e293b);
    margin-top: 40px;
}

/* ==================================================
   4. Table of Contents (فهرست با نقاط)
================================================== */
.custom-toc-container {
    background-color: var(--color-f8fafc); /* آبی-خاکستری بسیار روشن */
    border: 1px solid var(--color-e2e8f0);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 50px;
}

.toc-header {
    font-weight: 700;
    font-size: 18px;
    color: var(--color-1e293b);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.toc-header::before {
    content: '\2630';
    margin-left: 10px;
    font-size: 18px;
    color: var(--color-64748b);
}

.custom-toc-container ul {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.custom-toc-container li {
    margin-bottom: 12px;
    padding-right: 15px;
    position: relative;
}




.custom-toc-container a {
    text-decoration: none;
    color: var(--color-475569);
    font-weight: 500;
    transition: 0.2s;
    font-size: 15px;
}

.custom-toc-container a:hover {
    color: var(--color-2563eb);
    margin-right: 5px;
}

/* زیرمنوها */
.toc-sub-item {
    margin-right: 25px !important;
    font-size: 0.95em;
}

/* ==================================================
   5. New Minimal Table Style (اصلاح جدول)
================================================== */
.single-post .entry-content table {
    width: 100%;
    border-collapse: collapse; /* حذف فاصله‌های اضافی */
    border-radius: 25px;
    overflow: hidden; /* برای گرد شدن گوشه‌ها */
    box-shadow: 0 4px 15px var(--color-rgba-black-003); /* سایه بسیار ملایم */
    border: 1px solid var(--color-e2e8f0);
}

.single-post .entry-content table th {
    background-color: var(--color-f1f5f9); /* خاکستری خیلی روشن */
    color: var(--color-334155); /* متن تیره */
    padding: 18px 20px;
    text-align: right;
    font-weight: 700;
    border-bottom: 2px solid var(--color-cbd5e1); /* خط زیر هدر کمی ضخیم‌تر */
    border-right: none;
    border-left: none;
}
.entry-content[data-ast-blocks-layout] > figure {
    margin-bottom: 1em;
    border-radius: 25px;
}

.single-post .entry-content table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-e2e8f0);
    color: var(--color-475569);
    background: var(--color-fff);
    transition: background 0.2s;
}

.single-post .entry-content table tr:last-child td {
    border-bottom: none;
}

/* هاور روی ردیف‌ها برای تعامل بهتر */
.single-post .entry-content table tr:hover td {
    background-color: var(--color-f8fafc);
}

/* ==================================================
   6. Updated In-Content Elements
================================================== */
/* لیست‌های داخل متن (غیر از TOC) */

/* نقل قول */
.single-post .entry-content blockquote {
    background: var(--color-f8fafc);
    border-right: 4px solid var(--color-2563eb); /* آبی */
    color: var(--color-475569);
    border-radius: 4px;
}
.single-post .entry-content blockquote::before {
    color: var(--color-rgba-2563eb-01); /* آبی بسیار کم‌رنگ */
}

/* ==================================================
   7. Comments & Related Posts (Blue Theme)
================================================== */
.ast-related-posts-title {
    border-right: 4px solid var(--color-2563eb);
}

.ast-post-navigation a:hover {
    border-color: var(--color-2563eb);
}

.form-submit input[type="submit"] {
    background: var(--color-2563eb); /* دکمه آبی */
    box-shadow: 0 4px 15px var(--color-rgba-2563eb-03);
}

.form-submit input[type="submit"]:hover {
    background: var(--color-1d4ed8); /* آبی تیره‌تر برای هاور */
}

.reply a:hover {
    background: var(--color-2563eb);
    border-color: var(--color-2563eb);
}

/* Input Focus Color */
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-2563eb);
    box-shadow: 0 0 0 3px var(--color-rgba-2563eb-01);
}

/* Responsive Padding Fixes */
@media (max-width: 768px) {
    .single-post .entry-content {
        padding: 0px 0px;
    }
    .custom-single-hero { height: 400px; }
}
/* ==================================================
   4. Table of Contents (Interactive & Minimal)
================================================== */
.custom-toc-container {
    background-color: var(--color-f8fafc); /* پس‌زمینه خیلی روشن */
    border: 1px solid var(--color-e2e8f0);
    border-radius: 12px;
    padding: 0; /* پدینگ را صفر کردیم چون هدر جداست */
    margin-bottom: 50px;
    overflow: hidden; /* مهم برای انیمیشن بسته شدن */
    box-shadow: 0 2px 10px var(--color-rgba-black-002);
}

/* هدر فهرست (دکمه کلیک) */
.toc-header {
    background: var(--color-f1f5f9);
    padding: 15px 25px;
    font-weight: 700;
    font-size: 16px;
    color: var(--color-1e293b);
    display: flex;
    justify-content: space-between; /* متن راست، آیکون چپ */
    align-items: center;
    cursor: pointer; /* نشانگر دست */
    user-select: none; /* جلوگیری از انتخاب متن هنگام کلیک */
    border-bottom: 1px solid var(--color-e2e8f0);
    transition: background 0.2s;
}

.toc-header:hover {
    background: var(--color-e2e8f0);
}

/* آیکون فلش */
.toc-icon {
    font-size: 12px;
    color: var(--color-64748b);
    transition: transform 0.3s ease; /* انیمیشن چرخش */
    transform: rotate(0deg); /* پیش‌فرض: رو به پایین */
}

/* لیست آیتم‌ها */
.custom-toc-container ul {
    list-style: none !important;
    margin: 0;
    padding: 0 25px; /* پدینگ چپ و راست */
    max-height: 0; /* پیش‌فرض برای انیمیشن (توسط JS مقداردهی می‌شود) */
    overflow: hidden;
    transition: max-height 0.4s ease-out; /* انیمیشن نرم باز و بسته شدن */
    background: var(--color-fff);
}

/* فاصله آیتم‌ها */
.custom-toc-container li {
    margin-bottom: 0;
    padding: 12px 0;
    border-bottom: 1px dashed var(--color-f1f5f9);
    position: relative;
    padding-right: 20px; /* جا برای نقطه */
}

/* حذف خط آخرین آیتم */
.custom-toc-container li:last-child {
    border-bottom: none;
}

/* نقطه توپر دایره‌ای */
.custom-toc-container li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 20px; /* تنظیم دقیق وسط‌چین عمودی */
    width: 6px;
    height: 6px;
    background-color: var(--color-cbd5e1);
    border-radius: 50%;
    transition: 0.3s;
}
.ast-related-posts-wrapper .entry-content{
    display: none;
}
.custom-toc-container li:hover::before {
    background-color: var(--color-2563eb);
    transform: scale(1.4);
}

.custom-toc-container a {
    text-decoration: none;
    color: var(--color-475569);
    font-weight: 500;
    transition: 0.2s;
    font-size: 15px;
    display: block; /* برای اینکه کل خط کلیک‌خور شود */
}
.ast-single-post .entry-content a {
    text-decoration: none;
    font-weight: bold;
}
.custom-toc-container a:hover {
    color: var(--color-2563eb);
    transform: translateX(-5px); /* حرکت ریز به چپ */
}
/*بخش نظرات و کامنت ها */
body .ast-comment {
     padding-top: 0em;
     padding-bottom: 0em;
    border-top: 1px solid var(--ast-single-post-border, var(--ast-border-color));
}
.ast-comment-info {
    margin-bottom: 1em;
    display: flex;
}
body header.ast-comment-meta {
    display: flex;
    width: 100%;
    margin-bottom: 0;
    padding-bottom: 0;
    align-items: unset;
    flex-direction: column;
    gap: 2px;
}
body .ast-separate-container .ast-comment-list li.depth-1 {
    border: 1px solid;
    border-radius: 20px;
    padding: 1em;
    background-color: #FCFEFF;
    margin-bottom: 15px;
    box-shadow: 0 0 5px 5px #ededed;
}
body .ast-comment-list{
    margin: 10px;
}

/*بخش نظرات و کامنت ها */
body .ast-comment {
     padding-top: 0em;
     padding-bottom: 0em;
    border-top: 1px solid #cbcbcb;
}
.ast-comment-info {
    margin-bottom: 1em;
    display: flex;
}
body header.ast-comment-meta {
    display: flex;
    width: 100%;
    margin-bottom: 0;
    padding-bottom: 0;
    align-items: unset;
    flex-direction: column;
    gap: 2px;
}


.ast-separate-container .ast-comment-list li.depth-1, .ast-narrow-container .ast-comment-list li.depth-1 {
    border: 1px solid #e1e1e1;
    border-radius: 20px;
    padding: 1em;
    background-color: #f1f1f1;
    margin-bottom: 20px;
    box-shadow: 0 0 10px 2px #e5e5e5;
}

body .ast-comment-list{
    margin: 5%;
}
.comments-area textarea#comment, .comments-area .ast-comment-formwrap input[type="text"] {
    width: 100%;
    border-radius: 15px;
    vertical-align: middle;
    margin-bottom: 10px;
}
.ast-comment-list + .comment-respond {
    border-top: 1px solid var(--ast-single-post-border, var(--ast-border-color));
    background: #f1f1f1;
    border-radius: 20px;
    margin: 5%;
    padding: 2%;
}