/* ===============================
   Energy Solutions - Corporate Theme (The $3M Look)
   =============================== */

/* 1. Variables & Reset */
:root {
    /* Brand Colors */
    --primary-green: #10b981;
    --primary-dark: #059669;
    --primary-blue: #3b82f6;
    --accent-color: #f59e0b;
    
    /* Netural Colors (Corporate Palette) */
    --dark-text: #111827;       /* Darker for better readability */
    --medium-text: #4b5563;     /* Professional Gray */
    --light-text: #9ca3af;
    --white: #ffffff;
    --light-bg: #f9fafb;
    --border-color: #e5e7eb;
    
    /* Spacing System */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--dark-text);
    line-height: 1.6;
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Makes text look sharper on Mac */
}

/* 2. Layout & Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 3. Header & Navigation */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); /* Subtle shadow */
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--medium-text);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-green);
}

.cta-link {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-link:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

/* 4. Hero Section (The First Impression) */
.hero {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--dark-text);
    line-height: 1.1;
}

/* New Class for Button Layout */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

/* 5. Buttons (Corporate Style) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary-green);
    color: var(--white);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2), 0 2px 4px -1px rgba(16, 185, 129, 0.1);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--dark-text);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: #f0fdf4;
}

.btn-cta {
    background: var(--dark-text);
    color: var(--white);
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
}

.btn-cta:hover {
    background: black;
    transform: scale(1.02);
}

/* 6. Features / Services Cards */
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: left; /* Corporate style implies left align usually */
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-green);
}

.feature-icon {
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

.feature-description {
    color: var(--medium-text);
    font-size: 1rem;
    line-height: 1.6;
}

/* 7. Blog / Insights Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    margin-top: 3rem;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.post-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--dark-text);
    line-height: 1.4;
}

.post-excerpt {
    color: var(--medium-text);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.post-link {
    color: var(--primary-green);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===============================
   Footer Updates (Clean & Fix Lines)
   =============================== */

.footer {
    background: #111827; /* لون خلفية داكن فخم (Dark Navy) */
    color: #ffffff;
    padding-top: 4rem;
    border-top: 5px solid var(--primary-green); /* خط أخضر واحد شيك من فوق */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding-bottom: 3rem;
    /* هنا كان سبب المشكلة: شلنا الخط السفلي من هنا */
    border-bottom: none; 
    margin-bottom: 0;
}

.footer-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-subtitle {
    color: #9ca3af; /* لون رمادي فاتح للعنوان الفرعي */
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-description {
    color: #d1d5db;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* إصلاح ألوان الروابط لتكون فاتحة */
.footer-links a {
    color: #d1d5db; /* رمادي فاتح جداً */
    text-decoration: none;
    margin-bottom: 0.8rem;
    display: block;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-green);
    padding-left: 5px;
}

/* تحديث لون الإيميل ليكون أخضر واضح */
.footer-contact-info a {
    color: #10b981 !important; /* اللون الأخضر المميز */
    text-decoration: none;
    font-weight: 600; /* تقيل شوية عشان يبان */
    transition: color 0.3s ease;
}

.footer-contact-info a:hover {
    color: #ffffff !important; /* لما تقف عليه يبيض */
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.6); /* تأثير توهج بسيط */
}

.footer-contact-info a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-contact-info a:hover {
    color: var(--primary-green);
}

/* أيقونات السوشيال ميديا */
.social-links a {
    background: rgba(255, 255, 255, 0.1); /* خلفية شفافة */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.social-links a:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

/* الخط الوحيد الفاصل سيكون هنا فقط */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* خط رفيع وشفاف جداً */
    padding: 2rem 0;
    text-align: center;
    background: #0f172a; /* لون أغمق قليلاً للأسفل لإعطاء عمق */
}

.footer-text {
    color: #6b7280;
    font-size: 0.9rem;
}

/* ===============================
   Article Specific Styles (Merged)
   =============================== */

.article-container {
    padding: 4rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 3rem;
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.article-meta {
    color: var(--light-text);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.article-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--dark-text);
}

/* TOC Box */
.toc-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-box h2 {
    margin-top: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--medium-text);
}

/* Internal Links in Article */
.article-content a {
    color: var(--primary-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.article-content a:hover {
    border-bottom-color: var(--primary-green);
}

/* Related Articles Section */
.related-articles-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

/* ===============================
   Responsive Design
   =============================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .nav {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .header .container {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .logo-link {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .nav {
        display: flex !important;
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        align-items: center;
        margin-top: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
        width: 100%;
        text-align: center;
    }
    
    .logo-link {
        font-size: 1.1rem;
    }
}

/* =========================================
   STRATEGIC CONTENT CLASSES (The $3M Look)
   ========================================= */

/* 1. Highlight Box (For Quotes & Key Takeaways) */
.highlight-box {
    background: #f0fdf4; /* Light Emerald */
    border-left: 5px solid var(--primary-green);
    padding: 2rem;
    margin: 2rem 0;
    font-size: 1.1rem;
    color: var(--dark-text);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

/* 2. Deep Dive Box (For Technical Breakdowns) */
.deep-dive-box {
    background: #1f2937; /* Dark Navy */
    color: #e5e7eb;
    padding: 2.5rem;
    border-radius: 12px;
    margin: 3rem 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.deep-dive-box h3, .deep-dive-box h4 {
    color: var(--primary-green);
    margin-top: 0;
}

/* 3. Visual Box (For CSS Flowcharts/Diagrams) */
.visual-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    border-radius: 12px;
}

/* 4. Data Table (Financial & Technical Specs) */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}
.data-table th {
    background: #f3f4f6;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #d1d5db;
    font-weight: 700;
    color: var(--dark-text);
}
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: var(--medium-text);
}
.data-table tr:last-child td {
    border-bottom: none;
}

/* 5. Confidential Inquiry Box (The Trap) */
.acquisition-trap {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: white;
    padding: 3rem;
    text-align: center;
    border-radius: 12px;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}
.acquisition-trap::before {
    content: "\f023"; /* Lock Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 10rem;
    opacity: 0.05;
    color: white;
}
/* أضف هذا الكود في ملف الـ CSS */
a.btn-primary, 
a.btn-primary:visited, 
a.btn-primary:hover, 
a.btn-primary:active, 
a.btn-primary:focus {
    color: #ffffff !important;
    background-color: #10b981 !important;
}
/* --- FIX MARKET TICKER ON MOBILE --- */
@media (max-width: 768px) {
    .ticker-wrap {
        width: 100vw !important; /* إجبار العرض على حجم الشاشة فقط */
        max-width: 100% !important;
        overflow: hidden !important; /* إخفاء أي زوائد */
    }

    .ticker-item {
        font-size: 0.75rem !important; /* تصغير الخط قليلاً ليناسب الموبايل */
        padding: 0 1rem !important; /* تقليل المسافات بين الكلمات */
    }

    /* تسريع الحركة قليلاً على الموبايل لتظهر البيانات أسرع */
    .ticker {
        animation-duration: 25s !important; 
    }
}

/* حماية إضافية لمنع اهتزاز الشاشة */
body, html {
    overflow-x: hidden !important;
    max-width: 100% !important;
}
/* =======================================
   CRITICAL CLARITY & CONTRAST FIXES (BIPV)
   ======================================= */

/* 1. ENSURE GENERAL LINKS (INSIDE BODY TEXT) ARE DARK AND CLEAR */
.article-container a {
    color: #1e3a8a; /* Dark Blue - Clear on White Background */
    text-decoration: none;
    border-bottom: 1px dotted #a78bfa; /* Subtle divider */
    transition: all 0.2s;
}

.article-container a:hover {
    color: #4f46e5; /* Distinct color change on hover */
    border-bottom: 2px solid #6366f1; /* Solid line */
}

/* 2. ENSURE HEADERS POP */
.article-container h2,
.article-container h3 {
    letter-spacing: -0.5px; /* تحسين جمالية الخط الكبير */
    line-height: 1.3;
}

/* 3. FIX FOR BUTTONS (The White Text Issue) */
/* نضمن أن اللون الأبيض للنص يُفرض على أزرار الخلفية الداكنة */
a.btn-primary, 
a.btn-primary:visited, 
a.btn-primary:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important; /* لمتصفحات الجوال */
    text-decoration: none !important;
}

/* 4. CLARITY FIX FOR TABLE OF CONTENTS (TOC) LINKS */
/* جعل الروابط أغمق قليلاً على الخلفية الفاتحة للتجنب الغموض */
.toc-box a {
    color: #1e293b !important; 
    border-bottom: 1px dotted #e2e8f0; 
}
.toc-box a:hover {
    color: #0ea5e9 !important; /* الأزرق الساطع على التحويم */
}

/* 5. FIX FOR FOOTER TEXT COLOR IN LIGHT MODE (Safety Override) */
/* هذا للتأكد من أن أي نص يوضع في خلفية فاتحة لا يختفي */
.footer-text, .footer-description {
    color: #cbd5e1 !important;
}
/* ==================================================
   FINAL NUCLEAR CSS PATCH (Solving Specificity Conflicts)
   ================================================== */

/* 1. UNIVERSAL LINK CLARITY FIX (Ensures dark links on white backgrounds) */
.article-container a, 
.article-container a:link, 
.article-container a:visited {
    color: #1e3a8a !important; /* Dark Blue */
    text-decoration: none !important;
    border-bottom: 1px dotted #93c5fd;
}
.article-container a:hover {
    color: #4f46e5 !important;
    border-bottom: 2px solid #6366f1;
}

/* 2. PRIMARY BUTTON FIX (Forces White Text on Green Backgrounds) */
/* تستهدف أزرار CTA الأساسية: Acquire / Partner with Us */
a.btn-primary, 
a.btn-primary:visited, 
a.btn-primary:active, 
.btn-primary {
    color: #ffffff !important;       /* النص أبيض */
    background-color: #10b981 !important; /* الخلفية خضراء */
    -webkit-text-fill-color: #ffffff !important; /* إجبار متصفحات الموبايل على اللون الأبيض */
    text-decoration: none !important;
    opacity: 1 !important;
}

/* 3. SECONDARY/NAV BUTTON FIX (Forces Green Text on Transparent Backgrounds) */
/* تستهدف زر Partnership في القائمة العلوية */
a.cta-link, a.cta-link:visited {
    color: #10b981 !important;
    -webkit-text-fill-color: #10b981 !important;
    background: transparent !important;
    border: 1px solid #10b981 !important;
}

/* 4. GLOBAL RESPONSIVE FIX (Prevent Ticker/Layout Issues) */
body, html {
    overflow-x: hidden !important;
    max-width: 100% !important;
}
/* ========================================
   SOCIAL MEDIA BUTTONS FINAL FIX
   ======================================== */

/* 1. التصميم الأساسي (Desktop & Mobile) */
.social-links {
    display: flex !important;
    gap: 15px !important;
    align-items: center;
    margin-top: 1.5rem !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 2. شكل الزر (دائرة أنيقة) */
.social-links a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    background-color: rgba(255, 255, 255, 0.1) !important; /* خلفية شفافة */
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important; /* الأيقونة بيضاء */
    text-decoration: none !important;
    transition: all 0.3s ease;
    font-size: 1.2rem !important;
}

/* 3. تأثير التحويم (Hover Effect) */
.social-links a:hover {
    background-color: #10b981 !important; /* أخضر عند اللمس */
    border-color: #10b981 !important;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

/* 4. إصلاح الموبايل (Mobile Override) */
@media (max-width: 768px) {
    .social-links {
        justify-content: center !important; /* توسيط في الموبايل */
        margin-bottom: 2rem !important;
    }
}
/* ========================
   FIX MISSING X ICON
   ======================== */

/* 1. إجبار الأيقونات على اللون الأبيض والظهور */
.social-links i, 
.social-links svg {
    color: #ffffff !important;
    font-size: 1.2rem !important;
    opacity: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
}

/* 2. تصحيح خاص لأيقونة X (تويتر) */
/* أحياناً تحتاج لضبط الخط العريض لتظهر */
.fa-x-twitter {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important; /* التبديل للوزن الطبيعي */
}