/* ============================================================================
   هرکجا | MTheme — محتوای مقاله و لیست مقالات
   برای: Views/B/Index.cshtml (جزئیات مقاله) و Views/Home/postcategory.cshtml
   Light Theme · Design System جدید MTheme

   ⚠️ تمام استایل‌های محتوای مقاله زیر .article-content اسکوپ شده‌اند
      تا h1..h6 / p / ul / table کل سایت را تغییر ندهند.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   ۱) صفحه جزئیات مقاله — چیدمان
   --------------------------------------------------------------------------- */
.article-hero {
    padding: 28px 0 0;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(45, 108, 223, .07) 0%, transparent 55%),
        radial-gradient(100% 80% at 0% 100%, rgba(245, 158, 11, .06) 0%, transparent 55%),
        #f7f9fc;
}
.article-hero .crumbs { margin-bottom: 18px; }

.article-title {
    margin: 0 0 14px;
    font-size: clamp(1.35rem, 3vw, 2.1rem);
    font-weight: 900;
    line-height: 1.65;
    color: var(--ink, #16283f);
}
.article-lead {
    margin: 0 0 20px;
    font-size: clamp(.92rem, 1.5vw, 1.02rem);
    line-height: 2.1;
    color: var(--ink-soft, #3d5878);
    text-align: justify;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border, rgba(20,45,95,.09));
}
.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--muted, #7a8ca3);
}
.article-meta span i { color: var(--brand, #006a0d); }

/* تصویر شاخص مقاله */
.article-cover {
    position: relative;
    margin: 22px 0 0;
    border-radius: 20px;
    overflow: hidden;
    background: #eef3f9;
    box-shadow: 0 18px 46px -26px rgba(20, 45, 95, .38);
}
.article-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
}
.article-cover .cover-caption {
    position: absolute;
    inset-inline-start: 14px;
    bottom: 14px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 32, 58, .58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ---------------------------------------------------------------------------
   ۲) محتوای مقاله — Container اصلی (مبنای همه اسکوپ‌ها)
   --------------------------------------------------------------------------- */
.article-content {
    padding: 30px 0 10px;
    font-size: 1rem;
    line-height: 2.2;
    color: #24384f;
    word-spacing: -0.5px;
    overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------------
   ۳) پاراگراف — Justify (طبق درخواست، فقط داخل مقاله)
   --------------------------------------------------------------------------- */
.article-content p {
    margin: 0 0 1.30em;
    text-align: justify;
    text-justify: inter-word;
    line-height: 2.25;
    word-spacing: -0.5px;
    color: #24384f;
}
.article-content p:last-child { margin-bottom: 0; }

/* پاراگراف اول مقاله — کمی چشم‌نوازتر */
.article-content > p:first-of-type {
    font-size: 1.04rem;
    color: #1c2f45;
}

/* ---------------------------------------------------------------------------
   ۴) Headings — سلسله‌مراتب واضح
   --------------------------------------------------------------------------- */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--ink, #16283f);
    font-weight: 800;
    line-height: 1.6;
    margin: 1.6em 0 .7em;
    scroll-margin-top: 90px;
}
.article-content h1 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 900; }
.article-content h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
    padding-bottom: .45em;
    border-bottom: 2px solid rgba(45, 108, 223, .14);
}
.article-content h3 { font-size: clamp(1.08rem, 1.9vw, 1.28rem); }
.article-content h4 { font-size: 1.06rem; }
.article-content h5 { font-size: .98rem; color: #2c4462; }
.article-content h6 {
    font-size: .88rem;
    color: var(--muted, #7a8ca3);
    text-transform: uppercase;
    letter-spacing: .03em;
}
/* جلوگیری از چسبیدن اول Heading به بالای محتوا */
.article-content > h1:first-child,
.article-content > h2:first-child,
.article-content > h3:first-child { margin-top: 0; }

/* ---------------------------------------------------------------------------
   ۵) لیست‌ها (ul / ol) — بدون تأثیر روی منو/فوتر
   --------------------------------------------------------------------------- */
.article-content ul,
.article-content ol {
    margin: 0 0 1.4em;
    padding-inline-start: 1.6em;
}
.article-content ul { list-style: none; }
.article-content ul > li { position: relative; padding-inline-start: 1.1em; }
.article-content ul > li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: .85em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand, #006a0d);
    box-shadow: 0 0 0 3px rgba(45, 108, 223, .14);
}
.article-content ol { list-style: decimal; }
.article-content ol > li::marker { color: var(--brand, #006a0d); font-weight: 800; }

.article-content li {
    margin-bottom: .6em;
    line-height: 2.05;
    text-align: right;
}
.article-content li:last-child { margin-bottom: 0; }
/* لیست‌های تو در تو */
.article-content li > ul,
.article-content li > ol {
    margin: .6em 0 .3em;
    padding-inline-start: 1.3em;
}
.article-content li > ul > li::before {
    background: #9aa9bd;
    box-shadow: 0 0 0 3px rgba(154, 169, 189, .16);
}

/* ---------------------------------------------------------------------------
   ۶) جدول — حرفه‌ای و Responsive
   --------------------------------------------------------------------------- */
.article-content table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(20, 45, 95, .1);
    border-radius: 14px;
    overflow: hidden;
    font-size: .93rem;
    background: #fff;
    display: block;              /* اجازه اسکرول افقی در موبایل */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.article-content thead {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.article-content tbody {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.article-content th,
.article-content td {
    padding: 12px 15px;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid rgba(20, 45, 95, .08);
    line-height: 1.9;
}
.article-content th {
    font-weight: 800;
    color: var(--ink, #16283f);
    background: #f3f7fd;
    white-space: nowrap;
}
.article-content tr:last-child td { border-bottom: 0; }
.article-content tbody tr { transition: background .16s; }
.article-content tbody tr:hover { background: #f8fbff; }

/* ---------------------------------------------------------------------------
   ۷) bold / strong
   --------------------------------------------------------------------------- */
.article-content b,
.article-content strong {
    font-weight: 800;
    color: #16283f;
}
.article-content mark {
    background: rgba(245, 158, 11, .22);
    color: inherit;
    padding: 1px 5px;
    border-radius: 5px;
}

/* ---------------------------------------------------------------------------
   ۸) hr — Divider مدرن
   --------------------------------------------------------------------------- */
.article-content hr {
    height: 0;
    margin: 2.1em 0;
    border: 0;
    border-top: 1px solid rgba(20, 45, 95, .1);
}

/* ---------------------------------------------------------------------------
   ۹) تصاویر داخل مقاله — Responsive و بدون Crop
   --------------------------------------------------------------------------- */
.article-content img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 1.4em auto;
    border-radius: 14px;
    box-shadow: 0 12px 32px -22px rgba(20, 45, 95, .4);
}
/* اگر تصویر داخل پاراگراف باشد، inline بماند */
.article-content p img { display: inline-block; margin: 0 .3em; vertical-align: middle; }

figure.article-content-figure { margin: 1.4em 0; }
.article-content figcaption {
    margin-top: .6em;
    font-size: .82rem;
    color: var(--muted, #7a8ca3);
    text-align: center;
}

/* ---------------------------------------------------------------------------
   ۱۰) لینک‌های داخل مقاله
   --------------------------------------------------------------------------- */
.article-content a {
    color: var(--brand, #006a0d);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(45, 108, 223, .3);
    transition: color .18s, border-color .18s;
}
.article-content a:hover {
    color: #004f09;
    border-bottom-color: #004f09;
}

/* ---------------------------------------------------------------------------
   ۱۱) blockquote / code — فقط اگر در محتوا باشند
   --------------------------------------------------------------------------- */
.article-content blockquote {
    margin: 1.5em 0;
    padding: 16px 20px;
    border-inline-start: 4px solid var(--brand, #006a0d);
    border-radius: 0 14px 14px 0;
    background: #f5f8fd;
    color: #2c4462;
    font-style: normal;
    line-height: 2.1;
}
.article-content blockquote p { margin-bottom: .6em; text-align: right; }
.article-content blockquote p:last-child { margin-bottom: 0; }

.article-content code {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: .88em;
    background: #eef3f9;
    color: #004f09;
    direction: ltr;
    unicode-bidi: embed;
}
.article-content pre {
    margin: 1.4em 0;
    padding: 16px 18px;
    border-radius: 14px;
    background: #16283f;
    color: #e6eefb;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-size: .86rem;
    line-height: 1.9;
}
.article-content pre code { background: transparent; color: inherit; padding: 0; }

.article-content dl { margin: 1.3em 0; }
.article-content dt { font-weight: 800; color: #16283f; margin-top: .8em; }
.article-content dd { margin: 0 0 .6em 1.4em; color: #3d5878; }

/* ---------------------------------------------------------------------------
   ۱۲) لیست مقالات (postcategory) — کارت‌ها
   --------------------------------------------------------------------------- */
.blog-page-hero {
    padding: 30px 0 22px;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(45, 108, 223, .07) 0%, transparent 55%),
        #f7f9fc;
}
.blog-page-hero .eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    color: var(--brand, #006a0d);
    background: rgba(45, 108, 223, .09);
}
.blog-page-hero h1 {
    margin: 0;
    font-size: clamp(1.5rem, 3.4vw, 2.3rem);
    font-weight: 900;
    line-height: 1.5;
    color: var(--ink, #16283f);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.blog-post-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(20, 45, 95, .08);
    box-shadow: 0 10px 30px -22px rgba(20, 45, 95, .34);
    transition: transform .22s, box-shadow .22s, border-color .22s;
}
.blog-post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(45, 108, 223, .3);
    box-shadow: 0 20px 46px -24px rgba(45, 108, 223, .45);
}
.blog-post-thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eef3f9;
}
.blog-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.blog-post-card:hover .blog-post-thumb img { transform: scale(1.05); }

.blog-post-body {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 16px 17px 18px;
    flex: 1 1 auto;
}
.blog-post-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 700;
    color: var(--muted, #7a8ca3);
}
.blog-post-date i { color: var(--brand, #006a0d); }

.blog-post-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.75;
}
.blog-post-title a {
    color: var(--ink, #16283f);
    text-decoration: none;
    transition: color .18s;
}
.blog-post-title a:hover { color: var(--brand, #006a0d); }

.blog-post-excerpt {
    margin: 0;
    font-size: .86rem;
    line-height: 2;
    color: var(--ink-soft, #5d7591);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-post-more {
    align-self: flex-start;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    color: var(--brand, #006a0d);
    background: rgba(45, 108, 223, .09);
    text-decoration: none;
    transition: background .18s, color .18s, transform .18s;
}
.blog-post-more:hover {
    background: var(--brand, #006a0d);
    color: #fff;
    transform: translateX(-3px);
}

/* Empty state */
.blog-empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    border-radius: 18px;
    background: #fff;
    border: 1px dashed rgba(20, 45, 95, .18);
}
.blog-empty i { font-size: 2.2rem; color: #c3d0e0; display: block; margin-bottom: 14px; }
.blog-empty p { margin: 0; color: var(--muted, #7a8ca3); font-size: .95rem; line-height: 2; }

/* بخش «مشاهده بیشتر» (AJAX موجود حفظ می‌شود) */
.blog-loadmore {
    margin-top: 30px;
    text-align: center;
}
.blog-loadmore a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 34px;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 800;
    color: #fff !important;
    background: linear-gradient(135deg, #006a0d, #ee8d1a);
    box-shadow: 0 14px 34px -16px rgba(45, 108, 223, .72);
    text-decoration: none;
    transition: transform .18s, box-shadow .18s;
}
.blog-loadmore a:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px -18px rgba(45, 108, 223, .85);
}

/* کارت‌هایی که از AJAX (loaddata) برمی‌گردند هم همان ظاهر را بگیرند */
.listing-items .blog-post-card { width: 100%; }

/* ---------------------------------------------------------------------------
   ۱۳) Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .article-content { font-size: .97rem; line-height: 2.1; }
    .article-content p { line-height: 2.15; }
    .blog-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
    .article-cover { border-radius: 16px; }
    .article-cover img { max-height: 380px; }
}

@media (max-width: 600px) {
    .article-hero { padding-top: 20px; }
    .article-title { font-size: 1.28rem; line-height: 1.7; }
    .article-lead { font-size: .9rem; line-height: 2.05; }
    .article-meta { gap: 8px 12px; }
    .article-meta span { font-size: .76rem; }

    .article-cover { border-radius: 14px; margin-top: 16px; }
    .article-cover img { max-height: none; }
    .article-cover .cover-caption { inset-inline-start: 10px; bottom: 10px; font-size: .74rem; padding: 6px 12px; }

    .article-content { padding: 22px 0 6px; font-size: .95rem; }
    .article-content p { line-height: 2.1; margin-bottom: 1.15em; }
    .article-content h1 { font-size: 1.22rem; }
    .article-content h2 { font-size: 1.12rem; }
    .article-content h3 { font-size: 1.04rem; }
    .article-content h4, .article-content h5 { font-size: .98rem; }
    .article-content h6 { font-size: .82rem; }
    .article-content ul, .article-content ol { padding-inline-start: 1.2em; }
    .article-content ul > li { padding-inline-start: .95em; }
    .article-content th, .article-content td { padding: 10px 12px; font-size: .86rem; }
    .article-content blockquote { padding: 13px 15px; }
    .article-content pre { padding: 13px 14px; font-size: .8rem; }

    .blog-page-hero { padding: 22px 0 16px; }
    .blog-grid { grid-template-columns: 1fr; gap: 16px; }
    .blog-post-body { padding: 14px 15px 16px; }
    .blog-post-title { font-size: .97rem; }
    .blog-loadmore a { padding: 12px 26px; font-size: .86rem; }
}

/* ---------------------------------------------------------------------------
   ۱۴) جعبه CTA انتهای مقاله (data9)
   --------------------------------------------------------------------------- */
.article-cta-wrap { padding: 0 0 48px; }
.article-cta {
    position: relative;
    padding: 26px 30px;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(120% 160% at 100% 0%, rgba(255,255,255,.18) 0%, transparent 60%),
        linear-gradient(135deg, #006a0d 0%, #ee8d1a 100%);
    box-shadow: 0 22px 55px -26px rgba(45, 108, 223, .7);
}
.article-cta::after {
    content: '';
    position: absolute;
    left: -50px;
    bottom: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(245, 158, 11, .3);
    filter: blur(44px);
    pointer-events: none;
}
.article-cta h4 {
    position: relative;
    margin: 0;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    font-weight: 800;
    line-height: 1.8;
    color: #fff;
}

/* ---------------------------------------------------------------------------
   ۱۵) کلاس‌های کمکی — LayoutNew بوت‌استرپ ندارد
   (فقط چیزهایی که این دو صفحه استفاده می‌کنند)
   --------------------------------------------------------------------------- */
.article-page .container,
.blog-page-hero .container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }

.article-page .row { display: flex; flex-wrap: wrap; }
.article-page .justify-content-center { justify-content: center; }

.article-page .col-lg-9 { flex: 0 0 100%; max-width: 100%; min-width: 0; }

@media (min-width: 992px) {
    .article-page .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
}
@media (max-width: 600px) {
    .article-page .container,
    .blog-page-hero .container { padding-inline: 12px; }
    .article-cta { padding: 20px 18px; border-radius: 16px; }
    .article-cta-wrap { padding-bottom: 34px; }
}
