/* ۵. نوار پیشرفت مطالعه (Reading Progress Bar)*/
.reading-progress {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    height: 3px;
    z-index: 999;
    background: transparent;
}
.reading-progress__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #ff8a00);
    transition: width 0.1s linear;
    border-radius: 0 0 0 2px;
}
/* ۶. هیرو مقاله (Post Hero)*/
.post-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-top: var(--header-h);
}
.post-hero__bg {
    background-image: url('../images/article/01/head-blog.jpeg');
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.post-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(7, 8, 12, 1) 0%,
        rgba(7, 8, 12, 0.85) 30%,
        rgba(7, 8, 12, 0.3) 100%
    );
}
.post-hero__content {
    position: relative;
    z-index: 2;
    padding-bottom: 60px;
}

/* بردکرامب (Breadcrumb)*/
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.breadcrumb a { 
    color: var(--text-muted); 
}
.breadcrumb a:hover { 
    color: var(--accent); 
}
.breadcrumb i { 
    font-size: 0.6rem; 
    color: var(--text-muted); 
}
.breadcrumb__current { 
    color: var(--accent); 
}

.post-hero__category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 18px;
}
.post-hero__title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    max-width: 800px;
}
.post-hero__meta {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.post-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.post-hero__meta-item i {
    color: var(--accent);
    font-size: 0.85rem;
}
.post-hero__author-img {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--accent);
}

/* انیمیشن‌های هیرو مقاله*/
.post-hero__category { animation: slideUp 0.6s ease forwards; animation-delay: 0.1s; opacity: 0; }
.post-hero__title { animation: slideUp 0.6s ease forwards; animation-delay: 0.25s; opacity: 0; }
.post-hero__meta { animation: slideUp 0.6s ease forwards; animation-delay: 0.4s; opacity: 0; }
/* ۷. ساختار دو ستونه مقاله (Post Layout)*/
.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px; /* Use minmax(0, 1fr) to prevent overflow stretching */
    gap: 48px;
    align-items: start;
    padding: 60px 0 100px;
}
.post-content {
    max-width: var(--article-w);
    min-width: 0; /* Forces grid contents to stay strictly within container boundaries */
    width: 100%;
}

/* ۸. اجزای داخلی محتوای مقاله*/
.post-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 2.2;
    margin-bottom: 40px;
    padding: 28px;
    background: var(--bg-card);
    border-right: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.post-section {
    margin-bottom: 48px;
}
.post-section__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}
.post-section__title {
    font-size: 1.5rem;
    margin-bottom: 18px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.post-section__title i {
    color: var(--accent);
    font-size: 1.2rem;
}
.post-section__image {
    border-radius: var(--radius);
    overflow: hidden;
    margin: 20px 0;
    position: relative;
}
.post-section__image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: var(--transition-slow);
}
.post-section__image:hover img {
    transform: scale(1.02);
}
.post-section__image-caption {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 12px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
}
.post-text {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 2.1;
    margin-bottom: 16px;
}
.post-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ۹. باکس اطلاعات غذایی (Nutrition Box)*/
.nutrition-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 20px 0;
}
.nutrition-box__title {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nutrition-box__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.nutrition-box__item {
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.nutrition-box__value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    direction: ltr;
}
.nutrition-box__label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ۱۰. باکس نقل‌قول (Quote Box)*/
.post-quote {
    padding: 28px 30px;
    background: var(--bg-card);
    border-right: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 24px 0;
    position: relative;
}
.post-quote::before {
    content: '\201C';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.15;
    line-height: 1;
    font-family: serif;
}
.post-quote__text {
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 2.2;
    font-style: italic;
    margin-bottom: 10px;
}
.post-quote__author {
    font-size: 0.82rem;
    color: var(--accent);
    font-style: normal;
}

/* ۱۱. باکس نکات پیشنهادی (Tips List)*/
.post-tips {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin: 24px 0;
}
.post-tips__title {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.post-tips__title i { 
    color: var(--accent); 
}
.post-tips li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.post-tips li:last-child { 
    border-bottom: none; 
}
.post-tips li i {
    flex-shrink: 0;
    margin-top: 6px;
    color: var(--accent);
    font-size: 0.7rem;
}
/* ۱۲. جدول مقایسه‌ای درون پست*/
.post-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth kinetic swipe scrolling on mobile iOS devices */
    margin: 24px 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-sizing: border-box;
}
.post-table {
    width: 100%;
    min-width: 600px; /* Prevents cell collapsing and forces clean swipe-scroll behavior on small screens */
    border-collapse: collapse;
}
.post-table thead {
    background: var(--bg-card);
}
.post-table th {
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.post-table td {
    padding: 12px 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.post-table tbody tr:hover {
    background: var(--accent-soft);
}
.post-table tbody tr:last-child td { 
    border-bottom: none; 
}

/* ۱۳. برچسب‌ها و دکمه‌های اشتراک‌گذاری پست*/
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0 30px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.post-tags__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.post-tags a {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.post-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.post-share {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}
.post-share__label {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}
.post-share__btns { 
    display: flex; 
    gap: 8px; 
}
.post-share__btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); font-size: 0.95rem;
    transition: var(--transition);
}
.post-share__btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

/* ۱۴. باکس معرفی نویسنده در انتهای پست*/
.author-box {
    display: flex;
    gap: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 48px;
}
.author-box__image {
    flex-shrink: 0;
}
.author-box__image img {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--accent);
}
.author-box__name {
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.author-box__role {
    font-size: 0.82rem;
    color: var(--accent);
    margin-bottom: 12px;
}
.author-box__bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 14px;
}
.author-box__social { 
    display: flex; 
    gap: 8px; 
}
.author-box__social a {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.85rem;
    transition: var(--transition);
}
.author-box__social a:hover { 
    background: var(--accent); 
    border-color: var(--accent); 
    color: #fff; 
}

/* ۱۵. بخش مقالات مرتبط*/
.related-posts {
    margin-bottom: 60px;
}
.related-posts__title {
    font-size: 1.4rem;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.related-posts__title i { 
    color: var(--accent); 
    font-size: 1.1rem; 
}
.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(239,74,35,0.2);
}
.related-card__image {
    height: 160px;
    overflow: hidden;
}
.related-card__image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: var(--transition-slow);
}
.related-card:hover .related-card__image img { 
    transform: scale(1.06); 
}
.related-card__body { 
    padding: 16px; 
}
.related-card__category {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent);
    margin-bottom: 6px;
    font-weight: 500;
}
.related-card__title {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 6px;
}
.related-card__date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ۱۶. بخش دیدگاه‌ها و نظرات کاربران*/
.comments {
    margin-bottom: 48px;
}
.comments__title {
    font-size: 1.3rem;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.comments__title i { 
    color: var(--accent); 
}
.comment {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    transition: var(--transition);
}
.comment:hover { 
    border-color: var(--border-light); 
}
.comment__avatar {
    flex-shrink: 0;
    width: 50px; height: 50px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-secondary);
}
.comment__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.comment__name {
    font-size: 0.92rem;
    font-weight: 600;
}
.comment__date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.comment__text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 2;
}
.comment__actions {
    display: flex;
    gap: 14px;
    margin-top: 10px;
}
.comment__actions button {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.comment__actions button:hover { 
    color: var(--accent); 
}

/* فرم ارسال دیدگاه جدید*/
.comment-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
}
.comment-form__title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-form__title i { 
    color: var(--accent); 
}
.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.comment-form .form-group {
    margin-bottom: 16px;
}
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}
.comment-form input::placeholder,
.comment-form textarea::placeholder { 
    color: var(--text-muted); 
}
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.comment-form textarea { 
    resize: vertical; 
    min-height: 120px; 
}

/* ۱۷. ویجت‌ها و اجزای سایدبار صفحه مقاله*/
.sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
}
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.sidebar-widget__title {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-widget__title i { 
    color: var(--accent); 
    font-size: 0.9rem; 
}

/* ویجت فهرست مطالب (TOC)*/
.toc-list li {
    margin-bottom: 2px;
}
.toc-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    border-right: 2px solid transparent;
    transition: var(--transition);
}
.toc-list a:hover,
.toc-list a.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    border-right-color: var(--accent);
}
.toc-list a span {
    width: 22px; height: 22px;
    background: var(--bg-secondary);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.toc-list a:hover span,
.toc-list a.is-active span {
    background: var(--accent);
    color: #fff;
}

/* ویجت مقالات محبوب در سایدبار*/
.sidebar-post {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: var(--transition);
}
.sidebar-post:last-child { 
    border-bottom: none; 
}
.sidebar-post:hover { 
    opacity: 0.8; 
}
.sidebar-post__img {
    width: 64px; height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}
.sidebar-post__title {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 4px;
}
.sidebar-post__date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ویجت نویسنده در سایدبار*/
.sidebar-author {
    text-align: center;
}
.sidebar-author img {
    width: 80px; height: 80px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin: 0 auto 14px;
    border: 3px solid var(--accent);
}
.sidebar-author__name {
    font-size: 1rem;
    margin-bottom: 4px;
}
.sidebar-author__role {
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 12px;
}
.sidebar-author__bio {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 14px;
}

/* برچسب‌های سایدبار*/
.sidebar-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
}
.sidebar-tags a {
    padding: 5px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
}
.sidebar-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

/* Responsive Helper Utilities */
.show-mobile-only {
    display: none !important;
}

@media (max-width: 1024px) {
    .hide-mobile {
        display: none !important;
    }
    .show-mobile-only {
        display: block !important;
    }
}