/*
Theme Name: GEC Engineering Consultants
Theme URI: https://gec-engineering.com
Author: Provision Studio
Author URI: https://provisionstudio.net
Description: ثيم احترافي عصري لشركة GEC للاستشارات الهندسية - تصميم عربي RTL
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: Private
Text Domain: gec-theme
Tags: rtl-language, engineering, arabic, custom-colors, full-width-template
*/

/* ==============================
   CSS VARIABLES - GEC Brand Identity
============================== */
:root {
  /* Brand Colors */
  --gec-teal:        #2B7A70;
  --gec-teal-dark:   #1A5050;
  --gec-teal-mid:    #3D8C82;
  --gec-teal-light:  #4FA99C;
  --gec-lime:        #8DC63F;
  --gec-lime-dark:   #6FA832;
  --gec-lime-light:  #A8D86A;

  /* Neutrals */
  --gec-white:       #FFFFFF;
  --gec-off-white:   #F5F7F5;
  --gec-cream:       #F0F4EF;
  --gec-gray-100:    #EAEDEA;
  --gec-gray-200:    #D1D8D1;
  --gec-gray-400:    #8A9A8A;
  --gec-gray-500:    #6B7C6B;
  --gec-gray-600:    #556055;
  --gec-gray-800:    #2E3A2E;
  --gec-gray-900:    #1A201A;
  --gec-dark:        #1A1F1A;

  /* Card / Surface */
  --gec-card-bg:     #FFFFFF;
  --gec-card-dark:   #162820;
  --gec-border:      #EAEDEA;

  /* Typography */
  --font-arabic:     'Cairo', 'Tajawal', sans-serif;
  --font-display:    'Cairo', sans-serif;

  /* Spacing */
  --section-padding: 100px 0;
  --container-max:   1280px;

  /* Transitions */
  --transition:      0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm:       0 2px 8px rgba(27,80,80,0.08);
  --shadow-md:       0 8px 30px rgba(27,80,80,0.12);
  --shadow-lg:       0 20px 60px rgba(27,80,80,0.18);

  /* Border radius */
  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --radius-xl:       32px;
}

/* ==============================
   RESET & BASE
============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-arabic);
  background: var(--gec-white);
  color: var(--gec-gray-800);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  overflow-x: hidden;
}

body.ltr { direction: ltr; text-align: left; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul, ol { list-style: none; }

/* ==============================
   TYPOGRAPHY
============================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--gec-teal-dark);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--gec-gray-600); }

/* ==============================
   LAYOUT UTILITIES
============================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: var(--section-padding); }
.section-sm { padding: 60px 0; }
.section-lg { padding: 140px 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.text-center { text-align: center; }
.text-white { color: var(--gec-white); }

/* ==============================
   SECTION HEADER
============================== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gec-lime);
  text-transform: uppercase;
  margin-bottom: 12px;
  position: relative;
}

.section-label::before,
.section-label::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30px;
  height: 2px;
  background: var(--gec-lime);
}

.section-label::before { right: calc(100% + 10px); }
.section-label::after  { left: calc(100% + 10px); }

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--gec-teal-dark);
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--gec-gray-400);
  max-width: 560px;
  margin: 0 auto;
}

/* ==============================
   BUTTONS
============================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: var(--font-arabic);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gec-teal);
  color: var(--gec-white);
  box-shadow: 0 4px 20px rgba(43,122,112,0.35);
}

.btn-primary:hover {
  background: var(--gec-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(43,122,112,0.45);
}

.btn-lime {
  background: var(--gec-lime);
  color: var(--gec-white);
  box-shadow: 0 4px 20px rgba(141,198,63,0.35);
}

.btn-lime:hover {
  background: var(--gec-lime-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--gec-teal);
  border: 2px solid var(--gec-teal);
}

.btn-outline:hover {
  background: var(--gec-teal);
  color: var(--gec-white);
}

.btn-outline-white {
  background: transparent;
  color: var(--gec-white);
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline-white:hover {
  background: var(--gec-white);
  color: var(--gec-teal);
  border-color: var(--gec-white);
}

/* ==============================
   CARDS
============================== */
.card {
  background: var(--gec-card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--gec-gray-100);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-6px);
}

/* ==============================
   BADGE / TAG
============================== */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-teal { background: rgba(43,122,112,0.1); color: var(--gec-teal); }
.badge-lime { background: rgba(141,198,63,0.15); color: var(--gec-lime-dark); }

/* ==============================
   DECORATIVE ELEMENTS
============================== */
.gec-line-decor {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gec-lime), var(--gec-teal));
  border-radius: 2px;
  margin: 12px auto;
}

.gec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gec-lime);
  display: inline-block;
}

/* ==============================
   RESPONSIVE — Base Grid
============================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --section-padding: 70px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 18px; }
}

@media (max-width: 480px) {
  :root { --section-padding: 50px 0; }
}


/* ================================================
   SINGLE SERVICE PAGE
   ================================================ */

.project-details-box {
  background: linear-gradient(135deg, var(--gec-teal-dark), #0f3535);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

/* ================================================
   TEAM ARCHIVE — team-grid & team-card
   ================================================ */

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 20px 0 60px;
}

.team-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--gec-card-bg, #fff);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    isolation: isolate;          /* يمنع fixes.css transform من كسر overflow */
    transform: translateZ(0);    /* GPU layer ثابت */
}
.team-card:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow: 0 12px 40px rgba(43,122,112,0.18);
}

/* Image */
.team-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, var(--gec-teal-dark, #1A5050), var(--gec-teal-mid, #2B7A70));
    border-radius: 16px 16px 0 0;          /* نفس الـ radius بتاع الكارد */
    transform: translateZ(0);              /* يفرض GPU layer — يحل مشكلة overflow+border-radius */
    -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari fix */
}

/* يشمل كلا الـ class: team-thumb (archive) و team-photo (about page) */
.team-card-img .team-thumb,
.team-card-img .team-photo,
.team-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.4s ease;
}
.team-card:hover .team-thumb,
.team-card:hover .team-photo,
.team-card:hover img {
    transform: scale(1.05);
}
.team-no-img,
.team-no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gec-teal-dark, #1A5050), var(--gec-teal-mid, #2B7A70));
    color: rgba(255,255,255,0.4);
}

/* Overlay */
.team-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26,80,80,0.75);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.team-card:hover .team-card-overlay {
    opacity: 1;
}
.team-social {
    display: flex;
    gap: 10px;
}
.team-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}
.team-social-btn:hover {
    background: var(--gec-lime, #8DC63F);
    border-color: var(--gec-lime, #8DC63F);
}

/* Body */
.team-card-body {
    padding: 20px;
    text-align: center;
}
.team-card-body h3,
.team-card-body h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--gec-gray-900, #111);
}
.team-card-body .team-position {
    font-size: 0.85rem;
    color: var(--gec-teal);
    margin: 0 0 8px;
    font-weight: 600;
}
.team-card-body .badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
}
.team-specialty {
    font-size: 0.82rem;
    color: var(--gec-gray-500, #888);
    margin: 6px 0;
    line-height: 1.5;
}
.team-meta {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Dark Mode */
[data-theme="dark"] .team-card {
    background: var(--gec-card-dark, #162820);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
[data-theme="dark"] .team-card-body h3,
[data-theme="dark"] .team-card-body h4 {
    color: #f0f0f0;
}
[data-theme="dark"] .team-specialty {
    color: #999;
}

/* Responsive */
@media (max-width: 1200px) {
    .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 480px) {
    .team-grid { grid-template-columns: 1fr; }
}