/* =========================
   فونت Vazir-FD
   ========================= */

@font-face {
    font-family: 'VazirFD';
    src: url('../../fonts/Vazir-FD.woff2') format('woff2'),
         url('../../fonts/Vazir-FD.woff') format('woff'),
         url('../../fonts/Vazir-FD.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}




.article-lead {
    font-size: 15px;          /* درشت‌تر از قبل */
    color: #374151;
    margin: 6px 0 0;
    line-height: 1.9;
}

/* بخش‌های زیر پست: پربازدید و مرتبط */

.post-extra-section {
    margin-top: 18px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px 14px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    text-align: right;
    position: relative;
}

.post-extra-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
    border-right: 3px solid #2563eb;
    padding-right: 6px;
}

/* ۴ ستون روی دسکتاپ */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.popular-card {
    background-color: #f9fafb;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    font-size: 13px;
}

.popular-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.popular-thumb-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 6px;
}

/* عکس مربعی و نسبتاً بزرگ */
.popular-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background-color: #e5e7eb;
}

.popular-title {
    font-weight: 500;
    color: #111827;
    line-height: 1.6;
}

/* ریسپانسیو: تبلت ۲ ستون، موبایل ۲ یا ۱ ستون بسته به عرض */

@media (max-width: 900px) {
    .popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}






/* =========================
   Reset & پایه
   ========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    font-family: 'VazirFD', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f7fa;
    color: #111827;
    font-size: 14px;
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =========================
   دکمه‌ها
   ========================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #f9fafb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: #1e40af;
    box-shadow: 0 10px 24px rgba(30, 64, 175, 0.45);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: #111827;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* =========================
   HEADER & NAV
   ========================= */

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar {
    background-color: #0f172a;
    color: #e5e7eb;
    font-size: 11px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 8px;
}

.header-main {
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-brand-logo {
    width: 120px;
    height: 51px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-weight: 700;
    font-size: 18px;
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.site-tagline {
    font-size: 11px;
    color: #6b7280;
}

.header-secondary {
    font-size: 11px;
    color: #6b7280;
    text-align: left;
}

.main-nav {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.nav-scroll {
    overflow-x: auto;
}

.nav-list {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    white-space: nowrap;
}

.nav-link {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    color: #374151;
    border: 1px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.nav-link:hover {
    background-color: #e5f1ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.nav-link.active {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #f9fafb;
}

/* =========================
   MAIN LAYOUT
   ========================= */

.site-main {
    padding: 16px 0 32px;
}

.page-section {
    margin-bottom: 24px;
}

/* =========================
   HOME (صفحه اصلی)
   ========================= */

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.5fr);
    gap: 16px;
}

.home-main-column,
.home-side-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* HERO */

.hero-card {
    background-color: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
}

.hero-image {
    position: relative;
    padding-top: 52%;
    overflow: hidden;
}

.hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-body {
    padding: 14px 16px 16px;
}

.hero-meta {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

.hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0f172a;
}

.hero-excerpt {
    font-size: 13px;
    color: #4b5563;
}

/* باکس‌های دسته‌بندی */

.category-block {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
    margin-top: 12px;
}

.category-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.category-block-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.category-block-more {
    font-size: 11px;
    color: #2563eb;
}

.category-block-more:hover {
    text-decoration: underline;
}

.category-block-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-block-item {
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}

.category-block-item:last-child {
    border-bottom: none;
}

.category-block-item a {
    display: block;
    color: inherit;
}

.category-block-item-inner {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.category-block-thumb {
    width: 80px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #e5e7eb;
}

.category-block-text {
    font-size: 12px;
}

.category-block-item-title {
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.category-block-item-meta {
    font-size: 11px;
    color: #9ca3af;
}

/* سایدبار صفحه اصلی */

.side-block {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.side-block-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.side-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-list li {
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
}

.side-list li:last-child {
    border-bottom: none;
}

.side-link {
    display: inline-block;
    color: #111827;
}

.side-meta {
    font-size: 11px;
    color: #9ca3af;
    margin-right: 4px;
}

/* =========================
   NEWS LIST (لیست خبرها)
   ========================= */

.news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 10px;
    align-items: center;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.news-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.news-item-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.news-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.news-item-title a {
    color: inherit;
}

.news-item-meta {
    font-size: 11px;
    color: #9ca3af;
}

.news-item-excerpt {
    font-size: 12px;
    color: #4b5563;
}

.news-item-thumb {
    width: 100%;
    height: 78px;
    border-radius: 10px;
    object-fit: cover;
    background-color: #e5e7eb;
}

/* =========================
   صفحه مقاله / پست
   ========================= */

.article-page {
    display: flex;
    flex-direction: row-reverse; /* محتوا راست، سایدبار چپ */
    gap: 18px;
}

.article-main {
    flex: 3;
    background-color: #ffffff;
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    text-align: right;
}

.article-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* هدر پست: متن + عکس کنار هم، عکس سمت راست */

.article-header {
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.article-header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.article-header-thumb img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: contain; /* تصویر کامل، بدون کراپ */
}

.article-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.article-meta {
    font-size: 11px;
    color: #6b7280;
}

.article-meta span + span::before {
    content: " • ";
    margin: 0 2px;
}

.article-lead {
    font-size: 13px;
    color: #374151;
    margin: 4px 0 0;
}

.article-text {
    font-size: 14px;
    color: #111827;
    margin-top: 8px;
    text-align: right;
}

/* ستون تبلیغ + دکمه */

.ad-box {
    background-color: #f9fafb;
    border-radius: 14px;
    min-height: 260px;
    border: 1px dashed #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6b7280;
}

.ad-box-button .btn {
    width: 100%;
    justify-content: center;
}

.redirect-info {
    margin-top: 6px;
    font-size: 11px;
    color: #6b7280;
    text-align: right;
}

/* =========================
   Extra sections زیر پست
   ========================= */

.post-extra-section {
    margin-top: 18px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    text-align: right;
}

.post-extra-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #111827;
}

/* پربازدید + آخرین مطالب دسته – استایل مشترک */

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.popular-card {
    font-size: 12px;
    text-align: right;
}

.popular-thumb {
    width: 100%;
    aspect-ratio: 1 / 1; /* مربعی */
    border-radius: 12px;
    object-fit: cover;
    background-color: #e5e7eb;
    margin-bottom: 6px;
}

.popular-title {
    font-weight: 500;
    color: #111827;
}

/* =========================
   صفحه دسته‌بندی
   ========================= */

.category-header {
    margin-bottom: 10px;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-description {
    font-size: 12px;
    color: #6b7280;
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    padding: 10px 0 16px;
    font-size: 11px;
    color: #6b7280;
    margin-top: 12px;
}

.footer-inner {
    text-align: center;
}

/* =========================
   ADMIN PANEL
   ========================= */

.admin-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    background: #0f172a;
    color: #e5e7eb;
    padding: 16px;
}

.admin-sidebar h2 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 16px;
}

.admin-sidebar a {
    display: block;
    font-size: 14px;
    color: #e5e7eb;
    padding: 6px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
    background: #1f2937;
}

.admin-main {
    background: #f3f6fb;
    padding: 18px 20px;
}

.card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    margin-bottom: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 6px;
}

.table th {
    text-align: right;
    font-weight: 600;
    background: #f9fafb;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}

.form-control,
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    font-family: inherit;
}

textarea {
    min-height: 100px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.badge-green {
    background: #d1fae5;
    color: #065f46;
}

.badge-gray {
    background: #e5e7eb;
    color: #374151;
}

/* =========================
   ریسپانسیو
   ========================= */

@media (max-width: 1024px) {
    .home-layout {
        grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
    }
}

@media (max-width: 900px) {
    .home-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-secondary {
        text-align: right;
    }

    .news-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-page {
        flex-direction: column;
    }

    .article-main,
    .article-side {
        flex: none;
    }

    .article-header {
        flex-direction: column;
    }

    .popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 10px;
    }

    .hero-title {
        font-size: 18px;
    }

    .article-title {
        font-size: 19px;
    }

    .popular-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .category-block-item-inner {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .category-block-thumb {
        width: 70px;
        height: 46px;
    }
}








/* کارت‌های پربازدید و مرتبط – شیک‌تر */

.post-extra-section {
    margin-top: 18px;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 12px 14px 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    text-align: right;
    position: relative;
}

.post-extra-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111827;
    border-right: 3px solid #2563eb;
    padding-right: 6px;
}

/* دو ستون برای اینکه کارت‌ها بزرگ‌تر باشن */
.popular-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.popular-card {
    background-color: #f9fafb;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    font-size: 13px;
}

.popular-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.popular-thumb-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 6px;
}

/* عکس مربعی و بزرگ‌تر */
.popular-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background-color: #e5e7eb;
}

.popular-title {
    font-weight: 500;
    color: #111827;
    line-height: 1.6;
}

/* موبایل: تک‌ستونه */
@media (max-width: 768px) {
    .popular-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* === Fix popular/related grid: 4 columns on desktop === */

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* دسکتاپ: 4 تا در هر سطر */
    gap: 14px;
}

@media (max-width: 1024px) {
    .popular-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* لپ‌تاپ متوسط: 3 تا */
    }
}

@media (max-width: 768px) {
    .popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* موبایل / تبلت کوچیک: 2 تا */
    }
}



/* === Post header layout: bigger image === */

.article-page {
    display: flex;
    flex-direction: row-reverse; /* محتوا راست، سایدبار چپ */
    gap: 18px;
}

.article-main {
    flex: 3;
}

.article-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* عنوان + متا + عکس کنار هم (دسکتاپ) */
.article-header {
    display: flex;
    flex-direction: row-reverse; /* عکس سمت راست، متن سمت چپ */
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.article-header-text {
    flex: 3;
    text-align: right;
}

.article-header-thumb {
    flex: 2;
}

.article-header-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover; /* تصویر رو فول خونه کارت پر کنه */
}

/* توضیحات (لید) پایین هدر، درشت‌تر */
.article-lead {
    font-size: 15px;
    color: #374151;
    margin: 8px 0 0;
    line-height: 1.9;
}

/* ریسپانسیو: روی موبایل زیر هم بشن: عنوان/متا → عکس → توضیحات */
@media (max-width: 768px) {
    .article-page {
        flex-direction: column;
    }

    .article-main,
    .article-side {
        flex: none;
    }

    .article-header {
        flex-direction: column;  /* ترتیب DOM حفظ میشه: متن → عکس */
    }

    .article-header-thumb {
        width: 100%;
    }
}

/* =========================
   فیکس منوی دسته‌بندی در موبایل
   ========================= */
.main-nav {
    overflow: hidden;
}

.main-nav .nav-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.main-nav .nav-list {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 8px;
}

/* هر لینک منو جدا جدا بیاد و نصفه نشه */
.main-nav .nav-link {
    flex: 0 0 auto;
}

/* موبایل: فاصله‌ها یه کم جمع‌وجورتر */
@media (max-width: 768px) {
    .main-nav .nav-scroll {
        padding-bottom: 4px;
    }

    .main-nav .nav-link {
        font-size: 13px;
        padding: 6px 10px;
    }
}

