), assim ele escapa de qualquer transform aplicado ao body. */ if (root.parentElement !== document.documentElement) { document.documentElement.appendChild(root); }var header = root.querySelector('.rlz-header');/* Reforco continuo: a cada scroll, garante que o header segue como irmao do body, com posicao e visibilidade corretas via estilo inline com prioridade "important" - isso vence qualquer regra externa de CSS, mesmo outra com !important. */ if (header) { var forceFixed = function () { header.style.setProperty('position', 'fixed', 'important'); header.style.setProperty('top', '0', 'important'); header.style.setProperty('left', '0', 'important'); header.style.setProperty('right', '0', 'important'); header.style.setProperty('width', '100%', 'important'); header.style.setProperty('z-index', '2147483647', 'important'); header.style.setProperty('transform', 'translateZ(0)', 'important'); };var onHeaderScroll = function () { if (window.scrollY > 40) { header.classList.add('rlz-header--scrolled'); } else { header.classList.remove('rlz-header--scrolled'); } }; forceFixed(); onHeaderScroll();/* Throttle via requestAnimationFrame: so alterna a classe visual (sombra) no scroll - NAO reescreve mais position/top/z-index a cada frame. Reescrever esses estilos via JS constantemente pode forcar o navegador a recompor a camada do header repetidamente, competindo com a camada de GPU do carrossel (translate3d) e causando um "pisca" onde o carrossel aparece por cima por um instante. O CSS "position: fixed !important" ja e suficiente e estavel sozinho, sem precisar de reforco constante via JS. */ var scrollTicking = false; window.addEventListener('scroll', function () { if (!scrollTicking) { window.requestAnimationFrame(function () { onHeaderScroll(); scrollTicking = false; }); scrollTicking = true; } }, { passive: true }); }/* Header e fixo e sai do fluxo normal da pagina: sem isso, o conteudo do post (que nao tem hero proprio como as outras paginas) fica escondido embaixo do header. Empurra o para baixo pela altura real do header, recalculando se a tela mudar de tamanho. Tambem grava essa altura numa CSS var global (--rlz-header-h). */ if (header) { var pushContentDown = function () { var h = header.offsetHeight; document.body.style.paddingTop = h + 'px'; document.documentElement.style.setProperty('--rlz-header-h', h + 'px'); }; pushContentDown(); window.addEventListener('resize', pushContentDown); window.addEventListener('load', pushContentDown); if (document.fonts && document.fonts.ready) { document.fonts.ready.then(pushContentDown); } }var burger = root.querySelector('#rlz-burger'), nav = root.querySelector('#rlz-nav'); function closeMenu() { nav.classList.remove('is-open'); burger.classList.remove('is-open'); burger.setAttribute('aria-expanded', 'false'); document.body.style.overflow = ''; nav.querySelectorAll('.rlz-nav__item').forEach(function (it) { it.classList.remove('rlz-sub-open'); }); } if (burger && nav) { burger.addEventListener('click', function () { var open = nav.classList.toggle('is-open'); burger.classList.toggle('is-open', open); burger.setAttribute('aria-expanded', open ? 'true' : 'false'); document.body.style.overflow = open ? 'hidden' : ''; if (!open) { nav.querySelectorAll('.rlz-nav__item').forEach(function (it) { it.classList.remove('rlz-sub-open'); }); } });var navClose = root.querySelector('#rlz-nav-close'); if (navClose) { navClose.addEventListener('click', closeMenu); }nav.querySelectorAll('.rlz-nav__toggle').forEach(function (t) { t.addEventListener('click', function (e) { if (window.matchMedia('(max-width: 980px)').matches) { e.preventDefault(); t.closest('.rlz-nav__item').classList.toggle('rlz-sub-open'); } }); });nav.querySelectorAll('.rlz-nav__link, .rlz-nav__sub a').forEach(function (a) { a.addEventListener('click', closeMenu); }); } })();