/* ==========================================================================
   1. تعريف الخطوط المعتمدة بمسارات دقيقة
   ========================================================================== */
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Questv1';
    src: url('../fonts/Questv1 Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Sakkal Majalla';
    src: url('../fonts/Sakkal Majalla Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

/* ==========================================================================
   2. متغيرات الهوية الرقمية (Global Variables)
   ========================================================================== */
:root {
    --primary-blue: #3b71b9;
    --accent-green: #5bc4bf;
    --black-fakhim: #111827;
    --white: #ffffff;
    --bg-light: #f8fafc;
    --text-main: #2d3436;
    --text-dim: #5a6772;
    --background-linear: linear-gradient(135deg, var(--black-fakhim) 0%, var(--primary-blue) 100%);
    
    --font-main: 'Sakkal Majalla', 'Arial', sans-serif;
    --font-headers: 'Cairo', 'Helvetica', sans-serif;
    --font-accent: 'Questv1', sans-serif;
}

/* ==========================================================================
   3. الإعدادات والتهيئة الأساسية (Reset & Base Styles)
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    direction: rtl;
    text-align: right;
    font-family: var(--font-main);
    line-height: 1.6;
    background-color: var(--white) !important;
    color: var(--text-main);
    font-size: 1.5rem;
    overflow-x: hidden;
}

/* ==========================================================================
   4. التوزيع البرمجي الآمن للخطوط (Typography Hierarchy)
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.contact-header h1,
.contact-info h3,
.form-title,
.social-section-title {
    font-family: var(--font-headers) !important;
    font-weight: 700;
}

p, li, label, .wpcf7-form-control,
.contact-header p,
.contact-info p,
.social-section-desc {
    font-family: var(--font-main) !important;
}

/* ==========================================================================
   5. تأثير الخط الفاخر الموحد تحت كل العناوين (Titles Accent Line)
   ========================================================================== */
.contact-info h3,
.form-title,
.social-section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 35px;
}

.contact-info h3::after,
.form-title::after,
.social-section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 50px;
    height: 4px;
    background-color: var(--accent-green);
    border-radius: 2px;
}

/* محاذاة الخط للجانب الأيمن بالكامل لتناسب النمط الجديد للبطاقة الجانبية */
.contact-info h3::after,
.form-title::after,
.social-section-title::after {
    right: 0;
}
div#content {
    background-color: white;
}

/* ==========================================================================
   6. تنسيق الهيدر الرئيسي مع لمسة تداخل بريميوم
   ========================================================================== */
.contact-header {
    background: var(--background-linear);
    color: var(--white);
    padding: 130px 20px 190px; /* تمديد سفلي للسماح بتأثير التداخل للبطاقات */
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* نمط زخرفي فخم للخلفية */
.contact-header::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(91, 196, 191, 0.15) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
}

.contact-header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.contact-header h1 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.contact-header p {
    font-size: 1.6rem;
    color: #cbd5e1;
    line-height: 1.8;
}

/* ==========================================================================
   7. حاوية الاتصال الثنائية (توزيع شبكي مرن فخم)
   ========================================================================== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
    max-width: 1200px;
    margin: -90px auto 80px; /* رفع البطاقات للأعلى لتتداخل مع الهيدر */
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

/* --- بطاقة معلومات الاتصال الجانبية المعززة --- */
.contact-info {
    background: var(--background-linear);
    color: var(--white);
    padding: 45px 35px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(17, 24, 39, 0.25);
    display: flex;
    flex-direction: column;
    gap: 45px; /* توزيع مسافات متناسق بين كتلة العناوين والشبكة السداسية بالأسفل */
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-info::after {
    content: "";
    position: absolute;
    bottom: -100px; right: -100px;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(91, 196, 191, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.contact-info h3 {
    font-size: 1.8rem;
    color: var(--white);
}

.contact-details-list p {
    font-size: 1.55rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #e2e8f0;
}

.contact-details-list p:last-child {
    margin-bottom: 0;
}

.contact-details-list p i {
    font-size: 1.4rem;
    color: var(--accent-green);
    width: 25px;
    text-align: center;
}

.contact-details-list p a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-details-list p a:hover {
    color: var(--accent-green);
}

/* تخصيص كتلة السوشيال ميديا المدمجة داخل بطاقة الاتصال */
.inner-social-block {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 35px;
    position: relative;
    z-index: 2;
}

.inner-social-block .social-section-title {
    font-size: 1.5rem;
    color: var(--white);
}

.inner-social-block .social-section-desc {
    color: #cbd5e1;
    font-size: 1.35rem;
    margin-bottom: 25px;
}

.inner-social-block .social-hex-grid {
    display: flex;
    justify-content: center; /* تبدأ المحاذاة من اليمين لتناسب القراءة */
    gap: 15px;
    flex-wrap: wrap;
}

/* تطبيق القناع السداسي لزوايا دائرية منتظمة ومطابقة */
.inner-social-block .social-hex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 73px;
    background: var(--white);
    color: var(--accent-green);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* قناع الـ SVG السداسي الدائري المعتمد */
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='20 0 92 116'><path fill='black' d='M110.78,74.78v-32.21c0-6.48-3.41-12.48-8.97-15.8l-26.04-15.56c-5.81-3.47-13.06-3.47-18.88,0l-26.04,15.56c-5.56,3.32-8.97,9.32-8.97,15.8v32.21c0,6.48,3.41,12.48,8.97,15.8l26.04,15.56c5.81,3.47,13.06,3.47,18.88,0l26.04-15.56c5.56-3.32,8.97-9.32,8.97-15.8Z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='20 0 92 116'><path fill='black' d='M110.78,74.78v-32.21c0-6.48-3.41-12.48-8.97-15.8l-26.04-15.56c-5.81-3.47-13.06-3.47-18.88,0l-26.04,15.56c-5.56,3.32-8.97,9.32-8.97,15.8v32.21c0,6.48,3.41,12.48,8.97,15.8l26.04,15.56c5.81,3.47,13.06,3.47,18.88,0l26.04-15.56c5.56-3.32,8.97-9.32,8.97-15.8Z'/></svg>");
    
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.inner-social-block .social-hex i {
    transition: transform 0.3s ease;
}

.inner-social-block .social-hex:hover {
    background: var(--accent-green);
    border-color: var(--accent-green);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 20px rgba(91, 196, 191, 0.25);
    color: var(--white);
}

.inner-social-block .social-hex:hover i {
    transform: scale(1.1);
}

/* ==========================================================================
   8. تنسيق وإبراز نموذج الاتصال (Contact Form 7 Styling)
   ========================================================================== */
.contact-form {
    background-color: var(--white);
    padding: 50px 45px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.05);
    border: 1px solid #e2e8f0;
}

.form-title {
    font-size: 1.8rem;
    color: var(--primary-blue);
}

/* تحسين حقول الإدخال والـ Textarea */
.contact-form .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 20px;
}

.contact-form .wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    border-radius: 12px;
    font-size: 1.45rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    outline: none;
}

.contact-form .wpcf7-form-control:not(.wpcf7-submit):focus {
    border-color: var(--primary-blue);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(59, 113, 185, 0.12);
}

/* تخصيص صندوق الملاحظات العريض */
.contact-form textarea.wpcf7-form-control {
    height: 140px;
    resize: vertical;
}

/* زر إرسال النموذج الفخم للمحترفين */
.contact-form .wpcf7-submit {
    width: 100%;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1a3a63 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(59, 113, 185, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-form .wpcf7-submit:hover {
    background: linear-gradient(135deg, var(--accent-green) 0%, #3e9c98 100%);
    box-shadow: 0 10px 20px rgba(91, 196, 191, 0.3);
    transform: translateY(-2px);
}

/* ==========================================================================
   9. قسم الخريطة التفاعلية (Map Section Overlay)
   ========================================================================== */
.map-section {
    position: relative;
    border-top: 1px solid #e2e8f0;
    box-shadow: inset 0 10px 30px rgba(17, 24, 39, 0.05);
    line-height: 0;
    block-size: auto;
}

.map-section iframe {
    border: 0;
    display: block;
    filter: grayscale(15%) contrast(105%); /* فلترة خفيفة للحفاظ على التناسق اللوني مع الهوية */
    transition: filter 0.5s ease;
}

.map-section iframe:hover {
    filter: none;
}

/* ==========================================================================
   10. شاشات التجاوب والاحترافية الكاملة للجوال (Responsive Layout)
   ========================================================================== */
@media (max-width: 992px) {
    .contact-container {
        grid-template-columns: 1fr; /* دمج البطاقات فوق بعضها في الشاشات اللوحية */
        margin-top: -60px;
        gap: 30px;
    }
    
    .contact-info {
        padding: 40px 30px;
    }

    .inner-social-block .social-hex-grid {
        justify-content: center; /* توسيط الأيقونات في الشاشات المتوسطة والجوال لراحة العين */
    }
}

@media (max-width: 650px) {
    .contact-header {
        padding: 100px 15px 140px;
    }
    
    .contact-header h1 {
        font-size: 2.3rem;
    }
    
    .contact-header p {
        font-size: 1.35rem;
    }
    
    .contact-container {
        margin-top: -50px;
        padding: 0 15px;
    }
    
    .contact-form {
        padding: 35px 20px;
    }
    
    .form-title {
        font-size: 1.55rem;
        text-align: center;
        margin-bottom: 25px;
    }
    
    .inner-social-block .social-hex-grid {
        gap: 12px;
    }
    
    .inner-social-block .social-hex {
        width: 64px;
        height: 72px;
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   12. ضبط اتجاه النصوص ورسائل الخطأ لـ Contact Form 7 من اليمين
   ========================================================================== */

/* إجبار حقول الإدخال والنصوص النائبة (Placeholders) على اليمين */
.contact-form .wpcf7-form-control {
    direction: rtl !important;
    text-align: right !important;
}

/* ضبط رسائل الخطأ (Please fill out this field) لتظهر على اليمين بالكامل */
.contact-form .wpcf7-not-valid-tip {
    direction: rtl !important;
    text-align: right !important;
    display: block !important;
    margin-top: 5px;
    padding-right: 5px; /* مسافة جمالية بسيطة من جهة اليمين */
    font-size: 1.2rem !important;
    font-family: var(--font-main) !important;
}

/* تحسين مظهر رسالة نجاح الإرسال أو الفشل العامة أسفل النموذج */
.contact-form .wpcf7-response-output {
    direction: rtl !important;
    text-align: right !important;
    border-radius: 12px !important;
    margin: 20px 0 0 0 !important;
    font-family: var(--font-headers) !important;
    font-size: 1.3rem !important;
}

input.wpcf7-form-control.wpcf7-submit.has-spinner {
    text-align: center !important;
}