/* ==========================================================================
   Efeitos de scroll — Veneza (parallax, reveal, contagem, barra de leitura)
   Carregado só em: Início, A Veneza, Soluções, Estrutura, Conteúdos e artigos.
   NÃO carrega em: Contato, Política de Privacidade, Termos de Uso, 404, editor do Elementor.

   SELETORES USADOS (nenhuma classe precisa ser adicionada no Elementor)
   ----------------------------------------------------------------------
   Parallax (quadros .img; foto como fundo do quadro OU <img>/widget Imagem dentro dele)
     .dark > .wrap > .img      imagem do hero (Início, A Veneza, Soluções, Estrutura)
     #sobre-grid .img          imagem do bloco "A Veneza" (Início)
     .feat .img                artigo em destaque (Conteúdos)
   Reveal (fade + translateY 24px, 600ms, ease-out, escalonado em 80ms; só abaixo da dobra)
     .cards .card              cards de serviços (Início)
     #serv .cols3 .col         3 serviços (Soluções)
     .vals .val                Diferenciais (Estrutura) e Valores (A Veneza)
     .cols3 .col               Propósito / Missão / Visão (só em A Veneza)
     .countries .country       Matriz e Filiais (A Veneza)
     .facts > div              números de destaque (A Veneza)
     .articles .art            listagem de Conteúdos e "Continue lendo"
   Contagem (uma vez, ao entrar na tela): .stats b e .facts b que sejam "17+" ou "17+ anos"
     ("2009", "Uma", "Mercosul" ficam como estão)
   Barra de leitura: body.single-post, progresso medido só em .vz-article-body (corpo do artigo)
   Cabeçalho que encolhe: ver header.css (todas as páginas)

   COMO DESLIGAR
   - Num elemento (ou grupo): adicione a classe  vz-no-motion  em Avançado > Classes CSS.
   - Tudo: prefers-reduced-motion: reduce desliga parallax, reveal, contagem e barra.

   REGRAS
   - Elementos visíveis por padrão: o estado inicial oculto só existe com html.vz-motion
     (classe colocada pelo JS). Sem JS, tudo aparece.
   - Só transform e opacity são animados.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reveal
   -------------------------------------------------------------------------- */
html.vz-motion .vz-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  /* !important: o hover dos boxes (.elementor .e-con.card…) tem especificidade maior e anularia o atraso/escalonamento */
  transition: opacity .6s ease-out calc(var(--vz-i, 0) * 80ms), transform .6s ease-out calc(var(--vz-i, 0) * 80ms) !important;
  will-change: opacity, transform;
}
html.vz-motion .vz-reveal.vz-in { opacity: 1; transform: none; }
/* Quem recebe foco aparece na hora */
html.vz-motion .vz-reveal:focus-within { opacity: 1; transform: none; transition: opacity .2s ease-out, transform .2s ease-out !important; }

/* --------------------------------------------------------------------------
   Contagem de números (largura reservada pelo JS: sem CLS)
   -------------------------------------------------------------------------- */
.vz-count { display: inline-block; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Parallax
   -------------------------------------------------------------------------- */
.vz-px-frame { position: relative; overflow: hidden; isolation: isolate; }
.vz-px-host { background: none !important; }           /* o fundo foi copiado para a camada interna */
.vz-px-layer { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
/* <img> / widget Imagem dentro do quadro: preenche o quadro (altura reservada, sem CLS) */
.vz-px-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vz-px-frame .elementor-widget-image,
.vz-px-frame .elementor-widget-image .elementor-widget-container { height: 100%; }

html.vz-px .vz-px-target { transform: scale(1.12); will-change: transform; }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    html.vz-px .vz-px-frame { view-timeline-name: --vzpx; }
    html.vz-px .vz-px-target {
      animation: vz-px linear both;
      animation-timeline: --vzpx;
      animation-range: cover;
    }
  }
}
/* Deslocamento máx. ±6% da altura do quadro com escala 1.12 (a sobra de cada lado é 6%: nunca aparece borda) */
@keyframes vz-px {
  from { transform: translate3d(0, -6%, 0) scale(1.12); }
  to   { transform: translate3d(0,  6%, 0) scale(1.12); }
}

/* --------------------------------------------------------------------------
   Barra de leitura (só artigos)
   -------------------------------------------------------------------------- */
/* Acompanha só o corpo do artigo (.vz-article-body): 0 quando o topo do texto chega ao topo da tela,
   1 quando o fim do texto chega ao fim da tela. O JS escreve --vz-prog (um único listener passivo + rAF). */
@media (prefers-reduced-motion: no-preference) {
  body.single-post:not(.elementor-editor-active):not(.elementor-editor-preview)::before {
    content: "";
    position: fixed; top: 0; left: 0; z-index: 99;
    width: 100%; height: 3px;
    background: #2FBCCD;
    transform-origin: 0 50%;
    transform: scaleX(var(--vz-prog, 0));
    pointer-events: none;
  }
  /* Barra de administração do WordPress (logado): 32px no desktop, 46px em telas até 782px;
     até 600px ela rola junto com a página (position:absolute), então a barra de leitura volta ao topo */
  body.admin-bar.single-post:not(.elementor-editor-active):not(.elementor-editor-preview)::before { top: 32px; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 782px) { body.admin-bar.single-post:not(.elementor-editor-active):not(.elementor-editor-preview)::before { top: 46px; } }
@media (prefers-reduced-motion: no-preference) and (max-width: 600px) { body.admin-bar.single-post:not(.elementor-editor-active):not(.elementor-editor-preview)::before { top: 0; } }

/* --------------------------------------------------------------------------
   Segurança: movimento reduzido, editor e opt-out deixam tudo estático e visível
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html.vz-motion .vz-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html.vz-px .vz-px-target { animation: none !important; transform: none !important; }
}
.vz-no-motion .vz-reveal, .vz-no-motion.vz-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
body.elementor-editor-active .vz-reveal, body.elementor-editor-preview .vz-reveal { opacity: 1 !important; transform: none !important; }

/* Estrutura: entrada dos textos dos blocos (sobe e aparece em sequencia; o JS devolve ao normal depois) */
html.vz-motion .dif-txt > .vz-reveal{
  transform:translate3d(0,34px,0);
  transition:opacity .9s cubic-bezier(.2,.7,.2,1) calc(var(--vz-i,0)*150ms),transform .9s cubic-bezier(.2,.7,.2,1) calc(var(--vz-i,0)*150ms)!important}
html.vz-motion .dif-txt > .vz-reveal.vz-in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){html.vz-motion .dif-txt > .vz-reveal{opacity:1!important;transform:none!important;transition:none!important}}
