/* CSS Variables & Reset */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --bg-color: #ffffff;
    --light-bg: #f3f4f6;
    --border-radius: 8px;
    --container-width: 1200px;
    --transition: all 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1rem; }
.section-padding { padding: 4rem 0; }
.section-title { text-align: center; font-size: 2rem; margin-bottom: 2rem; color: var(--primary-color); }

/* Header */
.site-header { background: var(--bg-color); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem; }
.primary-menu { display: flex; list-style: none; gap: 1.5rem; }
.primary-menu a { font-weight: 500; }
.primary-menu a:hover { color: var(--primary-color); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border-radius: var(--border-radius); font-weight: 600; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--secondary-color); }
.btn-whatsapp { background: #25D366; color: #fff; }

/* Services Grid */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.service-card { background: var(--bg-color); border: 1px solid #e5e7eb; border-radius: var(--border-radius); overflow: hidden; transition: var(--transition); }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.service-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.service-body { padding: 1.5rem; }
.service-title { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* Statistics */
.statistics-section { background: var(--primary-color); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; text-align: center; }
.stat-number { font-size: 3rem; font-weight: 700; }

/* Mobile Menu */
.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.mobile-menu-toggle span { display: block; width: 25px; height: 3px; background: var(--text-color); }

@media (max-width: 768px) {
    .mobile-menu-toggle { display: flex; }
    .main-navigation { display: none; position: absolute; top: 100%; right: 0; left: 0; background: var(--bg-color); padding: 1rem; box-shadow: 0 5px 10px rgba(0,0,0,0.1); }
    .main-navigation.is-active { display: block; }
    .primary-menu { flex-direction: column; gap: 1rem; }
    .header-actions { display: none; } /* يمكن إظهارها داخل القائمة للموبايل */
}


/* Grid System for Posts/Services */
.posts-grid, .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Post Card Styling */
.post-card {
    background: var(--bg-color);
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}
.post-thumbnail-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}
.post-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.post-card-title a:hover {
    color: var(--primary-color);
}
.post-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
}
.post-card-excerpt {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    color: var(--text-color);
    transition: var(--transition);
}
.page-numbers.current, .page-numbers:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Search Form Styling */
.search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}
.search-form label { flex-grow: 1; }
.search-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    outline: none;
}
.search-field:focus { border-color: var(--primary-color); }
.search-submit {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    font-weight: 600;
}
.search-submit:hover { background: var(--secondary-color); }

/* 404 & No Results */
.text-center { text-align: center; }
.no-posts-found, .no-results-found {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--light-bg);
    border-radius: var(--border-radius);
}