/* KazaPedia Design System - AdSense Optimized */
:root {
    /* الألوان الأساسية */
    --primary-color: #0F4C75;
    /* أزرق موثوق - للهيدر والعناوين */
    --secondary-color: #3282B8;
    /* أزرق فاتح - للروابط */
    --accent-color: #FF9F1C;
    /* برتقالي - للأزرار والأكشن (High CTR) */
    --bg-color: #FDFDFD;
    /* أبيض مريح - للخلفية */
    --text-color: #333333;
    /* رمادي غامق - للقراءة */
    --light-gray: #F0F2F5;
    /* خلفية الأقسام */
    --border-color: #E1E4E8;

    /* أبعاد */
    --container-width: 1100px;
    --header-height: 88px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* --- تخطيط الصفحة --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- الهيدر --- */
header {
    background: var(--primary-color);
    color: #fff;
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* height: 100%; */
    margin-top: 4px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

.logo span {
    color: var(--accent-color);
}

/* كلمة Pedia */
.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #fff;
    font-weight: 500;
    font-size: 16px;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 2px;
}
.logo-container img {
    height: 30px;
    width: auto;
    border-radius: 4px;
}
.nav-links a:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .nav-links a {
      font-size: 11px;
    }

    .logo {
    font-size: 19px;
    }
    .logo-container img {
        display: none;
    }
}

/* --- الإعلانات (AdSense Slots) --- */
.ad-slot {
    background: #FAFAFA;
    border: 1px dashed #DDD;
    margin: 20px 0;
    padding: 10px;
    text-align: center;
    min-height: 250px;
    /* لمنع قفز المحتوى CLS */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 12px;
}

.ad-label {
    display: block;
    font-size: 10px;
    color: #ccc;
    margin-bottom: 5px;
}

/* --- الرئيسية --- */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 60px 0;
    text-align: center;
    border-radius: 0 0 20px 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 40px 0 20px;
    border-right: 5px solid var(--accent-color);
    padding-right: 15px;
}

.grid-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

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

.card-body {
    padding: 20px;
}

.card-cat {
    color: var(--secondary-color);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.1rem;
    margin: 10px 0;
    color: var(--primary-color);
}

.card-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.btn-read {
    display: inline-block;
    color: var(--accent-color);
    font-weight: bold;
}

/* --- صفحة المقال (Article) --- */
.layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-top: 40px;
}

.article-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.breadcrumbs {
    font-size: 14px;
    color: #777;
    margin-bottom: 20px;
}

h1.entry-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.meta-info {
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.content h2 {
    color: var(--primary-color);
    margin: 30px 0 15px;
    font-size: 1.5rem;
}

.content p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.content ul,
.content ol {
    margin: 15px 30px;
}

.content li {
    margin-bottom: 10px;
}

/* --- الصندوق السحري (Featured Snippet Box) --- */
.snippet-box {
    background: #F0F7FF;
    border-right: 4px solid var(--secondary-color);
    padding: 20px;
    border-radius: 6px;
    margin: 25px 0;
}

.snippet-title {
    font-weight: bold;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

/* --- الفوتر --- */
footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 50px 0 20px;
    margin-top: 60px;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-right: 5px;
}

.copyright {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
}

/* --- الموبايل --- */
@media (max-width: 768px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .sidebar {
        display: none;
    }

    /* أو اجعلها في الأسفل */
}










/* تنسيقات شبكة المقالات في صفحة القسم */
.category-content {
    grid-column: 1 / span 1;
}

/* تأخذ مساحتها الطبيعية */

.grid-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--secondary-color);
}

.card-img-link {
    display: block;
    overflow: hidden;
}

.card-img-link img {
    transition: transform 0.3s;
}

.card:hover .card-img-link img {
    transform: scale(1.05);
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title a {
    color: var(--text-color);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--primary-color);
}

.btn-read {
    margin-top: auto;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 14px;
}

/* للموبايل: اجعل الكروت تأخذ العرض الكامل إذا لزم الأمر */
@media (max-width: 600px) {
    .grid-posts {
        grid-template-columns: 1fr;
    }
}



/* --- Pagination (التنقل بين الصفحات) --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: var(--primary-color);
    font-weight: bold;
    background: #fff;
    transition: 0.3s;
}

.page-link:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
    color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-btn {
    padding: 0 20px;
    height: 40px;
    line-height: 38px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    background: #fff;
    color: var(--primary-color);
    font-weight: bold;
}

.page-btn:hover {
    background: var(--primary-color);
    color: #fff;
}


/* ================================================================================ */


#date-bar {
    /* position: fixed; */
    top: 0;
    left: 0;
    width: 100%;
    background-color: #1f3d5c;
    color: white;
    padding: 5px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); */
    direction: rtl;
}

#date-bar .hijri {
    font-size: 18px;
    font-weight: bold;
}

#date-bar .gregorian {
    font-size: 18px;
    font-weight: bold;
}

/* لشاشات الموبايل الصغيرة (عرض أقل من 480px) */
@media screen and (max-width: 480px) {
    #date-bar .hijri,
    #date-bar .gregorian {
        font-size: 10px; /* أو 15px إذا بدا صغير جداً، جرب وشوف */
    }
    
    /* اختياري: تقليل البادينغ عشان يتناسب أكتر */
    #date-bar {
        padding: 5px 10px;
    }
}

/* لشاشات متوسطة (موبايل كبير أو تابلت صغير) */
@media screen and (max-width: 768px) {
    #date-bar .hijri,
    #date-bar .gregorian {
        font-size: 10px;
    }
}

/* ================================================================================ */

/* شريط التقدم الثابت في الأعلى */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 5px;
    background-color: #4CAF50;
    z-index: 9999;
    transition: width 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


/* ================================================================================ */

/* لوحة الأزرار الثابتة */
#control-panel {
    position: fixed;
    bottom: 20px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

#control-panel button {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-size: 22px;
    font-weight: bold;
}

#control-panel button:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

#control-panel svg {
    width: 26px;
    height: 26px;
    fill: white;
}


/* تصغير الأزرار والأيقونات على الشاشات الصغيرة (الهواتف) */
@media (max-width: 768px) {
    #control-panel {
        bottom: 15px;
        left: 10px;
        gap: 10px;
    }

    #control-panel button {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    #control-panel svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    #control-panel button {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    #control-panel svg {
        width: 18px;
        height: 18px;
    }
}


/* ================================================================================ */