/*
Theme Name: الاول ويب
Theme URI: https://alawal.agency
Author: Alawal Team
Author URI: https://alawal.agency
Description: قالب ووردبريس عصري لوكالات الخدمات الرقمية. دعم RTL، الوضع الليلي/النهاري، جاهز للتحويل. مناسب لتطوير المواقع، تطبيقات الموبايل، وإدارة الإعلانات.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alawal2
Tags: custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, rtl-language-support, theme-options, translation-ready, block-styles, wide-blocks

الاول ويب - قالب وكالة تقنية عربية RTL.
*/

/* ==========================================================================
   CSS Variables - Dark/Light Mode
   ========================================================================== */
:root {
  --color-bg: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #cbd5e1;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-accent: #06b6d4;
  --color-hero-gradient-start: #eef2ff;
  --color-hero-gradient-end: #e0e7ff;
  --color-card-bg: #ffffff;
  --color-footer-bg: #0f172a;
  --color-footer-text: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --font-sans: 'Cairo', 'Tajawal', system-ui, sans-serif;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #334155;
  --color-text: #f8fafc;
  --color-text-muted: #94a3b8;
  --color-border: #475569;
  --color-primary: #818cf8;
  --color-primary-hover: #a5b4fc;
  --color-accent: #22d3ee;
  --color-hero-gradient-start: #1e1b4b;
  --color-hero-gradient-end: #312e81;
  --color-card-bg: #1e293b;
  --color-footer-bg: #020617;
  --color-footer-text: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
}

/* ==========================================================================
   Base & RTL
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  direction: rtl;
  transition: background-color var(--transition), color var(--transition);
}

[dir="ltr"] body {
  direction: ltr;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* WordPress alignment */
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; }
.wp-block-image img { height: auto; max-width: 100%; }

/* Header logo — متناسق مع ارتفاع الهيدر والقائمة */
.site-header .header-inner {
  min-height: 4rem;
}
@media (min-width: 1024px) {
  .site-header .header-inner {
    min-height: 5rem;
  }
}
.site-header .logo {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 180px;
}
@media (min-width: 1024px) {
  .site-header .logo {
    max-width: 220px;
  }
}
.site-header .logo .custom-logo-link {
  display: flex;
  align-items: center;
  height: 100%;
  max-height: inherit;
}
.site-header .logo img,
.site-header .logo .custom-logo {
  max-height: 2rem;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  vertical-align: middle;
}
@media (min-width: 1024px) {
  .site-header .logo img,
  .site-header .logo .custom-logo {
    max-height: 2.5rem;
  }
}
.site-header .logo .logo-fallback {
  display: inline-block;
  line-height: 1.2;
  white-space: nowrap;
}

/* Hero موشن الخلفية — عناصر عائمة (بدون Spline) */
.hero-motion-wrap {
  will-change: transform;
}
.hero-motion-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  animation: hero-blob-float 20s ease-in-out infinite;
  pointer-events: none;
}
.hero-motion-blob-1 {
  width:  clamp(200px, 40vw, 380px);
  height: clamp(200px, 40vw, 380px);
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation-duration: 22s;
  animation-delay: 0s;
}
.hero-motion-blob-2 {
  width:  clamp(180px, 35vw, 320px);
  height: clamp(180px, 35vw, 320px);
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  top: 30%;
  right: -8%;
  animation-duration: 18s;
  animation-delay: -4s;
}
.hero-motion-blob-3 {
  width:  clamp(160px, 30vw, 280px);
  height: clamp(160px, 30vw, 280px);
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  bottom: 10%;
  left: 15%;
  animation-duration: 25s;
  animation-delay: -8s;
}
.hero-motion-blob-4 {
  width:  clamp(140px, 28vw, 260px);
  height: clamp(140px, 28vw, 260px);
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 20s;
  animation-delay: -2s;
}
.hero-motion-blob-5 {
  width:  clamp(220px, 38vw, 340px);
  height: clamp(220px, 38vw, 340px);
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 65%);
  bottom: -15%;
  right: 10%;
  animation-duration: 24s;
  animation-delay: -6s;
}
@keyframes hero-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(5%, -8%) scale(1.05); }
  50%      { transform: translate(-6%, 4%) scale(0.98); }
  75%      { transform: translate(8%, 6%) scale(1.02); }
}
.hero-motion-blob-4 {
  animation-name: hero-blob-float-center;
}
@keyframes hero-blob-float-center {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33%      { transform: translate(-50%, -50%) translate(3%, -5%) scale(1.08); }
  66%      { transform: translate(-50%, -50%) translate(-4%, 3%) scale(0.95); }
}

/* ==========================================================================
   Hero visual — شكل هلامي (blob) للصورة واللوحة — يظهر على الجوال والكبير
   ========================================================================== */
.hero-visual {
  display: block !important;
  width: 100%;
}
.hero-visual-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* اللوحة الرئيسية — حدود هلامية مع حركة خفيفة */
.hero-blob-main {
  --blob-radius: 60% 40% 30% 70% / 55% 45% 55% 45%;
  position: relative;
  padding: 1.25rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--blob-radius);
  animation: hero-panel-blob 12s ease-in-out infinite;
  overflow: hidden;
}

.hero-blob-inner {
  border-radius: 50% 45% 52% 48% / 48% 52% 48% 52%;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: block;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  background-size: cover;
}

.hero-blob-inner.hero-blob-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
}

.hero-blob-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* لوحة الموبايل — شكل هلامي صغير */
.hero-blob-mobile {
  position: absolute;
  bottom: -1rem;
  left: -1rem;
  width: 8rem;
  padding: 0.5rem;
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  border-radius: 45% 55% 52% 48% / 55% 45% 55% 45%;
  animation: hero-panel-blob-mobile 10s ease-in-out infinite;
  overflow: hidden;
}

.hero-blob-mobile-inner {
  border-radius: 42% 58% 48% 52% / 52% 42% 58% 48%;
  aspect-ratio: 9 / 16;
  width: 100%;
}

@keyframes hero-panel-blob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 55% 45% 55% 45%; }
  33%      { border-radius: 40% 60% 50% 50% / 45% 55% 45% 55%; }
  66%      { border-radius: 50% 50% 40% 60% / 55% 45% 55% 45%; }
}

@keyframes hero-panel-blob-mobile {
  0%, 100% { border-radius: 45% 55% 52% 48% / 55% 45% 55% 45%; }
  50%      { border-radius: 55% 45% 48% 52% / 45% 55% 45% 55%; }
}

/* ==========================================================================
   Technologies section — orbit around site logo (solar system style)
   ========================================================================== */
.tech-solar-wrap {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.tech-orbit-stage {
  position: relative;
  width: 360px;
  height: 360px;
  max-width: 90vw;
}
/* المركز: لوقو الموقع */
.tech-orbit-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-card-bg);
  border: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tech-orbit-center .tech-center-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}
.tech-orbit-center-placeholder {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  padding: 0.25rem;
  line-height: 1.2;
}
/* حلقة المدار + مسار مرئي */
.tech-orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--tech-orbit-r, 140) * 2px);
  height: calc(var(--tech-orbit-r, 140) * 2px);
  pointer-events: none;
}
/* رسم المسار (الدائرة) الذي تدور عليه التقنيات */
.tech-orbit-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(99, 102, 241, 0.35);
  background: transparent;
  box-sizing: border-box;
}
[data-theme="dark"] .tech-orbit-ring::before {
  border-color: rgba(129, 140, 248, 0.4);
}
.tech-orbit-track {
  width: 100%;
  height: 100%;
  position: relative;
  animation: tech-orbit-spin linear infinite;
}
.tech-orbit-inner .tech-orbit-track {
  animation-duration: 28s;
}
.tech-orbit-outer .tech-orbit-track {
  animation-duration: 42s;
  animation-direction: reverse;
}
@keyframes tech-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* عنصر على المدار — يبقى مستقيمًا (مثل كوكب) */
.tech-orbit-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.5rem;
  height: 3.5rem;
  margin-left: -1.75rem;
  margin-top: -1.75rem;
  transform: rotate(var(--tech-angle, 0deg)) translateY(calc(var(--tech-orbit-r, 140) * -1px)) rotate(calc(-1 * var(--tech-angle, 0deg)));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-card-bg);
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.tech-orbit-item .tech-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}

/* ==========================================================================
   Portfolio section — horizontal scrolling projects
   ========================================================================== */
.portfolio-marquee-wrapper {
  width: 100%;
  user-select: none;
}
.portfolio-marquee-track {
  overflow: hidden;
  width: 100%;
}
.portfolio-marquee-inner {
  display: flex;
  width: max-content;
  animation: portfolio-marquee 60s linear infinite;
  will-change: transform;
}
.portfolio-marquee-group {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  padding: 0 1rem;
  flex-shrink: 0;
}
.portfolio-marquee-wrapper .portfolio-card {
  width: 280px;
  min-width: 280px;
}
@keyframes portfolio-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   Blog archive — بطاقات المقالات + الترقيم
   ========================================================================== */
.blog-hero .archive-description p:last-child {
  margin-bottom: 0;
}
.blog-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.blog-pagination .page-numbers.prev,
.blog-pagination .page-numbers.next {
  padding: 0 0.75rem;
}
.blog-card .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card .line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   الزر العائم (Sticky CTA) و واتساب — موبايل أولاً
   ========================================================================== */
/* Sticky CTA: الافتراضي = ظاهر على الجوال، يُخفى على الشاشات الكبيرة */
.sticky-cta-mobile {
  position: fixed;
  bottom: 5rem;
  left: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}
.sticky-cta-mobile.is-visible {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 1024px) {
  .sticky-cta-mobile {
    display: none !important;
  }
}

/* زر واتساب العائم - ثابت مع دعم RTL */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  z-index: 40;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background-color: #25D366;
  color: #fff;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.whatsapp-float:hover {
  transform: scale(1.1);
}
[dir="ltr"] .whatsapp-float {
  left: 1.5rem;
  right: auto;
}
[dir="rtl"] .whatsapp-float {
  right: 1.5rem;
  left: auto;
}

/* ==========================================================================
   قسم كيف نعمل — موبايل أولاً: افتراضي = تمرير أفقي، ثم شبكة على الكبير
   ========================================================================== */
.work-process-steps {
  display: flex;
  flex-wrap: nowrap;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.5rem;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
.work-process-steps::-webkit-scrollbar {
  height: 6px;
}
.work-process-steps::-webkit-scrollbar-track {
  background: var(--color-bg-tertiary);
  border-radius: 3px;
}
.work-process-steps::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
.work-process-step {
  flex: 0 0 auto;
  min-width: 260px;
  max-width: 280px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
@media (min-width: 1024px) {
  .work-process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    overflow: visible;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
  }
  .work-process-step {
    min-width: 0;
    max-width: none;
  }
}

/* ==========================================================================
   قسم تواصل معنا — مربعات الاتصال (اتصال، واتساب، ايميل)
   ========================================================================== */
.contact-method-card {
  min-height: 12rem;
  text-decoration: none;
  color: inherit;
}
.contact-method-card:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.contact-method-icon {
  flex-shrink: 0;
}
.contact-methods-grid .dir-ltr {
  direction: ltr;
  unicode-bidi: embed;
}
