/* --- 1. Variables & Global Settings (AllNutrition Design) --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800&display=swap');

:root {
    --primary-color: #10B981; /* أخضر صحي */
    --secondary-color: #F97316; /* برتقالي حيوي */
    --background-light: #F9FAFB;
    --background-card: #FFFFFF;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --border-color: #E5E7EB;
    --font-family: 'Nunito', sans-serif;
    --container-width: 1140px;

    /* Admin Colors (Consistent with boilerplate) */
    --admin-bg: #0d1117;
    --admin-sidebar-bg: #161b22;
    --admin-text: #c9d1d9;
    --admin-text-secondary: #8b949e;
    --admin-border: #30363d;
    --admin-accent: #0ea5e9;
    --admin-accent-hover: #0284c7;
}

/* --- Global Settings --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--background-light);
    color: var(--text-light);
    direction: ltr; /* For English content */
    line-height: 1.8;
}
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--secondary-color); }
h1, h2, h3, h4 { color: var(--text-dark); font-weight: 800; }
img { max-width: 100%; height: auto; display: block; }
.btn { padding: 12px 25px; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; transition: all 0.3s; font-family: var(--font-family); }

/* --- 2. Main Blog Interface (Mobile-First) --- */

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-dark); }
.main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--background-light);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 15px rgba(0,0,0,0.05);
}
.main-nav.active { display: flex; }
.main-nav a { font-weight: 700; font-size: 1.1rem; color: var(--text-dark); padding: 10px 0; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.search-form { display: none; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.search-input { border: none; padding: 8px 12px; font-family: var(--font-family); }
.search-button { background: var(--primary-color); border: none; color: #fff; padding: 0 12px; cursor: pointer; }
.menu-toggle { display: block; background: none; border: none; color: var(--text-dark); font-size: 1.5rem; cursor: pointer; }

/* Page Header */
.page-header { text-align: center; padding: 60px 20px; }
.page-header h1 { font-size: 2.5rem; line-height: 1.3; }
.page-header p { font-size: 1.1rem; max-width: 600px; margin: 15px auto 0 auto; }

/* Articles Grid */
.articles-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 40px; }
.article-card {
    background: var(--background-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.article-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.article-image { width: 100%; height: 200px; object-fit: cover; }
.article-content { padding: 25px; }
.article-title { font-size: 1.4rem; margin-bottom: 15px; line-height: 1.5; }
.article-excerpt { margin-bottom: 20px; }
.read-more { font-weight: 700; }

/* Single Article Page */
.single-article { margin: 40px 0; }
.article-main-title { font-size: 2.2rem; line-height: 1.3; margin-bottom: 15px; }
.article-meta { margin-bottom: 20px; }
.article-main-image { border-radius: 12px; margin-bottom: 30px; }
.article-full-content { font-size: 1.1rem; line-height: 2; color: var(--text-dark); }
.article-full-content h3 { font-size: 1.5rem; }

/* Footer */
.site-footer { background-color: #e5e7eb; padding: 50px 0 0 0; margin-top: 60px; border-top: 1px solid var(--border-color); color: var(--text-dark); }
.footer-container { display: flex; flex-direction: column; gap: 30px; }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 15px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: var(--text-light); }
.social-links { display: flex; gap: 20px; font-size: 1.5rem; }
.footer-bottom { text-align: center; padding: 25px 0; margin-top: 30px; border-top: 1px solid #d1d5db; }
.subscribe-form { display: flex; margin-top: 15px; }
.subscribe-form input[type="text"] { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px 0 0 8px; background-color: #fff; color: var(--text-dark); font-family: var(--font-family); direction: ltr; }
.subscribe-form input[type="submit"] { padding: 12px 20px; border: none; background-color: var(--primary-color); color: #fff; border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 700; font-family: var(--font-family); white-space: nowrap; }
.subscribe-form input[type="submit"]:hover { background-color: var(--primary-hover); }
.flash-message.front { padding: 15px; margin-bottom: 20px; border-radius: 8px; font-weight: 600; }
.flash-message.front.success { background-color: #d1fae5; color: #065f46; }
.flash-message.front.danger { background-color: #fee2e2; color: #991b1b; }
.flash-message.front.info { background-color: #dbeafe; color: #1e40af; }

/* --- 3. Admin Panel --- */
.login-page { background-color: var(--admin-bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { background-color: var(--admin-sidebar-bg); padding: 40px; border-radius: 12px; border: 1px solid var(--admin-border); width: 100%; max-width: 400px; text-align: center; color: var(--admin-text); }
.login-container h2 { margin-bottom: 30px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; }
.form-control { width: 100%; padding: 12px; background-color: var(--admin-bg); border: 1px solid var(--admin-border); border-radius: 8px; color: var(--admin-text); font-family: var(--font-family); }
.admin-body { background-color: var(--admin-bg); color: var(--admin-text); font-family: 'Cairo', sans-serif; direction: ltr; }
.admin-layout { display: flex; }
.sidebar { width: 260px; background-color: var(--admin-sidebar-bg); border-right: 1px solid var(--admin-border); height: 100vh; position: fixed; top: 0; left: 0; display: flex; flex-direction: column; }
.sidebar-header { padding: 25px; font-size: 1.5rem; font-weight: 800; text-align: center; border-bottom: 1px solid var(--admin-border); }
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; padding: 20px; flex-grow: 1; }
.sidebar-nav a { color: var(--admin-text-secondary); text-decoration: none; padding: 12px 15px; border-radius: 8px; display: flex; align-items: center; gap: 15px; font-weight: 600; transition: all 0.2s ease-in-out; }
.sidebar-nav a:hover { background-color: #21262d; color: var(--admin-text); }
.sidebar-nav a.active { background-color: var(--admin-accent); color: #fff; }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--admin-border); }
.main-content { margin-left: 0; width: 100%; padding: 20px; }
.content-header { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 30px; }
.content-header h1 { font-size: 1.8rem; }
.content-table, .content-form { background-color: var(--admin-sidebar-bg); border: 1px solid var(--admin-border); border-radius: 12px; padding: 20px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--admin-border); }
.actions { display: flex; gap: 10px; }
.btn-primary { background-color: var(--admin-accent); color: #fff; }
.btn-primary:hover { background-color: var(--admin-accent-hover); }
.btn-secondary { background-color: #374151; color: var(--admin-text); }
.btn-secondary:hover { background-color: #4b5563; }
.flash-message { padding: 15px; border-radius: 8px; margin-bottom: 20px; color: #fff; font-weight: 600; }
.flash-message.success { background-color: #166534; }
.flash-message.danger { background-color: #991b1b; }
.flash-message.info { background-color: #1e40af; }

/* --- 4. Media Queries for larger screens --- */
@media (min-width: 768px) {
    .main-nav { display: flex; position: static; width: auto; background: none; flex-direction: row; padding: 0; border: none; box-shadow: none; }
    .menu-toggle { display: none; }
    .search-form { display: flex; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-container { flex-direction: row; justify-content: space-between; }
    .main-content { margin-left: 260px; width: calc(100% - 260px); padding: 40px; }
}

@media (min-width: 1024px) {
    .articles-grid { grid-template-columns: repeat(3, 1fr); }
    .page-header h1 { font-size: 3.5rem; }
    .article-main-title { font-size: 3rem; }
}
