/* ---- Christmas --------------------------------------------------------------
   Art for bin/php/seasonal/christmas/*.php, built on the shared pieces in
   seasonal.css (corner boughs, hanging baubles, the flying sleigh, candles).
   Ribbons, caps, garlands, stars and thread are the theme gold, the sleigh and
   coal are the theme's darkest well and snow is mixed from the theme text, so
   they follow any theme change; the reds, greens and pine carry colours of
   their own (the --xm-* tokens below). */

.vh-season--christmas {
    --xm-red: #b8232d;
    --xm-green: #2f7a42;
    --xm-blue: #2f5f9e;
    --xm-pine: #2f6339;
    --xm-pine-dark: #1e4227;
    --xm-twig: #5a3f26;
    --xm-holly: #2c6b38;
    --xm-holly-dark: #1f4e29;
    --xm-berry: #cc2230;
    --xm-gold: var(--vh-accent);
    --xm-ink: color-mix(in srgb, #0d0a10 80%, var(--vh-track));
    --xm-snow: color-mix(in srgb, var(--vh-text) 22%, #f8fcff);
    --xm-snow-shade: color-mix(in srgb, var(--xm-snow) 62%, #8aa9c4);
    --xm-carrot: #e8822a;
    --wax: color-mix(in srgb, #c42b33 85%, var(--vh-text));
    --thread: var(--xm-gold);
    --thread-opacity: 0.75;
    --corner: clamp(130px, 11vw, 240px); /* boughs grow with wide and stretched screens */
}

/* ---- Symbol paint (sprite.php) ---- */

.vh-xm-stop-snow { stop-color: var(--xm-snow); }
.vh-xm-stop-snow-shade { stop-color: var(--xm-snow-shade); }

.vh-xm-twig {
    fill: none;
    stroke: var(--xm-twig);
    stroke-width: 2.6;
    stroke-linecap: round;
}

.vh-xm-twig--thin { stroke-width: 1.4; }

.vh-xm-needles {
    fill: none;
    stroke: var(--xm-pine);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.vh-xm-needles--dark { stroke: var(--xm-pine-dark); }

.vh-xm-holly { fill: var(--xm-holly); }
.vh-xm-holly--dark { fill: var(--xm-holly-dark); }

.vh-xm-holly-rib {
    fill: none;
    stroke: #000000;
    stroke-opacity: 0.2;
    stroke-width: 0.6;
}

.vh-xm-berry {
    fill: var(--xm-berry);
    stroke: #5e0a10;
    stroke-width: 0.5;
}

.vh-xm-glint {
    fill: #ffffff;
    opacity: 0.6;
}

.vh-xm-gold,
.vh-xm-ribbon,
.vh-xm-star { fill: var(--xm-gold); }

.vh-xm-cap-loop {
    fill: none;
    stroke: var(--xm-gold);
    stroke-width: 1;
}

.vh-xm-ball { fill: currentColor; }

.vh-xm-band {
    fill: none;
    stroke: var(--xm-gold);
    stroke-width: 1.3;
}

.vh-xm-sparkle {
    fill: #ffffff;
    animation: vh-xm-twinkle 3.2s ease-in-out var(--twinkle, 0s) infinite;
}

.vh-xm-trunk { fill: var(--xm-twig); }
.vh-xm-tier { fill: var(--xm-pine); }

.vh-xm-tier-shade {
    fill: #000000;
    opacity: 0.18;
}

.vh-xm-garland {
    fill: none;
    stroke: var(--xm-gold);
    stroke-width: 0.9;
    stroke-linecap: round;
}

.vh-xm-ornament--red { fill: var(--xm-berry); }
.vh-xm-ornament--gold { fill: var(--xm-gold); }
.vh-xm-ornament--blue { fill: #6fa4e0; }

.vh-xm-box { fill: currentColor; }

.vh-xm-box-shade {
    fill: #000000;
    opacity: 0.16;
}

.vh-xm-lid {
    stroke: #000000;
    stroke-opacity: 0.25;
    stroke-width: 0.5;
}

.vh-xm-coal,
.vh-xm-hat { fill: var(--xm-ink); }
.vh-xm-carrot { fill: var(--xm-carrot); }
.vh-xm-scarf { fill: var(--xm-red); }

.vh-xm-ink { fill: var(--xm-ink); }

.vh-xm-ink-line,
.vh-xm-runner {
    fill: none;
    stroke: var(--xm-ink);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.vh-xm-rein {
    fill: none;
    stroke: var(--xm-ink);
    stroke-width: 0.6;
}

.vh-xm-nose {
    fill: var(--vh-bad);
    animation: vh-season-glow 1.6s ease-in-out infinite;
}

/* ---- Backdrop: boughs, baubles, sleigh (top.php) ---- */

.vh-xm-bough {
    opacity: 0.92;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45));
}

.vh-xm-bauble {
    width: var(--size);
    height: calc(var(--size) * 1.27);
}

.vh-xm-hanging-star {
    width: var(--size);
    height: var(--size);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--xm-gold) 55%, transparent));
}

/* Two hang from the boughs, so their anchors and threads scale with them. */
.vh-xm-hang--1 { left: calc(var(--corner) * 0.58); --size: 26px; --rest: calc(var(--corner) * 0.3); --sway: 5.5s; color: var(--xm-red); }
.vh-xm-hang--2 { left: 22%; --size: 20px; --rest: 14px; --sway: 4.4s; --twinkle: -1.1s; color: var(--xm-gold); }
.vh-xm-hang--3 { right: 25%; --size: 22px; --rest: 6px; --sway: 6.2s; }
.vh-xm-hang--4 { right: calc(var(--corner) * 0.5); --size: 28px; --rest: calc(var(--corner) * 0.36); --sway: 5s; --twinkle: -2s; color: var(--xm-green); }

/* The sleigh starts and parks fully off-screen, and bobs as it flies. */
.vh-xm-sleigh {
    --y: 64px;
    --size: 132px;
    --cycle: 40s;
    --delay: -6s;
    --overshoot: var(--size);
    left: calc(-10px - var(--size));
}

.vh-xm-sleigh svg {
    width: var(--size);
    height: calc(var(--size) * 0.273);
    animation: vh-xm-bob 1.8s ease-in-out infinite alternate;
}

/* ---- Ledge and nook pieces: trees, presents, snowman (candles are shared) ---- */

/* A tree's star carries the lantern glow of the set. */
.vh-xm-tree {
    position: relative;
    display: block;
    isolation: isolate;
}

.vh-xm-tree svg {
    width: 40px;
    height: 56px;
}

.vh-xm-tree::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4px;
    z-index: -1;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--xm-gold) 55%, transparent), transparent);
    animation: vh-season-glow 2.8s ease-in-out var(--xm-delay, 0s) infinite;
}

.vh-season-ledge__end--right .vh-xm-tree { --xm-delay: -1.3s; }

.vh-xm-tree--small svg {
    width: 30px;
    height: 42px;
}

.vh-xm-tree--small::before {
    top: 2px;
    width: 26px;
    height: 26px;
    margin-left: -13px;
}

.vh-xm-gift {
    width: 32px;
    height: 32px;
}

.vh-xm-gift--small {
    width: 24px;
    height: 24px;
}

.vh-xm-gift--red { color: var(--xm-red); }
.vh-xm-gift--green { color: var(--xm-green); }
.vh-xm-gift--blue { color: var(--xm-blue); }

.vh-xm-snowman {
    width: 38px;
    height: 55px;
    margin-right: 4px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

/* ---- Motion of its own (sway, flight, flicker and glow are shared) ---- */

@keyframes vh-xm-twinkle {
    0%, 100% { opacity: 0.1; }
    45% { opacity: 0.1; }
    55% { opacity: 0.95; }
    70% { opacity: 0.2; }
}

@keyframes vh-xm-bob {
    from { transform: translateY(-3px); }
    to { transform: translateY(3px); }
}

/* Phones: smaller boughs and sleigh, the two bough baubles only. */
@media (max-width: 767px) {
    .vh-season--christmas {
        --corner: 100px;
    }

    .vh-xm-sleigh {
        --size: 92px;
        --y: 54px;
    }

    .vh-xm-hang--2,
    .vh-xm-hang--3 {
        display: none;
    }
}

/* Small phones: the footer's Agreements list becomes its own centred row, so
   only a narrow nook fits beside it. */
@media (max-width: 389px) {
    .vh-season-nook .vh-xm-snowman,
    .vh-season-nook .vh-xm-gift--blue,
    .vh-season-nook .vh-season-candle--short {
        display: none;
    }
}
