/* ═══════════════════════════════════════════
   Smart President Digital Solutions - Stylesheet
   ═══════════════════════════════════════════ */

:root { scroll-behavior: smooth; }
* { -webkit-tap-highlight-color: transparent; }

/* ───── Scroll reveal ───── */
[data-animate] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-duration: 700ms;
  will-change: opacity, transform;
}
[data-animate="fadeIn"]     { transform: none; }
[data-animate="fadeUp"]     { transform: translateY(45px); }
[data-animate="fadeDown"]   { transform: translateY(-45px); }
[data-animate="scaleIn"]    { transform: scale(0.9); }
[data-animate="slideLeft"]  { transform: translateX(60px); }
[data-animate="slideRight"] { transform: translateX(-60px); }
[data-animate].sa-in { opacity: 1 !important; transform: none !important; }

[data-stagger] > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ───── Scrollbar ───── */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d5094; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #213966; }
.dark ::-webkit-scrollbar-thumb { background: #3b5ba5; }

/* ───── Section title accent ───── */
.title-line {
  display: block; width: 64px; height: 4px;
  background: linear-gradient(90deg, #213966, #2d5094);
  border-radius: 3px; margin-top: 0.85rem;
}
.title-line.center { margin-left: auto; margin-right: auto; }

/* ───── Gradient text ───── */
.gradient-text {
  background: linear-gradient(90deg, #2d5094, #4a7bd4);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ───── Hero grid backdrop ───── */
.hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}
.hero-blob {
  position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: 0.5; pointer-events: none;
}

/* ───── Cards ───── */
.card-hover { transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease; }
.card-hover:hover { transform: translateY(-6px); }

/* ───── Marquee ───── */
@keyframes scrollX { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.marquee { animation: scrollX 32s linear infinite; }
.marquee:hover { animation-play-state: paused; }

/* ───── Client / partner logo card ───── */
.logo-card {
  transition: all .3s ease;
  filter: grayscale(100%) opacity(.65);
}
.logo-card:hover { filter: grayscale(0%) opacity(1); transform: translateY(-3px); }
.dark .logo-card { filter: grayscale(100%) opacity(.5) brightness(1.5); }
.dark .logo-card:hover { filter: grayscale(0%) opacity(1) brightness(1.1); }

/* ───── FAQ ───── */
.faq-item .faq-answer { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform .3s ease; }

/* ───── Count up numbers ───── */
.stat-value { font-variant-numeric: tabular-nums; }

/* ───── Prose (article content) ───── */
.prose-ar { line-height: 2; }
.prose-ar p { margin-bottom: 1.1rem; }
.prose-ar h2 { font-size: 1.5rem; font-weight: 800; margin: 1.5rem 0 .75rem; }
.prose-ar h3 { font-size: 1.25rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.prose-ar ul { list-style: disc; padding-right: 1.5rem; margin-bottom: 1rem; }
.prose-ar img { border-radius: .75rem; margin: 1rem 0; }

/* ───── Utilities ───── */
.glass {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
}
.line-clamp-2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-3 { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* Header shrink on scroll */
#site-header.scrolled { box-shadow: 0 8px 30px -12px rgba(33,57,102,.18); }

/* ───── Portfolio Behance-style cards ───── */
.pf-card { position: relative; overflow: hidden; border-radius: 1.25rem; }
.pf-card .pf-img { transition: transform .7s cubic-bezier(.22,1,.36,1); }
.pf-card:hover .pf-img { transform: scale(1.08); }
.pf-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,.92) 10%, rgba(33,57,102,.55) 55%, rgba(33,57,102,.15) 100%);
  opacity: 0; transition: opacity .45s ease;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.5rem;
}
.pf-card:hover .pf-overlay { opacity: 1; }
.pf-overlay > * { transform: translateY(18px); opacity: 0; transition: transform .5s ease, opacity .5s ease; }
.pf-card:hover .pf-overlay > * { transform: translateY(0); opacity: 1; }
.pf-card:hover .pf-overlay > *:nth-child(1) { transition-delay: .06s; }
.pf-card:hover .pf-overlay > *:nth-child(2) { transition-delay: .12s; }
.pf-card:hover .pf-overlay > *:nth-child(3) { transition-delay: .18s; }
.pf-card:hover .pf-overlay > *:nth-child(4) { transition-delay: .24s; }

/* Portfolio filter buttons */
.filter-active { background: #213966; color: #fff; }

/* Gallery thumb */
.gallery-thumb { transition: transform .3s ease, box-shadow .3s ease; cursor: pointer; }
.gallery-thumb:hover { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  [data-animate], .marquee { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
  .pf-card:hover .pf-img { transform: none; }
}

/* ═══════════ التجاوب العام مع جميع الأجهزة ═══════════ */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe { max-width: 100%; height: auto; }
* { -webkit-tap-highlight-color: transparent; }

/* منع تجاوز الجداول والأكواد داخل المحتوى */
.prose-content img { border-radius: 1rem; }
.prose-content table { display: block; width: 100%; overflow-x: auto; }
.prose-content iframe { width: 100%; aspect-ratio: 16/9; }

/* iframe الخرائط داخل المحتوى متجاوب */
iframe[src*="google.com/maps"], iframe[src*="maps"] { width: 100% !important; min-height: 320px; border: 0; }

/* الجوال: مسافات ألطف وعناوين أصغر */
@media (max-width: 640px) {
  section { padding-top: 3rem; padding-bottom: 3rem; }
  h1 { line-height: 1.3; }
  .hero-blob { opacity: .5; }
  .marquee { animation-duration: 22s; }
}

/* شاشات صغيرة جداً */
@media (max-width: 380px) {
  .title-line { width: 48px; }
}
