/* Christmas theme - loaded only while App\Services\Christmas::active() (29 Nov - 31 Dec).
   Everything here is decoration: pointer-events: none, transform/opacity animations only,
   and still under prefers-reduced-motion. */

/* ---------- Lights hanging from the header ---------- */
.site-header { --xmas-wire: #3a4356; }
.xmas-lights {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 3px);
    height: 26px;
    display: flex;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
/* the wire: one 72px dip per bulb */
.xmas-lights::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='14'%3E%3Cpath d='M0 2Q18 12 36 12T72 2' fill='none' stroke='%233a4356' stroke-width='1.6'/%3E%3C/svg%3E") repeat-x 0 0 / 72px 14px;
}
.xmas-lights i { position: relative; flex: none; width: 72px; }
.xmas-lights i::before { /* socket */
    content: '';
    position: absolute;
    left: 50%;
    top: 9px;
    width: 6px;
    height: 5px;
    margin-left: -3px;
    border-radius: 1px;
    background: #2a3142;
}
.xmas-lights i::after { /* bulb */
    content: '';
    position: absolute;
    left: 50%;
    top: 13px;
    width: 8px;
    height: 12px;
    margin-left: -4px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: var(--c);
    box-shadow: 0 0 8px 2px var(--c);
    animation: xmas-twinkle 2.6s ease-in-out infinite var(--d, 0s);
}
.xmas-lights i:nth-child(4n+1) { --c: #ef4444; }
.xmas-lights i:nth-child(4n+2) { --c: #22c55e; }
.xmas-lights i:nth-child(4n+3) { --c: #fbbf24; }
.xmas-lights i:nth-child(4n+4) { --c: #3b82f6; }
.xmas-lights i:nth-child(3n)   { --d: -.9s; }
.xmas-lights i:nth-child(3n+1) { --d: -1.7s; }
.xmas-lights i:nth-child(5n)   { --d: -.4s; }
@keyframes xmas-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Santa hat on the logo ---------- */
.nav-logo { position: relative; }
.xmas-hat {
    position: absolute;
    left: -9px;
    top: -6px;
    width: 30px;
    height: auto;
    transform: rotate(-18deg);
    pointer-events: none;
    filter: drop-shadow(0 2px 2px rgb(0 0 0 / .45));
}

/* ---------- Snow on the hero frame and the footer edge ---------- */
.hero-frame::before,
.site-footer::after {
    content: '';
    position: absolute;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 40' preserveAspectRatio='none'%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23dbe7ff'/%3E%3C/linearGradient%3E%3Cpath fill='url(%23g)' d='M0 14C40 4 80 6 120 10C170 2 220 4 260 12C310 4 360 2 400 10C450 4 500 6 540 12C565 8 585 8 600 12V22C590 24 585 34 578 34S570 24 560 22C520 26 480 22 450 24C442 25 440 38 432 38S424 26 414 24C360 28 300 22 250 26C240 27 238 33 231 33S224 26 214 25C160 28 100 22 60 26C50 27 48 36 41 36S34 27 24 26C14 25 6 24 0 22Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.hero-frame::before {
    left: -2px;
    right: -2px;
    top: -14px;
    height: 34px;
    z-index: 2;
    filter: drop-shadow(0 4px 6px rgb(0 0 0 / .35));
}
.site-footer::after {
    left: 0;
    right: 0;
    top: -1px;
    height: 22px;
    opacity: .9;
}

/* ---------- Hero badge ---------- */
.hero-pill.is-xmas {
    color: #fecaca;
    background: linear-gradient(90deg, rgb(220 38 38 / .22), rgb(22 163 74 / .22));
    border-color: rgb(248 113 113 / .35);
}

/* ---------- Falling snow (christmas.js) and its switch ---------- */
.xmas-snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.xmas-toggle {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 40;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #e0f2fe;
    background: rgb(var(--surface-rgb) / .85);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    transition: color var(--dur), border-color var(--dur), opacity var(--dur);
}
.xmas-toggle:hover { border-color: rgb(186 230 253 / .5); }
.xmas-toggle[aria-pressed="false"] { color: var(--text-3); opacity: .7; }
body.has-buybar .xmas-toggle { bottom: calc(5rem + env(safe-area-inset-bottom)); }

@media (max-width: 640px) {
    .xmas-hat { left: -7px; top: -4px; width: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .xmas-lights i::after { animation: none; }
}
