/* ESAP — Cohérence visuelle transversale, 2026-11-19.
   Cible uniquement l'accueil transitoire (#esap-v4) et les maquettes Divi ESAP.
   Ne modifie pas les blocs Divi ni les mecanismes existants de protection. */

/* Confidentialite : meme rythme, meme typographie et meme hover que les actions voisines. */
#esap-v4 .site-head .head-tools > a.esap-privacy-nav--header,
#esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  width:auto;
  height:auto;
  min-height:48px !important;
  margin:0 !important;
  padding:9px 15px !important;
  border:1px solid var(--border,var(--esap-border,#cbdde8)) !important;
  border-radius:40px !important;
  background:transparent !important;
  color:var(--ink,var(--esap-ink,#123848)) !important;
  font-family:inherit !important;
  font-size:.84em !important;
  font-weight:850 !important;
  line-height:1.2 !important;
  letter-spacing:normal !important;
  text-decoration:none !important;
  text-underline-offset:initial !important;
  opacity:1 !important;
  white-space:nowrap;
  box-sizing:border-box;
  transition:background-color .18s ease,border-color .18s ease !important;
}
#esap-v4 .site-head .head-tools > a.esap-privacy-nav--header svg,
#esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header svg {
  width:22px !important;
  height:22px !important;
  flex:0 0 22px !important;
}
#esap-v4 .site-head .head-tools > a.esap-privacy-nav--header:is(:hover,:focus-visible),
#esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header:is(:hover,:focus-visible) {
  background:var(--light,var(--esap-light,#d6ecfb)) !important;
  text-decoration:none !important;
  opacity:1 !important;
}
#esap-v4 .site-head .head-tools > a.esap-privacy-nav--header:focus-visible,
#esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header:focus-visible {
  outline:3px solid var(--blue,var(--esap-blue,#1f83ab)) !important;
  outline-offset:3px;
}

/* Le second lien de confidentialite en dessous de l'en-tete Divi est superflu. */
#esap-tb-header .esap-tb-legal {display:none !important;}

/* Une seule porte de signalement dans l'en-tete, puis le panneau sous le footer.
   Conserver les contacts utiles (telephone, e-mail et trois unites). */
#esap-v4 footer.micro .shortcuts > a[data-open-safety],
#esap-v4 footer.micro .shortcuts > a.esap-privacy-nav--footer,
#esap-tb-footer .shortcuts > a[data-esap-global-safety],
#esap-tb-footer .shortcuts > a[href*="/politique-de-confidentialite"],
#esap-tb-footer .shortcuts > a.esap-privacy-nav--footer {
  display:none !important;
}

/* Aligner les trois commandes restantes, sans toucher a leurs actions. */
#esap-v4 footer.micro .shortcuts,
#esap-tb-footer .micro .shortcuts {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px clamp(12px,1.5vw,24px);
  flex-wrap:wrap;
}
#esap-v4 footer.micro .shortcuts > :is(a,button),
#esap-tb-footer .micro .shortcuts > a,
#esap-tb-footer .micro .shortcuts > .units,
#esap-tb-footer .micro .shortcuts > .units > summary {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  vertical-align:middle;
  margin:0;
  min-height:44px;
  padding:8px 0;
  line-height:1.2;
}
#esap-v4 footer.micro .shortcuts > button {cursor:pointer;}

/* La narration transitoire ne doit pas etre proposee par erreur hors de l'accueil.
   Les lecteurs contextuels pourront declarer l'attribut data-esap-audio-context="ready" sur body. */
body:not(.page-id-142):not([data-esap-audio-context="ready"]) #esap-tb-header #esap-tb-audio {display:none!important;}

/* Mobile : eviter le chevauchement des boutons avec la marque. */
@media (max-width:980px) {
  #esap-v4 .site-head .head-tools > a.esap-privacy-nav--header,
  #esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header {
    padding:9px 12px !important;
  }
}
@media (max-width:760px) {
  #esap-v4 footer.micro .shortcuts,
  #esap-tb-footer .micro .shortcuts {justify-content:flex-start;}
}
@media (max-width:630px) {
  /* La page transitoire utilise une grille, avec outils affiches en display:contents. */
  #esap-v4 .site-head {
    grid-template-areas:'brand safety' 'brand tools' '. privacy';
  }
  #esap-v4 .site-head .head-tools > a.esap-privacy-nav--header {
    grid-area:privacy;
    justify-self:end;
    align-self:center;
    min-height:38px !important;
    padding:7px 10px !important;
    margin-top:1px !important;
  }
  /* Le bandeau global a lui aussi des outils en display:contents : icone dediee. */
  #esap-tb-header .site-head {padding-right:155px !important;}
  #esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header {
    position:absolute;
    right:12px;
    bottom:9px;
    height:38px;
    width:38px !important;
    min-height:38px !important;
    padding:6px !important;
  }
  #esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header span {
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    margin:-1px !important;
    padding:0 !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    white-space:nowrap;
  }
  #esap-tb-header .head-tools .settings-button {right:59px !important;}
  #esap-tb-header .head-tools .audio-switch {right:106px !important;}
}
@media (prefers-reduced-motion:reduce) {
  #esap-v4 .site-head .head-tools > a.esap-privacy-nav--header,
  #esap-tb-header .site-head .head-tools > a.esap-privacy-nav--header {transition:none!important;}
}
