/* =====================================================================
   WEATHER CYCLE HERO (optional, theme-independent)
   Turn on with ?hero=weather or SITE.HERO_MODE = "weather" in config.js.
   Layers added inside .hero-home by assets/js/weather.js:
     .hero-img (base photo, graded per phase with CSS filter)
     .wx-lights (night window/porch glows, positioned in % over the photo)
     .wx-grade-* (one gradient overlay per phase, crossfaded with opacity)
     .wx-sun, .wx-fog2, .wx-flash (sky-only soft lightning), canvas.wx-rain
   Only opacity/filter/transform change; all transitions are ~2.5s crossfades.
   ===================================================================== */
.hero-weather .hero-img{transition:filter 2.5s ease-in-out}
.hero-weather[data-wx="fog"] .hero-img{filter:saturate(.85) brightness(1.02)}
.hero-weather[data-wx="light-rain"] .hero-img{filter:saturate(.72) brightness(.88)}
.hero-weather[data-wx="heavy-rain"] .hero-img{filter:saturate(.58) brightness(.72) contrast(1.05)}
.hero-weather[data-wx="thunderstorm"] .hero-img{filter:saturate(.48) brightness(.56) contrast(1.08)}
.hero-weather[data-wx="dawn"] .hero-img{filter:saturate(1.12) brightness(.95) sepia(.18) hue-rotate(-8deg)}
.hero-weather[data-wx="sunny"] .hero-img{filter:saturate(1.3) brightness(1.08) contrast(1.06)}
.hero-weather[data-wx="night"] .hero-img{filter:saturate(.7) brightness(.38) hue-rotate(12deg)}

.wx-layer{position:absolute;inset:0;z-index:1;pointer-events:none;opacity:0;transition:opacity 2.5s ease-in-out}
.wx-grade-light-rain{background:linear-gradient(180deg,rgba(70,82,104,.35),rgba(70,82,104,.15))}
.wx-grade-heavy-rain{background:linear-gradient(180deg,rgba(40,48,66,.5),rgba(40,48,66,.25))}
.wx-grade-thunderstorm{background:linear-gradient(180deg,rgba(18,22,38,.62),rgba(24,28,44,.3))}
.wx-grade-dawn{background:linear-gradient(180deg,rgba(255,138,128,.32) 0%,rgba(255,190,120,.22) 45%,rgba(255,214,150,.06) 100%)}
.wx-grade-sunny{background:linear-gradient(180deg,rgba(120,190,255,.18) 0%,rgba(255,240,200,0) 55%)}
.wx-grade-night{background:linear-gradient(180deg,rgba(6,14,52,.62) 0%,rgba(10,22,70,.42) 60%,rgba(6,12,40,.55) 100%)}
.hero-weather[data-wx="light-rain"] .wx-grade-light-rain,.hero-weather[data-wx="heavy-rain"] .wx-grade-heavy-rain,
.hero-weather[data-wx="thunderstorm"] .wx-grade-thunderstorm,.hero-weather[data-wx="dawn"] .wx-grade-dawn,
.hero-weather[data-wx="sunny"] .wx-grade-sunny,.hero-weather[data-wx="night"] .wx-grade-night{opacity:1}

/* Sun glow (dawn + sunny) */
.wx-sun{background:radial-gradient(38% 46% at 52% 8%,rgba(255,236,170,.55),rgba(255,214,140,.18) 45%,transparent 70%)}
.hero-weather[data-wx="sunny"] .wx-sun{opacity:1}
.hero-weather[data-wx="dawn"] .wx-sun{opacity:.7;background:radial-gradient(45% 40% at 55% 30%,rgba(255,170,140,.5),rgba(255,200,150,.15) 50%,transparent 72%)}

/* Extra fog bank (fog, rain, dawn) */
.wx-fog2{inset:-10% -25%;filter:blur(30px);
  background:radial-gradient(60% 28% at 40% 58%,rgba(245,240,232,.75),transparent 70%),radial-gradient(50% 24% at 75% 52%,rgba(240,236,230,.6),transparent 70%);
  animation:wxfog 26s ease-in-out infinite alternate}
@keyframes wxfog{from{transform:translate3d(-8%,0,0)}to{transform:translate3d(8%,-1%,0)}}
.hero-weather[data-wx="fog"] .wx-fog2{opacity:.85}
.hero-weather[data-wx="light-rain"] .wx-fog2{opacity:.45}
.hero-weather[data-wx="heavy-rain"] .wx-fog2,.hero-weather[data-wx="thunderstorm"] .wx-fog2{opacity:.25}
.hero-weather[data-wx="dawn"] .wx-fog2{opacity:.4}
.hero-weather[data-wx="sunny"] .hero-fog{opacity:.12;transition:opacity 2.5s}
.hero-weather[data-wx="night"] .hero-fog{opacity:.15;transition:opacity 2.5s}

/* Soft lightning: SKY ONLY (top ~48% of the hero, faded radial glow, max ~55% white).
   Never a full-screen strobe. Timing is limited in weather.js (max 3 flashes in any 1 s). */
.wx-flash{bottom:auto;height:48%;transition:opacity .12s ease-out;
  background:radial-gradient(70% 90% at 58% 0%,rgba(225,232,255,.55),rgba(200,210,255,.16) 55%,transparent 80%)}

/* Rain canvas */
.wx-rain{position:absolute;inset:0;z-index:1;width:100%;height:100%;pointer-events:none;opacity:0;transition:opacity 2.5s ease-in-out}
.hero-weather[data-wx="light-rain"] .wx-rain,.hero-weather[data-wx="heavy-rain"] .wx-rain,.hero-weather[data-wx="thunderstorm"] .wx-rain{opacity:1}

/* Night window + porch lights: kept OUTSIDE the filtered photo (so night grading doesn't dim them) but in a
   box that runs the same Ken Burns zoom in sync. The container is sized/positioned by JS to match the
   photo's "cover" crop, so % positions line up with the windows in the image. */
.wx-lightbox{position:absolute;inset:0;transform-origin:60% 55%;animation:kenburns 36s ease-in-out infinite alternate;pointer-events:none}
.wx-lights{position:absolute;opacity:0;mix-blend-mode:screen;transition:opacity 3s ease-in-out;pointer-events:none}
.hero-weather[data-wx="night"] .wx-lights{opacity:1}
.wx-lights i{position:absolute;width:1.1%;height:1.9%;margin:-.95% 0 0 -.55%;border-radius:3px;
  background:radial-gradient(circle,rgba(255,238,180,.95) 0%,rgba(255,206,120,.75) 55%,rgba(255,180,90,.35) 100%);
  box-shadow:0 0 10px 3px rgba(255,190,100,.45),0 0 26px 8px rgba(255,170,80,.18);animation:wxflicker 5s ease-in-out infinite alternate}
.wx-lights i.porch{width:.9%;height:1.5%;border-radius:50%;box-shadow:0 0 18px 8px rgba(255,200,120,.5),0 0 44px 18px rgba(255,180,90,.2)}
.wx-lights i:nth-child(3n){animation-duration:6.5s;animation-delay:-2s}
.wx-lights i:nth-child(4n){animation-duration:4.2s;animation-delay:-1s}
@keyframes wxflicker{0%{opacity:.82}40%{opacity:1}70%{opacity:.88}100%{opacity:.97}}

/* Headline card: slightly stronger tint in weather mode so it stays readable in every phase */
.hero-weather .hero-card{background:rgba(var(--tint-rgb),.84)}

/* Paused (off-screen or hidden tab): freeze every CSS animation in the hero */
.hero-weather.wx-paused *,.hero-weather.wx-paused *::before,.hero-weather.wx-paused *::after{animation-play-state:paused!important}

@media (prefers-reduced-motion:reduce){
  .hero-weather .wx-fog2,.hero-weather .wx-lights i,.hero-weather .wx-lightbox{animation:none!important;transform:none!important}
  .hero-weather *,.hero-weather *::before,.hero-weather *::after{transition:none!important}
}

/* v6: lighter on phones - drop the second fog bank (the blurred layer is the main compositing cost) */
@media(max-width:700px){.hero-weather .wx-fog2{display:none}}
