/* General Styles */
:root {
    --primary-color: #4CAF50; /* Green */
    --secondary-color: #FFC107; /* Amber */
    --dark-color: #333;
    --light-color: #f4f4f4;
    --text-color: #555;
    --white: #fff;
    --sidebar-bg: #34495E; /* Dark Blue Gray */
    --sidebar-link-hover: #2C3E50;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    direction: rtl; /* For Arabic content */
    text-align: right; /* For Arabic content */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    padding: 20px 0;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

h1, h2, h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

p {
    margin-bottom: 10px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #FFB300;
}

/* Header */
.main-header {
    background: var(--white);
    color: var(--dark-color);
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-header h1 {
    margin: 0;
    font-size: 2em;
}

.main-header .menu-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--dark-color);
    padding: 5px 10px;
    display: block; /* Always show for sidebar toggle */
}

.main-header .top-nav ul {
    display: flex;
}

.main-header .top-nav ul li a {
    color: var(--dark-color);
    padding: 10px 15px;
    display: block;
    transition: background-color 0.3s ease;
    border-radius: 5px;
}

.main-header .top-nav ul li a:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* Sidebar */
.sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0; /* Position from right for RTL */
    background-color: var(--sidebar-bg);
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.sidebar.active {
    width: 280px; /* Adjust as needed */
}

.sidebar .close-btn {
    position: absolute;
    top: 15px;
    left: 25px; /* Position close button on the left for RTL */
    font-size: 36px;
    margin-left: 50px;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sidebar nav ul {
    padding: 0;
}

.sidebar nav ul li {
    margin-bottom: 10px;
}

.sidebar nav ul li a {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 1.2em;
    color: var(--white);
    display: block;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
}

.sidebar nav ul li a i {
    margin-left: 15px; /* Margin for icon in RTL */
    font-size: 1.4em;
}

.sidebar nav ul li a:hover {
    background-color: var(--sidebar-link-hover);
}

.overlay {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.7);
    overflow-x: hidden;
    transition: 0.5s;
}

.overlay.active {
    width: 100%;
}

/* Main Content */
.main-content {
    padding-top: 20px;
    transition: margin-right 0.5s; /* Adjust for RTL */
}

/* Hero Section */
.hero-section {
    background: url('https://via.placeholder.com/1500x600?text=خلفية+روحية') no-repeat center center/cover;
    color: var(--white);
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 20px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1;
}

.hero-text {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-text h2 {
    color: var(--white);
    font-size: 3.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.hero-text p {
    font-size: 1.3em;
    margin-bottom: 30px;
}

/* About Section */
.about-section {
    background: var(--white);
    padding: 50px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.about-section h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    position: relative;
}

.about-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

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

.feature-item {
    background: var(--light-color);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.feature-item i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-item h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--dark-color);
}

/* Featured Content */
.featured-content {
    padding: 50px 0;
    text-align: center;
    background: #fdfdfd;
}

.featured-content h2 {
    font-size: 2.5em;
    margin-bottom: 30px;
    position: relative;
}

.featured-content h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

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

.content-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: right; /* For RTL */
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.content-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.content-card h3 {
    padding: 15px;
    font-size: 1.6em;
    margin-bottom: 0;
    color: var(--primary-color);
}

.content-card p {
    padding: 0 15px 15px;
    font-size: 0.95em;
    color: var(--text-color);
}

.content-card .btn-secondary {
    margin: 0 15px 15px 0; /* Adjust margin for RTL */
}

/* Footer */
.main-footer {
    background: var(--dark-color);
    color: var(--white);
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
}

.main-footer .social-links {
    margin-top: 15px;
}

.main-footer .social-links a {
    color: var(--white);
    font-size: 1.5em;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.main-footer .social-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header .top-nav {
        display: none; /* Hide top nav on smaller screens, rely on sidebar */
    }

    .main-header h1 {
        font-size: 1.8em;
    }

    .hero-text h2 {
        font-size: 2.5em;
    }

    .hero-text p {
        font-size: 1.1em;
    }

    .features-grid, .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding-left: 10px;
        padding-right: 10px;
    }
    .hero-text h2 {
        font-size: 2em;
    }
    .hero-text p {
        font-size: 1em;
    }
}
/* Modal (Lightbox) Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top, higher than sidebar */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.8); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
    padding: 20px; /* Some padding for smaller screens */
}

.modal.active {
    display: flex; /* Show when active */
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px; /* Max width for readability */
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: fadeIn 0.3s ease-out;
    max-height: 90vh; /* Limit height to enable scrolling inside */
    overflow-y: auto; /* Enable scrolling for modal content */
    text-align: right; /* RTL */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-button {
    color: var(--dark-color);
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    left: 20px; /* Position to the left for RTL */
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-color);
}

.modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block; /* Remove extra space below image */
    margin-left: auto; /* Center image for RTL if it's smaller than max-width */
    margin-right: auto;
}

.modal-content h3 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.modal-content .article-meta {
    font-size: 1em;
    color: #777;
    margin-bottom: 25px;
}

#modal-article-full-content p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Responsive for Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .modal-content h3 {
        font-size: 1.8em;
    }
    .modal-content .article-meta {
        font-size: 0.9em;
    }
    #modal-article-full-content p {
        font-size: 1em;
    }
    .close-button {
        font-size: 30px;
        top: 5px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }
    .modal-content h3 {
        font-size: 1.6em;
    }
}
/* --- أنماط البوكس المنبثق (Modal) --- */
.modal {
    display: none; /* مخفي افتراضيًا */
    position: fixed; /* يبقى في مكانه عند التمرير */
    z-index: 1001; /* يظهر فوق كل شيء آخر، أعلى من القائمة الجانبية */
    left: 0;
    top: 0;
    width: 100%; /* عرض كامل */
    height: 100%; /* ارتفاع كامل */
    overflow: auto; /* تمكين التمرير إذا كان المحتوى كبيرًا */
    background-color: rgba(0,0,0,0.8); /* خلفية سوداء مع شفافية */
    justify-content: center; /* توسيط أفقي */
    align-items: center; /* توسيط عمودي */
    padding: 20px; /* هامش داخلي للشاشات الصغيرة */
}

.modal.active {
    display: flex; /* إظهار البوكس عند تفعيل الكلاس */
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px; /* أقصى عرض لسهولة القراءة */
    box-shadow: 0 8px 30px rgba(0,0,0,0.3); /* ظل أنيق */
    position: relative;
    animation: fadeIn 0.3s ease-out; /* حركة ظهور سلسة */
    max-height: 90vh; /* تحديد أقصى ارتفاع لتمكين التمرير داخل البوكس */
    overflow-y: auto; /* تمكين التمرير الرأسي لمحتوى البوكس */
    text-align: right; /* محاذاة النص لليمين للعربية */
}

/* حركة الظهور (Animation) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-button {
    color: var(--dark-color);
    font-size: 40px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    left: 20px; /* موقع زر الإغلاق لليسار (RTL) */
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-color);
}

.modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.modal-content h3 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.modal-content .article-meta {
    font-size: 1em;
    color: #777;
    margin-bottom: 25px;
}

#modal-article-full-content p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* --- تعديلات Responsive للـ Modal --- */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .modal-content h3 {
        font-size: 1.8em;
    }
    .modal-content .article-meta {
        font-size: 0.9em;
    }
    #modal-article-full-content p {
        font-size: 1em;
    }
    .close-button {
        font-size: 30px;
        top: 5px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 15px;
    }
    .modal-content h3 {
        font-size: 1.6em;
    }
}