/* 1. إعدادات الصفحة العامة */
html, body {
    direction: rtl !important;
    text-align: center !important; /* إجبار التوسيط لكل الموقع */
}

/* 1. تعريف الخط العثماني */
@font-face {
    font-family: 'UthmanicHafs';
    src: url('../fonts/uthmanic_hafs_v22.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 1. تصفير هوامش الحاويات لإجبار التوسيط الحقيقي */
.container, #body-wrapper, .columns, .column {
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important; /* إلغاء أي إزاحة جانبية */
    display: block !important;
    width: 100% !important;
    max-width: 1100px !important; /* تحديد عرض مريح للعين */
}

/* 1. تصفير هوامش الحاويات لإجبار التوسيط الحقيقي */
.container, #body-wrapper, .columns, .column {
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important; /* إلغاء أي إزاحة جانبية */
    display: block !important;
    width: 100% !important;
    max-width: 1100px !important; /* تحديد عرض مريح للعين */
}

/* 2. تنسيق محتوى السورة (استهداف مباشر) */
/* هذا السطر سيطبق الخط الضخم على أي نص داخل المقال */
.post-content p, 
article p, 
section#start p {
    font-family: 'UthmanicHafs', serif !important;
    font-size: 3.5rem !important; 
    line-height: 2.2 !important;
    text-align: center !important;
    margin: 30px auto !important;
    display: block !important;
    color: #000 !important;
}

/* 3. إلغاء أي أرقام أو هوامش داخلية للقالب قد تسبب انحراف */
article.post-content, section.section {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 4. تعديلات الموبايل (لضمان بقاء التوسيط) */
@media (max-width: 600px) {
    .post-content p, article p {
        font-size: 2.6rem !important;
        line-height: 2 !important;
        max-width: 95% !important;
    }
}

/* 3. حماية الفوتر (إجبار الحجم الصغير) */
#footer p, 
footer p, 
.footer-section p, 
#page-wrapper footer p {
    font-family: 'Tahoma', sans-serif !important;
    font-size: 1rem !important; /* حجم صغير للفوتر */
    line-height: 1.5 !important;
    color: #666 !important;
    margin: 10px auto !important;
}

/* 4. تعديلات الموبايل للسور فقط */
@media (max-width: 600px) {
    .post-content p, article p {
        font-size: 2.5rem !important;
        line-height: 2 !important;
    }
}

/* 1. إخفاء العناصر الزائدة (بدون الأزرار) */
.post-meta, .blog-date {
    display: none !important;
}

/* 2. إظهار وتنسيق أزرار التنقل (لتحقيق التباين المطلوب) */
.prev-next {
    display: flex !important; /* تأكدنا هنا من إظهارها */
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.prev-next .btn {
    background-color: #007bff; /* لون أزرق واضح */
    color: #ffffff !important; /* نص أبيض لأعلى تباين حسب Lighthouse */
    border: 1px solid #0056b3;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

.prev-next .btn:hover {
    background-color: #0056b3;
    border-color: #004494;
}


/* حاوية الشبكة */
.surah-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 15px !important;
    margin-top: 30px !important;
    direction: rtl !important;
}

/* تصميم كرت السورة */
.surah-card {
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
    border: 1px solid #ececec !important;
    border-radius: 10px !important;
    padding: 15px !important;
    text-decoration: none !important;
    color: #333 !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

.surah-card:hover {
    background: #f8f9fa !important;
    border-color: #2c3e50 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08) !important;
}

/* تنسيق رقم السورة الصغير */
.surah-card span {
    background: #2c3e50 !important;
    color: white !important;
    width: 25px !important;
    height: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.8rem !important;
    margin-left: 10px !important;
}


/* تنسيق العنوان الثاني (##) بنفس الخط العثماني */
h2, .post-content h2, .main-content h2 {
    font-family: 'UthmanicHafs', serif !important; /* تأكد من مطابقة الاسم تماماً */
    font-size: 3rem !important; /* حجم فخم وواضح للعنوان */
    text-align: center !important;
    color: #2c3e50 !important; /* لون غامق ووقور */
    margin: 40px auto 30px auto !important;
    display: block !important;
    direction: rtl !important; /* لضمان الاتجاه الصحيح من اليمين لليسام */
    line-height: 1.5 !important;
    border: none !important; /* إزالة أي خطوط افتراضية من القالب */
}


/* ترك فراغ كبير تحت اسم السورة */
.post-content h2, .main-content h2 {
    margin-bottom: 50px !important; /* يمكنك زيادة الرقم 50 حسب رغبتك في حجم الفراغ */
}

/* ترك فراغ بين فقرات النص القرآني لسهولة القراءة */
.post-content p, .main-content p {
    margin-bottom: 30px !important; 
    line-height: 2.5 !important; /* زيادة المسافة بين السطور نفسها داخل الفقرة */
}

/* تصميم فاصل الصفحات مع رقم الصفحة في الوسط */
.page-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 50px 0; /* مسافة فوق وتحت الفاصل */
    color: #95a5a6; /* لون الرقم والخط */
}

.page-divider::before, .page-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd; /* لون وشكل الخط الجانبي */
}

.page-divider:not(:empty)::before {
    margin-right: .50em;
}

.page-divider:not(:empty)::after {
    margin-left: .50em;
}

.page-number {
    font-family: 'UthmanicHafs', serif !important;
    font-size: 1.2rem;
    border: 1px solid #ddd;
    border-radius: 50%; /* لجعل الرقم داخل دائرة */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #2c3e50 !important;
    flex-shrink: 0;
}


footer#footer p, footer#footer a {
    color: #444444 !important; /* لون رمادي داكن واضح */
    font-weight: 500;
}

/* تحسين تباين منطقة الفوتر بالكامل */
#footer.section.bg-gray {
    background-color: #f1f1f1 !important; /* خلفية رمادية فاتحة جداً */
    color: #333333 !important; /* نص رمادي غامق جداً لتحقيق التباين */
}

/* تحسين تباين الرابط الرئيسي (WebQuranMP3) */
#footer a {
    color: #004a99 !important; /* أزرق داكن يحقق معايير التباين AA */
    font-weight: bold;
    text-decoration: underline; /* إضافة خط تحت الرابط لتمييزه بصرياً */
}

#footer a:hover {
    color: #003366 !important;
    text-decoration: none;
}

/* تنسيق نص الحقوق */
#footer p {
    color: #444444 !important;
    margin-top: 10px;
}