/* =====================================================================
   Mais Viagens · Camada "Spell UI" (V22)
   Efeitos inspirados na biblioteca Spell UI (spell.sh · licença MIT),
   reescritos em CSS + JS puros, sem React e sem build, para a HostGator.
   Componentes de origem: Blur Reveal, Shimmer Text, Rich Button,
   Flow Button, Tilt Card, Highlighted Text e Logos Carousel.
   Tudo é desligado automaticamente com "reduzir movimento" do sistema.
   ===================================================================== */

/* ---------- Blur Reveal: palavras surgem do desfoque ---------- */
.spell-palavra { display: inline-block; white-space: nowrap; }
.spell-revelar .spell-palavra {
  animation: spell-blur-in .62s cubic-bezier(.2,.7,.2,1) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + var(--atraso, 0ms));
}
@keyframes spell-blur-in {
  from { opacity: 0; filter: blur(12px); transform: translateY(10px); }
  to   { opacity: 1; filter: blur(0); transform: none; }
}
/* Subtítulo e botões do topo entram logo depois do título */
.spell-revelar-junto { animation: spell-sobe .7s cubic-bezier(.2,.7,.2,1) backwards; animation-delay: var(--atraso, 300ms); }
@keyframes spell-sobe { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* Elementos que entram ao rolar a página (só quando o JS está ativo) */
.spell-js .spell-aparecer { opacity: 0; transform: translateY(22px); filter: blur(8px); }
.spell-js .spell-aparecer.spell-visivel {
  opacity: 1; transform: none; filter: none;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1), filter .7s ease;
  transition-delay: calc(var(--i, 0) * 90ms);
}
.spell-js .spell-titulo-rolagem .spell-palavra { opacity: 0; }
.spell-js .spell-titulo-rolagem.spell-revelar .spell-palavra { opacity: 1; }

/* ---------- Shimmer Text: brilho que atravessa o destaque amarelo ---------- */
.spell-brilho {
  --brilho: rgba(255, 246, 214, .95);
  color: var(--amarelo);
  -webkit-text-fill-color: transparent;
  background: var(--amarelo) linear-gradient(90deg, var(--amarelo) 0%, var(--brilho) 40%, var(--brilho) 60%, var(--amarelo) 100%);
  background-repeat: no-repeat;
  background-size: 45% 200%;
  -webkit-background-clip: text; background-clip: text;
  animation: spell-brilho 4.2s linear 0s infinite;
}
@keyframes spell-brilho {
  0%   { background-position: -120% 0; }
  45%  { background-position: 260% 0; }
  100% { background-position: 260% 0; }
}

/* ---------- Rich Button: botão amarelo com volume ---------- */
.botao-primario {
  background: linear-gradient(180deg, #ffd05c 0%, var(--amarelo) 55%, #f0ab17 100%);
  border-color: color-mix(in srgb, #000 22%, var(--amarelo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 6px 18px -6px color-mix(in srgb, var(--amarelo) 55%, transparent), 0 2px 4px rgba(0,0,0,.25);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  transition: filter .2s, transform .15s, box-shadow .2s;
}
.botao-primario:hover { background: linear-gradient(180deg, #ffd05c 0%, var(--amarelo) 55%, #f0ab17 100%); filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 10px 26px -8px color-mix(in srgb, var(--amarelo) 70%, transparent), 0 2px 4px rgba(0,0,0,.25); }
.botao-primario:active { filter: brightness(.95); transform: translateY(1px); }
.botao-primario[disabled] { filter: none; transform: none; }

/* ---------- Flow Button: borda tracejada que corre no hover ---------- */
.spell-fluxo-host { position: relative; isolation: isolate; }
.spell-fluxo {
  position: absolute; inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px);
  overflow: visible; pointer-events: none; opacity: 0;
  transition: inset .2s ease-out, opacity .2s ease-out, width .2s ease-out, height .2s ease-out;
}
.spell-fluxo rect { fill: none; stroke: var(--fluxo-cor, var(--amarelo)); stroke-width: 1.6; stroke-dasharray: 6 4; }
.spell-fluxo-host:hover .spell-fluxo, .spell-fluxo-host:focus-visible .spell-fluxo { opacity: 1; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); }
.spell-fluxo-host:hover .spell-fluxo rect, .spell-fluxo-host:focus-visible .spell-fluxo rect { animation: spell-tracejado 1s linear infinite; }
@keyframes spell-tracejado { to { stroke-dashoffset: -10; } }
/* No hover a borda sólida some e entra a tracejada (comportamento original do Flow Button) */
.botao-contorno.spell-fluxo-host:hover { background: color-mix(in srgb, var(--amarelo) 10%, transparent); color: var(--amarelo); border-color: transparent; }
.botao-claro.spell-fluxo-host { --fluxo-cor: var(--texto); }
.botao-claro.spell-fluxo-host:hover { border-color: transparent; background: color-mix(in srgb, var(--texto) 6%, transparent); }

/* ---------- Tilt Card: cartão inclina e ganha holofote ---------- */
.spell-tilt { transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--escala, 1)); transition: transform .25s ease-out, border-color .3s, box-shadow .3s; will-change: transform; position: relative; }
.spell-tilt:hover { border-color: color-mix(in srgb, var(--amarelo) 35%, var(--linha)); box-shadow: 0 24px 50px -24px rgba(0,0,0,.65); }
.spell-holofote { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .3s; border-radius: inherit;
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(255,255,255,.11) 0%, rgba(255,255,255,0) 42%); }
.spell-tilt:hover .spell-holofote { opacity: 1; }

/* ---------- Highlighted Text: faixa amarela que sobe por trás do texto ---------- */
.spell-marca { position: relative; display: inline-block; isolation: isolate; padding-inline: .14em .18em; margin-inline: -.14em -.18em; transition: color .25s ease .28s; }
.spell-marca::before { content: ""; position: absolute; inset: .02em 0 -.02em; z-index: -1; background: var(--amarelo); border-radius: 4px; transform: scaleY(0); transform-origin: bottom; transition: transform .55s cubic-bezier(.34,1.3,.5,1) var(--atraso, 0ms); }
.spell-marca.spell-visivel { color: var(--petroleo) !important; -webkit-text-fill-color: var(--petroleo); }
.spell-marca.spell-visivel::before { transform: scaleY(1); }

/* ---------- Logos Carousel aplicado a destinos: troca com desfoque ---------- */
.spell-rotador { display: inline-grid; vertical-align: bottom; overflow: hidden; transition: width .45s cubic-bezier(.2,.7,.2,1); color: var(--menta); font-weight: 600; padding-bottom: .08em; }
.spell-rotador > span { grid-area: 1 / 1; justify-self: start; white-space: nowrap; opacity: 0; }
.spell-rotador > span.entra { animation: spell-entra .6s ease both; }
.spell-rotador > span.sai { animation: spell-sai .6s ease both; }
.spell-rotador > span.fixo { opacity: 1; }
@keyframes spell-entra { from { transform: translateY(70%); filter: blur(4px); opacity: 0; } to { transform: none; filter: blur(0); opacity: 1; } }
@keyframes spell-sai { from { transform: none; filter: blur(0); opacity: 1; } to { transform: translateY(-70%); filter: blur(4px); opacity: 0; } }

/* Respeito a "reduzir movimento": nada se move, tudo aparece pronto */
@media (prefers-reduced-motion: reduce) {
  .spell-js .spell-aparecer, .spell-js .spell-titulo-rolagem .spell-palavra { opacity: 1 !important; transform: none !important; filter: none !important; }
  .spell-brilho { -webkit-text-fill-color: currentColor; background: none; }
  .spell-tilt { transform: none !important; }
}
