/* D141 weather top bar (owner-approved sample: design/weather-bar). The header carries data-wx="<sky>".
   The sky sits behind the theme art (z-index order: header background → sky → theme art → buttons), so every theme
   keeps its own art and colours. Classic gets the full sky colours; the other themes get a soft tint of the sky.
   Phones (< 768 px): sky colour only. Less motion or data saver: a still picture. */
.gh>.wx.wx.wx{position:absolute;inset:0;z-index:0;border-radius:inherit;pointer-events:none;overflow:hidden;transition:background .8s}
.gh>.wx~.ta{z-index:0}
.wx>*{position:absolute;display:none}
.gh[data-wx]:not([data-wx=""])>.wx::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(6,30,18,.5) 0,rgba(6,30,18,0) 260px)} /* keeps the logo readable */

/* classic: the whole bar takes the sky colour (every sky stays dark enough for white text) */
.gh[data-th=classic][data-wx=sun]>.wx{background:linear-gradient(100deg,#0F3D24 0%,#14532D 45%,#2B6A2C 75%,#5C7A22 100%)}
.gh[data-th=classic][data-wx=partly]>.wx{background:linear-gradient(100deg,#0F3D24 0%,#14532D 50%,#2D5F3A 100%)}
.gh[data-th=classic][data-wx=rain]>.wx{background:linear-gradient(100deg,#0E2F22 0%,#1D3B33 55%,#2E4743 100%)}
.gh[data-th=classic][data-wx=wind]>.wx{background:linear-gradient(100deg,#0F3D24 0%,#14532D 55%,#21613F 100%)}
.gh[data-th=classic][data-wx=storm]>.wx{background:linear-gradient(100deg,#0A221A 0%,#1A2B2C 55%,#272F3A 100%)}
.gh[data-th=classic][data-wx=night]>.wx{background:linear-gradient(100deg,#06201A 0%,#0B2530 55%,#14213D 100%)}
.gh[data-th=classic][data-wx=nrain]>.wx{background:linear-gradient(100deg,#06201A 0%,#0E2228 55%,#1A2433 100%)}
.gh[data-th=classic][data-wx=dusk]>.wx{background:linear-gradient(180deg,#14532D 0%,#2F4F2A 45%,#8A4B23 80%,#C9642B 100%)}
/* other themes: a soft tint over the theme's own background (the art stays on top, untouched) */
.gh:not([data-th=classic])[data-wx=sun]>.wx{background:radial-gradient(60% 140% at 75% 0,rgba(247,194,27,.16),transparent 70%)}
.gh:not([data-th=classic])[data-wx=partly]>.wx{background:linear-gradient(100deg,transparent 40%,rgba(200,215,205,.08))}
.gh:not([data-th=classic])[data-wx=rain]>.wx{background:linear-gradient(100deg,rgba(40,60,60,.15),rgba(46,71,67,.4))}
.gh:not([data-th=classic])[data-wx=wind]>.wx{background:linear-gradient(100deg,transparent 30%,rgba(120,200,150,.08))}
.gh:not([data-th=classic])[data-wx=storm]>.wx{background:linear-gradient(100deg,rgba(10,20,25,.3),rgba(39,47,58,.55))}
.gh:not([data-th=classic])[data-wx=night]>.wx{background:linear-gradient(100deg,rgba(6,20,40,.25),rgba(20,33,61,.55))}
.gh:not([data-th=classic])[data-wx=nrain]>.wx{background:linear-gradient(100deg,rgba(6,20,30,.3),rgba(26,36,51,.55))}
.gh:not([data-th=classic])[data-wx=dusk]>.wx{background:linear-gradient(180deg,transparent 30%,rgba(201,100,43,.4) 100%)}

/* which pieces show for each sky */
.gh[data-wx=sun] .wx .sun,.gh[data-wx=sun] .wx .rays,
.gh[data-wx=partly] .wx .sun.small,.gh[data-wx=partly] .wx .cloud,
.gh[data-wx=rain] .wx .cloud,.gh[data-wx=rain] .wx .rainfx,
.gh[data-wx=wind] .wx .gust,.gh[data-wx=wind] .wx .leaf,
.gh[data-wx=storm] .wx .cloud,.gh[data-wx=storm] .wx .rainfx,.gh[data-wx=storm] .wx .flash,.gh[data-wx=storm] .wx .bolt,
.gh[data-wx=night] .wx .stars,.gh[data-wx=night] .wx .moon,
.gh[data-wx=nrain] .wx .cloud,.gh[data-wx=nrain] .wx .rainfx,.gh[data-wx=nrain] .wx .stars.few,
.gh[data-wx=dusk] .wx .horizon,.gh[data-wx=dusk] .wx .stars.few{display:block}
.gh[data-wx=partly] .wx .sun:not(.small),.gh[data-wx=sun] .wx .sun.small{display:none}

/* sun and moon: in the open space between the logo and the search box */
.wx .sun{left:330px;top:6px;width:44px;height:44px;border-radius:50%;background:radial-gradient(circle,#FFE27A 0 45%,#F7C21B 46% 60%,rgba(247,194,27,0) 61%);filter:drop-shadow(0 0 14px rgba(255,214,80,.55));animation:wxPulse 6s ease-in-out infinite}
.wx .sun.small{left:340px;top:4px;width:34px;height:34px}
.wx .rays{left:308px;top:-16px;width:88px;height:88px;border-radius:50%;background:repeating-conic-gradient(rgba(255,226,122,.22) 0 8deg,transparent 8deg 30deg);-webkit-mask:radial-gradient(circle,transparent 0 30%,#000 31% 70%,transparent 71%);mask:radial-gradient(circle,transparent 0 30%,#000 31% 70%,transparent 71%);animation:wxSpin 40s linear infinite}
@keyframes wxSpin{to{transform:rotate(360deg)}}
@keyframes wxPulse{50%{transform:scale(1.05)}}
/* clouds drift slowly */
.wx .cloud{top:2px;width:120px;height:40px;opacity:.55;animation:wxDrift 38s linear infinite}
.wx .cloud svg{width:100%;height:100%}
.wx .cloud.c1{left:170px;animation-delay:-6s}.wx .cloud.c2{left:62%;top:16px;width:84px;opacity:.5;animation-duration:46s;animation-delay:-20s}.wx .cloud.c3{right:-20px;top:-6px;width:150px;opacity:.4;animation-duration:52s}
.gh[data-wx=rain] .wx .cloud,.gh[data-wx=nrain] .wx .cloud{opacity:.5;filter:brightness(.75)}
.gh[data-wx=storm] .wx .cloud{opacity:.6;filter:brightness(.5)}
@keyframes wxDrift{from{transform:translateX(-60px)}to{transform:translateX(60px)}}
/* rain: thin slanted streaks, two layers */
.wx .rainfx{inset:0;background:repeating-linear-gradient(105deg,transparent 0 14px,rgba(190,220,235,.28) 14px 15px,transparent 15px 34px);background-size:60px 60px;animation:wxFall .7s linear infinite}
.wx .rainfx.r2{opacity:.6;background-size:90px 90px;animation-duration:1.1s}
@keyframes wxFall{from{background-position:0 -60px}to{background-position:-16px 0}}
/* wind: soft swoosh lines and a few leaves */
.wx .gust{height:3px;border-radius:3px;background:linear-gradient(90deg,transparent,rgba(225,245,230,.7),transparent);width:180px;animation:wxGust 4.5s ease-in-out infinite}
.wx .gust.g1{top:14px;left:230px}.wx .gust.g2{top:30px;left:45%;width:240px;animation-delay:-1.5s}.wx .gust.g3{top:44px;left:70%;width:150px;animation-delay:-3s}
@keyframes wxGust{0%{transform:translateX(-120px);opacity:0}30%{opacity:1}100%{transform:translateX(220px);opacity:0}}
.wx .leaf{width:12px;height:7px;border-radius:0 8px;background:#7BC85A;opacity:.8;animation:wxBlow 6s linear infinite}
.wx .leaf.l1{top:18px;left:300px}.wx .leaf.l2{top:34px;left:72%;animation-delay:-2s;background:#C9A227}.wx .leaf.l3{top:10px;left:80%;animation-delay:-4s}
@keyframes wxBlow{0%{transform:translate(-80px,0) rotate(0)}50%{transform:translate(40px,10px) rotate(180deg)}100%{transform:translate(160px,-4px) rotate(360deg);opacity:0}}
/* storm: a gentle glow, never a strobe (at most one soft flash every 9 s) */
.wx .flash{inset:0;background:radial-gradient(ellipse at 70% 0,rgba(230,235,255,.35),transparent 60%);opacity:0;animation:wxFlash 9s ease-in-out infinite}
@keyframes wxFlash{0%,88%,100%{opacity:0}90%{opacity:1}92%{opacity:.2}94%{opacity:.7}}
.wx .bolt{left:300px;top:6px;width:16px;height:34px;opacity:0;animation:wxFlash 9s ease-in-out infinite}
/* night: twinkling stars and the moon in today's phase */
.wx .stars{inset:0;background-image:radial-gradient(1.4px 1.4px at 12% 30%,#fff,transparent),radial-gradient(1px 1px at 22% 70%,#dfe8ff,transparent),radial-gradient(1.2px 1.2px at 35% 20%,#fff,transparent),radial-gradient(1px 1px at 47% 60%,#fff,transparent),radial-gradient(1.5px 1.5px at 58% 28%,#fff8d8,transparent),radial-gradient(1px 1px at 66% 75%,#fff,transparent),radial-gradient(1.2px 1.2px at 74% 18%,#fff,transparent),radial-gradient(1px 1px at 83% 55%,#dfe8ff,transparent),radial-gradient(1.3px 1.3px at 91% 32%,#fff,transparent),radial-gradient(1px 1px at 97% 70%,#fff,transparent);animation:wxTw 4s ease-in-out infinite}
.wx .stars.s2{background-image:radial-gradient(1px 1px at 17% 50%,#fff,transparent),radial-gradient(1.2px 1.2px at 29% 85%,#fff,transparent),radial-gradient(1px 1px at 41% 40%,#fff,transparent),radial-gradient(1.3px 1.3px at 53% 80%,#fff,transparent),radial-gradient(1px 1px at 62% 45%,#fff,transparent),radial-gradient(1px 1px at 79% 82%,#fff,transparent),radial-gradient(1.2px 1.2px at 88% 15%,#fff,transparent);animation-delay:-2s;animation-duration:5.5s}
.wx .stars.few{opacity:.35;animation:none}
@keyframes wxTw{50%{opacity:.35}}
.wx .moon{left:334px;top:9px;width:36px;height:36px;filter:drop-shadow(0 0 10px rgba(255,248,214,.45))}
/* sunrise / sunset: a warm glow low on the horizon, half a sun */
.wx .horizon{left:0;right:0;bottom:0;height:56px}
.wx .horizon .hs{position:absolute;left:330px;bottom:-22px;width:46px;height:46px;border-radius:50%;background:radial-gradient(circle,#FFD27A 0 55%,#F39A3C 56% 70%,transparent 71%);filter:drop-shadow(0 0 16px rgba(255,170,80,.7));animation:wxPulse 7s ease-in-out infinite}

/* place and temperature next to the bell ("Gulu · 24°") */
.wxl{color:rgba(255,255,255,.88);font-size:13px;font-weight:600;white-space:nowrap;padding:0 2px;text-shadow:0 1px 2px rgba(0,0,0,.35)}
.wxl:empty{display:none}
@media (max-width:1099px){.wxl{display:none}}

/* phones: the colour of the sky only, no pictures and no movement */
@media (max-width:767px){
 .wx>*{display:none!important}
 .gh[data-wx]:not([data-wx=""])>.wx::after{display:none}
 .gh[data-th=classic][data-wx=sun]>.wx{background:linear-gradient(100deg,#0F3D24 0%,#155B3A 60%,#1D6B57 100%)}
 .gh[data-th=classic][data-wx=partly]>.wx,.gh[data-th=classic][data-wx=wind]>.wx{background:linear-gradient(100deg,#123A26 0%,#2B4B3A 100%)}
 .gh[data-th=classic][data-wx=rain]>.wx{background:linear-gradient(100deg,#1E2E2A 0%,#2E3B3A 100%)}
 .gh[data-th=classic][data-wx=storm]>.wx{background:linear-gradient(100deg,#141C1E 0%,#222A33 100%)}
 .gh[data-th=classic][data-wx=night]>.wx,.gh[data-th=classic][data-wx=nrain]>.wx{background:linear-gradient(100deg,#0A1A2E 0%,#13203A 100%)}
 .gh[data-th=classic][data-wx=dusk]>.wx{background:linear-gradient(100deg,#2A3A22 0%,#7A4524 70%,#A8582A 100%)}
}

/* still picture when the phone asks for less motion, or when data saver is on (class "still") */
@media (prefers-reduced-motion:reduce){.wx *{animation:none!important}.wx .flash{opacity:0}.wx .bolt{opacity:.7}}
.wx.still *{animation:none!important}
.wx.still .flash{opacity:.6}.wx.still .bolt{opacity:.85}
.wx.still .gust{transform:translateX(40px)}
