/* =============================================
   Post Page Styles
   تایپوگرافی «متن مطلب» در post-body.css است (مشترک با ادیتور پنل).
   ============================================= */
.post-hero {
    background: linear-gradient(135deg, #4f46e5, #6a5ce2);
    padding: 24px 0 0;
}

.post-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}
.post-breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }
.post-breadcrumb a:hover { color: #fff; }
.post-breadcrumb span { opacity: 0.5; }
.post-breadcrumb [aria-current] { opacity: 1; color: #fff; }

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
}
@media (max-width: 991px) { .post-layout { grid-template-columns: 1fr; } .blog-sidebar { order: 2; } }

.post-content {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.post-header { padding: 36px 36px 0; }
.post-header h1 { font-size: 2rem; font-weight: 900; color: var(--text-heading); margin: 16px 0 12px; line-height: 1.5; }
.post-subtitle { font-size: 1.1rem; color: #64748b; margin: 0 0 20px; line-height: 1.8; }
.post-header .post-category { text-decoration: none; margin-left: 6px; }

.post-meta-full {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 24px;
}
.author-info { display: flex; align-items: center; gap: 12px; }
.author-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex: none;
    background: linear-gradient(135deg, var(--brand-purple), #3730a3);
    color: #fff; display: grid; place-items: center; font-weight: 900;
}
.author-info strong { display: block; font-size: 0.95rem; color: var(--text-heading); }
.author-info span, .author-info time { font-size: 0.82rem; color: #94a3b8; }
.post-stats { display: flex; gap: 16px; font-size: 0.85rem; color: #94a3b8; }

.post-featured-image { width: 100%; margin: 0 0 36px; background: #eef2ff; }
.post-featured-image img { width: 100%; height: 360px; object-fit: cover; display: block; border-radius: 0; }
.post-featured-image.post-img-gradient-1 { height: 360px; background: linear-gradient(135deg, #6a5ce2 0%, #312e81 100%); }
@media (max-width: 640px) { .post-featured-image img, .post-featured-image.post-img-gradient-1 { height: 210px; } }

.post-body-wrap { padding: 0 36px 36px; }
@media (max-width: 640px) { .post-header { padding: 24px 20px 0; } .post-header h1 { font-size: 1.5rem; } .post-body-wrap { padding: 0 20px 28px; } .related-posts { padding: 24px 20px; } }

/* فهرست مطالب */
.post-toc { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 0 20px; margin: 0 0 28px; }
.post-toc summary { cursor: pointer; font-weight: 900; color: var(--text-heading); padding: 14px 0; }
.post-toc ol { list-style: none; padding: 0 0 14px; margin: 0; counter-reset: toc; }
.post-toc li { margin: 6px 0; font-size: .95rem; }
.post-toc li.l3 { padding-right: 18px; font-size: .9rem; }
.post-toc li.l4 { padding-right: 36px; font-size: .88rem; }
.post-toc a { color: #475569; text-decoration: none; }
.post-toc a:hover { color: var(--brand-purple); }

/* پرسش‌های متداول */
.post-faq { margin: 36px 0 0; }
.post-faq h2 { font-size: 1.35rem; font-weight: 800; color: var(--text-heading); margin-bottom: 14px; }
.post-faq details { border: 1px solid #e2e8f0; border-radius: 14px; padding: 0 18px; margin-bottom: 10px; background: #fff; }
.post-faq summary { cursor: pointer; font-weight: 900; color: var(--text-heading); padding: 14px 0; }
.post-faq details p { margin: 0 0 14px; color: #475569; line-height: 1.85; }

.post-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 32px 0 24px; font-size: 0.9rem; color: #64748b; }
.post-tags a {
    background: #f1f5f9; color: var(--text-main); padding: 4px 14px;
    border-radius: 20px; text-decoration: none; font-size: 0.85rem; transition: 0.2s;
}
.post-tags a:hover { background: var(--brand-purple); color: #fff; }

.post-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; color: #64748b; }
.share-btn {
    padding: 6px 18px; border-radius: 20px; text-decoration: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: 0.85rem; font-weight: 600;
}
.share-telegram { background: #e0f2fe; color: #0284c7; }
.share-whatsapp { background: #d1fae5; color: #065f46; }
.share-linkedin { background: #dbeafe; color: #1d4ed8; }
.share-copy { background: #f1f5f9; color: #334155; }

/* Related Posts */
.related-posts { padding: 32px 36px; border-top: 1px solid #f1f5f9; background: #f8fafc; }
.related-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; color: var(--text-heading); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 768px) { .related-grid { grid-template-columns: 1fr; } }
.related-card { text-decoration: none; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid #e2e8f0; transition: var(--transition); display: block; }
.related-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.07); }
.related-thumb { height: 100px; overflow: hidden; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-body { padding: 12px; }
.related-body h4 { font-size: 0.9rem; font-weight: 700; color: var(--text-heading); margin-top: 8px; line-height: 1.6; }

/* نظرات */
.post-comments { background: #fff; border: 1px solid #e2e8f0; border-radius: 24px; padding: 32px 36px; margin-top: 28px; scroll-margin-top: 100px; }
@media (max-width: 640px) { .post-comments { padding: 22px 18px; } }
.post-comments h2 { font-size: 1.3rem; font-weight: 800; color: var(--text-heading); margin-bottom: 4px; }
.post-comments .comments-note { color: #64748b; font-size: .9rem; margin-bottom: 20px; }
.comment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .comment-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field legend { font-size: .88rem; font-weight: 700; color: var(--text-heading); }
.field input[type=text], .field input[type=email], .field textarea {
    width: 100%; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc;
    font-family: inherit; font-size: .95rem; color: var(--text-main); transition: var(--transition);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.8; }
.field input:focus, .field textarea:focus { border-color: var(--brand-purple); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(106, 92, 226, .15); }
.field.has-error input, .field.has-error textarea { border-color: #ef4444; }
.field-error { color: #b91c1c; font-size: .82rem; }
.form-alert { padding: 12px 16px; border-radius: 12px; font-size: .92rem; margin-bottom: 18px; }
.form-alert.success { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.form-alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.star-rate { border: 0; padding: 0; margin: 0 0 14px; }
.star-rate-inner { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-rate label { cursor: pointer; font-size: 1.8rem; line-height: 1; color: #cbd5e1; transition: color .15s; }
.star-rate input:checked ~ label, .star-rate label:hover, .star-rate label:hover ~ label { color: #f59e0b; }
.star-rate input:focus-visible + label { outline: 2px solid var(--brand-purple); outline-offset: 2px; border-radius: 4px; }

.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-row img { height: 50px; width: 150px; border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; display: block; }
.captcha-row .captcha-refresh { border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; font-size: 1.1rem; }
.captcha-row input { max-width: 170px; text-align: center; letter-spacing: 4px; direction: ltr; font-size: 1.1rem; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-submit { display: flex; justify-content: flex-end; margin-top: 6px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* نوار پیشرفت مطالعه */
.read-progress { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 1000; background: var(--brand-purple); transform: scaleX(0); transform-origin: right; pointer-events: none; }


/* ویدیوی آپارات در صفحه‌ی مقاله (به‌جای تصویر شاخص) */
.post-video-wrap { margin: 0 0 36px; }
.post-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0f172a center / cover no-repeat; }
.post-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.post-video-link { font-size: .85rem; color: #94a3b8; text-align: center; padding: 10px 20px 0; margin: 0; }
.post-video-link a { color: var(--brand-purple); }
