/*
  INDORAN — صفحات مقالات (لیست + تک مقاله)
  بعد از style.css، hero-premium.css و products.css لود می‌شود.
*/

/* =========================================
   لیست مقالات — استفاده از grid عمومی سایت
========================================= */
.articles-section {
    background: var(--light);
}

/* =========================================
   تک مقاله — لایوت اصلی
========================================= */
.article-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 50px;
    align-items: start;
}

.article-cover {
    overflow: hidden;
    margin-bottom: 26px;
    border-radius: var(--radius);
}

.article-cover img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: .82rem;
}

.article-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.article-detail-meta i {
    color: var(--primary-dark);
}

.article-detail-title {
    margin-bottom: 14px;
    color: var(--dark);
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 800;
    line-height: 1.6;
}

.article-lead {
    margin-bottom: 26px;
    padding-inline-start: 16px;
    border-inline-start: 3px solid var(--primary);
    color: var(--muted);
    font-size: 1rem;
    line-height: 2;
}

/* =========================================
   فهرست مطالب (TOC)
========================================= */
.article-toc {
    margin-bottom: 30px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--light);
}

.article-toc h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: var(--dark);
    font-size: .98rem;
}

.article-toc h3 i {
    color: var(--primary-dark);
}

.article-toc ol {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 24px;
    list-style: none;
    counter-reset: toc;
}

.article-toc li {
    counter-increment: toc;
    font-size: .86rem;
}

.article-toc li a {
    display: flex;
    gap: 8px;
    color: var(--text);
    line-height: 1.9;
    transition: .2s;
}

.article-toc li a::before {
    content: counter(toc) ".";
    flex-shrink: 0;
    color: var(--primary-dark);
    font-weight: 700;
    font-family: "JetBrains Mono", monospace;
}

.article-toc li a:hover {
    color: var(--primary-dark);
}

.article-toc li.toc-level-3 {
    grid-column: 1 / -1;
    padding-inline-start: 24px;
    font-size: .8rem;
    opacity: .85;
}

@media (max-width: 560px) {
    .article-toc ol {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   متن مقاله — تایپوگرافی
========================================= */
.article-body {
    color: var(--text);
    font-size: .96rem;
    line-height: 2.2;
}

.article-body > *:first-child {
    margin-top: 0;
}

.article-body p {
    margin-bottom: 18px;
}

.article-body h2 {
    margin: 40px 0 18px;
    padding-top: 4px;
    color: var(--dark);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 800;
    scroll-margin-top: 100px;
}

.article-body h3 {
    margin: 28px 0 14px;
    color: var(--dark);
    font-size: 1.08rem;
    font-weight: 700;
    scroll-margin-top: 100px;
}

.article-body h2:first-of-type {
    margin-top: 4px;
}

.article-body strong {
    color: var(--dark);
    font-weight: 700;
}

.article-body code {
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--light);
    color: var(--primary-dark);
    font-family: "JetBrains Mono", monospace;
    font-size: .85em;
}

.article-body ul.article-list,
.article-body ol.article-list {
    margin: 0 0 20px;
    padding-inline-start: 22px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.article-body ul.article-list {
    list-style: none;
    padding-inline-start: 4px;
}

.article-body ul.article-list li {
    position: relative;
    padding-inline-start: 22px;
}

.article-body ul.article-list li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset-inline-start: 0;
    top: 3px;
    font-size: .72rem;
    color: var(--primary-dark);
}

.article-body ol.article-list {
    list-style: decimal;
    padding-inline-start: 22px;
}

.article-body ol.article-list::marker,
.article-body ol.article-list li::marker {
    color: var(--primary-dark);
    font-weight: 700;
}

.article-body hr.article-hr {
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.article-body blockquote.article-quote {
    margin: 20px 0;
    padding: 16px 20px;
    border-inline-start: 4px solid var(--primary);
    border-radius: 10px;
    background: #fff8ec;
    color: var(--dark);
    font-size: .9rem;
    line-height: 1.9;
}

.article-body .article-table-wrap {
    margin: 8px 0 24px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.article-body table.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.article-body table.article-table th,
.article-body table.article-table td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.article-body table.article-table th {
    background: var(--light);
    color: var(--dark);
    font-weight: 700;
    white-space: nowrap;
}

.article-body table.article-table tr:last-child td {
    border-bottom: 0;
}

/* =========================================
   محصولات مرتبط (پایین متن مقاله)
========================================= */
.article-related-products {
    margin-top: 44px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.article-related-products h3 {
    margin-bottom: 18px;
    color: var(--dark);
    font-size: 1.05rem;
}

.article-related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.mini-product-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: .2s;
}

.mini-product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.mini-product-card img {
    /* aspect-ratio: 1 / 1; */
    border-radius: 8px;
    /* object-fit: contain; */
    background: var(--light);
    /* max-width: 100%; */
    /* max-height: 100%; */
    width: 100%;
    height: 100%;
}

.mini-product-card span {
    color: var(--dark);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.7;
}

/* =========================================
   سایدبار — کارت‌ها
========================================= */
.article-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
}

.sidebar-card h3 {
    margin-bottom: 14px;
    color: var(--dark);
    font-size: 1rem;
}

.sidebar-promo {
    background: var(--dark);
    border-color: var(--dark);
}

.sidebar-promo h3 {
    color: var(--white);
}

.sidebar-promo p {
    margin-bottom: 18px;
    color: rgba(255, 255, 255, .68);
    font-size: .84rem;
    line-height: 1.9;
}

.btn-block {
    width: 100%;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--light);
    color: var(--dark);
    font-size: 1.05rem;
    transition: .2s;
}

.share-btn:hover {
    transform: translateY(-3px);
    color: var(--white);
}

.share-whatsapp:hover { background: #25d366; }
.share-telegram:hover { background: #26a5e4; }
.share-linkedin:hover { background: #0a66c2; }
.share-x:hover { background: #000; }

.author-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.author-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--light);
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.author-box strong {
    display: block;
    margin-bottom: 6px;
    color: var(--dark);
    font-size: .9rem;
}

.author-box p {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.9;
}

.sidebar-related .mini-article-card:last-child {
    margin-bottom: 0;
}

.mini-article-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 10px;
    transition: .2s;
}

.mini-article-card:hover {
    background: var(--light);
}

.mini-article-card img {
    width: 66px;
    height: 56px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
}

.mini-article-card h4 {
    color: var(--dark);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.6;
}

.not-found-state.articles-not-found {
    margin: 0 auto;
}

@media (max-width: 900px) {
    .article-detail-grid {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }
}
