/* css/post.css */

/* Layout */
.main-layout-flex {
    display: flex;
    gap: 40px;
    padding: 60px 20px;
    align-items: flex-start;
}

/* Article Area */
.post-article-area {
    flex: 2;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Header & Meta */
.post-badge-chip {
    background: rgba(217, 4, 41, 0.1);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 15px;
}

.article-title {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-author img {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.meta-author span {
    color: var(--text-main);
    font-size: 0.95rem;
}

.meta-data {
    display: flex;
    gap: 20px;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.meta-data i { color: var(--primary); }

/* Featured Image */
.article-featured-img {
    margin-bottom: 40px;
    border-radius: 10px;
    overflow: hidden;
}

.article-featured-img img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.3s;
}

/* Table of Contents (TOC) */
.article-toc {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-right: 4px solid var(--primary);
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
    display: none; /* يظهر بالجافاسكريبت */
}

.toc-title {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li { margin-bottom: 8px; }

.toc-list a {
    color: var(--text-sec);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    display: block;
    font-size: 1rem;
}

.toc-list a:hover {
    color: var(--primary);
    transform: translateX(-5px);
}

/* تنسيق خاص للعناوين الفرعية H3 */
.toc-list li.sub-item {
    margin-right: 20px;
    font-size: 0.9rem;
    border-right: 2px solid var(--border);
    padding-right: 10px;
}

/* Main Content Typography */
.article-main-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-main);
}

.article-main-text h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin: 40px 0 20px;
    position: relative;
}

.article-main-text h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin: 30px 0 15px;
}

.article-main-text p { margin-bottom: 20px; }

.article-main-text ul, .article-main-text ol {
    margin-bottom: 20px;
    padding-right: 20px;
}

.article-main-text li { margin-bottom: 10px; }

.article-main-text blockquote {
    background: var(--bg-alt);
    border-right: 5px solid var(--primary);
    padding: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-sec);
}

/* Footer Box */
.article-footer-box {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.tags-container, .share-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.box-label { font-weight: bold; color: var(--text-main); }

.tags-list a {
    background: var(--bg-alt);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-gray);
    border: 1px solid var(--border);
}

.tags-list a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.share-icons-row a {
    width: 40px;
    height: 40px;
    background: var(--bg-alt);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    margin-left: 10px;
    border: 1px solid var(--border);
}

.share-icons-row a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Sidebar */
.article-sidebar {
    flex: 1;
    max-width: 350px;
}

.side-widget {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--border);
    margin-bottom: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.author-box img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid var(--primary);
    padding: 3px;
    background: #fff;
}

.author-box h4 { font-size: 1.3rem; margin-bottom: 10px; }
.author-box p { color: var(--text-sec); font-size: 0.95rem; margin-bottom: 20px; }

.author-socials a {
    color: var(--text-gray);
    margin: 0 10px;
    font-size: 1.2rem;
}
.author-socials a:hover { color: var(--primary); }

.newsletter-widget input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-body);
    outline: none;
}

.newsletter-widget button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}
.newsletter-widget button:hover { background: var(--primary-dark); }

/* Mobile Responsive */
@media (max-width: 900px) {
    .main-layout-flex { flex-direction: column; }
    .article-sidebar { max-width: 100%; }
    .post-article-area { padding: 25px; }
    .article-title { font-size: 1.8rem; }
}

/* تنسيق صندوق التعاقد (CTA) داخل المقال */
.article-cta-box {
    background: linear-gradient(135deg, #D90429 0%, #8d021b 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-top: 50px;
    color: #fff;
    box-shadow: 0 15px 35px rgba(217, 4, 41, 0.3);
}

.article-cta-box h3 {
    color: #fff !important; /* لضمان عدم تأثره بتنسيقات المقال الأخرى */
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 900;
}

.article-cta-box p {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* تنسيق الأزرار داخل الصندوق */
.cta-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-cta-primary {
    background: #fff;
    color: #D90429 !important;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cta-outline {
    background: transparent;
    border: 2px solid #fff;
    color: #fff !important;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    transition: 0.3s;
}

.btn-cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background: #f8f8f8;
}

.btn-cta-outline:hover {
    background: #fff;
    color: #D90429 !important;
}

/* تحسين للموبايل */
@media (max-width: 768px) {
    .article-cta-box { padding: 30px 20px; }
    .cta-btns { flex-direction: column; }
    .btn-cta-primary, .btn-cta-outline { width: 100%; justify-content: center; }
}