/* =========================================================
   صفحه تک‌مقاله - استایل‌های اختصاصی
   ========================================================= */

body {
    line-height: 2;
}

/* چیدمان مقاله */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    margin-bottom: 50px;
}

/* مقاله */
.article-wrapper {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

/* هدر مقاله */
.article-header {
    padding: 32px 40px 24px 40px;
    border-bottom: 1px solid var(--border);
}

.article-header .article-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-decoration: none;
}

.article-header .article-cat:hover {
    background: var(--primary);
    color: #fff;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-header .article-lead {
    font-size: 1.1rem;
    color: var(--gray);
    line-height: 1.9;
    margin-bottom: 24px;
    padding-right: 16px;
    border-right: 3px solid var(--primary);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--gray);
}

.article-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta .meta-item i {
    color: var(--primary);
    font-size: 0.85rem;
}

/* تصویر شاخص */
.article-featured-image {
    width: 100%;
    height: 400px;
    background: var(--gray-light);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* محتوای مقاله */
.article-content {
    padding: 36px 40px;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--dark);
    margin: 32px 0 16px 0;
    padding-right: 14px;
    border-right: 4px solid var(--primary);
    line-height: 1.4;
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    margin: 24px 0 12px 0;
    line-height: 1.5;
}

.article-content p {
    font-size: 1.05rem;
    color: var(--dark-secondary);
    line-height: 2;
    margin-bottom: 18px;
    text-align: justify;
}

.article-content ul,
.article-content ol {
    margin: 18px 0;
    padding-right: 24px;
}

.article-content ul li,
.article-content ol li {
    font-size: 1.05rem;
    color: var(--dark-secondary);
    line-height: 2;
    margin-bottom: 8px;
}

.article-content ul li::marker {
    color: var(--primary);
}

.article-content strong {
    color: var(--dark);
    font-weight: 800;
}

.article-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--primary);
}

.article-content a:hover {
    border-bottom-style: solid;
}

/* بلوک‌های ویژه */
.article-note {
    background: var(--primary-light);
    border-right: 4px solid var(--primary);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
}

.article-note .note-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-note p {
    margin-bottom: 0;
    font-size: 0.98rem;
    color: var(--dark-secondary);
}

.article-warning {
    background: #F1F7DC;
    border-right: 4px solid var(--warning);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
}

.article-warning .warning-title {
    font-size: 1rem;
    font-weight: 800;
    color: #B3540B;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-warning p {
    margin-bottom: 0;
    font-size: 0.98rem;
    color: var(--dark-secondary);
}

/* جدول */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.article-table thead {
    background: var(--dark);
    color: #fff;
}

.article-table thead th {
    padding: 14px 18px;
    text-align: right;
    font-size: 0.92rem;
    font-weight: 700;
}

.article-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: 0.15s;
}

.article-table tbody tr:last-child {
    border-bottom: none;
}

.article-table tbody tr:hover {
    background: var(--gray-light);
}

.article-table tbody td {
    padding: 14px 18px;
    font-size: 0.95rem;
    color: var(--dark-secondary);
}

.article-table tbody td:first-child {
    font-weight: 700;
    color: var(--dark);
}

/* محصول پیشنهادی در متن */
.article-product {
    background: var(--gray-light);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin: 28px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    transition: 0.2s;
}

.article-product:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(4, 79, 65, 0.08);
}

.article-product .product-image {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-mid);
    flex-shrink: 0;
    overflow: hidden;
}

.article-product .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-product .product-info {
    flex: 1;
    min-width: 0;
}

.article-product .product-info .product-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.article-product .product-info h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}

.article-product .product-info .product-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
}

.article-product .product-arrow {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--white);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: 0.15s;
    flex-shrink: 0;
}

.article-product:hover .product-arrow {
    background: var(--primary);
    color: #fff;
}

/* اشتراک‌گذاری */
.article-share {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    margin-top: 32px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.article-share .share-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark);
}

.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: 0.15s;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.share-btn.telegram { background: #0088cc; }
.share-btn.whatsapp { background: #25D366; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.copy { background: var(--gray); }

/* تگ‌های مقاله */
.article-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 20px;
    margin-top: 4px;
}

.article-tags .tags-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-tags .tags-label i {
    color: var(--primary);
}

.article-tags a {
    display: inline-block;
    padding: 5px 14px;
    background: var(--gray-light);
    color: var(--gray);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 20px;
    transition: 0.15s;
    border: 1px solid var(--border);
}

.article-tags a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* اطلاعات نویسنده */
.author-box {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--gray-light);
    border-radius: 14px;
    padding: 24px;
    margin-top: 32px;
    border: 1px solid var(--border);
}

.author-box .author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    flex-shrink: 0;
}

.author-box .author-info {
    flex: 1;
    min-width: 0;
}

.author-box .author-info .author-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
}

.author-box .author-info .author-bio {
    font-size: 0.88rem;
    color: var(--gray);
    line-height: 1.8;
}

/* مقالات مرتبط */
.related-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    margin-top: 24px;
}

.related-section h3 {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-section h3 i {
    color: var(--primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.related-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: 0.15s;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
}

.related-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.related-card .related-image {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: var(--gray-light);
    overflow: hidden;
    flex-shrink: 0;
}

.related-card .related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card .related-content {
    flex: 1;
    min-width: 0;
}

.related-card .related-content h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card:hover .related-content h4 {
    color: var(--primary);
}

.related-card .related-content .related-meta {
    font-size: 0.72rem;
    color: var(--gray);
    display: flex;
    gap: 10px;
}

/* سایدبار */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 90px;
    align-self: start;
}

.widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* فهرست مطالب */
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-list a {
    display: block;
    padding: 8px 12px;
    color: var(--dark-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    transition: 0.15s;
    border-right: 2px solid transparent;
}

.toc-list a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-right-color: var(--primary);
    padding-right: 16px;
}

.toc-list a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right-color: var(--primary);
    font-weight: 800;
}

/* مقالات پربازدید */
.popular-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.popular-list li {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.popular-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-list li:first-child {
    padding-top: 0;
}

.popular-list .popular-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: var(--gray-light);
    overflow: hidden;
    flex-shrink: 0;
}

.popular-list .popular-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-list .popular-content {
    flex: 1;
    min-width: 0;
}

.popular-list .popular-content h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-list .popular-content h4 a {
    color: inherit;
    text-decoration: none;
}

.popular-list .popular-content h4 a:hover {
    color: var(--primary);
}

.popular-list .popular-content .popular-meta {
    display: flex;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--gray);
}

/* محصولات مرتبط */
.product-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-sidebar-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--gray-light);
    text-decoration: none;
    color: inherit;
    transition: 0.15s;
    border: 1px solid var(--border);
}

.product-sidebar-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.product-sidebar-item .ps-image {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--gray-mid);
    flex-shrink: 0;
    overflow: hidden;
}

.product-sidebar-item .ps-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-sidebar-item .ps-content {
    flex: 1;
    min-width: 0;
}

.product-sidebar-item .ps-content h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-sidebar-item .ps-content .ps-price {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--primary);
}

/* نوار پیشرفت مطالعه */
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    z-index: 1001;
    transition: width 0.1s;
    width: 0%;
}

/* دکمه بازگشت به بالا */
.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(4, 79, 65, 0.3);
    transition: 0.2s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    font-family: 'YekanBakhFaNum', Tahoma, sans-serif;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ریسپانسیو مقاله */
@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .article-header {
        padding: 24px 24px 20px 24px;
    }

    .article-content {
        padding: 24px 24px;
    }

    .article-featured-image {
        height: 280px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.3rem;
    }

    .article-header .article-lead {
        font-size: 0.95rem;
    }

    .article-header {
        padding: 20px 18px 16px 18px;
    }

    .article-content {
        padding: 20px 18px;
    }

    .article-content h2 {
        font-size: 1.2rem;
        margin: 24px 0 12px 0;
    }

    .article-content h3 {
        font-size: 1.05rem;
    }

    .article-content p,
    .article-content ul li,
    .article-content ol li {
        font-size: 0.95rem;
    }

    .article-featured-image {
        height: 220px;
    }

    .article-product {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .article-product .product-image {
        width: 80px;
        height: 80px;
    }

    .article-table thead th,
    .article-table tbody td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .article-share {
        justify-content: center;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .related-section {
        padding: 20px 18px;
    }

    .widget {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .article-header h1 {
        font-size: 1.15rem;
    }

    .article-meta {
        gap: 12px;
        font-size: 0.78rem;
    }

    .article-meta .meta-item {
        font-size: 0.78rem;
    }

    .share-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
}

/* محصولات مرتبط انتهای مقاله (لود تنبل) */
.related-products {
    padding: 8px 40px 0;
}

.related-products-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 24px 0 4px;
}

.related-products-title i {
    color: var(--primary);
}

@media (max-width: 768px) {
    .related-products {
        padding: 8px 16px 0;
    }
}
