
/* MODERN CSS VARIABLES AND DESIGN SYSTEM */
:root {
  /* Colors */
  --primary-color: #00695c;
  --primary-dark: #004d40;
  --primary-light: #4db6ac;
  --accent-color: #f9a825;
  --accent-light: #ffb74d;
  
  /* Backgrounds */
  --light-bg: #f8f9fa;
  --dark-bg: #121212;
  --card-bg-light: #ffffff;
  --card-bg-dark: #1e1e1e;
  
  /* Text Colors */
  --text-light: #343a40;
  --text-dark: #e0e0e0;
  --text-muted: #6c757d;
  
  /* Borders */
  --border-light: #dee2e6;
  --border-dark: #333;
  --border-radius: 12px;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Transitions */
  --transition-fast: all 0.15s ease-in-out;
  --transition: all 0.3s ease-in-out;
  --transition-slow: all 0.5s ease-in-out;
  
  /* Layout */
  --container: min(1200px, 90vw);
  --header-height: 70px;
  --header-height-scrolled: 60px;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1040;
  --z-popover: 1050;
  --z-tooltip: 1060;
}
.site-header { 
  padding: 5px 0; /* avant: 10px ou 2.5px */
}

.site-header.scrolled { 
  padding: 2.5px 0; /* avant: 5px ou 1.25px */
}

.logo { width: 40px; } /* avant: 60px */
.site-header.scrolled .logo { width: 50px; } /* avant: 70px */

/* --- MODERN BASE STYLES --- */
*, *::before, *::after { 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth; 
  scroll-padding-top: var(--header-height);
}

body {
  
  font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--light-bg);
  background-image: linear-gradient(rgba(244, 246, 248, 0.95), rgba(244, 246, 248, 0.95)), url('../images/moroccan_zellige_pattern.png');
  color: var(--text-light);
  line-height: 1.6;
  transition: var(--transition);
  padding-top: var(--header-height);
  margin: 0;
  min-height: 100vh;
  font-size: var(--font-size-base);
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dark mode styles */
body.dark-mode { 
  background-color: var(--dark-bg); 
  color: var(--text-dark); 
}

body.dark-mode .site-header { 
  background: rgba(22, 22, 22, 0.9); 
  border-bottom-color: var(--border-dark); 
  backdrop-filter: blur(20px);
}

body.dark-mode .main-nav { 
  background-color: var(--dark-bg); 
}

body.dark-mode .main-nav a { 
  color: var(--text-dark); 
}

body.dark-mode .main-nav a:hover, 
body.dark-mode .main-nav a.active { 
  background: var(--primary-color); 
}

body.dark-mode .section.alt { 
  background: var(--card-bg-dark); 
}

body.dark-mode h2::after { 
  background-color: var(--accent-color); 
}

body.dark-mode .card, 
body.dark-mode .activity-card, 
body.dark-mode .rib-container, 
body.dark-mode .responsive-image { 
  background: var(--card-bg-dark); 
  border-color: var(--border-dark); 
}

body.dark-mode .theme-toggle { 
  color: var(--accent-color); 
}

/* --- ÉLÉMENTS COMMUNS --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section.alt { background-color: var(--card-bg-light); }
.text-center { text-align: center; }
.section-lead { max-width: 850px; margin: 0 auto 40px auto; font-size: 1.1rem; opacity: 0.9; }
h2 { 
  font-size: 2.8rem; 
  font-weight: 700; 
  margin-bottom: 25px; 
  position: relative; 
  display: inline-block; 
  /* padding-bottom: 15px;  <-- Ligne supprimée (espace pour le trait) */
}

/* Le bloc h2::after a été supprimé pour enlever le trait */
/* h2::after { content: ''; position: absolute; bottom: 0; right: 0; width: 70px; height: 4px; background-color: var(--primary-color); border-radius: 2px; }
.text-center h2::after { right: 50%; transform: translateX(50%); } 
*/

/* --- MODERN HEADER --- */
.site-header { 
  position: fixed; 
  top: 0; 
  left: 0; 
  right: 0; 
  z-index: var(--z-fixed); 
  padding: var(--spacing-sm) 0;
  background: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(20px); 
  border-bottom: 1px solid var(--border-light); 
  transition: var(--transition); 
  height: var(--header-height);
}

.site-header.scrolled { 
  padding: var(--spacing-xs) 0;
  box-shadow: var(--shadow); 
  height: var(--header-height-scrolled);
}


/* Modern Header Layout with CSS Grid */
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--spacing-lg);
  height: 100%;
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: var(--spacing-md); 
  text-decoration: none; 
  z-index: calc(var(--z-fixed) + 1);
}

.logo { 
  width: 50px; 
  height: 50px; 
  object-fit: contain;
  transition: var(--transition); 
  border-radius: var(--border-radius);
}

.site-header.scrolled .logo { 
  width: 40px; 
  height: 40px; 
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .arabic-title { 
  font-weight: 600; 
  color: var(--primary-color); 
  font-size: var(--font-size-lg);
  line-height: 1.2;
  margin: 0;
}

.brand-text .sub-title { 
  font-size: var(--font-size-sm); 
  opacity: 0.7; 
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
}

.main-nav { 
  justify-self: center; 
}

.main-nav ul { 
  display: flex; 
  gap: var(--spacing-sm); 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a { 
  text-decoration: none; 
  padding: var(--spacing-sm) var(--spacing-md); 
  border-radius: 25px; 
  font-weight: 600; 
  transition: var(--transition); 
  color: var(--primary-dark); 
  font-size: var(--font-size-sm);
  position: relative;
  white-space: nowrap;
}

.main-nav a:hover, 
.main-nav a.active { 
  background: var(--primary-color); 
  color: white; 
  transform: translateY(-1px);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
}

.header-controls { 
  display: flex; 
  align-items: center; 
  gap: var(--spacing-md); 
}

.theme-toggle, 
.nav-toggle { 
  background: transparent; 
  border: 0; 
  font-size: var(--font-size-xl); 
  cursor: pointer; 
  color: var(--primary-dark);
  padding: var(--spacing-sm);
  border-radius: 50%;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover,
.nav-toggle:hover {
  background: var(--light-bg);
  transform: scale(1.1);
}

.nav-toggle { 
  display: none; 
}

/* --- MODERN HERO SECTION --- */
.hero { 
  height: 70vh; 
  min-height: 500px;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  position: relative; 
  /* background-size: cover; (géré par le slide) */
  /* background-position: center; (géré par le slide) */
  color: white; 
  text-align: center;
  overflow: hidden;
}

/* SUPPRESSION DE L'ANCIEN BLOC .overlay 
  (géré par .slide::before)
*/

.hero-inner { 
  position: relative; 
  z-index: 2; 
  max-width: 800px;
  padding: 0 var(--spacing-lg);
}

.hero h1 {
  font-size: clamp(var(--font-size-4xl), 5vw, var(--font-size-5xl));
  margin: 0 0 var(--spacing-lg);
  font-weight: 800;

  text-shadow:
    1px 1px 0px #e0e0e0,
    2px 2px 0px #c8c8c8,
    3px 3px 0px #b0b0b0,
    4px 4px 4px rgba(0,0,0,0.35);
}



.hero-subtitle {
  font-family: 'Tajawal', sans-serif;
  font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-2xl));
  margin-bottom: var(--spacing-lg);
  opacity: 0.9;
  font-weight: 400;
}

.hero .lead { 
  font-size: clamp(var(--font-size-lg), 2.5vw, var(--font-size-xl)); 
  margin-bottom: var(--spacing-xxl); 
  opacity: 0.9;
  line-height: 1.6;
}

/* Modern Button System */
.btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl); 
  border-radius: 50px; 
  font-weight: 600; 
  text-decoration: none; 
  transition: var(--transition); 
  border: 2px solid transparent;
  font-size: var(--font-size-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  min-height: 48px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.8s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary { 
  background: var(--accent-color); 
  color: var(--primary-dark); 
  border-color: var(--accent-color);
}

.btn-primary:hover { 
  background: var(--accent-light);
  transform: translateY(-2px); 
  box-shadow: var(--shadow-lg); 
}

.btn-secondary { 
  background: transparent; 
  color: white; 
  border-color: white;
}

.btn-secondary:hover { 
  background: white; 
  color: var(--primary-dark);
  transform: translateY(-2px); 
  box-shadow: var(--shadow-lg); 
}

.hero-cta {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  justify-content: center;
}
.stats-section { padding: 50px 0; background: var(--primary-dark); color: white; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-item .stat-icon { font-size: 2.5rem; color: var(--accent-color); margin-bottom: 10px; }
.stat-number { font-size: 3rem; font-weight: 700; }
.stat-label { opacity: 0.8; }



/* --- SECTIONS SPÉCIFIQUES --- */

.gallery {
  /* 1. Transformer la galerie en Grille (Grid) */
  display: grid;
  
  /* 2. Définir une grille de 2 colonnes de taille égale */
  grid-template-columns: repeat(2, 1fr);
  
  /* 3. Ajouter de l'espace entre les cartes */
  gap: 15px;
  
  /* 4. Centrer les cartes horizontalement dans leurs colonnes */
  justify-items: center;
  
  /* (Optionnel) Définir une largeur max et centrer la grille 
     pour éviter qu'elle ne s'étire trop sur de grands écrans */
  max-width: 700px;
  margin: auto;
}
/* غلاف جديد للصورة والاسم لضمان ظهور الاسم فوق الصورة */
.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 250px; /* نفس ارتفاع الصورة السابق */
}

/* تحديث تنسيق الصورة لملء الغلاف */
.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* تحديث تنسيق الاسم لضمان ظهوره فوق الصورة */
.label {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  backdrop-filter: blur(5px);
  z-index: 10; /* لضمان ظهوره فوق الصورة */
  font-weight: bold;
}

/* --- Logique de réorganisation --- */

/* Cible la première carte (دار الأطفال) */
.gallery .card:nth-child(1) {
  /* A. Lui dit de s'étendre sur toute la largeur (de la ligne 1 à -1) */
  grid-column: 1 ;
  
  /* B. Lui donne l'ordre d'affichage 2 (le groupe du milieu) */
  order: 1;
}

/* Cible la 2ème et 3ème carte (دار الفتاة et رياض المسنين) */
.gallery .card:nth-child(2){
  order: 2;
}
.gallery .card:nth-child(3) {
  /* .  دار الطالبة)) */
  order: 3;
}

/* Cible la 4ème et 5ème carte (دار التضامن et  */
.gallery .card:nth-child(4){
order: 4;
}

.gallery .card:nth-child(5) {
  /* D. Leur donne l'ordre 3 (le dernier groupe, en bas) */
  order: 5;
}
.card { position: relative; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; height: 250px; object-fit: cover; display: block; }
.label { position: absolute; bottom: 15px; right: 15px; background: rgba(0,0,0,0.6); color: white; padding: 8px 15px; border-radius: 20px; backdrop-filter: blur(5px); }

.image-container { margin-top: 30px; }
.responsive-image { max-width: 100%; height: auto; border-radius: var(--border-radius); box-shadow: var(--shadow); }

.activities-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-top: 40px; }
.activity-card { padding: 30px; text-align: center; border-radius: var(--border-radius); box-shadow: var(--shadow); background-color: var(--card-bg-light); transition: var(--transition); }
.activity-card:hover { transform: translateY(-8px); }
.activity-icon { font-size: 3rem; color: var(--primary-color); margin-bottom: 20px; }
.activity-card h3 { margin: 0 0 10px 0; }

.partners-list { margin-top: 30px; font-size: 1.2rem; font-weight: 500; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px 25px; }
.partners-list span { opacity: 0.8; }

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 50px; align-items: start; margin-top: 40px; }
.contact-info { list-style: none; padding: 0; margin: 0; }
.contact-info li { display: flex; align-items: start; gap: 15px; margin-bottom: 25px; font-size: 1.1rem; }
.contact-info i { color: var(--primary-color); font-size: 1.5rem; margin-top: 5px; }
.contact-info a { color: inherit; text-decoration: none; }
.rib-container { margin-top: 30px; padding: 20px; border: 1px solid var(--border-light); border-radius: var(--border-radius); }
.rib-container strong { display: block; font-size: 1.2rem; margin: 10px 0; letter-spacing: 1px; }
.btn.small { padding: 8px 16px; font-size: 0.9rem; }

/* --- Modification pour la carte responsive --- */ 
.map-wrapper { 
  border-radius: var(--border-radius); 
  overflow: hidden; 
  box-shadow: var(--shadow); 
  
  /* Hauteur réduite (environ la moitié) */
  position: relative;
  padding-bottom: 28%; /* au lieu de 56.25% */
  height: 0;
}

.map-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}



/* --- FOOTER --- */
.site-footer { background: var(--primary-dark); color: white; padding: 25px 0; text-align: center; margin-top: 40px; }

/* --- MODERN RESPONSIVE DESIGN --- */

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: var(--z-tooltip);
  transition: var(--transition);
}

.skip-link:focus {
  top: 6px;
}

/* Keyboard navigation styles */
.keyboard-navigation *:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Large screens (1200px+) */
@media (max-width: 1200px) {
  .main-nav a { 
    padding: var(--spacing-sm) var(--spacing-sm); 
    font-size: var(--font-size-sm); 
  }
  .brand-text .arabic-title {
    font-size: var(--font-size-base);
  }
}

/* Tablets (992px and below) */
@media (max-width: 992px) {
  :root {
    --header-height: 60px;
    --header-height-scrolled: 50px;
  }

  h2 { font-size: var(--font-size-4xl); }
  .contact-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-xl); }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: var(--spacing-md);
  }
  
  .main-nav { 
    display: none; 
  }
  
  .nav-toggle { 
    display: flex; 
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }
}

/* Mobile devices (768px and below) */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --header-height-scrolled: 50px;
    --container: 95vw;
  }

  body { 
    padding-top: var(--header-height); 
    font-size: var(--font-size-sm);
  }
  
  .section { 
    padding: var(--spacing-xxl) 0; 
  }
  
  h2 { 
    font-size: var(--font-size-3xl); 
    margin-bottom: var(--spacing-lg);
  }

  .brand-text { 
    display: none; 
  }

  .main-nav { 
    display: block; 
    position: fixed; 
    right: -100%; 
    top: 0; 
    width: min(280px, 80vw); 
    height: 100vh; 
    background-color: var(--card-bg-light); 
    box-shadow: var(--shadow-lg); 
    transition: right var(--transition); 
    z-index: var(--z-modal);
  }
  
  .main-nav.open { 
    right: 0; 
  }
  
  .main-nav ul { 
    flex-direction: column; 
    padding: calc(var(--header-height) + var(--spacing-xl)) var(--spacing-xl) var(--spacing-xl); 
    align-items: flex-start; 
    gap: var(--spacing-md); 
  }
  
  .nav-toggle { 
    display: flex; 
    z-index: calc(var(--z-modal) + 1); 
  }

  .hero { 
    height: 60vh; 
    min-height: 400px;
  }

  .hero h1 { 
    font-size: var(--font-size-3xl); 
    margin-bottom: var(--spacing-md);
  }

  .hero .lead { 
    font-size: var(--font-size-lg); 
    margin-bottom: var(--spacing-xl);
  }

  .hero-cta {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .btn {
    width: 100%;
    max-width: 250px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .activities-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
}

/*gallerie photos--*/
.galerie {
    display: flex;
    flex-direction: column; /* Aligne les éléments les uns sous les autres */
    align-items: center;   /* Centre les éléments horizontalement */
    text-align: center;    /* Centre le texte au cas où */
    
}

/* --- AJOUT: Styles pour les images de la galerie et des membres --- */
.galerie img,
.membres img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow);
    background-color: var(--card-bg-light);
}

body.dark-mode .galerie img,
body.dark-mode .membres img {
    background-color: var(--card-bg-dark);
    border: 1px solid var(--border-dark);
}


/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-md);
  }

  .hero {
    height: 50vh;
    min-height: 350px;
  }

  .hero h1 {
    font-size: var(--font-size-2xl);
  }

  .hero .lead {
    font-size: var(--font-size-base);
  }

  .main-nav {
    width: 100vw;
  }

  .section {
    padding: var(--spacing-xl) 0;
  }

  h2 {
    font-size: var(--font-size-2xl);
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/*membres*/
.membres {
    display: flex;
    flex-direction: column; /* Aligne les éléments les uns sous les autres */
    align-items: center;   /* Centre les éléments horizontalement */
    text-align: center;    /* Centre le texte au cas où */
}



/* --- HERO SLIDESHOW  --- */
.hero {
  overflow: hidden; 
}

.slideshow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 400%; /* Largeur pour 4 slides */
  height: 100%;
  display: flex;
  transition: transform 0.8s ease-in-out; 
  z-index: 0;  
}

.slide {
  width: 25%; 
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative; 
}

.slide::before {
  content: ""; 
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.6) 100%); 
  z-index: 1; 
}

.hero-inner {
  position: relative; 
  z-index: 2; 
}

.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(199, 193, 193); /* couleur des flèches */
  font-weight: bold;
  font-size: 32px; /* tu peux augmenter ou réduire */
  z-index: 3;

  /* 🔥 Supprime TOUT le cadre */
  border: none;
  outline: none;
  background: none;
  padding: 0;
  margin: 0;
}
.next {
  left: 10px; /* léger décalage pour ne pas coller au bord */
}

.prev {
  right: 10px;
}


.prev:hover, .next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}



/* --- Styles Témoignages (Optimisés avec Variables) --- */

.testimonials-section {
  /* 1. Définir des variables de couleur locales pour ce composant */
  --section-bg: var(--light-bg);
  --card-bg: var(--card-bg-light);
  --card-border: var(--primary-color);
  --card-text: var(--text-muted);
  --card-author: var(--primary-dark);
  --btn-bg: var(--primary-dark);
  --btn-bg-active: var(--accent-color);
  --card-text-opacity: 1;

  /* Appliquer les variables */
  background-color: var(--section-bg);
  position: relative;
  overflow: hidden;
}

/* 2. Redéfinir les variables locales en mode sombre (TOUT AU MÊME ENDROIT) */
body.dark-mode .testimonials-section {
  --section-bg: var(--card-bg-dark);
  --card-bg: var(--dark-bg);
  --card-border: var(--accent-color);
  --card-text: var(--text-dark);
  --card-author: var(--accent-color);
  --btn-bg: var(--text-dark);
  /* Le seul style unique au dark-mode qui n'est pas une couleur */
  --card-text-opacity: 0.9;
}

.testimonials-slider {
  position: relative;
  /* min-height est crucial pour que le conteneur ne s'affaisse pas */
  min-height: 200px; 
  max-width: 700px;
  margin: 0 auto;
}

.testimonial-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;

  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  
  /* Utilisation des variables locales */
  background: var(--card-bg);
  /* Propriété logique : 'border-inline-start' gère LTR (left) et RTL (right) */
  border-inline-start: 5px solid var(--card-border);
}

/* La carte active utilise 'relative' pour définir la hauteur du slider */
.testimonial-card.active {
  position: relative; 
  opacity: 1;
  visibility: visible;
}

.testimonial-content p {
  font-size: var(--font-size-lg);
  font-style: italic;
  margin: 0 0 var(--spacing-lg);
  line-height: 1.5;
  
  /* Utilisation des variables locales */
  color: var(--card-text);
  opacity: var(--card-text-opacity);
}

.testimonial-author {
  /* Propriété logique : 'end' s'aligne à droite en LTR, à gauche en RTL */
  text-align: end; 
}

.testimonial-author strong {
  display: block;
  color: var(--card-author); /* Utilisation de la variable */
}

.testimonial-author span {
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

.testimonial-controls {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

.testimonial-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  
  /* Utilisation des variables locales */
  background-color: var(--btn-bg);
  opacity: 0.3;
}

/* Regroupement des états :active et :hover */
.testimonial-btn.active,
.testimonial-btn:hover {
  opacity: 1;
  background-color: var(--btn-bg-active); /* Utilisation de la variable */
  transform: scale(1.1);
}


/* --- AJOUT: Styles pour les logos des partenaires --- */
.partenaires-logos {
  display: grid;
  /* Crée des colonnes de 100px min et 1fr max */
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  justify-items: center; /* Centre les logos horizontalement */
  align-items: center;   /* Centre les logos verticalement */
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.partenaires-logos img {
  max-height: 80px;  /* Hauteur max pour l'uniformité */
  max-width: 100%; /* Ne déborde pas de la cellule */
  object-fit: contain;
  opacity: 0.9;
  transition: var(--transition);
}
.partenaires-logos img:hover {
    opacity: 1;
    transform: scale(1.05);
}
/* --- STYLES DES MODALES (FICHES TECHNIQUES) --- */
.modal {
  display: none; /* Caché par défaut */
  position: fixed; 
  z-index: 2000; /* Au-dessus de tout (header inclus) */
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.8); /* Fond sombre transparent */
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: var(--card-bg-light);
  margin: 5% auto; /* 5% du haut et centré */
  padding: 30px;
  border: 1px solid var(--border-light);
  width: 90%; 
  max-width: 700px; /* Largeur max */
  border-radius: var(--border-radius);
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Mode sombre pour la modale */
body.dark-mode .modal-content {
  background-color: var(--card-bg-dark);
  border-color: var(--border-dark);
  color: var(--text-dark);
}

/* Bouton de fermeture (X) */
.close-modal {
  color: var(--text-muted);
  float: left; /* À gauche car le site est en RTL */
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--accent-color);
  text-decoration: none;
}

/* --- STYLE DU TABLEAU --- */
.tech-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-family: 'Tajawal', sans-serif;
}

.tech-table th, .tech-table td {
  padding: 15px;
  text-align: right; /* RTL */
  border-bottom: 1px solid var(--border-light);
}

.tech-table th {
  background-color: var(--primary-color); /* Vert foncé */
  color: white;
  width: 35%;
  font-weight: bold;
}

.tech-table tr:last-child td {
  border-bottom: none;
}

/* Arrondi des coins du tableau */
.tech-table tr:first-child th { border-top-right-radius: 8px; }
.tech-table tr:first-child td { border-top-left-radius: 8px; }
.tech-table tr:last-child th { border-bottom-right-radius: 8px; }
.tech-table tr:last-child td { border-bottom-left-radius: 8px; }

/* Animation d'apparition */
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}

/* PREMIUM CIRCULAR BUTTONS */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 55px;
  height: 55px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 50%;
  color: white;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  transition: 0.3s ease;
}
.next { left: 15px; }
.prev { right: 15px; }
.prev:hover, .next:hover {
  background: rgba(0, 0, 0, 0.55);
  transform: translateY(-50%) scale(1.1);
}
@media (max-width: 600px) {
  .prev, .next {
    width: 70px;
    height: 70px;
    font-size: 32px;
  }
  .next { left: 10px; }
  .prev { right: 10px; }
}
/* ================================
   HISTORIQUE – VERSION INTÉGRÉE
================================ */

.history-content {
  max-width: 900px;
  margin: 40px auto 0;
  background: var(--card-bg-light);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  direction: rtl;
  text-align: justify;
}

body.dark-mode .history-content {
  background: var(--card-bg-dark);
}

.history-content p {
  font-size: var(--font-size-lg);
  line-height: 2;
  color: var(--text-light);
  margin-bottom: 28px;
  position: relative;
  padding-right: 22px;
}

body.dark-mode .history-content p {
  color: var(--text-dark);
}

.history-content p::before {
  content: "◆";
  position: absolute;
  right: 0;
  top: 8px;
  color: var(--accent-color);
  font-size: 0.8rem;
}

.history-content strong {
  color: var(--accent-color);
  font-weight: 700;
}

.history-content .year {
  background: rgba(249, 168, 37, 0.15);
  color: var(--accent-color);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .history-content {
    padding: 25px;
  }

  .history-content p {
    font-size: var(--font-size-base);
    line-height: 1.9;
  }
}
