/* ============================================================
   ONG FAMM — main.css | Styles globaux & Variables CSS
   ============================================================ */

/* ── Variables CSS ── */
:root {
  --primary:      #1A3A7C;
  --primary-dark: #122a5e;
  --primary-light:#2a5aac;
  --secondary:    #4A9FD4;
  --accent:       #E8580C;
  --accent-dark:  #c44708;
  --bg:           #F5F7FA;
  --bg-card:      #EBF5FC;
  --text:         #1C2B3A;
  --text-muted:   #4A6080;
  --white:        #FFFFFF;
  --border:       #D8E8F5;
  --font-title:   'Montserrat', sans-serif;
  --font-body:    'Open Sans', sans-serif;
  --spacing-xs:   0.25rem;
  --spacing-sm:   0.5rem;
  --spacing-md:   1rem;
  --spacing-lg:   1.5rem;
  --spacing-xl:   2rem;
  --spacing-2xl:  3rem;
  --spacing-3xl:  4rem;
  --spacing-4xl:  6rem;
  --radius:       8px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-full:  9999px;
  --shadow-sm:    0 2px 8px rgba(26,58,124,0.07);
  --shadow:       0 4px 24px rgba(26,58,124,0.10);
  --shadow-md:    0 8px 32px rgba(26,58,124,0.14);
  --shadow-lg:    0 16px 48px rgba(26,58,124,0.18);
  --transition:   0.3s ease;
  --header-h:     80px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { 
  font-size: 16px; 
  scroll-behavior: smooth; 
}

/* Accessibility: Focus Visible */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
body { font-family: var(--font-body); line-height: 1.7; color: var(--text); background: var(--bg); overflow-x: hidden; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }
ul, ol { list-style: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font-body); font-size: 1rem; }

/* ── Modern Form Styles ── */
.form-group { 
  margin-bottom: 20px; 
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1A3A7C;
  margin-bottom: 6px;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #D3D1C7;
  border-radius: 8px;
  font-size: 15px;
  font-family: 'Open Sans', sans-serif;
  color: #1C2B3A;
  background: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1A3A7C;
  box-shadow: 0 0 0 3px rgba(26,58,124,0.10);
  background: #fff;
}
.form-group textarea {
  resize: vertical;
  min-height: 140px;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #A0AEC0;
  opacity: 0.7;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-title); line-height: 1.25; color: var(--primary); }
h1 { font-size: clamp(1.75rem,4vw,2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem,3vw,2.25rem);  font-weight: 700; }
h3 { font-size: clamp(1.2rem,2.5vw,1.75rem);font-weight: 600; }
h4 { font-size: clamp(1.1rem,2vw,1.375rem); font-weight: 600; }
p  { color: var(--text-muted); margin-bottom: var(--spacing-md); }
p:last-child { margin-bottom: 0; }
main { padding-top: var(--header-h); }

/* ── Layout ── */
.container   { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--spacing-lg); }
.section     { padding: var(--spacing-4xl) 0; }
.section-sm  { padding: var(--spacing-2xl) 0; }

/* ── Section Header ── */
.section-header   { text-align: center; margin-bottom: var(--spacing-3xl); }
.section-label    { display: inline-block; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--secondary); background: rgba(74,159,212,0.12); padding: var(--spacing-xs) var(--spacing-md); border-radius: var(--radius-full); margin-bottom: var(--spacing-md); }
.section-title    { color: var(--primary); margin-bottom: var(--spacing-md); }
.section-subtitle { max-width: 640px; margin: 0 auto; color: var(--text-muted); font-size: 1.0625rem; }

/* ── Grids ── */
.grid   { 
  display: flex; 
  flex-wrap: wrap; 
  gap: var(--spacing-xl); 
  justify-content: center; /* Centrage des cartes orphelines */
}
.grid > * { flex: 1 1 100%; } /* Mobile par défaut */

.grid-2 > * { flex: 0 1 calc(50% - (var(--spacing-xl) / 2)); }
.grid-3 > * { flex: 0 1 calc(33.333% - (var(--spacing-xl) * 2 / 3)); }
.grid-4 > * { flex: 0 1 calc(25% - (var(--spacing-xl) * 3 / 4)); }

/* ── Flex ── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-sm  { gap: var(--spacing-sm); }
.gap-md  { gap: var(--spacing-md); }
.gap-lg  { gap: var(--spacing-lg); }
.gap-xl  { gap: var(--spacing-xl); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--spacing-sm);
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600;
  padding: 0.75rem 1.75rem; border-radius: var(--radius-full); border: 2px solid transparent;
  cursor: pointer; transition: all var(--transition); white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-accent  { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-accent:hover  { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,88,12,.35); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline-white { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn-outline-white:hover { background: var(--white); color: var(--primary); border-color: var(--white); transform: translateY(-2px); }
.btn-sm { font-size: .875rem; padding: .5rem 1.25rem; }
.btn-lg { font-size: 1.0625rem; padding: 1rem 2.25rem; }

/* ── Cards ── */
.card       { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; transition: all var(--transition); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.card-body  { padding: var(--spacing-xl); }
.card-blue  { background: var(--bg-card); border: 1px solid var(--border); }

/* ── Badge & Pill ── */
.badge           { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; font-weight: 600; padding: .25rem .75rem; border-radius: var(--radius-full); }
.badge-primary   { background: rgba(26,58,124,.1); color: var(--primary); }
.badge-accent    { background: rgba(232,88,12,.1); color: var(--accent); }
.badge-secondary { background: rgba(74,159,212,.1); color: var(--secondary); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1.5px solid #1A3A7C;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #1A3A7C;
  font-family: 'Montserrat', sans-serif;
  background: transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.pill--filled {
  background: #1A3A7C;
  color: #fff;
  border-color: #1A3A7C;
}
.pill--accent {
  background: #E8580C;
  color: #fff;
  border-color: #E8580C;
}
.pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

/* ── Icon Box ── */
.icon-box           { width: 56px; height: 56px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 1.375rem; flex-shrink: 0; }
.icon-box-primary   { background: rgba(26,58,124,.1); color: var(--primary); }
.icon-box-secondary { background: rgba(74,159,212,.1); color: var(--secondary); }
.icon-box-accent    { background: rgba(232,88,12,.1); color: var(--accent); }
.icon-box-white     { background: rgba(255,255,255,.15); color: var(--white); }

/* ── Stats ── */
.stat-card   { text-align: center; padding: var(--spacing-xl); }
.stat-number { font-family: var(--font-title); font-size: clamp(2.5rem, 5vw, 3.5rem); font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: var(--spacing-xs); }
.stat-number span { color: var(--accent); }
.stat-label  { color: var(--text-muted); font-size: .9375rem; font-weight: 600; }

/* ── Stats Section (High Impact) ── */
.stats-section {
  background: #1A3A7C !important;
  padding: 80px 0;
}
.stats-section .stat-number {
  color: #FFFFFF !important;
  font-size: 56px;
}
.stats-section .stat-label {
  color: #4A9FD4 !important;
  font-size: 16px;
  font-weight: 400;
  margin-top: 8px;
}

/* ── Hero ── */
.hero         { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; padding-top: var(--header-h); }
.hero-bg      { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg,rgba(26,58,124,.88) 0%,rgba(26,58,124,.6) 50%,rgba(26,58,124,.3) 100%); z-index: 1; }
.hero-content { position: relative; z-index: 2; color: var(--white); }
.hero-label   { display: inline-block; font-size: .8125rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: rgba(255,255,255,.8); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(4px); padding: var(--spacing-xs) var(--spacing-md); border-radius: var(--radius-full); margin-bottom: var(--spacing-lg); }
.hero h1     { color: var(--white); margin-bottom: var(--spacing-lg); }
.hero-lead   { color: rgba(255,255,255,.85); font-size: clamp(1rem,1.5vw,1.1875rem); max-width: 560px; margin-bottom: var(--spacing-2xl); }
.hero-actions { display: flex; gap: var(--spacing-md); flex-wrap: wrap; }

/* ── Page Hero ── */
.page-hero { position: relative; padding: calc(var(--header-h) + var(--spacing-3xl)) 0 var(--spacing-3xl); background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); overflow: hidden; }
.page-hero-content { position: relative; z-index: 2; color: var(--white); text-align: center; }
.page-hero h1 { color: var(--white); }
.page-hero p  { color: rgba(255,255,255,.8); font-size: 1.0625rem; max-width: 620px; margin: var(--spacing-md) auto 0; }

/* ── CTA Band ── */
.cta-band {
  background: linear-gradient(rgba(26,58,124,0.72), rgba(26,58,124,0.72)), url('../images/hero-accueil.jpg') center/cover no-repeat;
  background-attachment: fixed;
  padding: var(--spacing-4xl) 0;
  text-align: center;
}
.cta-band h2      { color: var(--white); margin-bottom: var(--spacing-md); }
.cta-band p       { color: rgba(255,255,255,.9) !important; max-width: 560px; margin: 0 auto var(--spacing-2xl); font-size: 1.05rem; }
.cta-band-actions { display: flex; gap: var(--spacing-md); justify-content: center; flex-wrap: wrap; }

.cta-band .btn-white {
  background: #FFFFFF !important;
  color: #1A3A7C !important;
  border: 2px solid #FFFFFF !important;
  font-weight: 700;
  transition: all 0.3s ease;
}

.cta-band .btn-white:hover {
  background: transparent !important;
  color: #FFFFFF !important;
  border: 2px solid #FFFFFF !important;
}

/* ── Gallery ── */
.gallery-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 16px; 
}
.gallery-item { 
  border-radius: 12px; 
  overflow: hidden; 
  cursor: zoom-in; 
  position: relative; 
}
.gallery-item img { 
  width: 100%; 
  height: 260px; 
  object-fit: cover; 
  transition: transform .3s ease, box-shadow 0.3s ease; 
}
.gallery-item:hover img { 
  transform: scale(1.02); 
  box-shadow: 0 8px 32px rgba(26,58,124,0.15);
}
.gallery-item-overlay { position: absolute; inset: 0; background: rgba(26,58,124,.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); pointer-events: none; }
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay i { font-size: 2rem; color: var(--white); }

/* ── Lightbox ── */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.lightbox-overlay.active { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: 90vw; max-height: 85vh; border-radius: var(--radius-lg); object-fit: contain; }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: var(--white); font-size: 1.25rem; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--transition); }
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Avatar placeholder ── */
.avatar-placeholder { width: 100%; height: 100%; background: var(--bg-card); color: var(--primary); display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 2rem; font-weight: 700; border-radius: 50%; }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: var(--spacing-sm); font-size: .875rem; color: var(--text-muted); padding: var(--spacing-md) 0; margin-bottom: var(--spacing-xl); }
.breadcrumb a { color: var(--secondary); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

/* ── Utilities ── */
.text-primary { color: var(--primary) !important; }
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-white   { color: var(--white) !important; }
.text-center  { text-align: center; }
.bg-white     { background: var(--white); }
.bg-light     { background: var(--bg); }
.bg-card      { background: var(--bg-card); }
.mt-xl { margin-top: var(--spacing-xl); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; top: -999px; left: 0; z-index: 9999; background: var(--accent); color: var(--white); padding: var(--spacing-sm) var(--spacing-md); font-weight: 600; border-radius: 0 0 var(--radius) 0; }
.skip-link:focus { top: 0; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4 > * { flex: 0 1 calc(50% - (var(--spacing-xl) / 2)); }
  .section { padding: var(--spacing-3xl) 0; }
}
@media (max-width: 768px) {
  .grid-3 > * { flex: 0 1 calc(50% - (var(--spacing-xl) / 2)); }
  .grid-2 > * { flex: 1 1 100%; }
  .section { padding: var(--spacing-2xl) 0; }
  .container { padding: 0 var(--spacing-md); }
  .hero-actions,.cta-band-actions { flex-direction: column; align-items: flex-start; }
  .cta-band-actions { align-items: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  :root { --header-h: 68px; }
  .grid-2 > *, .grid-3 > *, .grid-4 > * { flex: 1 1 100%; }
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ── Final Polish ── */

/* Card Hover Transitions */
.card, .feature-card, .program-card, .partner-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover, .feature-card:hover, .program-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  border: none;
  box-shadow: var(--shadow);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  background: var(--accent);
  transform: scale(1.1);
}

/* ── Specific Buttons ── */
.whatsapp-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #25D366;
  color: #1C2B3A;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.whatsapp-contact-btn i {
  color: #25D366;
  font-size: 1.25rem;
}
.whatsapp-contact-btn:hover {
  background: #f0faf3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.15);
}

/* ── Force white text on all hero sections ── */
.hero, .page-hero, .prog-hero, .contact-hero,
section[style*="background: linear-gradient"],
section[style*="background:linear-gradient"] {
  color: #ffffff !important;
}
.hero h1, .hero h2, .hero p, .hero a,
.page-hero h1, .page-hero h2, .page-hero p, .page-hero a,
.prog-hero h1, .prog-hero h2, .prog-hero p, .prog-hero a,
.contact-hero h1, .contact-hero h2, .contact-hero p, .contact-hero a,
section[style*="background: linear-gradient"] h1,
section[style*="background: linear-gradient"] h2,
section[style*="background: linear-gradient"] p,
section[style*="background: linear-gradient"] a,
section[style*="background:linear-gradient"] h1,
section[style*="background:linear-gradient"] h2,
section[style*="background:linear-gradient"] p,
section[style*="background:linear-gradient"] a {
  color: #ffffff !important;
}
.hero a, .page-hero a, .prog-hero a, .contact-hero a,
section[style*="background: linear-gradient"] a,
section[style*="background:linear-gradient"] a {
  opacity: 0.85;
}
.hero a:hover, .page-hero a:hover, .prog-hero a:hover, .contact-hero a:hover,
section[style*="background: linear-gradient"] a:hover,
section[style*="background:linear-gradient"] a:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .cta-band { background-attachment: scroll !important; }
}
