@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Noto+Kufi+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Colors */
  --primary-dark: #331f46;
  --primary: #4a2d65;
  --primary-light: #8860b5;
  --accent: #cfc449;

  /* Accent Palette */
  --accent-orange: #da693a;
  --accent-red: #da693a;
  --accent-green: #2A9D8F;
  --accent-yellow: #cfc449;

  /* Neutrals */
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --bg-main: #FAFAFA;
  --bg-card: #FFFFFF;
  --border: #E5E7EB;

  /* Typography */
  --font-heading: 'Cairo', sans-serif;
  --font-body: 'Noto Kufi Arabic', sans-serif;

  /* Shadows & Radius */
  --shadow-sm: 0 4px 6px -1px rgba(51, 31, 70, 0.07);
  --shadow-md: 0 10px 15px -3px rgba(51, 31, 70, 0.08), 0 4px 6px -2px rgba(51, 31, 70, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(51, 31, 70, 0.08), 0 10px 10px -5px rgba(51, 31, 70, 0.03);
  --shadow-xl: 0 25px 50px -12px rgba(51, 31, 70, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.8; letter-spacing: 0;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography Utilities */
.text-center { text-align: center; }
.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-orange);
  border-radius: var(--radius-full);
}

[dir="rtl"] .section-title::after {
  left: auto;
  right: 0;
  background: var(--accent-orange);
}
.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem auto;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem; min-height: 48px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 4px 15px rgba(51, 31, 70, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(51, 31, 70, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(51, 31, 70, 0.25);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid rgba(51, 31, 70, 0.08);
}

.navbar.scrolled {
  padding: 1rem 0;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: var(--transition);
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}

.navbar .logo-img {
  height: 54px;
}

@media (max-width: 768px) {
  .navbar .logo-img {
    height: 44px;
  }
}

.logo:hover {
  transform: scale(1.02);
}

.logo span {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-main);
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] .nav-link::after {
  left: auto;
  right: 0;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}



/* ── Hero Section ──────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 5rem;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(51,31,70,0.07) 0%, transparent 70%),
    linear-gradient(160deg, rgba(51,31,70,0.04) 0%, var(--bg-main) 60%);
  overflow: hidden;
}

/* Ambient orb — upper area (purple) */
.hero::before {
  content: '';
  position: absolute;
  width: 55vw;
  height: 55vw;
  max-width: 680px;
  max-height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(51,31,70,0.28) 0%, transparent 65%);
  top: -18%;
  right: -8%;
  z-index: -1;
  filter: blur(48px);
  animation: heroOrb1 22s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

/* Ambient orb — lower area (orange) */
.hero::after {
  content: '';
  position: absolute;
  width: 40vw;
  height: 40vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
  background: radial-gradient(circle at center, rgba(218,105,58,0.20) 0%, transparent 65%);
  bottom: -8%;
  left: 22%;
  z-index: -1;
  filter: blur(56px);
  animation: heroOrb2 28s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

@keyframes heroOrb1 {
  0%,  100% { transform: translate(  0px,   0px) scale(1.00); }
  25%        { transform: translate(-35px,  55px) scale(1.08); }
  50%        { transform: translate( 45px,  18px) scale(0.93); }
  75%        { transform: translate(-18px, -42px) scale(1.06); }
}

@keyframes heroOrb2 {
  0%,  100% { transform: translate(  0px,   0px) scale(1.00);
              border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%; }
  33%        { transform: translate( 55px, -42px) scale(1.14);
              border-radius: 45% 55% 40% 60% / 55% 45% 55% 45%; }
  66%        { transform: translate(-42px,  32px) scale(0.90);
              border-radius: 55% 45% 60% 40% / 45% 55% 45% 55%; }
}

/* Canvas particle layer — sits behind hero-bg & overlay */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  display: block;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after  { animation: none !important; }
  .hero-canvas  { display: none !important; }
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(0 0, 85% 0, 100% 100%, 0 100%);
  z-index: -1;
  filter: brightness(0.9) contrast(1.1);
  transition: opacity 900ms ease;
  opacity: 1;
}

.hero-bg-next {
  opacity: 0;
}

.hero.is-crossfading .hero-bg {
  opacity: 0;
}

.hero.is-crossfading .hero-bg-next {
  opacity: 1;
}

/* Slide text animation (keep buttons stable) */
#hero-slide-tag,
#hero-slide-title,
#hero-slide-text {
  transition: opacity 450ms ease, transform 650ms ease, filter 650ms ease;
  opacity: 1;
}

.hero.is-text-out #hero-slide-tag,
.hero.is-text-out #hero-slide-title,
.hero.is-text-out #hero-slide-text {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(2px);
}

.hero.is-text-in #hero-slide-tag,
.hero.is-text-in #hero-slide-title,
.hero.is-text-in #hero-slide-text {
  animation: heroTextIn 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes heroTextIn {
  from { opacity: 0; transform: translateY(12px); filter: blur(2px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(-90deg, var(--bg-main) 0%, transparent 50%, rgba(51,31,70,0.25) 100%);
  z-index: -1;
}

.hero-content {
  max-width: 600px;
}

.hero-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(218, 105, 58, 0.12);
  color: var(--accent-orange);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-title span {
  color: var(--primary-light);
}

.hero-text {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-btns {
  display: flex;
  gap: 1rem;
}

/* Stats Section */
.stats {
  background: var(--bg-card);
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item h3 {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-item p {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Featured Projects */
.projects-section {
  background: var(--bg-main);
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.project-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.project-content {
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-tag::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.project-tag.uganda { color: var(--accent-yellow); }
.project-tag.egypt { color: var(--primary-light); }
.project-tag.sudan { color: var(--accent-green); }

.project-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.project-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-link {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

/* Campaign Highlights */
.campaign-highlight {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  padding: 4rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #4a2d65 100%);
  box-shadow: var(--shadow-lg);
}

.campaign-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

.campaign-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  color: white;
}

.campaign-content h2 {
  color: white;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.campaign-content p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: white;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: white;
  display: flex;
  align-items: center;
}

.footer-logo .logo-img {
  height: 60px;
}

.footer-text {
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-icon i {
  font-size: 1rem;
  line-height: 1;
}

/* Inline SVG icons (used for X logo) */
.social-icon svg {
  width: 1em;
  height: 1em;
  display: block;
  fill: currentColor;
}

.social-icon:hover {
  background: var(--accent-orange);
  transform: translateY(-3px);
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: white;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
  padding-inline-start: 5px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate {
  animation: fadeIn 0.8s ease-out forwards;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-title { font-size: 3rem; }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    clip-path: circle(0% at top left);
    transition: var(--transition);
  }
  .nav-links.active {
    clip-path: circle(150% at top left);
  }
  .menu-toggle { display: block; }
  
  .hero-bg, .hero-overlay { display: none; }
  .hero-content {
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
  }
  .hero-btns { justify-content: center; }
  
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  
  .campaign-highlight { padding: 2rem; text-align: center; }

  /* New Mobile Optimizations */
  h1, h2, .hero-title { line-height: 1.4 !important; }
  .hero-title { font-size: 2.5rem !important; }
  .section-title { font-size: 2rem; }
  .section { padding: 4rem 0; }
  .btn { width: 100%; margin-bottom: 0.5rem; }
  .contact-wrapper { grid-template-columns: 1fr !important; gap: 2rem; }
  .contact-info, .contact-form { padding: 2rem !important; }
  .nav-links li { margin-bottom: 1rem; width: 100%; text-align: right; }
  .nav-links { padding: 2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
  .menu-toggle { display: flex; align-items: center; justify-content: center; padding: 0.5rem; min-width: 44px; min-height: 44px; }

  
  /* Mobile Timeline — single column, line on the inline-start side */
  .timeline::after {
    left: auto;
    right: auto;
    inset-inline-start: 18px;
    inset-inline-end: auto;
  }
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    left: auto;
    right: auto;
    padding-inline-start: 46px;
    padding-inline-end: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .timeline-item::after,
  .timeline-item:nth-child(even)::after {
    inset-inline-start: 9px;
    inset-inline-end: auto;
    left: auto;
    right: auto;
    top: 18px;
  }
  [dir="rtl"] .timeline-item::after,
  [dir="rtl"] .timeline-item:nth-child(even)::after {
    inset-inline-start: 9px;
    inset-inline-end: auto;
    left: auto;
    right: auto;
  }
  .about-image { margin-bottom: 2rem; }
  
  /* Filter Buttons Mobile Optimization */
  .filter-btn { padding: 0.75rem 1.2rem; font-size: 0.875rem; }
  .filters { gap: 0.5rem; }
}

/* Inner Pages headers */
.page-header {
  padding: 10rem 0 5rem;
  background: var(--primary-dark);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header h1 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.page-header p {
  color: rgba(255,255,255,0.8);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Sub-pages specific styles */
.about-image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 4rem auto;
}

/* Center vertical line */
.timeline::after {
  content: '';
  position: absolute;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-light), var(--accent));
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

/* LTR: odd items sit on the left half */
.timeline-item {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
  left: 0;
}

/* LTR: dot on odd items sits at the right edge (touching center line) */
.timeline-item::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: -9px;
  left: auto;
  background-color: var(--bg-card);
  border: 3px solid var(--primary);
  top: 18px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(51, 31, 70, 0.08);
}

/* LTR: even items sit on the right half */
.timeline-item:nth-child(even) {
  left: 50%;
}

/* LTR: dot on even items sits at the left edge (touching center line) */
.timeline-item:nth-child(even)::after {
  left: -9px;
  right: auto;
}

/* RTL: flip the whole layout — odd items go RIGHT, even items go LEFT */
[dir="rtl"] .timeline-item {
  left: auto;
  right: 0;
}

[dir="rtl"] .timeline-item::after {
  right: auto;
  left: -9px;
}

[dir="rtl"] .timeline-item:nth-child(even) {
  left: auto;
  right: 50%;
}

[dir="rtl"] .timeline-item:nth-child(even)::after {
  left: auto;
  right: -9px;
}

.timeline-content {
  padding: 20px 28px;
  background-color: var(--bg-card);
  position: relative;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border-inline-start: 3px solid var(--accent);
  transition: var(--transition);
}

.timeline-content:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Values Grid */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.value-card {
  padding: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: var(--transition);
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.value-icon {
  font-size: 2rem;
  color: var(--accent-orange);
  background: rgba(218, 105, 58, 0.1);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

/* Filters */
.filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-full);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Gallery Masonry */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 250px;
  grid-auto-flow: dense;
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item.wide { grid-column: span 2; }
.gallery-item.tall { grid-row: span 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(51,31,70,0.85), transparent);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h3 {
  color: white;
  font-size: 1.2rem;
  margin: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(33, 10, 50, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  left: 2rem; right: auto;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* Contact Form */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.contact-info {
  background: var(--primary-dark);
  color: white;
  padding: 4rem;
}

.contact-info h3 {
  color: white;
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.contact-form {
  padding: 4rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  transition: var(--transition);
  background: var(--bg-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(218, 105, 58, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 150px;
}

/* ── Contact Social Section ────────────────────────────────────────── */
.contact-social-section {
  padding: 5rem 0;
  background: var(--bg-main);
  text-align: center;
}

.contact-social-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.contact-social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-decoration: none;
  transition: var(--transition);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  width: 140px;
  height: 140px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.05);
}

.contact-social-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  background: white;
}

.contact-social-card i {
  font-size: 2.5rem;
  color: var(--primary);
}

.contact-social-card svg {
  width: 2.5rem;
  height: 2.5rem;
  display: block;
  fill: currentColor;
  color: var(--primary);
}

.contact-social-card span {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .contact-social-grid {
    gap: 1rem;
  }
  .contact-social-card {
    width: 120px;
    padding: 1rem;
  }
}

/* ── Flip Cards (Vision & Mission) ──────────────────────────────────── */
.flip-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-top: 3rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.flip-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flip-card-title {
  font-size: 2.2rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  position: relative;
  font-family: var(--font-heading);
}

.flip-card-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--accent-orange);
  border-radius: var(--radius-full);
}

.flip-card {
  perspective: 1200px;
  height: 320px;
  width: 100%;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* Flip on hover (desktop) */
.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Flip on tap (mobile — toggled via JS class) */
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

/* RTL: flip in the opposite direction for natural feel */
[dir="rtl"] .flip-card:hover .flip-card-inner,
[dir="rtl"] .flip-card.flipped .flip-card-inner {
  transform: rotateY(-180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  text-align: center;
}

/* ── Front face ────────────────────────────────────────────────────── */
.flip-card-front {
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  box-shadow: var(--shadow-lg);
}

.flip-card-front h3 {
  color: white;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.flip-card-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.flip-card:hover .flip-card-icon {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.flip-card-prompt {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: promptPulse 2s ease-in-out infinite;
}

@keyframes promptPulse {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}

/* ── Back face ─────────────────────────────────────────────────────── */
.flip-card-back {
  background: linear-gradient(145deg, var(--accent-orange) 0%, #c55a2e 100%);
  color: white;
  transform: rotateY(180deg);
  box-shadow: var(--shadow-lg);
}

[dir="rtl"] .flip-card-back {
  transform: rotateY(-180deg);
}

.flip-card-back h4 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.flip-card-back h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-full);
}

.flip-card-back p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.8;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .flip-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 500px;
  }

  .flip-card {
    height: 300px;
  }

  .flip-card-front h3 {
    font-size: 1.75rem;
  }

  .flip-card-icon {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .flip-card-back p {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  /* On touch devices, disable hover flip — rely on .flipped class only */
  .flip-card:hover .flip-card-inner {
    transform: none;
  }
  .flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
  }
  [dir="rtl"] .flip-card:hover .flip-card-inner {
    transform: none;
  }
  [dir="rtl"] .flip-card.flipped .flip-card-inner {
    transform: rotateY(-180deg);
  }
}

@media (max-width: 480px) {
  .flip-card {
    height: 340px;
  }
  .flip-card-front,
  .flip-card-back {
    padding: 1.75rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — Overflow & Layout Fixes
   Targets: 320px · 375px · 414px · 768px
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Global word-wrap safeguards ─────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

/* Prevent any element from punching through its container.
   NOTE: <a> is intentionally excluded here — icon/card links use
   display:flex and must not have their display or max-width overridden. */
p, h1, h2, h3, h4, h5, h6, li, td, th, span, label {
  overflow-wrap: break-word;
  word-break: break-word;
  word-wrap: break-word;
  white-space: normal;
  max-width: 100%;
}

/* Only email links and footer contact links get aggressive break-all.
   a[href^="http"] is intentionally excluded to avoid breaking
   .social-icon and .contact-social-card flex layouts. */
a[href^="mailto:"],
.footer-contact a {
  overflow-wrap: anywhere;
  word-break: break-all;
  display: inline-block;
}

/* Inline text links inside body content that happen to be long URLs */
.footer-contact a,
.contact-item a {
  overflow-wrap: anywhere;
  word-break: break-all;
  max-width: 100%;
}

/* ── 2. Images & iframes don't overflow (safe global rules) ──────────── */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* ════════════════════════════════
   TABLET  (≤ 1024 px)
   ════════════════════════════════ */
@media (max-width: 1024px) {
  /* Footer grid — override inline style with !important */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem !important;
  }
}

/* ════════════════════════════════
   MOBILE  (≤ 768 px)
   ════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Container padding ── */
  .container {
    padding-inline: 1.25rem;
  }

  /* ── Section vertical spacing ── */
  .section {
    padding: 3.5rem 0;
  }

  /* ── Page header ── */
  .page-header {
    padding: 7rem 0 3.5rem;
  }

  .page-header h1 {
    font-size: 2.2rem !important;
    line-height: 1.25 !important;
  }

  .page-header p {
    font-size: 1rem;
  }

  /* ── Section headings ── */
  .section-title {
    font-size: 1.75rem !important;
  }

  .section-subtitle {
    font-size: 1rem;
    max-width: 100%;
  }

  /* ── Hero ── */
  .hero-title {
    font-size: 2.2rem !important;
    line-height: 1.3 !important;
  }

  /* ── Footer grid — collapse to single column, override inline style ── */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* ── Footer contact email ── */
  .footer-contact li {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .footer-contact li > div {
    min-width: 0;
    flex: 1 1 0;
  }

  .footer-contact a {
    overflow-wrap: anywhere;
    word-break: break-all;
    display: block;
    max-width: 100%;
  }

  /* ── Values grid — override the inline `repeat(3, 1fr)` ── */
  .values-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  .value-card {
    padding: 1.5rem;
    gap: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .value-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .value-card h3 {
    font-size: 1rem;
  }

  .value-card p {
    font-size: 0.9rem;
  }

  /* ── Timeline ── */
  .timeline {
    margin: 2rem auto;
    max-width: 100%;
  }

  .timeline-content {
    padding: 1rem 1.25rem;
  }

  .timeline-content h3 {
    font-size: 1rem;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .timeline-content p {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  /* ── Campaign highlight ── */
  .campaign-highlight {
    padding: 2rem 1.5rem;
  }

  .campaign-content h2 {
    font-size: 1.75rem !important;
  }

  .campaign-content p {
    font-size: 1rem;
  }

  /* ── Contact wrapper ── */
  .contact-info {
    padding: 2rem 1.5rem !important;
  }

  .contact-form {
    padding: 2rem 1.5rem !important;
  }

  .contact-item {
    flex-wrap: wrap;
  }

  .contact-item > div {
    min-width: 0;
    flex: 1 1 0;
  }

  .contact-item a {
    overflow-wrap: anywhere;
    word-break: break-all;
    display: inline-block;
    max-width: 100%;
  }

  /* ── Stats ── */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .stat-item h3 {
    font-size: 2rem;
  }

  /* ── Project cards ── */
  .project-content {
    padding: 1.5rem;
  }

  /* ── Buttons ── */
  .hero-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-btns .btn {
    width: 100%;
    text-align: center;
  }

  /* ── Section title underline alignment ── */
  .section-title.center {
    display: block;
    text-align: center;
  }

  .section-title.center::after {
    left: 50%;
    transform: translateX(-50%);
  }

  [dir="rtl"] .section-title.center::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ════════════════════════════════
   SMALL MOBILE  (≤ 480 px)
   ════════════════════════════════ */
@media (max-width: 480px) {

  /* ── Container padding ── */
  .container {
    padding-inline: 1rem;
  }

  /* ── Hero ── */
  .hero-title {
    font-size: 1.9rem !important;
  }

  /* ── Values grid — single column on very small screens ── */
  .values-grid {
    grid-template-columns: 1fr !important;
  }

  .value-card {
    flex-direction: row;
    align-items: flex-start;
  }

  /* ── Page header ── */
  .page-header h1 {
    font-size: 1.8rem !important;
  }

  /* ── Stats ── */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item h3 {
    font-size: 1.75rem;
  }

  .stat-item p {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
  }

  /* ── Section ── */
  .section {
    padding: 2.5rem 0;
  }

  /* ── Campaign highlight ── */
  .campaign-highlight {
    padding: 1.5rem 1rem;
    min-height: auto;
  }

  .campaign-content h2 {
    font-size: 1.4rem !important;
  }

  /* ── Contact info ── */
  .contact-info {
    padding: 1.5rem 1rem !important;
  }

  .contact-form {
    padding: 1.5rem 1rem !important;
  }

  /* ── Footer ── */
  .footer {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-grid {
    gap: 1.5rem !important;
  }

  /* ── Timeline content ── */
  .timeline-content {
    padding: 0.875rem 1rem;
  }

  /* ── Section title ── */
  .section-title {
    font-size: 1.5rem !important;
  }
}

/* ════════════════════════════════
   TINY SCREENS  (≤ 375 px)
   ════════════════════════════════ */
@media (max-width: 375px) {

  .container {
    padding-inline: 0.875rem;
  }

  .hero-title {
    font-size: 1.65rem !important;
  }

  .page-header h1 {
    font-size: 1.6rem !important;
  }

  .section-title {
    font-size: 1.4rem !important;
  }

  .btn {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }

  .footer-contact a {
    font-size: 0.8rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SOCIAL MEDIA ICONS — Consistency & Mobile Touch Targets
   ═══════════════════════════════════════════════════════════════════════ */

/* Prevent footer socials row from overflowing on narrow screens */
.footer-socials {
  flex-wrap: wrap;
}

/* Icon containers never shrink below their declared size */
.social-icon {
  flex-shrink: 0;
  flex-grow: 0;
}

/* FA icons inside .social-icon */
.social-icon i {
  font-size: 1rem;
  line-height: 1;
  display: block;
}

/* Inline SVG (X / Twitter logo) — match FA visual weight */
.social-icon svg {
  width: 1.1em;
  height: 1.1em;
  display: block;
  fill: currentColor;
  pointer-events: none;
  flex-shrink: 0;
}

/* Contact-page social card icons (large format) */
.contact-social-card i,
.contact-social-card svg {
  font-size: 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: block;
  fill: currentColor;
  color: var(--primary);
}

@media (max-width: 768px) {
  /* 44 x 44 px touch targets — WCAG 2.5.5 minimum */
  .social-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .footer-socials {
    gap: 0.65rem;
    flex-wrap: wrap;
  }

  .contact-social-grid {
    gap: 0.75rem;
  }

  .contact-social-card {
    width: 110px;
    height: 110px;
    padding: 1rem;
  }

  .contact-social-card i,
  .contact-social-card svg {
    font-size: 2rem;
    width: 2rem;
    height: 2rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   OUR JOURNEY TIMELINE — Mobile Redesign
   Converts the split two-column timeline to clean stacked cards.
   Applies equally to Arabic (RTL) and English (LTR) pages.
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* 1. Hide the center vertical line */
  .timeline::after {
    display: none !important;
  }

  /* 2. Full-width stacked items — reset all positional offsets */
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100% !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    inset-inline-start: 0 !important;
    inset-inline-end: 0 !important;
    padding: 0 0 1.25rem 0 !important;
  }

  /* 3. Hide dot markers */
  .timeline-item::after,
  .timeline-item:nth-child(even)::after,
  [dir="rtl"] .timeline-item::after,
  [dir="rtl"] .timeline-item:nth-child(even)::after {
    display: none !important;
  }

  /* 4. Card body — colored inline-start border replaces the line visually.
        border-inline-start = left in LTR, right in RTL — correct for both. */
  .timeline-content {
    padding: 1.25rem 1.5rem !important;
    border-radius: var(--radius-md) !important;
    border-inline-start: 4px solid var(--primary-light) !important;
    box-shadow: var(--shadow-sm) !important;
    transform: none !important;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* 5. Card heading */
  .timeline-content h3 {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.5rem !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* 6. Card body text */
  .timeline-content p {
    font-size: 0.9rem !important;
    line-height: 1.75 !important;
    margin-top: 0 !important;
  }

  /* 7. No gap after the last card */
  .timeline-item:last-child,
  .timeline-item:nth-child(even):last-child {
    padding-bottom: 0 !important;
  }
}

@media (max-width: 480px) {
  .timeline-item,
  .timeline-item:nth-child(even) {
    padding-bottom: 1rem !important;
  }

  .timeline-content {
    padding: 1rem 1.25rem !important;
  }

  .timeline-content h3 {
    font-size: 0.95rem !important;
  }
}

@media (max-width: 375px) {
  .timeline-content {
    padding: 0.875rem 1rem !important;
  }

  .timeline-content h3 {
    font-size: 0.875rem !important;
  }
}
