/* 1. المتغيرات */
:root {
    --bg-sand: #F4F1DE;
    --dune-orange: #E07A5F;
    --night-blue: #3D405B;
    --oasis-green: #81B29A;
    --text-dark: #2b2d42;
    --white: #ffffff;
}

/* 2. الأساسيات */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-sand);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

/* 3. الهيدر (المحاذاة والتناسق) */
header {
    background-color: var(--white);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between; /* الشعار يمين، الزر/الروابط يسار */
    align-items: center; /* محاذاة عمودية دقيقة */
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dune-orange);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap; /* منع انقسام نص الشعار */
}

/* القائمة للشاشات الكبيرة */
nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: var(--night-blue);
    font-weight: 500;
    transition: 0.3s;
}

nav a:hover { color: var(--dune-orange); }

/* زر الجوال */
.menu-toggle {
    display: none; /* مخفي في الكمبيوتر */
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--night-blue);
    padding: 5px;
}

/* 4. قسم Hero */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(61, 64, 91, 0.6), rgba(61, 64, 91, 0.6)), 
                url('https://images.unsplash.com/photo-1473580044384-7ba9967e16a0?q=80&w=1200') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.hero-content h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 10px; }


/* تنسيق عنوان القسم وأزرار الفلترة */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--night-blue);
    position: relative;
    padding-bottom: 10px;
}

/* خط صغير تحت العنوان */
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 60px;
    height: 3px;
    background-color: var(--dune-orange);
}

/* حاوية الأزرار */
.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* للسماح للأزرار بالنزول لسطر جديد في الشاشات الصغيرة */
    justify-content: center;
}

/* تصميم الزر الموحد */
.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--dune-orange);
    background-color: transparent;
    color: var(--dune-orange);
    border-radius: 50px; /* شكل بيضاوي */
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* الزر عند التمرير فوقه */
.filter-btn:hover {
    background-color: var(--dune-orange);
    color: var(--white);
}

/* الزر النشط (Active) */
.filter-btn.active {
    background-color: var(--dune-orange);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(224, 122, 95, 0.3);
}

/* تجاوب قسم الفلترة مع الجوال */
@media (max-width: 480px) {
    .filters {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}

/* 5. شبكة المقالات */
main { padding: 40px 5%; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.post-card:hover { transform: translateY(-5px); }
.post-card img { width: 100%; height: 200px; object-fit: cover; }
.post-content { padding: 20px; }
/* تنسيق رابط "اقرأ المزيد" */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* مسافة بين النص والأيقونة */
    color: var(--dune-orange);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 15px;
    transition: all 0.3s ease;
    position: relative;
}

/* إضافة خط سفلي خفي يظهر عند التمرير */
.read-more::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--dune-orange);
    transition: width 0.3s ease;
}

/* حركة الأيقونة والنص عند التمرير (Hover) */
.read-more:hover {
    color: var(--night-blue);
    letter-spacing: 0.5px; /* حركة بسيطة للنص */
}

.read-more:hover::after {
    width: 100%; /* ظهور الخط السفلي */
}

/* تحريك السهم عند التمرير */
.read-more i {
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(-5px); /* تحريك السهم لجهة اليمين قليلاً (بما أن الاتجاه RTL) */
}
/* 6. الفوتر */
/* تنسيق الحاوية الكبرى للفوتر */
.main-footer {
    background-color: var(--night-blue);
    color: var(--bg-sand);
    padding: 60px 5% 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط المحتوى أفقياً */
}

/* تنسيق شبكة الأعمدة بداخل الفوتر */
.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1200px; /* تحديد عرض أقصى لضمان التمركز في الشاشات الكبيرة */
}

/* تنسيق كل عمود بفرده لضمان توسيط النصوص بداخله */
.footer-col {
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط العناصر داخل العمود */
    text-align: center;  /* توسيط النصوص */
}

.footer-col h3, .footer-col h4 {
    margin-bottom: 20px;
    color: var(--dune-orange);
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a { color: #cbd5e0; text-decoration: none; font-size: 0.9rem; }
/* موازنة أيقونات التواصل الاجتماعي في المنتصف */
/* حاوية الأيقونات */
.social-icons {
    display: flex;
    gap: 15px; /* مسافة بين الأيقونات */
    margin-top: 15px;
    align-items: center;
}

/* تنسيق الرابط والأيقونة */
.social-icons a {
    text-decoration: none;
    color: var(--bg-sand); /* لون فاتح ليتناسب مع خلفية الفوتر الداكنة */
    background-color: rgba(255, 255, 255, 0.1); /* خلفية شفافة خفيفة */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* لجعل الأيقونة داخل دائرة */
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

/* تأثير التمرير (Hover) */
.social-icons a:hover {
    background-color: var(--dune-orange); /* يتغير للون البرتقالي عند التمرير */
    color: var(--white);
    transform: translateY(-3px); /* حركة بسيطة للأعلى */
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* تخصيص ألوان الأيقونات عند التمرير (اختياري) */
.social-icons a:hover .fa-instagram { color: #E1306C; background: white; border-radius: 50%; }
.social-icons a:hover .fa-youtube { color: #FF0000; background: white; border-radius: 50%; }

/* موازنة نموذج الاشتراك في المنتصف */


/* حاوية النموذج */
.newsletter-footer {
    display: flex;
    width: 100%;
    max-width: 350px; /* تحديد عرض مناسب للنموذج */
    margin-top: 20px;
    justify-content: center;

}

/* حقل إدخال البريد الإلكتروني */
.newsletter-footer input[type="email"] {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 0 5px 5px 0; /* زوايا مستديرة من جهة اليمين (بما أن الاتجاه ltr) */
    outline: none;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    direction: rtl; /* الكتابة بداخل الحقل تظل من اليمين */
}

/* زر الاشتراك */
.newsletter-footer button {
    background-color: var(--dune-orange);
    color: var(--white);
    border: none;
    padding: 0 20px;
    border-radius: 5px 0 0 5px; /* زوايا مستديرة من جهة اليسار */
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.newsletter-footer button:hover {
    background-color: #c46a52; /* درجة أغمق قليلاً عند التمرير */
}

.newsletter-footer button i {
    font-size: 1.1rem;
    /* لإمالة أيقونة الطائرة الورقية لتبدو وكأنها تنطلق */
    transform: rotate(180deg); 
}

/* تنسيق الجوال */
@media (max-width: 480px) {
    .newsletter-footer {
        max-width: 100%;
    }
}

/* الجزء السفلي من الفوتر (حقوق النشر) */
.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: center;
}
/* 7. التجاوب (Media Queries) */
@media (max-width: 768px) {
    .menu-toggle { display: block; } /* يظهر الزر الآن بجانب الشعار */

    nav {
        display: none;
        position: absolute;
        top: 65px;
        right: 0;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

    nav.active { display: block; }
    nav ul { flex-direction: column; text-align: center; }
}