
/* ═══════════════════════════════════════════════════════════
   post-scroll-fix.css — نسخهٔ v2
   اسکرول داخلی متن + مخفی مرتبط در مودال + جابجایی کامنت‌ها
   ═══════════════════════════════════════════════════════════ */

/* ─── ۱) اسکرول داخلی متن — همه صفحات ─── */
.post-content,
.post__content,
.article-content,
.article__content,
.article-body,
.post-body,
.entry-content,
.single-content,
.post-single__content,
.modal .post-content,
.modal .article-content,
.modal .article-body,
[class*="modal"] .post-content,
[class*="modal"] .article-content,
[class*="modal"] .article-body,
[class*="post-content"],
[class*="article-content"],
[class*="article-body"] {
    max-height: 450px !important;
    min-height: 250px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 18px 22px !important;
    line-height: 2 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: inset 0 1px 3px rgba(15,31,56,.06) !important;
    scroll-behavior: smooth !important;
    direction: rtl !important;
    position: relative !important;
    border: 1px solid rgba(15,54,65,.08) !important;
}

/* اسکرول‌بار طلایی */
.post-content::-webkit-scrollbar,
.article-content::-webkit-scrollbar,
.article-body::-webkit-scrollbar,
.modal .post-content::-webkit-scrollbar,
.modal .article-content::-webkit-scrollbar {
    width: 8px !important;
}
.post-content::-webkit-scrollbar-track,
.article-content::-webkit-scrollbar-track,
.article-body::-webkit-scrollbar-track {
    background: rgba(15,54,65,.04) !important;
    border-radius: 10px !important;
}
.post-content::-webkit-scrollbar-thumb,
.article-content::-webkit-scrollbar-thumb,
.article-body::-webkit-scrollbar-thumb,
.modal .post-content::-webkit-scrollbar-thumb,
.modal .article-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D99A2B, #8B5E14) !important;
    border-radius: 10px !important;
}

/* ارتفاع موبایل */
@media (max-width: 700px) {
    .post-content,
    .article-content,
    .article-body {
        max-height: 350px !important;
        min-height: 220px !important;
        padding: 12px 14px !important;
    }
}

/* ─── ۲) مودال — بدون مرتبط‌ها ─── */

/* مخفی کردن مطالب مرتبط در مودال */
.modal .related,
.modal .related-posts,
.modal .related-items,
.modal .similar,
.modal .similar-posts,
.modal .related-section,
.modal [class*="related-post"],
.modal [class*="related_post"],
.modal [class*="similar-post"],
.modal__content .related,
.modal-body .related,
.modal-content .related,
.nat-modal .related,
[class*="modal"] .related,
[class*="modal"] [class*="related"],
[class*="nat-modal"] [class*="related"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* ─── ۳) مودال — اسکرول داخلی ─── */
.modal,
.modal__content,
.modal-body,
.modal-content,
.modal__dialog,
.modal-dialog,
[class*="modal-content"],
[class*="modal-body"],
[class*="modal-dialog"],
.nat-modal {
    max-height: 85vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
}

.modal::-webkit-scrollbar,
.modal__content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px !important;
}
.modal::-webkit-scrollbar-thumb,
.modal__content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D99A2B, #8B5E14) !important;
    border-radius: 10px !important;
}

/* ─── ۴) مرتب‌سازی در صفحات مستقل — کامنت بالا ─── */

/* فقط در صفحات مستقل پست (نه مودال) */
body:not(.modal-open) .comments,
body:not(.has-modal) .comments,
.post-single .comments,
.article-single .comments,
.single-post .comments {
    margin-bottom: 20px !important;
}

body:not(.modal-open) .related,
body:not(.has-modal) .related,
.post-single .related,
.article-single .related,
.single-post .related {
    margin-top: 20px !important;
    padding: 14px 18px !important;
    background: linear-gradient(135deg, #faf7ee, #f0ece3) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(15,54,65,.08) !important;
}

/* ─── ۵) مرتبط‌ها کوچک ─── */
.related .card,
.related-posts .card,
.similar .card {
    padding: 8px !important;
}
.related h3,
.related .card__body h3 {
    font-size: .82rem !important;
    line-height: 1.4 !important;
}
.related .card__img {
    aspect-ratio: 16/9 !important;
    max-height: 100px !important;
}
.related .card__body p {
    font-size: .72rem !important;
    max-height: 2.8em !important;
    overflow: hidden !important;
}
.related__title,
.related h2 {
    font-size: 1rem !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid rgba(217,154,43,.30) !important;
    display: inline-block !important;
}

/* ─── ۶) کامنت‌ها اسکرول داخلی ─── */
.comments-list,
.comment-list {
    max-height: 500px !important;
    overflow-y: auto !important;
    padding-left: 6px !important;
}
.comments-list::-webkit-scrollbar,
.comment-list::-webkit-scrollbar {
    width: 6px !important;
}
.comments-list::-webkit-scrollbar-thumb,
.comment-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #D99A2B, #8B5E14) !important;
    border-radius: 10px !important;
}

/* ─── ۷) دکمهٔ باز کردن متن ─── */
.post-expand-btn {
    display: block !important;
    width: 100% !important;
    padding: 10px !important;
    margin-top: 8px !important;
    background: linear-gradient(135deg, rgba(217,154,43,.10), rgba(217,154,43,.03)) !important;
    color: #8B5E14 !important;
    border: 1.5px dashed rgba(217,154,43,.40) !important;
    border-radius: 10px !important;
    font-family: 'Vazirmatn', Tahoma !important;
    font-weight: 800 !important;
    font-size: .82rem !important;
    cursor: pointer !important;
    transition: all .2s !important;
    text-align: center !important;
}
.post-expand-btn:hover {
    background: linear-gradient(135deg, rgba(217,154,43,.18), rgba(217,154,43,.06)) !important;
    border-style: solid !important;
}

/* ─── ۸) فشرده‌سازی فضای کلی ─── */
.post-single,
.article-single,
.single-post {
    padding-top: 14px !important;
}
.post-single > *,
.article-single > * {
    margin-bottom: 16px !important;
}

/* ─── ۹) مخفی کردن مرتبط‌ها در modal-flat (اگر هست) ─── */
.modal-flat .related,
#natModal .related,
#modalBox .related,
.modal-wrap .related {
    display: none !important;
}