// source --> https://blog.eisn.fr/wp-content/uploads/hm_custom_css_js/custom.js?ver=1760399747 
document.addEventListener("DOMContentLoaded",()=>{const header=document.querySelector(".smart-header");if(header){let lastScroll=0,headerHeight=header.offsetHeight;window.addEventListener("scroll",()=>{const currentScroll=window.pageYOffset;header.style.top=currentScroll>lastScroll&&currentScroll>0?`-${headerHeight}px`:"0";lastScroll=currentScroll})}
const cards=document.querySelectorAll(".cat-desc");if(!cards.length)return;cards.forEach(card=>{const textEl=card.querySelector(".elementor-widget-container")||card;if(!textEl||textEl.innerText.trim().length<=200)return;const btn=document.createElement("button");btn.type="button";btn.className="cat-desc__toggle";btn.textContent="Voir plus";card.appendChild(btn);btn.addEventListener("click",()=>{const open=card.classList.toggle("is-open");btn.textContent=open?"Voir moins":"Voir plus"})})});