/*
 * Theme Name:  CNAPESS
 * Theme URI:   https://www.cnapess-gouv.com/
 * Description: Thème enfant Astra — Centre National d'Appui à la Promotion de l'Économie Sociale et Solidaire. 100% code custom, sans page builder.
 * Author:      Abdoulaye Konaté — Consultant Marketing Digital & IA
 * Author URI:  https://www.cnapess-gouv.com/
 * Template:    astra
 * Version:     1.1.0
 * License:     Propriétaire — tous droits réservés CNAPESS
 * Text Domain: cnapess
 */

/* ============================================================
   DESIGN SYSTEM — VARIABLES CSS
   ============================================================ */

:root {
  /* Palette principale */
  --vert:          #1E7339;
  --vert-fonce:    #0F4A22;
  --vert-moyen:    #2D8A4E;
  --vert-clair:    #E8F5EC;
  --or:            #C9A227;
  --or-clair:      #F0D060;
  --or-fonce:      #A8841E;
  --blanc:         #FFFFFF;
  --noir:          #0D0D0D;
  --gris-1:        #F5F7F5;
  --gris-2:        #E8EDE9;
  --gris-3:        #C8D4CA;
  --texte:         #1A2E1F;
  --texte-2:       #4A6350;
  --texte-3:       #7A9480;
  --bordure:       rgba(30,115,57,0.15);

  /* Typographie */
  --font-titre:    'Poppins', sans-serif;
  --font-corps:    'Inter', 'DM Sans', sans-serif;
  --font-accent:   'Playfair Display', serif;

  /* Espacements */
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --section-pad:   80px 0;
  --container:     1200px;

  /* Ombres */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.14);
  --shadow-vert:   0 8px 30px rgba(30,115,57,0.20);
  --shadow-or:     0 4px 20px rgba(201,162,39,0.30);

  /* Transitions */
  --trans:         0.25s ease;
  --trans-slow:    0.40s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-corps);
  font-size: 16px;
  line-height: 1.7;
  color: var(--texte);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--vert);
  text-decoration: none;
  transition: color var(--trans);
}

a:hover { color: var(--vert-fonce); }

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   TOPBAR
   ============================================================ */

.top-bar {
  background: var(--vert-fonce);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-family: var(--font-titre);
  letter-spacing: 0.05em;
  padding: 7px 0;
}

.top-bar-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* ============================================================
   BANNIÈRE IMAGE HORIZONTALE
   ============================================================ */

.header-banner {
  width: 100%;
  height: auto;
  position: relative;
  overflow: hidden;
  background: #0F4A22; /* fallback couleur si image lente */
  line-height: 0;      /* supprime l'espace sous l'img inline */
}

.header-banner-img {
  width: 100%;
  height: auto;
  display: block;
  /* ratio naturel : 7042 × 1317 */
}

.header-banner-tag {
  font-family: var(--font-titre);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.80);
  font-weight: 500;
}

/* ============================================================
   NAVIGATION PRINCIPALE
   ============================================================ */

.site-nav {
  background: var(--vert);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.nav-menu {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 16px 18px;
  color: rgba(255,255,255,0.92);
  font-family: var(--font-titre);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: var(--vert-fonce);
  color: #fff;
}

.nav-link svg { width: 14px; height: 14px; transition: transform var(--trans); }
.nav-item:hover .nav-link svg { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border-top: 3px solid var(--or);
  box-shadow: var(--shadow-md);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--trans);
  z-index: 100;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 11px 18px;
  font-size: 13px;
  color: var(--texte);
  font-family: var(--font-corps);
  border-bottom: 1px solid var(--gris-2);
  transition: background var(--trans), padding var(--trans);
}

.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover {
  background: var(--vert-clair);
  color: var(--vert-fonce);
  padding-left: 24px;
}

/* Burger mobile */
.nav-burger {
  display: none;
  margin-left: auto;
  padding: 10px 12px;
  color: #fff !important;
  background: var(--vert-fonce) !important;
  border: 1.5px solid rgba(255,255,255,0.25) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

/* ============================================================
   FIL D'ARIANE
   ============================================================ */

.breadcrumb {
  background: var(--gris-1);
  border-bottom: 1px solid var(--gris-2);
  padding: 10px 0;
  font-size: 13px;
  color: var(--texte-2);
}

.breadcrumb-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--vert); }
.breadcrumb a:hover { color: var(--vert-fonce); }
.breadcrumb-sep { color: var(--gris-3); }
.breadcrumb-current { color: var(--texte); font-weight: 600; }

/* ============================================================
   HERO PAGE INTÉRIEURE
   ============================================================ */

.page-hero {
  background: linear-gradient(135deg, var(--vert-fonce) 0%, var(--vert) 100%);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 360px;
  height: 360px;
  border: 60px solid rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

.page-hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.page-hero-label {
  display: inline-block;
  font-family: var(--font-titre);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 14px;
}

.page-hero h1 {
  font-family: var(--font-titre);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 17px;
  color: rgba(255,255,255,0.80);
  max-width: 600px;
  line-height: 1.7;
}

/* ============================================================
   SECTIONS GÉNÉRALES
   ============================================================ */

.section { padding: var(--section-pad); }
.section-alt { background: var(--gris-1); }

.section-label {
  font-family: var(--font-titre);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-family: var(--font-titre);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--vert-fonce);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--texte-2);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 48px;
}

/* ============================================================
   BOUTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-titre);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: all var(--trans);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--vert);
  color: #fff;
  border-color: var(--vert);
}

.btn-primary:hover {
  background: var(--vert-fonce);
  border-color: var(--vert-fonce);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-vert);
}

.btn-or {
  background: var(--or);
  color: #fff;
  border-color: var(--or);
}

.btn-or:hover {
  background: var(--or-fonce);
  border-color: var(--or-fonce);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-or);
}

.btn-outline {
  background: transparent;
  color: var(--vert);
  border-color: var(--vert);
}

.btn-outline:hover {
  background: var(--vert);
  color: #fff;
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.10);
  border-color: #fff;
  color: #fff;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--bordure);
  overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans);
}

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

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-body { padding: 24px; }

.card-tag {
  font-family: var(--font-titre);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 10px;
  display: block;
}

.card-title {
  font-family: var(--font-titre);
  font-size: 18px;
  font-weight: 700;
  color: var(--vert-fonce);
  margin-bottom: 10px;
  line-height: 1.35;
}

.card-excerpt {
  font-size: 14px;
  color: var(--texte-2);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* ============================================================
   ANIMATIONS REVEAL (IntersectionObserver)
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   PIED DE PAGE
   ============================================================ */

.site-footer {
  background: var(--vert-fonce);
  color: rgba(255,255,255,0.80);
  padding: 64px 0 0;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-logo-img {
  height: 70px;
  width: auto;
  margin-bottom: 16px;
  border-radius: 50%;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.70);
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.70);
  transition: all var(--trans);
}

.footer-social a:hover {
  background: var(--or);
  border-color: var(--or);
  color: #fff;
}

.footer-col-title {
  font-family: var(--font-titre);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--or);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.70);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--trans), padding var(--trans);
}

.footer-links a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-contact-item {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.70);
}

.footer-contact-item svg {
  width: 16px;
  height: 16px;
  color: var(--or);
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-bottom {
  margin-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 20px 0;
}

.footer-bottom-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.50);
}

.footer-bottom a {
  color: rgba(255,255,255,0.60);
  transition: color var(--trans);
}

.footer-bottom a:hover { color: #fff; }

/* ============================================================
   WHATSAPP FLOTTANT
   ============================================================ */

.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 54px;
  height: 54px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.40);
  z-index: 9999;
  transition: transform var(--trans), box-shadow var(--trans);
}

.whatsapp-float:hover {
  transform: scale(1.10);
  box-shadow: 0 6px 30px rgba(37,211,102,0.55);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  color: #fff;
  fill: #fff;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */

.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-family: var(--font-titre);
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
  margin-bottom: 8px;
}

.form-label .required { color: #c0392b; margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gris-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-corps);
  font-size: 15px;
  color: var(--texte);
  background: #fff;
  transition: border-color var(--trans), box-shadow var(--trans);
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--vert);
  box-shadow: 0 0 0 3px rgba(30,115,57,0.12);
}

.form-control.error { border-color: #e74c3c; }

.form-error {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 5px;
  display: none;
}

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

/* ============================================================
   RESPONSIVE — MOBILE FIRST (breakpoint 768px)
   ============================================================ */

@media (max-width: 768px) {

  .nav-inner { flex-wrap: wrap; }
  .nav-burger { display: flex; }

  /* Logo CNAPESS : masqué uniquement quand le menu burger est ouvert */
  .nav-inner.menu-open .nav-logo-link {
    visibility: hidden;
    pointer-events: none;
    width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
  }

  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-bottom: 12px;
  }

  .nav-menu.open { display: flex; }

  .nav-link { padding: 12px 16px; font-size: 14px; }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    border-top: none;
    border-left: 3px solid var(--or);
    margin-left: 16px;
    display: none;
  }

  .nav-item.open .nav-dropdown { display: block; }

  /* banner : height:auto — ratio naturel conservé */

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .page-hero { padding: 40px 0; }

  /* Container */
  .container { padding: 0 16px; }

  /* Top bar */
  .top-bar { padding: 5px 0; }
  .top-bar-inner {
    flex-direction: column;
    gap: 1px;
    text-align: center;
    font-size: 8.5px;
    letter-spacing: 0.04em;
    padding: 0 12px;
    line-height: 1.4;
  }

  /* Header banner : ratio naturel conservé sur mobile */

  /* Nav logo text */
  .nav-logo-link span { font-size: 15px; }

  /* Sections */
  .section { padding: 48px 0; }
  .section-title { font-size: 24px; }
  .section-desc { font-size: 14px; }

  /* Hero page intérieure */
  .page-hero { padding: 36px 0; }
  .page-hero h1 { font-size: 26px; }
  .page-hero p { font-size: 14px; }

  /* Boutons */
  .btn { padding: 11px 18px; font-size: 13px; }

  /* Cards */
  .card-img { height: 180px; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-col-brand { text-align: center; }
  .footer-social { justify-content: center; }
  .footer-bottom-inner { flex-direction: column; text-align: center; gap: 8px; }

  /* WhatsApp flottant */
  .whatsapp-float { width: 46px; height: 46px; bottom: 18px; right: 14px; }
  .whatsapp-float svg { width: 22px; height: 22px; }

  /* Formulaires */
  .form-control { font-size: 16px; } /* évite le zoom iOS */
}

/* ============================================================
   TABLETTE (max-width: 1024px)
   ============================================================ */

@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* ============================================================
   PETIT MOBILE (max-width: 480px)
   ============================================================ */

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .section { padding: 32px 0; }
  .page-hero { padding: 24px 0; }
  .page-hero h1 { font-size: 20px; }
  .btn { width: 100%; justify-content: center; }
  .whatsapp-float { bottom: 14px; right: 10px; }
}
