/* Vortex — painel Clima (26/10/2026)
   Painel de instrumento com cena animada de fundo (sol, estrelas, nuvens, chuva, trovoada, neblina),
   ícones que se mexem, curva das 24 h e barras de temperatura da semana. Respeita "reduzir movimento". */

.clima { overflow: hidden; isolation: isolate; }
.clima > :not(.clima-cena) { position: relative; z-index: 1; }
.clima .panel-head { margin-bottom: 6px; }
#clima-corpo.entra { animation: clima-entra .6s ease both; }

/* ---------------------------------------------------------------- cena de fundo */
.clima-cena { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: background .9s ease; }
.clima-cena[data-cena="limpo-dia"], .clima-cena[data-cena="parcial-dia"] {
  background: radial-gradient(circle at 92% 2%, rgba(255, 178, 62, .22), transparent 46%), linear-gradient(180deg, rgba(255, 178, 62, .05), transparent 40%); }
.clima-cena[data-cena="limpo-noite"], .clima-cena[data-cena="parcial-noite"] {
  background: radial-gradient(circle at 90% 4%, rgba(140, 160, 255, .17), transparent 44%), linear-gradient(180deg, rgba(80, 100, 220, .09), transparent 42%); }
.clima-cena[data-cena^="nublado"] { background: linear-gradient(180deg, rgba(150, 172, 192, .12), transparent 48%); }
.clima-cena[data-cena^="chuva"] { background: linear-gradient(180deg, rgba(82, 229, 242, .11), rgba(60, 90, 170, .05) 60%, transparent); }
.clima-cena[data-cena^="tempestade"] { background: linear-gradient(180deg, rgba(120, 108, 205, .18), rgba(60, 60, 140, .05) 60%, transparent); }
.clima-cena[data-cena^="neblina"] { background: linear-gradient(180deg, rgba(190, 206, 222, .12), transparent 56%); }
.clima-cena > i { position: absolute; display: block; }
.cena-sol { top: -46px; right: -46px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 80, .55), rgba(255, 178, 62, .12) 55%, transparent 70%); animation: clima-pulsa 7s ease-in-out infinite; }
.cena-estrela { width: 2.5px; height: 2.5px; border-radius: 50%; background: #dfe7ff; box-shadow: 0 0 6px rgba(223, 231, 255, .9); animation: clima-brilha 4s ease-in-out infinite; }
.cena-nuvem { left: -240px; border-radius: 999px; background: rgba(214, 227, 239, .08); filter: blur(14px); animation: clima-deriva 70s linear infinite; }
.cena-gota { top: -24px; width: 1px; height: 16px; background: linear-gradient(180deg, transparent, rgba(82, 229, 242, .9)); animation: clima-chove 1s linear infinite; }
.cena-raio { inset: 0; background: rgba(200, 190, 255, .0); animation: clima-relampago 7s infinite; }
.cena-neblina { left: -30%; width: 160%; height: 46px; border-radius: 50%; background: rgba(205, 218, 232, .10); filter: blur(16px); animation: clima-neblina 26s ease-in-out infinite alternate; }

/* ---------------------------------------------------------------- agora */
.clima-hero { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: center; }
.clima-icone svg { display: block; width: 84px; height: 84px; filter: drop-shadow(0 0 16px rgba(82, 229, 242, .16)); animation: clima-flutua 6s ease-in-out infinite; }
.clima-temp { display: flex; align-items: flex-start; font: 500 50px/1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.clima-temp small { margin: 6px 0 0 3px; font: 500 16px/1 var(--display); color: var(--mute); }
.clima-texto { margin-top: 5px; font-weight: 600; font-size: 14.5px; }
.clima-sub { margin-top: 2px; font-size: 12.5px; color: var(--mute); }
.clima-sub .max { color: var(--ember); }
.clima-sub .min { color: #6aa8ff; }
.clima-resumo { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; padding: 6px 10px 6px 8px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(82, 229, 242, .05); }
.cr-ic svg { display: block; width: 22px; height: 22px; }
.cr-ic svg * { animation: none !important; }

/* ---------------------------------------------------------------- medidores */
.clima-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.clima-stat { padding: 7px 4px 6px; text-align: center; border: 1px solid rgba(82, 229, 242, .1); border-radius: 8px; background: rgba(82, 229, 242, .045);
  transition: border-color .2s, background .2s, transform .2s; }
.clima-stat:hover { border-color: var(--line-strong); background: rgba(82, 229, 242, .09); transform: translateY(-1px); }
.clima-stat > span { display: block; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.clima-stat b { display: block; margin-top: 2px; font: 500 16px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.clima-stat b small { font: 500 10px/1 var(--text); color: var(--mute); }
.clima-stat em { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 1.25em; font-style: normal; font-size: 10.5px; color: var(--mute); }
.cl-seta { color: var(--ion); transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.uv-ok { color: var(--signal) !important; } .uv-med { color: #ffd166 !important; } .uv-alto { color: var(--ember) !important; } .uv-muito { color: var(--alarm) !important; }

/* ---------------------------------------------------------------- arco do sol */
.clima-sol { margin: 8px 0 0; }
.clima-sol svg { display: block; width: 100%; height: auto; overflow: visible; }
.cs-horizonte { stroke: var(--line); stroke-width: 1; }
.cs-trilha { fill: none; stroke: var(--faint); stroke-width: 1.3; stroke-dasharray: 2 4; stroke-linecap: round; }
.cs-feito { fill: none; stroke: var(--ember); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: var(--f, 0) 1; filter: drop-shadow(0 0 4px rgba(255, 178, 62, .55)); animation: clima-arco 1.6s .2s cubic-bezier(.3, .7, .2, 1) both; }
.cs-pulso { transform-box: fill-box; transform-origin: center; animation: clima-ping 2.4s ease-out infinite; }
.cs-txt { font: 500 10.5px var(--text); fill: var(--mute); }
.cs-txt.meio { fill: #a9bccd; }

/* ---------------------------------------------------------------- curva das 24 h */
.clima-secao { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 16px; margin: 10px 0 2px; font-size: 11.5px; letter-spacing: .04em; color: var(--mute); }
#clima-hcap { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.clima-horas.on ~ * { }
.clima-leg { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 10.5px; }
.clima-leg i { display: inline-block; }
.lg-temp { width: 12px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #52e5f2, #ffb23e); margin-left: 4px; }
.lg-chuva { width: 4px; height: 8px; border-radius: 1.5px; background: rgba(82, 229, 242, .55); margin-left: 6px; }
.clima-horas { touch-action: pan-y; cursor: crosshair; }
.clima-horas svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-noite { fill: rgba(120, 140, 255, .07); }
.ch-linha { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; filter: drop-shadow(0 0 5px rgba(82, 229, 242, .35)); animation: clima-traco 1.5s .1s cubic-bezier(.4, .1, .2, 1) both; }
.ch-area { animation: clima-aparece 1s .7s ease both; }
.ch-chuva { fill: rgba(82, 229, 242, .55); transform-box: fill-box; transform-origin: bottom; animation: clima-cresce .7s .5s cubic-bezier(.3, .8, .3, 1) both; }
.ch-hora { font: 500 9.5px var(--text); fill: var(--mute); }
.ch-temp { font: 500 10.5px var(--display); fill: var(--fog); }
.ch-guia { stroke: rgba(214, 227, 239, .35); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; transition: opacity .15s; }
.ch-ponto { stroke: var(--abyss); stroke-width: 2; opacity: 0; transition: opacity .15s; }
.clima-horas.on .ch-guia, .clima-horas.on .ch-ponto { opacity: 1; }
.ch-agora-anel { transform-box: fill-box; transform-origin: center; animation: clima-ping 2.4s ease-out infinite; }

/* ---------------------------------------------------------------- semana */
.clima-dias { display: grid; gap: 1px; margin: 4px 0 0; padding: 0; list-style: none; }
.clima-dia { display: grid; grid-template-columns: 44px 24px 30px 28px minmax(0, 1fr) 28px; gap: 7px; align-items: center; padding: 4px 2px; font-size: 13px; border-radius: 6px;
  transition: background .15s; animation: clima-entra .5s ease both; }
.clima-dia:hover { background: rgba(82, 229, 242, .06); }
.cd-nome { font-weight: 500; }
.clima-dia:first-child .cd-nome { color: var(--ion); }
.cd-ic svg { display: block; width: 24px; height: 24px; }
.cd-ic svg * { animation: none !important; }
.cd-chuva { text-align: right; font-size: 11.5px; color: #6aa8ff; }
.cd-chuva.alta { color: var(--ion); font-weight: 600; }
.cd-min { text-align: right; color: var(--mute); font-variant-numeric: tabular-nums; }
.cd-max { font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-barra { position: relative; height: 5px; border-radius: 3px; background: rgba(116, 137, 160, .2); }
.cd-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; transform-origin: left center; animation: clima-barra .8s cubic-bezier(.3, .8, .3, 1) both; }
.cd-agora { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--fog); border: 2px solid var(--abyss); box-shadow: 0 0 8px rgba(214, 227, 239, .65); }

.clima-rodape { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 10px; font-size: 11px; color: var(--mute); }
.clima-rodape .antigo { color: var(--ember); }

/* botão de atualizar */
#clima-atualizar svg { transition: transform .5s ease; }
#clima-atualizar:hover svg { transform: rotate(90deg); }
#clima-atualizar.gira svg { animation: clima-gira .8s linear infinite; }

/* ---------------------------------------------------------------- ícones animados */
.ic-raios { transform-box: fill-box; transform-origin: center; animation: clima-gira 28s linear infinite; }
.ic-sol { transform-box: fill-box; transform-origin: center; animation: clima-pulsa 5s ease-in-out infinite; }
.ic-nuvem { animation: clima-balanca 7s ease-in-out infinite; }
.ic-lua { animation: clima-pulsa 6s ease-in-out infinite; }
.ic-estrela { animation: clima-brilha 3s ease-in-out infinite; }
.ic-estrela.e2 { animation-delay: 1.2s; }
.ic-gota { animation: clima-gota 1.1s ease-in infinite; }
.ic-gota.g2 { animation-delay: .35s; } .ic-gota.g3 { animation-delay: .7s; }
.ic-raio { transform-box: fill-box; transform-origin: center; animation: clima-raio 3.2s ease-in-out infinite; }
.ic-nev { animation: clima-nev 4s ease-in-out infinite alternate; }
.ic-nev.n2 { animation-delay: -1.3s; } .ic-nev.n3 { animation-delay: -2.4s; }

/* ---------------------------------------------------------------- movimento */
@keyframes clima-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes clima-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes clima-flutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes clima-pulsa { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .82; transform: scale(1.06); } }
@keyframes clima-brilha { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes clima-gira { to { transform: rotate(360deg); } }
@keyframes clima-balanca { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2.5px); } }
@keyframes clima-gota { 0% { transform: translateY(-3px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }
@keyframes clima-raio { 0%, 62%, 100% { opacity: .85; transform: scale(1); } 66% { opacity: 1; transform: scale(1.12); } 70% { opacity: .5; } 74% { opacity: 1; transform: scale(1.06); } }
@keyframes clima-nev { from { transform: translateX(-3px); opacity: .55; } to { transform: translateX(3px); opacity: 1; } }
@keyframes clima-deriva { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 480px)); } }
@keyframes clima-chove { from { transform: translateY(0); } to { transform: translateY(760px); } }
@keyframes clima-relampago { 0%, 90%, 100% { background: rgba(200, 190, 255, 0); } 91% { background: rgba(200, 190, 255, .20); } 92% { background: rgba(200, 190, 255, .02); } 93.5% { background: rgba(200, 190, 255, .16); } 96% { background: rgba(200, 190, 255, 0); } }
@keyframes clima-neblina { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes clima-traco { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes clima-cresce { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes clima-barra { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes clima-arco { from { stroke-dasharray: 0 1; } to { stroke-dasharray: var(--f, 0) 1; } }
@keyframes clima-ping { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }

@media (max-width: 1000px) and (min-width: 821px) { .clima-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .rail-left .clima { flex: 1.25 1 0; } }
@media (prefers-reduced-motion: reduce) {
  .clima *, .clima *::before, .clima *::after { animation: none !important; transition-duration: .01ms !important; }
  .cena-gota, .cena-nuvem, .cena-raio { display: none; }
}

/* minimizado (28/10/2026): só o clima atual */
.clima-botoes { display: flex; gap: 2px; }
#clima-minimizar svg { width: 16px; height: 16px; transition: transform .35s ease; }
.clima.mini #clima-minimizar svg { transform: rotate(180deg); }
.clima.mini .clima-resumo, .clima.mini .clima-sol, .clima.mini .clima-secao, .clima.mini .clima-horas,
.clima.mini .clima-dias, .clima.mini .clima-rodape { display: none; }
.clima.mini .clima-stats { margin-top: 10px; }
.clima.mini .clima-hero, .clima.mini .clima-stats { animation: clima-entra .35s ease both; }
