/* blog.css */
:root {
    --accent: #c9a96e;
    --muted: #666;
    --card-bg: #fff;
    --border: #e9ecef;
}

/* ensure RTL container */
.container-rtl {
    direction: rtl;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: "Vazirmatn", sans-serif;
}

/* header */
.blog-header {
    text-align: center;
    margin-bottom: 18px;
}

.blog-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #111;
}

/* categories row as chips */
.categories-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 18px 0 8px;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all .15s ease;
}

.cat-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.cat-chip.active {
    background: rgba(201, 169, 110, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* divider */
.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to left, transparent, #eee, transparent);
    margin: 20px 0 30px;
}

/* grid */
.posts-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
}

/* responsive grid */
@media (max-width: 1000px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* card */
.post-card {
    background: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.09);
}

/* image */
.post-image-wrap {
    position: relative;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.post-card:hover .post-image {
    transform: scale(1.03);
}

/* circular avatar / initial */
.post-avatar {
    position: absolute;
    top: 12px;
    left: 12px; /* because rtl, left positions top-left visually */
    background: linear-gradient(45deg, #6b2bd6, #a62bf0);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    font-size: 1.05rem;
}

/* body */
.post-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

/* meta */
.post-meta {
    font-size: .85rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.post-meta .meta-cat {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.post-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-excerpt {
    margin: 0;
    color: #555;
    font-size: .97rem;
    line-height: 1.6;
    min-height: 48px;
}

/* actions */
.post-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

/* pagination */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.pagination-list {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.pagination-list li {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
}

.pagination-list li a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.pagination-list li.active-page {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
}

.no-posts {
    text-align: center;
    color: var(--muted);
    padding: 40px 0;
}


/* hero , category*/

/* ===== HERO ===== */
.blog-hero {
    display: flex;
    justify-content: center; /* وسط افقی */
    align-items: center; /* وسط عمودی */
    text-align: center;
    height: 300px; /* ارتفاع دلخواه */
    background-color: #f5f5f5; /* رنگ پس‌زمینه هیرو */
}

.blog-hero-container {
    max-width: 800px;
    padding: 0 20px;
}

.hero-icon {
    font-size: 50px;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 36px;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.hero-sub {
    font-size: 18px;
    color: #555;
}

/* ===== CATEGORIES ===== */
.categories-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* وسط صفحه */
    gap: 10px;
    margin: 20px 0;
}

.cat-chip {
    padding: 8px 15px;
    border-radius: 25px;
    background-color: #e0e0e0;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cat-chip:hover {
    background-color: #1a1a1a;
    color: #fff;
}

.cat-chip.active {
    background-color: #c9a96e;
    color: #fff;
}

/* ===== BLOG DETAIL PAGE ===== */
html, body {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

.blog-detail {
    max-width: 850px;
    margin: 120px auto 80px;
    padding: 0 20px 100px;
    font-family: "Vazirmatn", sans-serif;
    color: #222;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    color: #111;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    border-radius: 10px; /* اختیاری */
    margin: 10px 0;
}


.detail-meta {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.detail-image-wrap {
    text-align: center;
    margin-bottom: 30px;
}

.detail-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
}

.detail-content {
    font-size: 1rem;
    line-height: 2;
    color: #333;
}


/* =====  Blog Detail TAGS (chips) ===== */
.categories-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 28px 0 18px;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fff;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all .15s ease;
}

.cat-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.cat-chip.active {
    background: rgba(201, 169, 110, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

/* =====  Blog Detail SHARE SECTION ===== */
.share-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 30px 0 0;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 700;
    color: #222;
    margin-left: 6px;
}

.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f8f8f8;
    font-size: 1.2rem;
    color: #444;
    border: 1px solid #e3e3e3;
    transition: all .2s ease;
}

.share-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* رنگ‌های مخصوص هر شبکه */
.share-icon.telegram {
    color: #0088cc;
}

.share-icon.whatsapp {
    color: #25D366;
}

.share-icon.instagram {
    color: #C13584;
}

.share-icon.link {
    color: #444;
}