/* single-post.css */

:root {
    --oryx-green: var(--oryx-hex-00704a); /* يمكنك تغييره حسب درجة الأخضر الخاصة بكم */
    --oryx-green-dark: var(--oryx-hex-064e3b); /* أخضر غامق للعناوين */
    --oryx-green-light: var(--oryx-hex-059669); /* للروابط */
    --oryx-light: var(--oryx-hex-e5e7eb);
    
    --text-dark: var(--oryx-hex-1f2937);
    --text-gray-400: var(--oryx-hex-9ca3af);
    --text-gray-600: var(--oryx-hex-4b5563);
    --text-gray-800: var(--oryx-hex-1f2937);
    --text-gray-900: var(--oryx-hex-111827);
    
    --bg-gray-50: var(--oryx-hex-f9fafb);
    --bg-gray-100: var(--oryx-hex-f3f4f6);
    --bg-gray-200: var(--oryx-hex-e5e7eb);
    --border-gray-100: var(--oryx-hex-f3f4f6);
}

/* =========================================
   قسم ترويسة المقال (Header Section)
   ========================================= */
.post-header-wrap {
    position: relative;
    background-color: var(--oryx-green);
    padding-top: 4rem;
    padding-bottom: 4rem;
    overflow: hidden;
}

.post-header-bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
}

.post-header-content {
    position: relative;
    max-width: 56rem; /* max-w-4xl */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: center;
    color: var(--oryx-hex-ffffff);
}

.post-category-link {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--oryx-hex-ffffff);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-block;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
    margin: 0 0.25rem;
    text-decoration: none;
}

.post-category-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.post-title {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700;
    line-height: 1.625;
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07));
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .post-title {
        font-size: 2.25rem; /* text-4xl */
    }
}

.post-meta {
    color: var(--oryx-light);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.post-meta svg {
    width: 1rem;
    height: 1rem;
}

/* =========================================
   تخطيط الصفحة الرئيسية (Main Layout)
   ========================================= */
.page-main-bg {
    background-color: var(--bg-gray-50);
    min-height: 100vh;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    font-family: 'Cairo', sans-serif;
}

.page-container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .page-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
    .page-container { padding-left: 2rem; padding-right: 2rem; }
}

.layout-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: flex-start;
    position: relative;
}

@media (min-width: 1024px) {
    .layout-grid {
        flex-direction: row;
    }
}

/* =========================================
   الأعمدة الجانبية (Sidebars)
   ========================================= */
.sidebar-column {
    display: none;
    width: 20%;
    position: sticky;
    top: 2rem;
    height: max-content;
}

@media (min-width: 1024px) {
    .sidebar-column {
        display: block;
    }
}

.sidebar-card {
    background-color: var(--oryx-hex-ffffff);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-gray-100);
    padding: 1.25rem;
    overflow: hidden;
}

.sidebar-title {
    font-weight: 700;
    color: var(--text-gray-900);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-gray-100);
    padding-bottom: 0.5rem;
    font-size: 0.875rem;
}

.sidebar-title-indicator {
    width: 0.25rem;
    height: 1.25rem;
    background-color: var(--oryx-green);
    border-radius: 9999px;
}

/* قائمة أحدث المقالات */
.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-post-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    text-decoration: none;
}

.recent-post-item:hover .recent-post-img {
    transform: scale(1.1);
}

.recent-post-item:hover .recent-post-title {
    color: var(--oryx-green);
}

.recent-post-img-wrap {
    position: relative;
    width: 5rem;
    height: 5rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-gray-100);
    background-color: var(--bg-gray-100);
}.article-body-content h1,

.recent-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.recent-post-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oryx-hex-d1d5db); /* gray-300 */
    background-color: var(--bg-gray-50);
}

.recent-post-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-gray-800);
    transition: color 0.2s;
    line-height: 1.375;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   محتوى المقال (Main Article Area)
   ========================================= */
.main-content-column {
    width: 100%;
    background-color: var(--oryx-hex-ffffff);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-gray-100);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .main-content-column {
        width: 60%;
    }
}

.main-content-inner {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .main-content-inner {
        padding: 2.5rem;
    }
}

.main-thumbnail-wrap {
    width: 100%;
    margin-bottom: 2rem;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-gray-100);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.main-thumbnail-wrap img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* تنسيقات النصوص الداخلية للمقال (تم نقلها من style الداخلي) */
.article-body-content {
    max-width: 100%;
}

.article-body-content h1, 
.article-body-content h2, 
.article-body-content h3, 
.article-body-content h4, 
.article-body-content h5, 
.article-body-content h6 {
    color: var(--oryx-green-dark) !important;
    font-weight: 800 !important;
    margin-top: 1.5em !important;
    margin-bottom: 0.8em !important;
    line-height: 1.6 !important; /* هذا السطر سيحل مشكلة التداخل */
}

.article-body-content p, 
.article-body-content li, 
.article-body-content span,
.article-body-content strong {
    color: var(--text-dark) !important;
    font-family: 'Cairo', sans-serif !important;
    line-height: 1.8 !important;
}

.article-body-content a {
    color: var(--oryx-green-light) !important;
    text-decoration: underline !important;
}

/* =========================================
   قسم المشاركة (Share Section)
   ========================================= */
.share-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-text {
    font-size: 0.875rem;
    color: var(--text-gray-400);
}

.btn-share {
    font-size: 0.75rem;
    background-color: var(--bg-gray-100);
    color: var(--text-gray-600);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    cursor: pointer;
}

.btn-share:hover {
    background-color: var(--bg-gray-200);
}

/* =========================================
   بنر الإعلانات (Ad Banner Sidebar)
   ========================================= */
.ad-card {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ad-card:hover .ad-img {
    transform: scale(1.1);
}

.ad-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s;
}

.ad-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2), transparent);
}

.ad-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 10;
}

.ad-title {
    color: var(--oryx-hex-ffffff);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.07));
}

.ad-desc {
    color: var(--oryx-hex-e5e7eb);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.btn-ad {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--oryx-green);
    color: var(--oryx-hex-ffffff);
    font-weight: 700;
    border-radius: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: block;
}

.btn-ad:hover {
    background-color: var(--oryx-hex-ffffff);
    color: var(--oryx-green);
    transform: translateY(-0.25rem);
}
/* تغميق نصوص الروابط الجانبية لزيادة التباين */
.main-content-column a, 
.share-text, 
a[href*="wa.me"] {
    color: var(--oryx-hex-0d5a2b) !important; /* أخضر غامق وواضح */
}

.share-text {
    color: var(--oryx-hex-4a5568) !important; /* رمادي غامق جداً للنصوص الوصفية */
}
/* التغلب على تنسيقات Tailwind وفرض هوية أوركس */
#forced-article-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    text-align: right !important;
    background-color: #ffffff !important;
    margin: 30px 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.08) !important;
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
}

#forced-article-content th {
    background-color: #1b5b29 !important;
    color: #ffffff !important;
    padding: 18px 15px !important;
    font-weight: 700 !important;
    font-size: 1.1em !important;
    border: 1px solid #14461f !important;
}

#forced-article-content td {
    padding: 15px !important;
    border-bottom: 1px solid #eeeeee !important;
    border-right: 1px solid #eeeeee !important;
    border-left: 1px solid #eeeeee !important;
    color: #444444 !important;
}

#forced-article-content tr:nth-child(even) {
    background-color: #f9fbf9 !important;
}

#forced-article-content tr:hover {
    background-color: #eef5f0 !important;
    transition: background-color 0.3s ease !important;
}
/* =========================================
   تحسينات عرض الجداول على الموبايل + تلميح التمرير
   ========================================= */
@media (max-width: 768px) {
    #forced-article-content table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        font-size: 0.9em !important;
        margin: 20px 0 30px 0 !important; /* زيادة المسافة السفلية لإعطاء مساحة لشريط التمرير */
    }

    #forced-article-content th,
    #forced-article-content td {
        padding: 10px 12px !important;
        font-size: 0.95em !important;
    }

    /* تخصيص شريط التمرير (Scrollbar) ليظهر بوضوح وبتصميم متناسق */
    #forced-article-content table::-webkit-scrollbar {
        height: 6px !important; /* ارتفاع شريط التمرير */
    }
    
    #forced-article-content table::-webkit-scrollbar-track {
        background: #f1f1f1 !important; /* لون مسار الشريط (رمادي فاتح) */
        border-radius: 4px !important;
    }
    
    #forced-article-content table::-webkit-scrollbar-thumb {
        background: #1b5b29 !important; /* لون أوركس الأخضر لتوضيح إمكانية السحب */
        border-radius: 4px !important;
    }
    
    #forced-article-content table::-webkit-scrollbar-thumb:hover {
        background: #14461f !important; /* لون أغمق عند اللمس/التمرير */
    }
}