/*
 * ==========================================================================
 * # MASTER CSS FILE WITH DYNAMIC VARIABLES (ABSOLUTELY COMPLETE)
 * ==========================================================================
 */

/* ==========================================================================
   1. Global Variables & Base Styles
   ========================================================================== */
:root {
    /* لوحة الألوان الافتراضية */
    --sf-bg-color: #000000;
    --sf-bg-m-color: #FFDBAA;
    --sf-text-color: #FFDBAA;
    --sf-accent-color: #00FF00;
    --sf-button-color: var(--sf-accent-color);
    --sf-button-text-color: #000000;
    --sf-link-color: var(--sf-text-color);
    --sf-overlay-color: rgba(0, 0, 0, 0.6);
    --sf-border-color: var(--sf-text-color);
    --sf-light-text-color: #ffffff;
    --sf-code-bg-color: #1e1e1e;

    /* الخطوط */
    --font-primary: "basic-sans", sans-serif;
    --font-secondary: "minion-pro", serif;

    /* المسافات */
    --space-sm: 20px;
    --space-md: 40px;
    --space-lg: 80px;
    --space-xl: 120px;

    /* نعومة الحواف */
    --border-radius: 8px;
}

body {
    background-color: var(--sf-bg-color);
    color: var(--sf-text-color) !important;
    line-height: 1.6;
    font-family: var(----font-secondary);
}

h1, h2, h3, h4, h5, h6, .sf-alt-font, em {
    font-family: var(--font-secondary);
    font-style: italic;
}

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

.sf-max-width-all {
    max-width: 1200px;
    width: 93%;
    margin: 20px auto;
}

canvas {
    display: block;
}

#canvas3d {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100vh;
    transition: opacity 0.4s ease;
}

.overlay-color {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--sf-overlay-color);
    z-index: 2;
    pointer-events: none;
}

.sf-intro-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--sf-text-color);
    line-height: 1.2;
    font-weight: 400;
    z-index: 15;
}

.sf-svg-logo-i-b {
    margin: 0 auto;
}

.sf-svg-logo-i-b svg {
    fill: var(--sf-accent-color);
    height: 100px;
    min-width: 230px;
    width: 100%;
}

.sf-intro-text .sf-top-line {
    font-size: 75px;
    opacity: 0;
    transform: scale(0.3);
    font-family: "basic-sans", sans-serif;
}

.sf-intro-text .sf-bottom-line {
    font-size: 74px;
    font-style: italic;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.4);
    font-family: var(----font-secondary);
}

.sf-image-box {
    position: absolute;
    width: 250px;
    height: 150px;
    background-size: cover;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: opacity 1s ease, transform 0.8s ease;
    z-index: 4;
}

.sf-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1005;
    font-family: var(----font-secondary);
}

.sf-logo {
    font-weight: 400;
    color: var(--sf-text-color) !important;
}

.sf-logo svg {
    max-width: 180px;
    margin-top: -2px;
    fill: var(--sf-text-color) !important;
    transition: fill 0.3s ease;
}

body.menu-open .sf-logo svg {
    fill: var(--sf-button-text-color) !important;
}

.sf-nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2rem;
    align-items: center;
    z-index: 10;
}

.sf-nav-links a {
    text-decoration: none;
    color: var(--sf-text-color) !important;
    font-weight: 400;
}

.sf-book-btn {
    margin-left: auto;
    background-color: var(--sf-button-color) !important;
    color: var(--sf-button-text-color) !important;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: bold;
    font-style: italic;
}
a.sf-book-btn:hover {
    color: var(--sf-button-text-color) !important;
}

.sf-mobile-menu {
    visibility: hidden;
}

.sf-mobile-menu.show {
    visibility: visible;
}

/* --- Project Card Grid --- */
.sf-portfolio-grid {
    display: grid;
    gap: 20px;
}
.sf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--sf-light-text-color);
    overflow: hidden;
    transition: transform 0.3s ease;
}
.sf-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}
.sf-card-content {
    padding-top: 5px;
}
.sf-card-content h3 {
    margin: 0;
    font-size: 1.2em;
    font-family: "minion-pro", serif;
    font-style: italic;
}
.sf-services-list {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: "basic-sans", sans-serif;
}
.sf-services-list li {
    font-size: 0.85em;
    margin-right: 10px;
    padding: 0px;
    color: var(--sf-light-text-color);
    line-height: 1.5;
}
.sf-card-image-wrapper {
    position: relative;
    overflow: hidden;
    line-height: 0;
}
.sf-card-image-wrapper::before,
.sf-card-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.sf-card-image-wrapper::before {
    background: var(--sf-accent-color);
    mix-blend-mode: color;
}
.sf-card-image-wrapper::after {
    background: rgba(0, 255, 0, 0.5); /* Equivalent to color-mix */
}
.sf-card:hover .sf-card-image-wrapper::before,
.sf-card:hover .sf-card-image-wrapper::after {
    opacity: 1;
}
.sf-card:hover .sf-card-content h3,
.sf-card:hover .sf-card-content .sf-services-list li {
    color: var(--sf-accent-color);
}
.sf-card:hover {
    transform: scale(1.01);
}

/* --- Services Accordion --- */
.sf-services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    margin-top: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.sf-services-title {
    font-size: 2.5rem;
    font-weight: bold;
    font-style: italic;
    margin: 0;
}
.sf-services {
    background: var(--sf-bg-color);
    color: var(--sf-text-color);
    margin: auto;
}
.sf-tab {
    border-bottom: 1px solid var(--sf-border-color);
}
.sf-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 20px 0;
}
.sf-tab-header h3 {
    margin: 0;
    font-style: italic;
    font-size: 1.5em;
}
.sf-arrow-icon {
    transition: transform 0.3s ease;
}
.sf-arrow {
    stroke: var(--sf-text-color);
}
.sf-tab-content {
    display: none;
    padding: 0 0 20px 0;
    animation: fadeIn 0.3s ease;
}
.sf-tab-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.sf-tab-desc {
    flex: 1;
    margin: 0;
}
.sf-see-more-in-ser {
    color: var(--sf-accent-color);
    font-size: 0.9em;
    text-decoration: none;
    white-space: nowrap;
}
.sf-tab.active .sf-tab-content {
    display: block;
}
.sf-tab.active .sf-arrow-icon {
    transform: rotate(180deg);
}

/* --- Footer --- */
.sf-footer {
    max-width: 1200px;
    width: 93%;
    margin: 80px auto;
    background: none !important;
    color: var(--sf-text-color) !important;
    text-align: center;
}
.sf-footer-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}
.sf-join-btn, .sf-join-btn:visited {
    background: var(--sf-accent-color) !important;
    color: var(--sf-button-text-color) !important;
    font-weight: bold;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    border: 2px solid var(--sf-accent-color) !important;
}


.sf-join-btn:hover {
    background: none !important;
    color: var(--sf-accent-color) !important;
    border: 2px solid var(--sf-accent-color) !important;
}
.sf-footer .sf-logo svg {
    height: 15px;
    margin-bottom: 4px;
    width: auto;
    vertical-align: middle;
    display: inline-block;
    fill: var(--sf-text-color) !important;
}
.sf-socials {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.sf-socials a {
    color: var(--sf-accent-color) !important;
    font-weight: 500;
}
.sf-footer-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Contact Form 7 --- */
.sf-join-form label {
    display: block;
    font-style: italic;
    font-weight: bold;
}
.sf-join-form input,
.sf-join-form textarea,
.sf-join-form select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    margin-bottom: 5px;
    border: 2px solid var(--sf-border-color);
    background: var(--sf-bg-color);
    color: var(--sf-text-color);
    border-radius: 6px;
}
input.wpcf7-form-control.wpcf7-submit.has-spinner.sf-btn {
    width: 200px;
    text-align: center;
    margin: 0 auto;
    border-radius: 999px !important;
    background: var(--sf-accent-color) !important;
    color: var(--sf-button-text-color) !important;
    border: 2px solid var(--sf-accent-color) !important;
    font-weight: 400 !important;
}
input.wpcf7-form-control.wpcf7-submit.has-spinner.sf-btn:hover {
    background: var(--sf-bg-color) !important;
    color: var(--sf-accent-color) !important;
    border-color: var(--sf-accent-color) !important;
}

/*
 * ==========================================================================
 * 5. Single Work Page Specific Styles
 * ==========================================================================
 */
.single-work .sf-nav {
    position: absolute !important;
}
.single-work .sf-work-projects-hero {
    height: 500px;
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 6rem 2rem;
    color: var(--sf-text-color);
    text-align: center;
    overflow: hidden;
}
.single-work .sf-work-projects-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--sf-bg-color) 100%);
}
.single-work .sf-work-projects-hero > * {
    position: relative;
    z-index: 2;
}
.single-work .sf-work-hero-content h1 {
    font-size: 3.5rem;
    padding-top: 110px;
    margin-bottom: -80px;
	font-style: normal;
    font-family: "basic-sans", sans-serif;
}
.single-work .sf-work-hero-content h2 {
    font-size: 18px;
    opacity: 0.7;
    color: var(--sf-text-color);
    font-weight: 400;
    padding-top: 49px;
    font-family: "minion-pro", serif;
}
.single-work .sf-work-logo-inline svg {
    fill: var(--sf-accent-color);
    width: 100%;
    transition: fill 0.3s ease;
    height: 45px;
    margin-top: -40px !important;
}
.single-work .project-details {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem 0;
    color: var(--sf-text-color);
}
.single-work .project-description {
    flex: 1 1 50%;
    line-height: 1.8;
    max-width: 600px;
}
.single-work .project-meta {
    flex: 1 1 40%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
    font-size: 1rem;
}
.single-work .project-meta .label {
    font-style: italic;
    opacity: 0.7;
    margin-bottom: 0.25rem;
    display: block;
}
.single-work .project-meta .value a {
    font-weight: 500;
    color: var(--sf-link-color);
    text-decoration: none;
    margin-right: 1rem;
}
.single-work .project-meta .value a:hover {
    text-decoration: underline;
    color: var(--sf-accent-color);
}

@media (max-width: 768px) {
    .single-work .sf-work-projects-hero {
        height: 400px;
    }
    .single-work .sf-work-hero-content h1 {
        font-size: 2.5rem;
        padding-top: 140px;
        margin-bottom: -70px;
    }
    .single-work .sf-work-hero-content h2 {
        font-size: 14px;
        padding-top: 53px;
    }
    .single-work .project-details {
        flex-direction: column;
    }
    .single-work .project-meta {
        grid-template-columns: 1fr;
    }
    .single-work .sf-work-logo-inline svg {
        height: 22px !important;
    }
}

/* --- 3.X Image With Text Component (Corrected) --- */
.sf-iwt-wrapper {
    display: flex;
    flex-wrap: wrap; 
    gap: 40px; 
	color: var(--sf-text-color);
    /* align-items يتم إضافته الآن عبر الـ PHP للتحكم الكامل */
}

.sf-iwt-column {
    display: flex;
    flex-direction: column;
    justify-content: center; /* هذا يضمن التوسيط الرأسي للمحتوى داخل العمود */
}

/* القواعد الجديدة والمهمة للصورة نفسها 
*/
.sf-iwt-column-media img {
    width: 100%; /* <-- هذا يجعل الصورة تملأ عرض العمود بالكامل */
    
    /* هذا يجعل الصورة تحاول ملء ارتفاع العمود أيضاً, 
       مما يساعد على المحاذاة مع النص الطويل.
       إذا تم تحديد ارتفاع مخصص من ACF، فسيتم تطبيق ذاك الارتفاع. */
    height: 100%; 
    
    /* هذه هي الخاصية السحرية: تمنع الصورة من التمطط وتشويه أبعادها.
       تقوم بقص الأجزاء الزائدة بدلاً من ضغط الصورة. */
    object-fit: cover; 
    
    display: block;
}

/* --- منطق التوزيع --- */
.sf-layout[class*="ratio-"] .sf-iwt-column {
    flex-grow: 1; 
}

.sf-layout.ratio-50-50 .sf-iwt-column { flex-basis: calc(50% - 20px); }
.sf-layout.ratio-40-60 .sf-iwt-column-media { flex-basis: calc(40% - 20px); }
.sf-layout.ratio-40-60 .sf-iwt-column-text { flex-basis: calc(60% - 20px); }
.sf-layout.ratio-60-40 .sf-iwt-column-media { flex-basis: calc(60% - 20px); }
.sf-layout.ratio-60-40 .sf-iwt-column-text { flex-basis: calc(40% - 20px); }
.sf-layout.ratio-30-70 .sf-iwt-column-media { flex-basis: calc(30% - 20px); }
.sf-layout.ratio-30-70 .sf-iwt-column-text { flex-basis: calc(70% - 20px); }
.sf-layout.ratio-70-30 .sf-iwt-column-media { flex-basis: calc(70% - 20px); }
.sf-layout.ratio-70-30 .sf-iwt-column-text { flex-basis: calc(30% - 20px); }

/* --- منطق الترتيب --- */
.order-first { order: 1; }
.order-last { order: 2; }

/* --- التجاوب مع الجوال --- */
@media (max-width: 768px) {
    .sf-iwt-wrapper .sf-iwt-column {
        flex-basis: 100% !important; 
        order: initial !important; 
    }
    .sf-iwt-column-text {
        text-align: left !important; 
    }
}

@media screen and (max-width: 768px) {
    .sf-menu-toggle {
        color: var(--sf-button-text-color) !important;
        background-color: var(--sf-accent-color) !important;
    }
	
	.sf-mobile-menu {
        color: var(--sf-text-color !important);
        background-color: var(--sf-bg-m-color) !important;
	}
}


/* --- تنسيقات مكون شبكة الصور --- */
.sf-image-grid-container {
    display: grid;
    gap: 20px; /* المسافة بين الصور */
}

/* --- التحكم في عدد الأعمدة لسطح المكتب --- */
.desktop-cols-1 { grid-template-columns: 1fr; }
.desktop-cols-2 { grid-template-columns: repeat(2, 1fr); }
.desktop-cols-3 { grid-template-columns: repeat(3, 1fr); }
.desktop-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* --- التحكم في عدد الأعمدة للجوال (تأثير المكعب) --- */
@media (max-width: 768px) {
    /* نجبر الشبكة دائماً على عرض عمودين في الجوال */
    .sf-image-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
	
	.sf-image-grid-container .sf-grid-item:first-child:last-child {
        grid-column: span 2; /* اجعل هذا العنصر الوحيد يمتد على عرض العمودين */
    }
}

/* --- التحكم في أبعاد الصور (Aspect Ratio) --- */
.sf-image-grid-container .sf-grid-item {
    width: 100%;
    overflow: hidden; /* لإخفاء أي أجزاء من الصورة قد تزيد عن الأبعاد */
}

/* تطبيق الأبعاد المحددة */
.aspect-ratio-landscape .sf-grid-item { aspect-ratio: 16 / 9; }
.aspect-ratio-portrait .sf-grid-item { aspect-ratio: 3 / 4; }
.aspect-ratio-square .sf-grid-item { aspect-ratio: 1 / 1; }

.sf-image-grid-container .sf-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* أهم خاصية: تجعل الصورة تملأ المساحة بدون تمطط */
    display: block;
}

/*
 * ==========================================================================
 * 6. Album Component (Masonry Style)
 * ==========================================================================
 */

.sf-album-container {
    /* الخاصية الأساسية لعمل التأثير */
    column-count: 5; /* عدد الأعمدة على الشاشات الكبيرة (جرب 3 أو 4) */
    column-gap: 15px; /* المسافة بين الأعمدة */
    display: block !important;
}

.sf-album-item {
    display: inline-block; /* ضروري لعمل التأثير */
    width: 100%;
    margin-bottom: 15px; /* المسافة الرأسية بين الصور في نفس العمود */
    
    /* أهم خاصية: تمنع الصورة من الانقسام بين عمودين */
    break-inside: avoid; 
    
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.sf-album-item:hover {
    transform: translateY(-5px); /* تأثير رفع بسيط عند المرور */
    opacity: 0.9;
}

.sf-album-item img {
    width: 100%;
    height: auto; /* <-- هذا هو السر: السماح للصورة بأخذ ارتفاعها الطبيعي */
    display: block;
    border-radius: var(--border-radius);
}

/* --- التحكم في عدد الأعمدة للشاشات المختلفة --- */

/* للتابلت */
@media (max-width: 1024px) {
    .sf-album-container {
        column-count: 5;
    }
}

/* للجوال */
@media (max-width: 767px) {
    .sf-album-container {
        column-count: 3;
    }
}

/*
 * ==========================================================================
 * 7. Advanced Grid Component (sf_advanced_grid)
 * ==========================================================================
 */

/* --- النص المصاحب للشبكة --- */
.sf-adv-grid-text {
    max-width: 750px; /* تحديد عرض أقصى للنص لسهولة القراءة */
    margin-left: auto;
    margin-right: auto;
    text-align: center; /* توسيط النص افتراضياً */
}

/* إضافة هامش سفلي إذا كان النص قبل الشبكة */
.sf-adv-grid-text + .sf-adv-grid-container {
    margin-top: var(--space-md);
}

/* إضافة هامش علوي إذا كان النص بعد الشبكة */
.sf-adv-grid-container + .sf-adv-grid-text {
    margin-top: var(--space-md);
}


/* --- حاوية الشبكة الرئيسية --- */
.sf-adv-grid-container {
    display: flex;
    flex-direction: column; /* الصفوف ستكون تحت بعضها رأسياً */
    gap: 20px; /* المسافة بين كل صف والآخر */
}

/* --- كل صف داخل الشبكة --- */
.sf-adv-grid-row {
    display: flex; /* الصور داخل الصف ستكون بجانب بعضها أفقياً */
    gap: 20px; /* المسافة بين الصور في نفس الصف */
}

/* --- كل عنصر (صورة) داخل الصف --- */
.sf-adv-grid-item {
    /* هذه الخاصية هي السر! ستقوم بتوزيع المساحة بالتساوي بين الصور في الصف */
    flex: 1; 
    
    min-width: 0; /* ضروري لعمل flex بشكل صحيح مع الصور ومنعها من التجاوز */
    display: flex; /* لجعل الصورة بداخلها تتصرف بشكل جيد */
}

.sf-adv-grid-item img {
    width: 100%;
    display: block;
    
    /* إذا لم يتم تحديد ارتفاع من ACF، ستأخذ الصورة ارتفاعها الطبيعي.
       إذا تم تحديد ارتفاع، ستحاول ملء هذا الارتفاع. */
    height: 100%; 
    
    /* أهم خاصية: تمنع الصور من التمطط والتشوه عند تحديد ارتفاع لها */
    object-fit: cover; 
}


/*
==============================================
split-media v4.0.7
==============================================
*/
.sf-split-media-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 20px;
}

/* توزيع افتراضي (فيديو عرضي) */
.sf-split-media.video-is-horizontal .sf-split-image,
.sf-split-media.video-is-horizontal .sf-split-video {
  flex: 1 1 50%;
}

/* توزيع خاص للفيديو الطولي */
.sf-split-media.video-is-vertical .sf-split-image {
  flex: 1 1 70%;
}
.sf-split-media.video-is-vertical .sf-split-video {
  flex: 1 1 30%;
}

/* الصورة */
.sf-split-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* الفيديو */
.sf-video-wrapper {
  display: flex;
  width: 100%;
  height: auto;
  align-items: stretch;
}
.sf-video-wrapper iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  display: block;
  border: none;
}

/* الجوال */
@media (max-width: 768px) {
  .sf-split-media-inner {
    flex-direction: column;
  }

  .sf-split-image,
  .sf-split-video {
    flex: 1 1 100%;
  }
}
@media (min-width: 769px) {
	.sf-video-wrapper {
    width: 100%;
    max-height: 600px;
}
}
