/* ================ Reset & Variables ================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #06402B;
  --primary-light: #085a3c;
  --primary-dark: #042d1e;
  --accent: #10b981;
  --accent-light: #34d399;
  --bg: #ffffff;
  --bg-alt: #eef1ee;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 6px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-lg: 16px;
  --transition: .3s ease;
  --max-w: 1200px;
  --font-ar: 'Tajawal', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, sans-serif;
}

html.dark {
  --primary: #0d6b47;
  --primary-light: #10b981;
  --primary-dark: #06402B;
  --bg: #0a0a0a;
  --bg-alt: #121212;
  --card: #181818;
  --border: #262626;
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --shadow: 0 6px 20px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }
html[dir="rtl"] body { font-family: var(--font-ar); }
html[dir="ltr"] body { font-family: var(--font-en); }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ================ Buttons ================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(6,64,43,.3); }
.btn-ghost {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 2px solid rgba(255,255,255,.25);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255,255,255,.15); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: var(--transition);
  font-weight: 600;
  font-size: .85rem;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--primary); }

/* ================ Header ================ */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
html.dark .header { background: rgba(10,10,10,.85); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
}
html.dark .logo { color: var(--accent-light); }

.nav-menu {
  display: flex;
  gap: 26px;
  align-items: center;
}
.nav-menu a {
  font-weight: 500;
  font-size: .95rem;
  color: var(--text);
  position: relative;
  padding: 6px 0;
}
.nav-menu a:hover,
.nav-menu a.active { color: var(--primary); font-weight: 700; }
.nav-menu a.active::after { width: 100%; }
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0; inset-inline-start: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: var(--transition);
}
.nav-menu a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-cta { padding: 9px 20px; font-size: .9rem; }

.hamburger { display: none; }

/* ================ Hero ================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 90px 0 40px;
  color: #fff;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, #042d1e 0%, #06402B 50%, #10b981 100%);
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(16,185,129,.2), transparent 60%);
}
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  display: none;
}
.hero-image[src]:not([src=""]) { display: block; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(4,45,30,.6) 50%, rgba(0,0,0,.85) 100%);
  z-index: 2;
}

.hero-inner {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 900px;
  padding: 0 20px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 28px;
  color: rgba(255,255,255,.9);
}
.badge-pill .dot {
  width: 8px; height: 8px;
  background: var(--accent-light);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-light);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -.03em;
}
.gradient-text {
  background: linear-gradient(90deg, #34d399, #10b981, #14b8a6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: rgba(255,255,255,.78);
  max-width: 720px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: 1.1rem;
  animation: bounce 2s infinite;
  z-index: 2;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* ================ Sections ================ */
.section {
  padding: 90px 0;
}
.section.alt { background: var(--bg-alt); }

.section-head {
  text-align: center;
  margin-bottom: 55px;
  max-width: 700px;
  margin-inline: auto;
}
.eyebrow {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}
html.dark .eyebrow { color: var(--accent-light); }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}
.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ================ About ================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 50px;
  align-items: start;
  margin-bottom: 60px;
}
.about-media {
  position: sticky;
  top: 100px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  max-height: 520px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-lg);
}
.about-media img { width: 100%; height: 100%; object-fit: cover; display: none; }
.about-media img[src]:not([src=""]) { display: block; }
.about-media img[src]:not([src=""]) ~ .about-placeholder { display: none; }
.about-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 6rem; opacity: .4;
}

.about-content p {
  margin-bottom: 18px;
  color: var(--text-muted);
  line-height: 1.9;
  font-size: 1.02rem;
}
.about-opening {
  font-size: 1.2rem !important;
  font-weight: 700;
  color: var(--text) !important;
  border-inline-start: 4px solid var(--primary);
  padding-inline-start: 18px;
  margin-bottom: 24px !important;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.pill {
  padding: 6px 14px;
  background: var(--bg-alt);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
}
html.dark .pill { background: rgba(16,185,129,.1); color: var(--accent-light); border-color: rgba(16,185,129,.3); }

/* Achievements */
.achievements { margin-top: 60px; }
.achievements h3 {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 30px;
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.ach-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  transition: var(--transition);
}
.ach-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.ach-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.ach-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.ach-card p { font-size: .9rem; color: var(--text-muted); }

/* Team statement */
.team-statement {
  margin-top: 70px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius-lg);
}
.team-statement h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--primary);
}
html.dark .team-statement h3 { color: var(--accent-light); }
.team-statement p { margin-bottom: 14px; color: var(--text-muted); line-height: 1.9; }
.team-statement p.highlight {
  font-weight: 700;
  color: var(--text);
  font-size: 1.08rem;
  border-inline-start: 4px solid var(--primary);
  padding-inline-start: 18px;
  margin-top: 20px;
}

/* Mission */
.mission-card {
  margin-top: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 45px 40px;
  border-radius: var(--radius-lg);
  text-align: center;
}
.mission-card h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 18px; }
.mission-card blockquote {
  font-size: 1.1rem;
  line-height: 1.9;
  font-style: italic;
  max-width: 800px;
  margin: 0 auto;
  opacity: .95;
}

/* ================ Services ================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.service-icon {
  width: 56px; height: 56px;
  background: rgba(6,64,43,.12);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}
html.dark .service-icon { background: rgba(16,185,129,.15); color: var(--accent-light); }
.service-card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; }
.service-card p {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 18px;
  flex: 1;
}
.service-highlights {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

/* ================ Projects ================ */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: .88rem;
  transition: var(--transition);
  color: var(--text);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.project-thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  position: relative;
  overflow: hidden;
}
.project-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: var(--transition);
}
.project-video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.project-card:hover .project-thumb img { transform: scale(1.06); }
.project-thumb-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 3rem; opacity: .5;
}
.project-body { padding: 22px; }
.project-category {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  margin-bottom: 8px;
}
html.dark .project-category { color: var(--accent-light); }
.project-body h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.project-body p { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 50px 20px;
  font-size: 1rem;
}

/* ================ Clients marquee ================ */
.marquee {
  overflow: hidden;
  position: relative;
  padding: 30px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 0; /* لا gap — نستخدم margin على كل عنصر لضمان التدوير السلس */
  width: max-content;
  animation: scroll 12s linear infinite;
  will-change: transform;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(var(--dir, -1) * 50%)); }
}
html[dir="rtl"] .marquee-track { --dir: 1; }
html[dir="ltr"] .marquee-track { --dir: -1; }
.marquee:hover .marquee-track { animation-play-state: paused; }

.client-logo {
  height: 72px;
  min-width: 140px;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  margin-inline-end: 16px; /* margin بدل gap — يُطبّق على آخر عنصر أيضاً */
  font-weight: 700;
  color: var(--text-muted);
  font-size: 1.05rem;
  transition: var(--transition);
  flex-shrink: 0;
}

/* Light mode: all logos → uniform black silhouette */
.client-logo img {
  max-height: 52px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: brightness(0) opacity(.45);
  transition: filter .35s ease, opacity .35s ease;
  display: block;
}
.client-logo:hover img {
  filter: none;
  opacity: 1;
}

/* Dark mode: flip to white silhouette */
html.dark .client-logo img {
  filter: brightness(0) invert(1) opacity(.5);
}
html.dark .client-logo:hover img {
  filter: brightness(0) invert(1) opacity(1);
}

/* ================ Contact ================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 35px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.form-group { margin-bottom: 18px; display: flex; flex-direction: column; }
.form-group label {
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.form-group input,
.form-group textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6,64,43,.15);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.form-group textarea { resize: vertical; min-height: 140px; }

.form-status {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  display: none;
}
.form-status.success { display: block; background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.form-status.error { display: block; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.info-icon {
  width: 44px; height: 44px;
  background: rgba(6,64,43,.12);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}
html.dark .info-icon { background: rgba(16,185,129,.15); color: var(--accent-light); }
.info-item h4 { font-size: .95rem; font-weight: 700; margin-bottom: 3px; }
.info-item p { font-size: .9rem; color: var(--text-muted); }

.info-item.social { display: block; }
.info-item.social h4 { margin-bottom: 14px; }
.social-row { display: flex; gap: 10px; }
.social-row a {
  width: 42px; height: 42px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.social-row a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* ================ Footer ================ */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.85);
  padding: 40px 0 30px;
  position: relative;
}
.footer .logo { color: #fff; margin-bottom: 6px; }
.footer p { font-size: .9rem; color: rgba(255,255,255,.7); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.copyright { font-size: .85rem; }
.admin-hidden {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 15px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  transition: var(--transition);
}
.admin-hidden:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ================ WhatsApp ================ */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  inset-inline-end: 25px;
  width: 56px; height: 56px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 6px 20px rgba(37,211,102,.45);
  z-index: 999;
  transition: var(--transition);
}
.whatsapp-float:hover { transform: scale(1.1); box-shadow: 0 10px 30px rgba(37,211,102,.6); }

/* ================ Responsive ================ */
@media (max-width: 968px) {
  .about-grid { grid-template-columns: 1fr; gap: 35px; }
  .about-media { position: static; max-width: 400px; margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .marquee {
    padding: 20px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  }
  .marquee-track {
    width: max-content;
    flex-wrap: nowrap;
    justify-content: flex-start;
    animation: scroll 8s linear infinite;
    gap: 0;
  }
  .client-logo {
    height: 60px;
    min-width: 128px;
    max-width: 150px;
    padding: 8px 18px;
    margin-inline-end: 12px;
    flex: 0 0 auto;
  }
  .client-logo img {
    max-height: 42px;
    max-width: 120px;
  }

  .nav-menu {
    position: fixed;
    top: 65px;
    inset-inline-end: -100%;
    flex-direction: column;
    width: 80%; max-width: 320px;
    height: calc(100vh - 65px);
    background: var(--card);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    align-items: flex-start;
  }
  .nav-menu.active { inset-inline-end: 0; }
  .hamburger { display: inline-flex; }
  .nav-cta { display: none; }
  #langToggle { display: inline-flex; }
  .section { padding: 60px 0; }
  .form-row { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .hero-title { font-size: 2.2rem; }
  .footer-inner { text-align: center; justify-content: center; }
  .team-statement { padding: 28px 20px; }
  .mission-card { padding: 32px 24px; }
}

/* ================ Blog ================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.blog-card-media {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  overflow: hidden;
}
.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.blog-card:hover .blog-card-media img { transform: scale(1.05); }
.blog-card-media .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5); font-size: 3.5rem;
}
.blog-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.blog-card-meta i { color: var(--accent); margin-inline-end: 4px; }
.blog-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text);
}
.blog-card-excerpt {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.blog-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.blog-tag {
  padding: 3px 10px;
  background: var(--bg-alt);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
}
html.dark .blog-tag { background: rgba(16,185,129,.1); color: var(--accent-light); border-color: rgba(16,185,129,.3); }
.blog-read-more {
  color: var(--primary);
  font-weight: 700;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
html.dark .blog-read-more { color: var(--accent-light); }
.blog-read-more:hover { gap: 10px; }

.section-cta {
  text-align: center;
  margin-top: 20px;
}

/* Blog page specific */
.blog-hero {
  padding: 120px 0 40px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  text-align: center;
}
.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
}
.blog-hero p {
  color: rgba(255,255,255,.8);
  max-width: 700px;
  margin: 0 auto;
}
.blog-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}
.blog-search {
  flex: 1;
  max-width: 340px;
  min-width: 220px;
  position: relative;
}
.blog-search input {
  width: 100%;
  padding: 12px 18px;
  padding-inline-start: 42px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
}
.blog-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.blog-search i {
  position: absolute;
  top: 50%;
  inset-inline-start: 16px;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Single post */
.post-wrap { max-width: 820px; margin: 0 auto; padding: 120px 20px 60px; }
.post-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.post-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.post-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  color: var(--text);
}
.post-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: .92rem;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.post-meta i { color: var(--accent); margin-inline-end: 6px; }
.post-body {
  font-size: 1.05rem;
  line-height: 1.95;
  color: var(--text);
}
.post-body h2, .post-body h3 {
  margin: 32px 0 14px;
  color: var(--text);
}
.post-body h2 { font-size: 1.6rem; }
.post-body h3 { font-size: 1.3rem; }
.post-body p { margin-bottom: 16px; color: var(--text-muted); }
.post-body ul, .post-body ol { margin: 0 0 16px; padding-inline-start: 22px; color: var(--text-muted); }
.post-body li { margin-bottom: 8px; }
.post-body a { color: var(--primary); font-weight: 600; text-decoration: underline; }
html.dark .post-body a { color: var(--accent-light); }
.post-body blockquote {
  border-inline-start: 4px solid var(--accent);
  padding: 14px 18px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: 20px 0;
  color: var(--text);
  font-style: italic;
}
.post-body img,
.svc-desc img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  margin: 20px auto;
  box-shadow: var(--shadow);
}
.svc-desc p { margin-bottom: 16px; }
.svc-desc h2 { font-size: 1.4rem; font-weight: 700; margin: 24px 0 12px; }
.svc-desc h3 { font-size: 1.2rem; font-weight: 700; margin: 20px 0 10px; }
.svc-desc ul, .svc-desc ol { padding-inline-start: 22px; margin-bottom: 16px; }
.svc-desc li { margin-bottom: 6px; }
.svc-desc blockquote { border-inline-start: 3px solid var(--primary); padding-inline-start: 16px; color: var(--text-muted); font-style: italic; margin: 16px 0; }
.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 24px;
}
html.dark .post-back { color: var(--accent-light); }

/* ================ Share Buttons ================ */
.share-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.share-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--primary);
  border-radius: 2px;
}
html.dark .share-title::before { background: var(--accent); }
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
  font-family: inherit;
}
.share-btn:hover { transform: translateY(-2px); opacity: .88; }
.share-btn i { font-size: 1rem; }

/* ================ FAQ ================ */
.faq-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}
.faq-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.faq-subtitle {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: inherit;
  font-family: inherit;
  transition: background var(--transition);
}
.faq-question:hover { background: var(--bg-alt); }
.faq-question.open { color: var(--primary); }
html.dark .faq-question.open { color: var(--accent-light); }
.faq-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  color: var(--primary);
  transition: transform .25s ease;
}
html.dark .faq-icon { color: var(--accent); }
.faq-question.open .faq-icon { transform: rotate(180deg); background: var(--primary); color: #fff; }
html.dark .faq-question.open .faq-icon { background: var(--accent); color: #fff; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding: 0 22px;
  color: var(--text-muted);
  font-size: .97rem;
  line-height: 1.85;
}
.faq-answer.open {
  max-height: 600px;
  padding: 0 22px 20px;
}

/* ================ Popup ================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 20, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.popup-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.4s cubic-bezier(.2,.9,.3,1.2);
  max-height: 92vh;
  overflow-y: auto;
}
.popup-overlay.active .popup-card { transform: scale(1) translateY(0); }
.popup-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 10;
  transition: var(--transition);
}
.popup-close:hover { background: rgba(239, 68, 68, 0.85); transform: rotate(90deg); }
.popup-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  overflow: hidden;
}
.popup-media img { width: 100%; height: 100%; object-fit: cover; }
.popup-body {
  padding: 32px 28px;
  text-align: center;
}
.popup-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.popup-desc {
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 22px;
}
.popup-form .form-group { margin-bottom: 12px; }
.popup-form input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
  text-align: inherit;
}
.popup-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  background: var(--card);
}
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }
.popup-status {
  margin-top: 12px;
  font-size: .9rem;
  min-height: 20px;
  color: var(--accent);
  font-weight: 600;
}
.popup-status.error { color: #ef4444; }

/* ===== Popup Header Band ===== */
.popup-header-band {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 28px 20px 20px;
  text-align: center;
}
.popup-header-icon { font-size: 3.2rem; line-height: 1; display: block; }
.popup-badge {
  display: inline-block;
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.3);
  color: var(--accent);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.popup-trust {
  margin-top: 14px;
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ===== YouTube Section ===== */
.youtube-outer {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.25), 0 0 0 1px var(--border);
  background: #000;
}
.youtube-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.youtube-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 768px) {
  .youtube-outer { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
}
.youtube-caption {
  text-align: center;
  margin-top: 18px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .03em;
}

/* ===== Marketing CTA Section ===== */
#marketing-cta {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}
#marketing-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(16,185,129,.18) 0%, transparent 65%);
  pointer-events: none;
}
#marketing-cta .section-head h2,
#marketing-cta #mktTitle { color: #fff; }
#marketing-cta #mktDesc { color: rgba(255,255,255,.85); }
#marketing-cta .mkt-bullets li { color: rgba(255,255,255,.92); }
#marketing-cta .mkt-bullets li i { color: var(--accent-light); }
#marketing-cta .mkt-emoji { background: rgba(255,255,255,.12); }
.mkt-container { text-align: center; }
.mkt-emojis {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.mkt-emoji {
  font-size: 2.2rem;
  background: var(--bg-alt);
  border-radius: 50%;
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform .3s;
}
.mkt-emoji:hover { transform: scale(1.15); }
.mkt-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 24px 0 32px;
}
.mkt-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.mkt-bullets li i { color: var(--accent); }
.mkt-form {
  max-width: 520px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.mkt-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.mkt-fields input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
}
.mkt-fields input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
@media (max-width: 520px) { .mkt-fields { grid-template-columns: 1fr; } }

/* ===== Portfolio Download Button ===== */
#portfolioDownloadBtn {
  font-weight: 700;
  gap: 10px;
  padding: 14px 32px;
  font-size: 1rem;
}
#portfolioDownloadBtn.disabled {
  opacity: .65;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Service Rating ===== */
.service-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.svc-stars { color: #f59e0b; font-size: 1rem; letter-spacing: 1px; }
.svc-rating-count { font-size: .8rem; color: var(--text-muted); }

/* ===== Testimonials Section ===== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.testimonial-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .3s, box-shadow .3s;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.testimonial-stars { font-size: 1.15rem; }
.stars-filled { color: #f59e0b; }
.stars-empty { color: var(--border); }
.testimonial-text {
  font-size: .97rem;
  color: var(--text);
  line-height: 1.8;
  font-style: italic;
  flex: 1;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.testimonial-avatar-ph {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}
.testimonial-info strong { display: block; font-size: .95rem; color: var(--text); }
.testimonial-info span  { font-size: .82rem; color: var(--text-muted); }
html.dark .testimonial-card { background: var(--card); }

/* ===== Course Promotion ===== */
.course-promo {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr);
  gap: 32px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow);
}
.course-promo .section-head {
  text-align: start;
  margin-bottom: 22px;
}
.course-promo .section-head.compact h2 {
  font-size: 1.9rem;
  margin-bottom: 12px;
}
.course-promo .section-head.compact .lead {
  max-width: 680px;
  margin-inline: 0;
}
.course-promo-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
}
.course-promo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 820px) {
  .course-promo {
    grid-template-columns: 1fr;
    padding: 26px 22px;
  }
  .course-promo .section-head.compact h2 { font-size: 1.55rem; }
}

/* ===== Quill editor in modal ===== */
.ql-toolbar { border-color: var(--border) !important; border-radius: var(--radius) var(--radius) 0 0 !important; }
.ql-container { border-color: var(--border) !important; border-radius: 0 0 var(--radius) var(--radius) !important; font-family: var(--font-ar); }

/* ==================== Case Studies & News (server-rendered) ==================== */
.cs-chip {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: .74rem;
  font-weight: 700;
  color: #b8860b;
  background: rgba(212, 175, 55, .12);
  border: 1px solid rgba(212, 175, 55, .35);
}
html.dark .cs-chip { color: #e6c667; }
.blog-tag.cs-gold {
  color: #b8860b;
  background: rgba(212, 175, 55, .12);
  border-color: rgba(212, 175, 55, .35);
}
html.dark .blog-tag.cs-gold { color: #e6c667; }

/* التحدي / الحل / النتيجة */
.cs-points {
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
}
.cs-point {
  background: var(--card);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.cs-point h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.cs-point h2 i { color: var(--accent); margin-inline-end: 6px; }
.cs-point p { color: var(--text-muted); line-height: 1.85; }
.cs-point.gold { border-inline-start-color: #d4af37; }
.cs-point.gold h2 i { color: #d4af37; }

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.breadcrumbs a { color: var(--primary); font-weight: 600; }
html.dark .breadcrumbs a { color: var(--accent-light); }
.breadcrumbs span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.page-btn {
  min-width: 40px;
  padding: 9px 14px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: .9rem;
  transition: var(--transition);
}
a.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* CTA داخل صفحات المحتوى */
.content-cta {
  text-align: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  margin: 40px 0;
}
.content-cta h2 { color: #fff; font-size: 1.5rem; margin-bottom: 10px; }
.content-cta p { color: rgba(255,255,255,.82); margin-bottom: 20px; }

/* مواضيع ذات صلة */
.related-block { margin-top: 44px; }
.related-block > h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
}
