/* ==========================================================================
   OSETHOS — Base : reset, typographie, boutons, header, footer
   ========================================================================== */

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

body {
  margin: 0;
  font-family: var(--police-corps);
  font-size: var(--fs-corps);
  color: var(--texte);
  line-height: 1.6;
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

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

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

/* Règle de justification par défaut (section 1.1) : paragraphes de contenu
   courant justifiés ; exceptions volontaires pour libellés/boutons/titres. */
p { text-align: justify; margin: 0 0 1em; }
h1, h2, h3, h4, .no-justify, button, .btn, .label, .eyebrow, blockquote.exergue {
  text-align: initial;
}

h1, h2, h3, h4 {
  font-family: var(--police-hero);
  color: var(--or);
  margin: 0 0 0.6em;
  font-weight: 600;
  line-height: 1.25;
}

.container {
  width: 85%;
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-etroit {
  max-width: 1300px;
  width: var(--largeur-contenu-etroit);
  margin: 0 auto;
  text-align: justify;
}

section { padding: var(--espace-lg) 0; }

.section-blanc { background: var(--blanc); }
.section-grise { background: var(--gris-tres-clair); }

/* Focus visible clavier (accessibilité de base, section 22) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--or);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   Boutons (section 2.3 — 4 variantes + bouton Retour)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--police-corps);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.7rem 1.7rem;
  border-radius: var(--radius-pilule);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform var(--transition-rapide), background var(--transition-rapide), color var(--transition-rapide);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* 1. Pilule nav — Candidater / Donner (header) */
.btn-pilule-nav {
  background: var(--pilule-bg);
  border-color: var(--or);
  color: var(--noir);
}
.btn-pilule-nav:hover { background: #E4E0D2; }

/* 2. CTA plein doré — S'engager / Se connecter / Créer un compte / Étape suivante */
.btn-cta {
  background: var(--or);
  border-color: var(--noir);
  color: var(--blanc);
}
.btn-cta:hover { background: #6B5200; }

/* 3. Pilule Contact */
.btn-contact {
  background: var(--pilule-bg);
  border-color: var(--marron);
  color: var(--noir);
}
.btn-contact:hover { background: #E4E0D2; }

/* 4. Pilule E-mail */
.btn-email {
  background: transparent;
  border-color: var(--texte-secondaire);
  color: var(--noir);
}
.btn-email:hover { background: rgba(0,0,0,0.04); }

/* 5. Bouton Retour (tunnel) */
.btn-retour {
  background: var(--marron);
  border-color: var(--marron);
  color: var(--blanc);
  border-radius: var(--radius-pilule);
}
.btn-retour:hover { background: #2c1a0f; }

.btn-lien-souligne {
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  font-family: var(--police-corps);
}

.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.paire-contact-email {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.paire-contact-email .btn { min-width: 200px; }
@media (max-width: 640px) {
  .paire-contact-email { align-items: stretch; }
  .paire-contact-email .btn { width: 100%; }
}

/* ==========================================================================
   Header (section 4)
   ========================================================================== */

#site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: var(--gris-tres-clair);
  transition: transform var(--transition-normale);
}
#site-header.header--cachee { transform: translateY(-100%); }

.header-bandeau-1 {
  border-bottom: 1px solid #E2E2E2;
  height: 42px;
}
.header-bandeau-1 .container {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-bandeau-2 {
  height: 108px; /* agrandi (correction) */
}
.header-bandeau-2 .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-suivre-lien {
  font-family: var(--police-nav);
  font-size: var(--fs-nav);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--noir);
}

.header-reseaux {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.icone-reseau {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--noir);
  transition: color var(--transition-rapide);
}
.icone-reseau:hover { color: var(--or); }
.icone-reseau svg { width: 100%; height: 100%; fill: none; stroke: currentColor; }

.header-compte {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--noir);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--police-nav);
  font-weight: 700;
  font-size: 0.85rem;
}

.header-nav-principale {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  font-family: var(--police-nav);
  font-size: 1.05rem; /* agrandi (correction) */
}
.header-nav-principale .nav-item { position: relative; cursor: pointer; }
.header-nav-principale .btn { font-size: 1rem; padding: 0.75rem 1.9rem; }
.header-nav-gauche, .header-nav-droite { display: flex; align-items: center; gap: 1.8rem; flex: 1; }
.header-nav-droite { justify-content: flex-end; }

.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-logo img { height: 54px; width: auto; } /* agrandi (correction) */

/* Menu déroulant "Agir avec nous" (section 4.1) */
.dropdown-agir {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--gris-tres-clair);
  border-top: 1px solid #E2E2E2;
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transition: opacity 90ms ease;
}
.dropdown-agir.ouvert { opacity: 1; visibility: visible; }
.dropdown-agir .container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.badge-colonne {
  display: inline-block;
  padding: 0.45rem 1.3rem;
  border-radius: 999px;
  font-family: var(--police-nav);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--blanc);
  margin-bottom: 0.9rem;
  text-align: center;
}
.badge-gris { background: #5A5449; }
.badge-or { background: var(--or); }
.badge-marron { background: var(--marron); }
.dropdown-col { display: flex; flex-direction: column; align-items: flex-start; }
.dropdown-col a {
  display: block;
  width: 100%;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texte);
}
.dropdown-col a.badge-colonne {
  display: inline-block;
  width: auto;
  padding: 0.45rem 1.3rem;
  color: var(--blanc);
}
.dropdown-col a:not(.badge-colonne)::after { content: " →"; color: inherit; }
.dropdown-col a:not(.badge-colonne):hover { color: var(--or); text-decoration: underline; }
.dropdown-col a.badge-colonne:hover { opacity: 0.88; }

/* --- Corrections : page Donner, liste réduction fiscale ---------------------- */
.liste-fiscale { margin: 0 0 0.4rem; padding-left: 1.4rem; font-style: italic; color: var(--texte-secondaire); }
.liste-fiscale li { margin-bottom: 0.3rem; }

/* Header mobile */
.header-burger {
  background: none;
  border: none;
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
  display: none;
}
.header-burger span, .header-burger::before, .header-burger::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--noir);
  transition: transform var(--transition-rapide), opacity var(--transition-rapide);
}
.header-burger::before { top: 0; }
.header-burger span { top: 50%; transform: translateY(-50%); }
.header-burger::after { bottom: 0; }
.header-burger.ouvert::before { transform: translateY(10px) rotate(45deg); }
.header-burger.ouvert::after { transform: translateY(-10px) rotate(-45deg); }
.header-burger.ouvert span { opacity: 0; }

.menu-mobile {
  display: none;
  background: var(--gris-tres-clair);
  border-top: 1px solid #E2E2E2;
  padding: 1rem 0 2rem;
}
.menu-mobile.ouvert { display: block; }
.menu-mobile .container { display: flex; flex-direction: column; gap: 0.25rem; font-family: var(--police-nav); }
.menu-mobile a, .menu-mobile .menu-mobile-toggle {
  display: block;
  padding: 0.7rem 0;
  border-bottom: 1px solid #E2E2E2;
  font-size: 0.95rem;
  background: none; border: none; text-align: left; width: 100%; cursor: pointer;
}
.menu-mobile .sous-menu { padding-left: 1rem; display: none; }
.menu-mobile .sous-menu.ouvert { display: block; }

@media (max-width: 860px) {
  .header-nav-principale.nav-desktop { display: none; }
  .header-burger { display: block; }
  .header-bandeau-2 .container { justify-content: space-between; }
}
@media (min-width: 861px) {
  .menu-mobile, .header-burger { display: none !important; }
}

/* Pages plein écran sans header/footer (section 4.3) */
body.plein-ecran #site-header, body.plein-ecran #site-footer { display: none; }

/* ==========================================================================
   Footer (section 5)
   ========================================================================== */

#site-footer {
  background: var(--gris-tres-clair);
  padding-top: var(--espace-lg);
}
.footer-logo-lien img { height: 90px; width: auto; margin: 0 auto; cursor: pointer; }
.footer-patronage {
  color: var(--or);
  font-size: 0.8rem;
  text-align: center;
  margin: 0.75rem 0 1rem;
  font-family: var(--police-nav);
}
.footer-titre {
  font-family: var(--police-nav);
  font-weight: 700;
  color: var(--noir);
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  margin-top: 1.5rem;
}
.footer-liens a {
  display: block;
  padding: 0.25rem 0;
  color: var(--texte-secondaire);
  font-size: 0.9rem;
}
.footer-liens a:hover { color: var(--or); }

.footer-grille {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding-bottom: var(--espace-lg);
}
.footer-col-centre { text-align: center; }
.footer-col-droite { text-align: right; }
.footer-reseaux-centre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.footer-reseaux-centre .icone-reseau { width: 24px; height: 24px; }
.footer-newsletter-lien, .footer-actualite-lien {
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  background: none; border: none; color: var(--texte-secondaire);
}

.footer-bas {
  border-top: 1px solid #DCDCDC;
  padding: 1.25rem 0;
}
.footer-bas .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--texte-secondaire);
}
.footer-bas-liens a { text-decoration: underline; margin: 0 0.3rem; }
.footer-bas-liens span { color: var(--texte-tertiaire); }

@media (max-width: 860px) {
  .footer-grille { grid-template-columns: 1fr; text-align: center; }
  .footer-col-centre { order: -1; }
  .footer-bas .container { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   Utilitaires de mise en page (ratios — section 2.4, décisions validées)
   ========================================================================== */

.rangee { display: flex; gap: 2.5rem; align-items: flex-start; }
.rangee-inversee-mobile { flex-direction: row; }
.col-35 { flex: 0 0 35%; max-width: 35%; }
.col-65 { flex: 0 0 65%; max-width: 65%; }
.col-45 { flex: 0 0 45%; max-width: 45%; }
.col-55 { flex: 0 0 55%; max-width: 55%; }
.col-50 { flex: 0 0 50%; max-width: 50%; }
@media (max-width: 860px) {
  .rangee { flex-direction: column; }
  .col-35, .col-65, .col-45, .col-55, .col-50 { flex: 1 1 auto; max-width: 100%; }
}

.centre { text-align: center; }
.majuscules { text-transform: uppercase; letter-spacing: 0.03em; }

.eyebrow {
  font-family: var(--police-impact);
  font-size: var(--fs-label-pilier);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--or);
}

.titre-impact {
  font-family: var(--police-impact);
  font-weight: 800;
  font-size: var(--fs-impact);
  color: var(--noir);
  line-height: 1.1;
}

blockquote.exergue {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: var(--fs-exergue);
  color: var(--or);
  text-align: center;
  margin: var(--espace-lg) auto;
  max-width: 1300px;
  width: 85%;
  padding: 0 1.5rem;
  font-style: normal;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
