/* ==========================================================================
   B.E.N.I.R — Design tokens & Styles
   Couleurs officielles Charte :
   - Red BENIR:  #EE2C43
   - Gray BENIR: #A7A9AC
   ========================================================================== */

html, body {
  margin: 0 !important;
  padding: 0 !important;
  scroll-padding-top: 78px !important;
}

:root {
  --paper:      #FFFFFF;
  --paper-dim:  #F4F4F5;
  --ink:        #202124;
  --ink-soft:   #56585C;
  
  /* Couleurs officielles Brand Guidelines */
  --gold:       #EE2C43;  /* Rouge BENIR officiel */
  --gold-deep:  #C81F34;  /* Rouge foncé (hover) */
  --sage:       #A7A9AC;  /* Gris BENIR officiel */
  --sage-deep:  #5C6470;  /* Gris foncé */
  
  --line:       #E4E4E6;
  --white:      #FFFFFF;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  --radius: 4px;
  --max-w: 1180px;

  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em 0;
  font-weight: 600;
  line-height: 1.1;
}

p { margin: 0 0 1em 0; }

a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
.logo .mark {
  height: 85px !important; /* Taille Desktop strictement identique */
  width: auto !important;
  flex-shrink: 0;
}
.logo .logo-light { display: block !important; }
.logo .logo-dark { display: none !important; }

.logo .tagline {
  display: block;
  font-family: var(--font-body);
  font-size: 0.55rem !important; /* Tagline affinée */
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
}

nav.main-nav { order: 2; }
nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
nav.main-nav li { flex-shrink: 0; }
nav.main-nav a {
  display: inline-block;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
  border-bottom-color: var(--gold);
}

.header-cta {
  background: var(--gold);
  color: var(--white) !important;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: none !important;
}
.header-cta:hover { background: var(--gold-deep); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 42px;
  height: 42px;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--white); }
.btn-primary:hover { background: var(--gold-deep); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn-sage { background: var(--sage-deep); color: var(--white); }
.btn-sage:hover { background: var(--ink); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-deep);
  margin-bottom: 18px;
  display: block;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  max-width: 18ch;
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }

/* ---------- Acronym signature ---------- */
.acronym {
  display: flex;
  gap: clamp(6px, 2vw, 22px);
  flex-wrap: wrap;
}
.acronym .letter-block {
  cursor: default;
  flex: 1 1 0;
  min-width: 110px;
  border-top: 3px solid var(--sage);
  padding-top: 14px;
  transition: border-color 0.3s ease;
}
.acronym .letter-block:hover { border-top-color: var(--gold); }
.acronym .big-letter {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  color: var(--ink);
  line-height: 1;
  display: block;
}
.acronym .word {
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sage-deep);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.acronym .letter-block:hover .word,
.acronym .letter-block.revealed .word {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-alt { background: var(--paper-dim); }
.section-dark { background: var(--ink); color: var(--paper); }
.section-dark h2, .section-dark h3 { color: var(--paper); }
.section-dark .lede { color: #C7CDD6; }

.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-deep);
  margin-bottom: 10px;
  display: block;
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
}
.card .icon-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-deep);
  margin-bottom: 14px;
  display: block;
}
.card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.96rem; }

/* ---------- Stats strip ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 40px 0;
}
.stat { flex: 1 1 160px; }
.stat .num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--ink);
  display: block;
}
.stat .label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Quote / témoignage ---------- */
.quote-block {
  border-left: 3px solid var(--gold);
  padding-left: 28px;
  max-width: 62ch;
}
.quote-block p {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink);
}
.quote-block cite {
  font-style: normal;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- Article Card ---------- */
.article-card {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  border-bottom: 1px solid var(--line);
  padding: 40px 0;
  align-items: center;
}
.article-card .article-photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-dim);
}
.article-card .article-photo img,
.article-card .article-photo svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-card time {
  font-weight: 600;
  color: var(--sage-deep);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 8px;
}
.article-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.article-card p { color: var(--ink-soft); }
.badge {
  display: inline-block;
  background: #FDEBEC;
  color: var(--gold-deep);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}
html[data-theme="dark"] .badge { background: #3A1E20; }

.timeline-item {
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
}
.timeline-item time {
  font-weight: 600;
  color: var(--sage-deep);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timeline-item h3 { font-size: 1.15rem; margin-bottom: 6px; }
.timeline-item p { color: var(--ink-soft); margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.96rem;
  background: var(--white);
  color: var(--ink);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}
.form-note { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #C7CDD6;
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-grid h4 {
  color: #FFFFFF;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  font-family: var(--font-body);
  font-weight: 600;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: #C7CDD6; font-size: 0.92rem; }
.footer-grid a:hover { color: #FFFFFF; }
.site-footer .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  color: #FFFFFF;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.site-footer .brand img { height: 34px; width: auto; }
.footer-bottom {
  border-top: 1px solid #33404F;
  padding-top: 22px;
  font-size: 0.82rem;
  color: #8B96A3;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) and (min-width: 861px) {
  nav.main-nav ul { gap: 14px; }
  nav.main-nav a { font-size: 0.86rem; }
  .header-cta { padding: 9px 14px; font-size: 0.86rem; }
  .logo .tagline { display: none; }
}

/* ==========================================
   NOUVEAU MENU MOBILE (S'active sous 860px)
   ========================================== */
@media (max-width: 860px) {
  /* 1. Bloque le défilement de la page quand le menu est ouvert */
  body.menu-open {
    overflow: hidden !important;
    height: 100vh !important;
  }

  /* 2. Blocage strict de tout débordement horizontal */
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
  }

  .wrap {
    padding: 0 16px !important;
  }

  /* 3. Repassage propre du contenu du milieu sur 1 colonne */
  .grid-3, .grid-2 { 
    grid-template-columns: 1fr !important; 
    gap: 16px !important;
  }

  .article-card { 
    grid-template-columns: 1fr !important; 
    gap: 16px !important;
  }

  .timeline-item { 
    grid-template-columns: 1fr !important; 
    gap: 6px !important; 
  }

  h1 { font-size: 1.85rem !important; line-height: 1.25 !important; }
  h2 { font-size: 1.45rem !important; }
  .hero { padding-top: 32px !important; padding-bottom: 24px !important; }

  /* Masquer l'acronyme lourd sur mobile */
  .acronym, .hero .acronym {
    display: none !important;
  }

  .btn {
    width: 100% !important;
    text-align: center !important;
    padding: 14px 16px !important;
  }

  /* Header fixe plus haut (78px) pour le logo complet */
  .site-header {
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: var(--paper) !important;
  }

  /* Compense la nouvelle hauteur du header */
  body {
    padding-top: 78px !important;
  }

  .site-header .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  /* Logo mobile ajusté */
  .logo {
    font-size: 1.1rem !important;
    gap: 6px !important;
    flex-shrink: 1 !important;
    min-width: 0;
  }
  .logo span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .logo .mark { height: 42px !important; }
  .logo .tagline { display: none !important; }

  /* Conteneur des actions à droite */
  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  /* Supprime les pseudo-éléments parasites */
  .nav-toggle::before,
  .nav-toggle::after,
  .nav-toggle-lines::before,
  .nav-toggle-lines::after {
    display: none !important;
    content: none !important;
  }

  /* Bouton pilule */
  .nav-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: var(--paper-dim) !important;
    border: 1px solid var(--line) !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
    height: 38px !important;
    min-width: 102px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    margin-right: 2px !important;
  }

  .nav-toggle-label {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--ink) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .nav-toggle-lines {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 3.5px !important;
    width: 15px !important;
    height: 11px !important;
    flex-shrink: 0 !important;
  }

  .nav-toggle-lines span {
    display: block !important;
    width: 15px !important;
    height: 2px !important;
    background: var(--ink) !important;
    border-radius: 2px !important;
  }

  /* Tiroir calé sous le header de 78px */
  nav.main-nav {
    display: none;
    position: fixed !important;
    top: 78px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: calc(100vh - 78px) !important;
    background: var(--paper) !important;
    padding: 20px 24px 40px !important;
    overflow-y: auto !important;
    z-index: 100 !important;
  }

  nav.main-nav.open { display: block !important; }

  nav.main-nav ul {
    flex-direction: column !important;
    gap: 0 !important;
  }

  nav.main-nav li {
    border-bottom: 1px solid var(--line) !important;
  }

  nav.main-nav a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    padding: 18px 0 !important;
    color: var(--ink) !important;
    border-bottom: none !important;
  }

  nav.main-nav a:not(.header-cta)::after {
    content: "→";
    color: var(--sage-deep);
  }

  .header-cta {
    display: block !important;
    text-align: center !important;
    margin-top: 24px !important;
    padding: 16px 20px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    border-radius: 8px !important;
    line-height: 1.2 !important;
  }

  /* Footer mobile */
  .site-footer .footer-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 16px !important;
  }

  .site-footer .footer-grid > div:nth-child(1),
  .site-footer .footer-grid > div:nth-child(4) {
    grid-column: span 2 !important;
  }

  .site-footer .footer-grid > div:nth-child(1) {
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .site-footer .footer-bottom {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }
}

/* ---------- Mode Sombre ---------- */
html {
  transition: background-color 0.25s ease, color 0.25s ease;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper:      #17181B;
  --paper-dim:  #202225;
  --ink:        #F2F2F3;
  --ink-soft:   #B9BCC1;
  --gold:       #EE2C43;
  --gold-deep:  #FF5265;
  --sage:       #A7A9AC;
  --sage-deep:  #C3C7CC;
  --line:       #34363B;
  --white:      #FFFFFF;
}
html[data-theme="dark"] .site-header { background: var(--paper); border-bottom-color: var(--line); }
html[data-theme="dark"] .card { background: #1F2124; border-color: var(--line); }
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .form-field select { background: #1F2124; border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .section-dark { background: #0E0F11; color: #F2F2F3; }
html[data-theme="dark"] .section-dark h2,
html[data-theme="dark"] .section-dark h3 { color: #F2F2F3; }
html[data-theme="dark"] .header-cta { color: #FFFFFF !important; }
html[data-theme="dark"] .btn-outline { border-color: var(--ink); color: var(--ink); }
html[data-theme="dark"] .btn-outline:hover { background: var(--ink); color: var(--paper); }

/* Inversion propre des deux logos en mode sombre */
html[data-theme="dark"] .logo-light { display: none !important; }
html[data-theme="dark"] .logo-dark { display: block !important; }

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px; /* Bouton Thème Agrandisé */
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-dim);
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--gold); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.header-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Bloque physiquement tout scroll sur iPhone quand le menu est ouvert */
body.menu-open {
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* ---------- Lisibilité accrue du footer (Clair & Sombre) ---------- */
.site-footer h4,
.site-footer .brand {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .site-footer {
  background: #0E0F11 !important;
  color: #E4E4E6 !important;
}

html[data-theme="dark"] .site-footer p,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .site-footer .form-note {
  color: #C3C7CC !important;
}

html[data-theme="dark"] .site-footer a:hover {
  color: #FFFFFF !important;
}

html[data-theme="dark"] .site-footer .footer-bottom {
  border-top-color: #2A2D32 !important;
  color: #A7A9AC !important;
}