/* ==========================================================
   NEWS DETAIL PAGE
========================================================== */

/* ==========================
   HERO
========================== */

.article-hero {
    padding: 60px 0 40px;
    background: linear-gradient(180deg, #f8fbff, #ffffff);
}

/* فقط برای وسط‌چین شدن محتوای همین صفحه */
.article-hero .container,
.article-section .container {
    width: min(100% - 40px, 1320px);
    margin-right: auto;
    margin-left: auto;
}

.article-breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
    font-size: 14px;
    color: #64748b;
}

.article-breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.article-breadcrumb a:hover {
    color: #0f4c75;
}

.hero-wrapper {
    background: #ffffff;
    border-radius: 32px;
    padding: 35px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    border: 1px solid #edf2f7;
}

.article-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 50px;
    background: #eaf4ff;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: 42px;
    line-height: 1.5;
    font-weight: 900;
    color: #0f4c75;
    margin: 0 0 20px;
}

.article-summary {
    color: #64748b;
    line-height: 2;
    font-size: 17px;
    margin: 0 0 25px;
}

.article-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.meta-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 15px;
    color: #475569;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-image {
    overflow: hidden;
    border-radius: 26px;
    height: 380px;
    background: #f8fafc;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================
   ARTICLE BODY
========================== */

.article-section {
    padding: 45px 0 80px;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 35px;
    align-items: start;
}

.article-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 45px;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
    border: 1px solid #edf2f7;
    overflow: hidden;
    direction: rtl;
    text-align: right;
}

.content-card p {
    font-size: 17px;
    line-height: 2.2;
    color: #374151;
    margin: 0 0 20px;
}

.content-card p:last-child {
    margin-bottom: 0;
}

.content-card img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    display: block;
    margin: 24px auto;
}

.content-card iframe,
.content-card video,
.content-card table,
.content-card .table-responsive {
    max-width: 100%;
}

.content-card * {
    word-wrap: break-word;
}

/* ==========================
   CKEDITOR CONTENT
========================== */

.content-card h1,
.content-card h2,
.content-card h3,
.content-card h4,
.content-card h5,
.content-card h6 {
    color: #0f172a;
    line-height: 1.9;
    font-weight: 800;
    margin: 28px 0 14px;
}

.content-card h1 {
    font-size: 30px;
}

.content-card h2 {
    font-size: 26px;
}

.content-card h3 {
    font-size: 22px;
}

.content-card ul,
.content-card ol {
    margin: 0 0 20px;
    padding-right: 22px;
    line-height: 2.1;
    color: #374151;
}

.content-card li {
    margin-bottom: 8px;
}

.content-card blockquote {
    margin: 24px 0;
    padding: 16px 18px;
    background: #f8fafc;
    border-right: 4px solid var(--color-primary);
    border-radius: 16px;
    color: #475569;
    line-height: 2.1;
}

.content-card a {
    color: var(--color-primary);
    text-decoration: none;
}

.content-card a:hover {
    text-decoration: underline;
}

.content-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.content-card th,
.content-card td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: right;
    vertical-align: top;
    color: #374151;
}

.content-card th {
    background: #f8fafc;
    font-weight: 700;
}

.content-card figure {
    margin: 24px 0;
}

.content-card figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    line-height: 1.8;
}

.content-card hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 30px 0;
}

/* ==========================
   SIDEBAR
========================== */

.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 25px;
    border: 1px solid #edf2f7;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.06);
}

.sidebar-card h3 {
    font-size: 20px;
    font-weight: 900;
    color: #0f4c75;
    margin: 0 0 20px;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-card li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid #eef2f7;
}

.sidebar-card li:first-child {
    padding-top: 0;
}

.sidebar-card li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-card li span {
    color: #64748b;
    font-size: 13px;
}

.sidebar-card li strong {
    color: #1e293b;
    font-size: 15px;
    line-height: 1.9;
}

/* ==========================
   TAGS
========================== */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-list span {
    max-width: 100%;
    padding: 8px 14px;
    background: #edf6ff;
    color: #0f4c75;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    white-space: normal;
    line-height: 1.8;
}

/* ==========================
   BACK BUTTON
========================== */

.article-footer {
    margin-top: 24px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 14px 25px;
    border-radius: 15px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.back-btn:hover {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* ==========================
   RELATED NEWS
========================== */

.related-news-inline {
    margin-top: 26px;
}

.section-title {
    margin-bottom: 18px;
}

.section-title span {
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 700;
}

.section-title h2 {
    margin: 6px 0 0;
    font-size: 24px;
    font-weight: 900;
    color: #0f4c75;
    line-height: 1.6;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.related-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid #edf2f7;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.related-image {
    height: 145px;
    overflow: hidden;
    background: #f8fafc;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-category {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--color-primary);
    font-weight: 700;
}

.related-body h3 {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.8;
    margin: 0 0 8px;
    color: #0f172a;
}

.related-body p {
    color: #64748b;
    font-size: 13px;
    line-height: 1.9;
    margin: 0 0 10px;
}

.related-date {
    margin-top: auto;
    font-size: 12px;
    color: #94a3b8;
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 1200px) {
    .hero-content h1 {
        font-size: 36px;
    }
}

@media (max-width: 992px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    /* فقط حفظ وسط‌چین بودن و حاشیه استاندارد در موبایل */
    .article-hero .container,
    .article-section .container {
        width: min(100% - 30px, 1320px);
    }

    .article-hero {
        padding: 30px 0 25px;
    }

    .article-breadcrumb {
        gap: 8px;
        margin-bottom: 20px;
        font-size: 13px;
    }

    .hero-wrapper {
        padding: 20px;
        border-radius: 22px;
        gap: 22px;
    }

    .hero-content h1 {
        font-size: 28px;
        line-height: 1.8;
        margin-bottom: 15px;
    }

    .article-summary {
        font-size: 15px;
        line-height: 2;
    }

    .article-meta {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
    }

    .meta-item {
        width: auto;
        max-width: 100%;
        min-width: 0;
        padding: 8px 11px;
        border-radius: 10px;
        font-size: 12px;
        line-height: 1.6;
        white-space: nowrap;
    }


    .hero-image {
        height: 240px;
        border-radius: 20px;
    }

    .article-section {
        padding: 35px 0 70px;
    }

    .content-card {
        padding: 25px 18px;
        border-radius: 22px;
    }

    .content-card p {
        font-size: 15px;
        line-height: 2.1;
    }

    .article-sidebar {
        display: flex;
        flex-direction: column;
    }

    .sidebar-card {
        padding: 20px 18px;
        border-radius: 20px;
    }

    .sidebar-card h3 {
        font-size: 18px;
    }

    .back-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 18px;
    }

    .related-news-inline {
        margin-top: 22px;
    }

    .section-title h2 {
        font-size: 21px;
    }

    .related-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .related-image {
        height: 130px;
    }

    .related-body {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 24px;
    }

    .article-category {
        font-size: 13px;
        padding: 7px 14px;
    }

    .meta-item {
        font-size: 13px;
    }

    .content-card {
        padding: 20px 16px;
    }

    .sidebar-card {
        padding: 18px 16px;
    }

    .related-image {
        height: 120px;
    }
}

@media (max-width: 359.98px) {
    .article-meta {
        gap: 6px;
    }

    .meta-item {
        padding: 7px 9px;
        font-size: 11px;
        gap: 6px;
    }
}
