/* The weather on the greeting card (dash-weather.js): the card's own background, only what is there now -- a glowing
   sun, the moon, or a cloud with its rain / snow / lightning -- standing over two soft hills that carry the city's name.
   The text and the picture stay in front. */

#view-dashboard .sd-sky { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: var(--ap-radius, 18px) var(--ap-radius, 18px) 0 0; cursor: pointer; user-select: none;
  --wx-cloud: #d5deea; --wx-cloud-back: #c3cedd; --wx-storm: #8f9bad; --wx-moon: #8fa3cc; --wx-hill: #dbe8dc; --wx-hill-back: #e9f1e9; --wx-place: #6b7a8c; }
[data-theme="dark"] #view-dashboard .sd-sky, :root:not([data-theme="light"]) #view-dashboard .sd-sky { --wx-cloud: #556076; --wx-cloud-back: #465066; --wx-storm: #3b4456; --wx-moon: #e6ebf7; --wx-hill: #26352f; --wx-hill-back: #1f2b27; --wx-place: #9aa8b8; }
[data-theme="light"] #view-dashboard .sd-sky { --wx-cloud: #d5deea; --wx-cloud-back: #c3cedd; --wx-storm: #8f9bad; --wx-moon: #8fa3cc; --wx-hill: #dbe8dc; --wx-hill-back: #e9f1e9; --wx-place: #6b7a8c; }
/* the horizon: two soft hills; the city's name under them */
.sd-sky .wx-hill { fill: var(--wx-hill); }
.sd-sky .wx-hill-back { fill: var(--wx-hill-back); }
.sd-sky .wx-place { fill: var(--wx-place); font-weight: 600; letter-spacing: .02em; }
#view-dashboard .sd-sky[hidden] { display: none; }
#view-dashboard .sd-hello .sd-art { z-index: 1; }   /* the picture stands in front */
@container dash (max-width: 680px) { #view-dashboard .sd-hello .sd-art { position: relative; } }
.sd-sky .wx-svg { position: absolute; left: 0; top: 0; display: block; overflow: visible; }

/* sun by day, moon by night; a cloud takes their place as the weather says */
/* swapped only while hidden behind the hills (dash-weather.js show()) -- at once, never fading */
.sd-sky.wx-instant * { transition: none !important; }
.sd-sky .wx-rays { stroke: #ffc94d; }
.sd-sky .wx-rays line { stroke-width: 3; stroke-linecap: round; }
.sd-sky .wx-moon-disc { fill: var(--wx-moon); }
.sd-sky .wx-moon, .sd-sky[data-night="1"] .wx-sun { opacity: 0; }
.sd-sky[data-night="1"] .wx-moon { opacity: 1; }
.sd-sky:is([data-kind="cloudy"], [data-kind="rain"], [data-kind="snow"], [data-kind="storm"], [data-kind="fog"]) :is(.wx-sun, .wx-moon) { opacity: 0; }

.sd-sky .wx-cloud { opacity: 0; }
.sd-sky .wx-cloud path { fill: var(--wx-cloud); transition: fill .6s; }
.sd-sky .wx-cloud .wx-cloud-back { fill: var(--wx-cloud-back); }
.sd-sky[data-kind="partly"] .wx-cloud-small,
.sd-sky:is([data-kind="cloudy"], [data-kind="rain"], [data-kind="snow"], [data-kind="storm"]) .wx-cloud-big { opacity: 1; }
.sd-sky[data-kind="storm"] .wx-cloud path { fill: var(--wx-storm); }

.sd-sky .wx-rain, .sd-sky .wx-snow, .sd-sky .wx-bolt, .sd-sky .wx-fog { opacity: 0; }
.sd-sky .wx-rain line { stroke: #6aa6e8; stroke-width: 2; stroke-linecap: round; }
.sd-sky:is([data-kind="rain"], [data-kind="storm"]) .wx-rain { opacity: 1; }
.sd-sky .wx-snow circle { fill: #9cc2ec; }
.sd-sky[data-kind="snow"] .wx-snow { opacity: 1; }
.sd-sky .wx-bolt { fill: #ffc531; }
.sd-sky .wx-fog path { fill: none; stroke: var(--wx-cloud-back); stroke-width: 4; stroke-linecap: round; }
.sd-sky .wx-fog .wx-fog-cloud { fill: var(--wx-cloud); stroke: none; opacity: .75; }
.sd-sky[data-kind="fog"] .wx-fog { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .sd-sky .wx-rays { animation: wx-spin 40s linear infinite; }
  .sd-sky .wx-bob { animation: wx-bob 5s ease-in-out infinite alternate; }
  .sd-sky .wx-rain line { animation: wx-fall .9s linear infinite; animation-delay: calc(var(--d) * -1); }
  .sd-sky .wx-snow circle { animation: wx-snow 3s linear infinite; animation-delay: calc(var(--d) * -1); }
  .sd-sky[data-kind="storm"] .wx-bolt { opacity: 0; animation: wx-flash 5s infinite; }
  .sd-sky .wx-fog path:nth-child(3) { animation: wx-bob 6s ease-in-out infinite alternate-reverse; }
  .sd-sky .wx-fog path:nth-child(2), .sd-sky .wx-fog path:nth-child(4) { animation: wx-bob 7s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) { .sd-sky[data-kind="storm"] .wx-bolt { opacity: 1; } }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-bob { from { translate: -3px 0; } to { translate: 3px 0; } }
@keyframes wx-fall { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-4px, 22px); opacity: 0; } }
@keyframes wx-snow { from { transform: translate(0, 0); opacity: 1; } 50% { transform: translate(2px, 12px); } to { transform: translate(-1px, 26px); opacity: 0; } }
@keyframes wx-flash { 0%, 84%, 100% { opacity: 0; } 86%, 90% { opacity: 1; } 88% { opacity: .2; } }

/* its switch in the settings (general -> appearance) */
.settings-switch-row { display: grid; gap: 6px; }
