/* assets/css/style-pages.css - نسخه نهایی و تمیز */

/* =========================
   Base
========================= */
.article-page {
    background: #fff;
    padding: 60px 0;
    direction: rtl;
    min-height: 100vh;
}

#toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    display: none;
    z-index: 1000;
}

/* =========================
   Layout
========================= */
.article-layout {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 28px;
    align-items: start;
}

.article-main {
    min-width: 0;
}

.article-box {
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 30px 30px 22px 30px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
    background: #fff;
}

/* =========================
   Header
========================= */
.article-header {
    text-align: center;
    margin-bottom: 26px;
    border-bottom: 1px solid #eee;
    padding-bottom: 18px;
}

.article-header h1 {
    font-size: 2.05rem;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1.55;
    margin: 0 0 15px 0;
}

.article-meta {
    font-size: 1.05rem;
    color: #555;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.author-name {
    color: #1e66ff;
}

.meta-sep {
    color: #bbb;
    font-weight: 900;
}

.article-date {
    font-size: 0.98rem;
    color: #666;
    font-weight: 900;
}

/* آیتم‌های کتگوری (در همان ردیف) */
.category-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.category-item.section-blue {
    background: #f0f5ff;
    color: #1e66ff;
    border: 1px solid #d0e0ff;
}

.category-item.section-gold {
    background: #fff8e7;
    color: #b87c00;
    border: 1px solid #ffe6b3;
}

.category-item i {
    font-size: 0.8rem;
}

/* =========================
   Featured Image
========================= */
.article-featured-image {
    margin: 24px 0 34px 0;
    text-align: center;
}

.article-featured-image img {
    max-width: 100%;
    height: auto;
    width: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    background: #fff;
}

/* =========================
   Body
========================= */
.article-body {
    font-size: 1.18rem;
    line-height: 2.15;
    color: #333;
    text-align: justify;
}

.article-body p {
    margin-bottom: 22px;
}

.article-body h2, .article-body h3 {
    font-weight: 900;
    margin: 30px 0 15px 0;
    color: #1a1a1a;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

/* =========================
   Share Bar
========================= */
.share-bar {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.share-title {
    font-weight: 900;
    color: #555;
    white-space: nowrap;
}

.share-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none !important;
    color: #222 !important;
    background: #fff;
    transition: 0.2s;
    cursor: pointer;
}

.share-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: #e6e6e6;
}

.share-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.si-wa {
    background: #25D366;
}

.si-fb {
    background: #3b5998;
}

.si-tg {
    background: #0088cc;
}

.si-cp {
    background: #7f8c8d;
}

.share-label {
    font-weight: 900;
    font-size: 0.95rem;
    color: #222;
}

.back-btn {
    color: #888;
    text-decoration: none;
    font-weight: 900;
}

.back-btn:hover {
    color: #1e66ff;
}

/* =========================
   Related (cards, no date)
========================= */
.related-wrap {
    margin-top: 18px;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
    background: #fff;
}

.related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.related-head h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 900;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.rel-card {
    text-decoration: none !important;
    color: #222 !important;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    overflow: hidden;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.rel-thumb {
    height: 120px;
    background: #f4f4f4;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rel-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.rel-title {
    font-weight: 900;
    font-size: 0.98rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================
   Sidebar
========================= */
.sidebar {
    position: sticky;
    top: 90px;
}

.side-card {
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.03);
    margin-bottom: 18px;
    background: #fff;
}

.side-title {
    font-weight: 900;
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid #1e66ff;
    padding-bottom: 8px;
}

.side-title i {
    color: #1e66ff;
    width: 20px;
    text-align: center;
}

/* Sidebar lists */
.side-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-list li {
    border-bottom: 1px dashed #eee;
    padding: 12px 0;
}

.side-list li:last-child {
    border-bottom: none;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: #222 !important;
}

.side-link:hover .side-text {
    color: #1e66ff;
}

.side-text {
    font-weight: 700;
    line-height: 1.45;
    font-size: 0.95rem;
    flex: 1;
}

/* Thumb */
.thumb {
    width: 64px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 auto;
    background: #f4f4f4;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-ph {
    color: #aaa;
    font-size: 18px;
}

/* Latest posts */
.latest-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.latest-list li {
    border-bottom: 1px dashed #eee;
    padding: 12px 0;
}

.latest-list li:last-child {
    border-bottom: none;
}

.latest-link {
    text-decoration: none !important;
    color: #222 !important;
    font-weight: 700;
    line-height: 1.6;
    display: block;
}

.latest-link:hover {
    color: #1e66ff !important;
}

/* =========================
   Credit Box
========================= */
.credit-box {
    margin-top: 18px;
    border: 2px solid #f1d6d6;
    border-right: 8px solid #c0392b;
    border-radius: 14px;
    padding: 18px 16px;
    background: #fff3f3;
    color: #111;
    font-weight: 700;
    line-height: 2.05;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}

.credit-box i {
    color: #c0392b;
    margin-left: 8px;
    font-size: 18px;
}

.credit-box b {
    color: #c0392b;
}

/* =========================
   Text utilities
========================= */
.text-muted {
    color: #888;
    font-weight: 500;
    padding: 10px 0;
}

/* =========================
   Responsive
========================= */
@media (max-width: 1200px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: static;
        top: auto;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-page {
        padding: 35px 0;
    }
    
    .article-header h1 {
        font-size: 1.55rem;
    }
    
    .article-body {
        font-size: 1.08rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .article-featured-image img {
        max-height: 300px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .meta-sep {
        display: none;
    }
    
    .share-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .share-actions {
        width: 100%;
        justify-content: center;
    }
    
    .back-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .article-box {
        padding: 20px;
    }
    
    .share-item {
        padding: 8px 10px;
    }
    
    .share-label {
        font-size: 0.85rem;
    }
    
    .share-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .category-item {
        padding: 3px 8px;
        font-size: 0.85rem;
    }
}