/*
Theme Name: القرية الخضراء
Theme URI: https://yourwebsite.com
Author: You
Description: قالب متكامل مستوحى من الطبيعة الخضراء والماء - تصميم احترافي متوافق مع جميع الأجهزة
Version: 5.0
License: GPL v2 or later
Text Domain: greenvillage
*/

/* ===== استيراد خطوط عربية جميلة ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

/* ===== متغيرات التصميم ===== */
:root {
    --green-primary: #2e7d32;
    --green-light: #4caf50;
    --green-dark: #1b5e20;
    --green-soft: #81c784;
    --water: #00acc1;
    --water-light: #4dd0e1;
    --water-dark: #00838f;
    --earth: #8d6e63;
    --cream: #fef9e6;
    --white: #ffffff;
    --black: #1f2937;
    --gray: #6b7280;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
}

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

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: linear-gradient(145deg, #e8f5e9 0%, #dcedc8 100%);
    color: var(--black);
    line-height: 1.8;
    direction: rtl;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
}

/* ===== تنسيق النصوص ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    font-weight: 700;
    line-height: 1.3;
}

p {
    margin-bottom: 1.2em;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

/* ===== شريط التقدم ===== */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--green-primary), var(--water));
    z-index: 10000;
    transition: width 0.2s;
}

/* ===== زر العودة للأعلى ===== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
}

#back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===== الهيدر ===== */
header {
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--green-light);
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 42px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-text a {
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* قائمة التنقل */
.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    list-style: none;
    position: relative;
}

.nav-links a {
    text-decoration: none;
    color: var(--green-dark);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    padding: 8px 0;
    display: inline-block;
}

.nav-links a:before {
    content: '🌿';
    position: absolute;
    right: -25px;
    opacity: 0;
    transition: 0.3s;
    font-size: 14px;
}

.nav-links a:hover:before {
    opacity: 1;
    right: -30px;
}

.nav-links a:hover {
    color: var(--green-primary);
}

.nav-links .current-menu-item a {
    color: var(--green-primary);
    border-bottom: 2px solid var(--green-primary);
}

/* زر القائمة للجوال */
.menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: bold;
}

/* نموذج البحث */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    padding: 10px 18px;
    border: 2px solid var(--green-light);
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    background: white;
    outline: none;
    transition: 0.3s;
}

.search-form input:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

.search-form button {
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* ===== هيرو سكشن ===== */
.hero {
    background: linear-gradient(135deg, var(--green-primary), var(--water-dark));
    color: white;
    text-align: center;
    padding: 120px 0 100px;
    border-radius: 0 0 70px 70px;
    position: relative;
    overflow: hidden;
}

.hero:before {
    content: '🌿 💧 🌱 🌊 🍃 💦';
    position: absolute;
    bottom: 20px;
    left: 30px;
    font-size: 80px;
    opacity: 0.1;
    font-family: monospace;
    white-space: pre;
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 15px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 20px;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 18px 35px;
    border-radius: 60px;
    display: inline-block;
}

/* ===== تخطيط الصفحة الرئيسية ===== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 45px;
    margin: 60px 0;
}

/* ===== بطاقات المقالات - عرض مقالتين في صف ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 35px;
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(76,175,80,0.15);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--green-light);
}

.card-img {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

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

.card-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: bold;
    z-index: 5;
}

.card-category a {
    color: white;
    font-size: 11px;
}

.card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.card h3 a {
    color: var(--green-dark);
}

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

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--gray);
    font-size: 12px;
    margin: 15px 0;
    padding-bottom: 12px;
    border-bottom: 1px dashed #c8e6c9;
}

/* ===== تحسين مظهر الملخص مع فواصل الأسطر ===== */
.card-excerpt {
    color: #4a674a;
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 14px;
    flex: 1;
    white-space: normal;
    word-wrap: break-word;
}

.card-excerpt br {
    display: block;
    margin-bottom: 5px;
    content: "";
}

/* الحفاظ على التنسيق للنص داخل الملخص */
.card-excerpt p {
    margin-bottom: 8px;
}

.read-more {
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    align-self: flex-start;
}

.read-more:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 20px rgba(46,125,50,0.4);
}

/* ===== الشريط الجانبي ===== */
.sidebar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid rgba(76,175,80,0.2);
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    margin-bottom: 40px;
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--green-light);
    display: inline-block;
    color: var(--green-dark);
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
}

.sidebar-widget li {
    margin-bottom: 14px;
    padding-right: 28px;
    position: relative;
}

.sidebar-widget li:before {
    content: '🌱';
    position: absolute;
    right: 0;
    font-size: 14px;
}

.sidebar-widget a {
    color: #2c5e2c;
    transition: 0.3s;
}

.sidebar-widget a:hover {
    color: var(--green-primary);
    padding-right: 5px;
}

/* ===== صفحة المقال المفرد ===== */
.single-post {
    background: white;
    border-radius: var(--radius-lg);
    padding: 55px;
    margin: 60px auto;
    box-shadow: var(--shadow-lg);
}

.breadcrumbs {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8f5e9;
}

.breadcrumbs a {
    color: var(--green-primary);
}

.post-title {
    font-size: 46px;
    color: var(--green-dark);
    margin-bottom: 25px;
}

.post-meta-enhanced {
    background: linear-gradient(145deg, #f5f9f5, #eef5ee);
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 35px;
}

.post-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 12px;
}

.meta-item {
    font-size: 14px;
    color: #4a674a;
}

.post-featured-image {
    margin: 35px 0;
    text-align: center;
}

.post-featured-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-width: 100%;
    height: auto;
}

.image-caption {
    font-size: 13px;
    color: var(--gray);
    margin-top: 12px;
    font-style: italic;
}

.post-content-enhanced {
    font-size: 18px;
    line-height: 1.9;
}

.post-content-enhanced h2 {
    font-size: 30px;
    color: var(--green-primary);
    margin: 45px 0 20px;
    padding-right: 18px;
    border-right: 5px solid var(--green-primary);
}

.post-content-enhanced h3 {
    font-size: 26px;
    color: var(--water-dark);
    margin: 35px 0 15px;
}

.post-content-enhanced p {
    margin-bottom: 1.5em;
}

.post-content-enhanced img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 30px 0;
}

/* جدول المحتويات */
.table-of-contents {
    background: #f0f5f0;
    padding: 25px 30px;
    border-radius: var(--radius-md);
    margin: 35px 0;
    border-right: 5px solid var(--green-primary);
}

.toc-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--green-dark);
    margin-bottom: 15px;
}

.toc-list ul {
    list-style: none;
    padding-right: 20px;
}

.toc-list li {
    margin-bottom: 10px;
}

.toc-list a {
    color: #4a674a;
}

.toc-list a:hover {
    color: var(--green-primary);
    padding-right: 5px;
}

/* أزرار المشاركة */
.share-buttons {
    background: #f5f9f5;
    padding: 25px;
    border-radius: var(--radius-md);
    margin: 45px 0;
    text-align: center;
}

.share-label {
    display: block;
    margin-bottom: 18px;
    font-weight: bold;
    color: var(--green-dark);
    font-size: 18px;
}

.share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.share-btn {
    padding: 10px 25px;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    transition: 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.facebook { background: #1877f2; }
.twitter { background: #1da1f2; }
.whatsapp { background: #25d366; }
.telegram { background: #0088cc; }

/* التنقل بين المقالات */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 45px 0;
    padding: 25px 0;
    border-top: 2px solid #e8f5e9;
    border-bottom: 2px solid #e8f5e9;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-home a {
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    color: white;
    padding: 10px 28px;
    border-radius: 50px;
}

/* مقالات مشابهة */
.related-posts-enhanced {
    margin: 55px 0;
}

.related-posts-enhanced h3 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--green-dark);
}

.related-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.related-card-enhanced {
    background: #f9fcf9;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: 0.3s;
    text-align: center;
}

.related-card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.related-card-enhanced img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.related-card-enhanced h4 {
    padding: 18px 15px 8px;
}

.related-card-enhanced a {
    color: var(--green-dark);
}

.related-date {
    font-size: 12px;
    color: var(--gray);
    padding-bottom: 18px;
}

/* ===== التعليقات المحسنة ===== */
.comments-section-enhanced {
    margin-top: 55px;
    padding-top: 35px;
    border-top: 2px solid #e8f5e9;
}

.comments-section-enhanced h3 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--green-dark);
}

.comments-count {
    font-size: 18px;
    color: var(--green-light);
}

.comments-wrapper {
    background: #fafdfa;
    border-radius: var(--radius-md);
    padding: 35px;
}

.comment-item {
    display: flex;
    gap: 25px;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e8e0;
}

.comment-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-meta {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: baseline;
}

.comment-author {
    color: var(--green-dark);
    font-size: 16px;
    font-weight: bold;
}

.comment-date {
    font-size: 12px;
    color: var(--gray);
}

.comment-reply-link {
    font-size: 12px;
    color: var(--green-primary);
}

.comment-text {
    line-height: 1.7;
    color: #2c3e2c;
}

/* نموذج التعليق */
.comment-respond {
    margin-top: 45px;
}

.comment-reply-title {
    font-size: 22px;
    margin-bottom: 25px;
    color: var(--green-dark);
}

.comment-form-row {
    margin-bottom: 20px;
}

.comment-form-row input,
.comment-form textarea {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #c8e0c8;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    transition: 0.3s;
}

.comment-form-row input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

.submit-comment {
    background: linear-gradient(135deg, var(--green-primary), var(--water));
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: 0.3s;
}

.submit-comment:hover {
    transform: translateX(-3px);
}

/* ===== معرض الصور ===== */
.gallery-section {
    background: linear-gradient(145deg, #c8e6c9, #b2dfdb);
    padding: 80px 0;
    margin: 60px 0;
    border-radius: 70px;
}

.section-title {
    font-size: 38px;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title:before {
    content: '🌿';
    margin-left: 15px;
    font-size: 40px;
}

.section-title:after {
    content: '💧';
    margin-right: 15px;
    font-size: 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px;
    transition: bottom 0.3s;
}

.gallery-item:hover .gallery-overlay {
    bottom: 0;
}

.gallery-overlay span {
    color: white;
    font-size: 14px;
}

/* ===== التذييل ===== */
footer {
    background: linear-gradient(135deg, var(--green-dark), var(--water-dark));
    color: white;
    padding: 60px 0 35px;
    margin-top: 70px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
    margin-bottom: 45px;
}

.footer-widget h4 {
    font-size: 22px;
    margin-bottom: 25px;
    position: relative;
}

.footer-widget h4:after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--green-light);
    margin-top: 12px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 12px;
}

.footer-widget a {
    color: #c8e6c9;
    transition: 0.3s;
}

.footer-widget a:hover {
    color: white;
    padding-right: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

/* ============================================ */
/* ===== التجاوب مع جميع الأجهزة (محسن بالكامل) ===== */
/* ============================================ */

/* أجهزة الكمبيوتر المكتبية الكبيرة */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
        padding: 0 25px;
    }
}

/* أجهزة الكمبيوتر المحمولة */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }
    .hero h1 {
        font-size: 48px;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* أجهزة التابلت (iPad) */
@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    
    .main-layout {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    
    .sidebar {
        position: static;
        margin-top: 20px;
    }
    
    .hero {
        padding: 80px 0 60px;
    }
    
    .hero h1 {
        font-size: 38px;
    }
    
    .hero p {
        font-size: 18px;
        padding: 15px 25px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .card-img {
        height: 200px;
    }
    
    .card h3 {
        font-size: 20px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-meta {
        gap: 12px;
        font-size: 11px;
    }
    
    .post-title {
        font-size: 32px;
    }
    
    .single-post {
        padding: 35px;
        margin: 40px 0;
    }
    
    .related-grid-enhanced {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* الأجهزة اللوحية الصغيرة */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    /* القائمة للجوال */
    .menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        text-align: center;
        background: white;
        border-radius: var(--radius-md);
        margin-top: 15px;
        box-shadow: var(--shadow-md);
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 10px;
    }
    
    .nav-links a:before {
        display: none;
    }
    
    /* الهيرو */
    .hero {
        padding: 60px 0 50px;
        border-radius: 0 0 40px 40px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
        padding: 12px 20px;
    }
    
    .hero:before {
        font-size: 40px;
        bottom: 10px;
    }
    
    /* المقالات - عرض مقالة واحدة */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .card-img {
        height: 200px;
    }
    
    .card h3 {
        font-size: 20px;
    }
    
    /* الشريط الجانبي */
    .sidebar {
        padding: 20px;
    }
    
    .sidebar-widget {
        padding: 20px;
    }
    
    .sidebar-widget h3 {
        font-size: 20px;
    }
    
    /* صفحة المقال المفرد */
    .single-post {
        padding: 20px;
        margin: 30px 0;
    }
    
    .post-title {
        font-size: 24px;
    }
    
    .post-meta-enhanced {
        padding: 15px;
    }
    
    .post-meta-row {
        gap: 12px;
        font-size: 11px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .post-content-enhanced {
        font-size: 16px;
    }
    
    .post-content-enhanced h2 {
        font-size: 24px;
    }
    
    .post-content-enhanced h3 {
        font-size: 20px;
    }
    
    /* التعليقات */
    .comment-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .comment-avatar img {
        margin: 0 auto;
    }
    
    .comment-meta {
        justify-content: center;
    }
    
    .comments-wrapper {
        padding: 20px;
    }
    
    /* أزرار المشاركة */
    .share-buttons {
        padding: 20px;
    }
    
    .share-icons {
        gap: 10px;
    }
    
    .share-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* التنقل */
    .post-navigation {
        flex-direction: column;
        text-align: center;
    }
    
    /* مقالات مشابهة */
    .related-grid-enhanced {
        grid-template-columns: 1fr;
    }
    
    /* المعرض */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    /* التذييل */
    footer {
        margin-top: 50px;
        padding: 40px 0 25px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 35px;
    }
    
    .footer-widget h4:after {
        margin: 10px auto 0;
    }
    
    .footer-bottom {
        font-size: 14px;
    }
    
    /* زر العودة للأعلى */
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    /* نموذج البحث */
    .search-form {
        margin-top: 10px;
    }
    
    .search-form input {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .search-form button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* تحسين الملخص للجوال */
    .card-excerpt {
        font-size: 13px;
        line-height: 1.7;
    }
}

/* الهواتف الصغيرة جداً */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .logo-icon {
        font-size: 32px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .card h3 {
        font-size: 18px;
    }
    
    .card-meta {
        font-size: 10px;
        gap: 10px;
    }
    
    .card-excerpt {
        font-size: 13px;
    }
    
    .read-more {
        padding: 8px 20px;
        font-size: 13px;
    }
    
    .post-title {
        font-size: 22px;
    }
    
    .post-content-enhanced {
        font-size: 15px;
    }
    
    .post-content-enhanced h2 {
        font-size: 22px;
    }
    
    .post-content-enhanced h3 {
        font-size: 18px;
    }
    
    .breadcrumbs {
        font-size: 12px;
    }
    
    .share-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ===== تنسيق تمييز كلمات البحث ===== */
.search-highlight {
    background: #ffeb3b;
    color: #333;
    padding: 0 5px;
    border-radius: 5px;
    font-weight: bold;
}

/* ===== الإصلاح الدقيق والنهائي للقائمة المنسدلة لسطح المكتب ===== */
@media (min-width: 769px) {
    /* كسر أي تأثير flex موروث على القائمة الفرعية وإخفاؤها تلقائياً */
    .nav-links .sub-menu {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        background: var(--white) !important;
        box-shadow: var(--shadow-md) !important;
        border-radius: var(--radius-sm) !important;
        padding: 10px 0 !important;
        min-width: 220px !important;
        z-index: 99999 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    /* إجبار عناصر القائمة الفرعية بالداخل على النزول عمودياً بدلاً من الأفقي */
    .nav-links .sub-menu li {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* تنسيق روابط القائمة المنسدلة الداخلية وإلغاء أيقونة 🌿 الفرعية */
    .nav-links .sub-menu li a {
        display: block !important;
        padding: 10px 20px !important;
        color: var(--green-dark) !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        text-align: right !important;
        white-space: nowrap !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    }
    
    .nav-links .sub-menu li a:before {
        display: none !important; /* إخفاء الإيموجي في القائمة الداخلية لمنع التداخل */
    }

    /* تأثير تمرير مؤشر الفأرة على روابط المنسدلة */
    .nav-links .sub-menu li a:hover {
        background-color: var(--cream) !important;
        color: var(--green-primary) !important;
    }

    /* إظهار القائمة الفرعية فوراً بمجرد حوم الفأرة فوق عنصر القائمة الأب */
    .nav-links li:hover > .sub-menu {
        display: block !important;
    }
}

/* ===== إصلاح القائمة الفرعية للجوال لتظهر كروابط رئيسية مباشرة ===== */
@media (max-width: 768px) {
    /* تحويل عنصر القائمة الأب إلى سلوك كتلة عادي لمنع التداخل الأفقي */
    .nav-links li {
        display: block !important;
        width: 100% !important;
        position: static !important; /* إلغاء نقطة الارتكاز المطلقة */
    }

    /* إلغاء الصندوق المنبثق تماماً وجعل القائمة الفرعية تنسدل كجزء طبيعي من القائمة */
    .nav-links .sub-menu {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* ضبط عناصر القائمة الفرعية الداخلية لتصبح ممتدة بالكامل لأسفل */
    .nav-links .sub-menu li {
        display: block !important;
        width: 100% !important;
    }

    /* تنسيق الروابط الفرعية لتتطابق تماماً مع الروابط الرئيسية مع إزاحة خفيفة للتنظيم */
    .nav-links .sub-menu li a {
        display: block !important;
        width: 100% !important;
        padding: 12px 25px !important; /* إزاحة يمين خفيفة لتمييزها بصرياً */
        color: var(--green-dark) !important;
        font-size: 15px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        box-sizing: border-box !important;
    }

    /* إلغاء أيقونة 🌿 من القوائم الفرعية في الجوال لضمان مطابقة الصورة الثانية */
    .nav-links .sub-menu li a:before {
        display: none !important;
    }
}