/* ============================================================
   HXS Seasonal: Winter
   Loaded by includes/hooks/seasonal_theme.php only while the theme is live,
   after seasonal.css. Everything is scoped to html.hxs-winter or to elements
   winter.js creates, so removing the class removes it all.
   ============================================================ */

/* Ice blue accent, and a glacier gradient (cyan through blue to periwinkle) for
   the buttons. Only the theme tokens change, so every component follows. */
html.hxs-winter-recolor {
    --hxs-accent-primary:  #38bdf8;
    --hxs-accent-hover:    #7dd3fc;
    --hxs-border-solid:    #27506e;
    --hxs-accent-gradient: linear-gradient(135deg, #0891b2 0%, #0ea5e9 32%, #3b82f6 70%, #6366f1 100%);
}
html.hxs-winter-recolor .form-control:focus,
html.hxs-winter-recolor select:focus,
html.hxs-winter-recolor input:focus,
html.hxs-winter-recolor textarea:focus {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.24) !important;
}
html.hxs-winter-recolor ::selection {
    background: rgba(56, 189, 248, 0.4);
    color: #fff;
}

/* Northern lights low behind the top of the page, drifting very slowly, and a
   cold blue settling at the bottom. Fixed, so it stays put while you read. */
html.hxs-winter body::before {
    content: "";
    position: fixed;
    inset: -10% -10% 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 45% 22% at 28% 6%, rgba(45, 212, 191, 0.11), transparent 70%),
        radial-gradient(ellipse 40% 20% at 62% 3%, rgba(56, 189, 248, 0.10), transparent 70%),
        radial-gradient(ellipse 35% 18% at 84% 9%, rgba(129, 140, 248, 0.10), transparent 70%),
        radial-gradient(ellipse 60% 35% at 50% 108%, rgba(56, 189, 248, 0.07), transparent 70%);
    animation: hxs-sn-aurora 26s ease-in-out infinite alternate;
}
@keyframes hxs-sn-aurora {
    0%   { transform: translateX(-3%); opacity: 0.8; }
    50%  { opacity: 1; }
    100% { transform: translateX(3%); opacity: 0.85; }
}

/* Frost in the top corners of the page; it scrolls away with it. */
.hxs-sn-frost {
    position: absolute;
    top: 0;
    width: 260px;
    height: 260px;
}
.hxs-sn-frost--left  { left: 0; }
.hxs-sn-frost--right { right: 0; transform: scaleX(-1); }

/* Icicles under the navbar. Below the header's own contents (z-index -1 inside
   its stacking context), so the phone menu slides over them. */
.hxs-sn-icicles {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

/* Falling snow. */
.hxs-sn-flake {
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0 34%, rgba(240, 249, 255, 0.6) 52%, rgba(240, 249, 255, 0) 72%);
}
.hxs-sn-crystal {
    overflow: visible;
    filter: drop-shadow(0 0 2px rgba(186, 230, 253, 0.7));
}

/* Snow lying on top of the cards. Not a sprite, so it stays when the visitor
   stops the snowfall. */
.hxs-sn-cap {
    position: absolute;
    top: 0;
    left: 0;
}

/* The footer: a snowdrift along its top edge, with pines and a snowman stood
   in it. Their feet go in first, then the drift is drawn over them. */
.hxs-sn-bank {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 0;
    pointer-events: none;
    /* The drift may not widen the page on a phone. */
    overflow-x: clip;
}
.hxs-sn-drift {
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 30px;
    filter: drop-shadow(0 -2px 6px rgba(186, 230, 253, 0.18));
}
.hxs-sn-group {
    position: absolute;
    bottom: -2px;
    display: flex;
    align-items: flex-end;
}
.hxs-sn-group--left  { left: max(16px, 5vw); }
.hxs-sn-group--right { right: max(16px, 5vw); }
.hxs-sn-pine, .hxs-sn-snowman {
    display: block;
    filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.35));
}
.hxs-sn-pine svg, .hxs-sn-snowman svg { display: block; width: 100%; height: auto; }
.hxs-sn-pine--lg { width: 56px; }
.hxs-sn-pine--sm { width: 38px; margin: 0 -6px; }
.hxs-sn-snowman  { width: 44px; margin: 0 4px; }
.hxs-sn-scarf {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: hxs-sn-scarf 3.4s ease-in-out infinite;
}
@keyframes hxs-sn-scarf {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(9deg); }
    55% { transform: rotate(3deg); }
    75% { transform: rotate(11deg); }
}

/* The shared hide button, in ice blue. */
html.hxs-winter .hxs-ss-toggle {
    --ss-tone: 125, 211, 252;
    --ss-ink: #e0f2fe;
    --ss-bg: rgba(9, 16, 30, 0.88);
}

@media (max-width: 782px) {
    .hxs-sn-frost { width: 160px; height: 160px; }
    .hxs-sn-pine--lg { width: 44px; }
    .hxs-sn-pine--sm { width: 30px; }
    .hxs-sn-snowman  { width: 36px; }
}
/* On a phone one group is plenty, and the left one would sit under the toggle. */
@media (max-width: 520px) {
    .hxs-sn-group--left { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html.hxs-winter body::before, .hxs-sn-scarf { animation: none; }
}

@media print {
    .hxs-sn-frost, .hxs-sn-icicles, .hxs-sn-bank { display: none !important; }
}
