/* Atelier Latitude — Header fixe, masqué au défilement vers le bas, barre de progression
   Thème enfant Divi : assets/al-header.css (chargé par functions.php)
   S'applique uniquement à la section Divi dont l'ID CSS est « header-principal »
   (Section > Avancé > ID et classes CSS > ID CSS). */
:root {
  --al-header-bg: rgba(245, 241, 234, .9); /* fond après 24 px de défilement */
  --al-header-line: rgba(52, 46, 41, .1);  /* filet sous le header */
  --al-progress: #8C7B6B;                  /* barre de progression */
}

/* 1. Section fixée en haut de l'écran, au premier plan */
body:not(.et-fb) #header-principal {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 99989;
  background-color: transparent !important;
  box-shadow: inset 0 -1px 0 transparent !important;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1), background-color .5s ease, box-shadow .5s ease;
}
body:not(.et-fb) :is(.et-l--header, .et_builder_inner_content):has(#header-principal) { position: relative; z-index: 99989; }
body.admin-bar:not(.et-fb) #header-principal { top: 32px; }
@media (max-width: 782px) { body.admin-bar:not(.et-fb) #header-principal { top: 46px; } }

/* Pages sans hero : le contenu démarre sous le header */
body:not(.et-fb):not(:has(.al-hero)):has(#header-principal) #et-main-area { padding-top: var(--al-header-h, 80px); }

/* 2. Fond crème flouté après 24 px de défilement */
html.al-hdr-scrolled body:not(.et-fb) #header-principal {
  background-color: var(--al-header-bg) !important;
  box-shadow: inset 0 -1px 0 var(--al-header-line) !important;
  -webkit-backdrop-filter: saturate(1.3) blur(16px);
  backdrop-filter: saturate(1.3) blur(16px);
}

/* 3. Masqué quand on descend, réaffiché quand on remonte (et à la navigation clavier) */
html.al-hdr-hidden body:not(.et-fb) #header-principal { transform: translateY(-100%); }
html.al-hdr-hidden body:not(.et-fb) #header-principal:has(:focus-visible) { transform: none; }

/* 4. Barre de progression (ajoutée par al-header.js) */
#header-principal .al-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; overflow: hidden; pointer-events: none; }
#header-principal .al-progress span { display: block; height: 100%; background: var(--al-progress); transform: scaleX(0); transform-origin: 0 50%; }

@media (prefers-reduced-motion: reduce) {
  #header-principal { transition: none !important; }
}
