/* Christmas theme A (Winter Blue, 8-bit pixel decorations). Only applies when seasonal.js adds body.is-xmas (1 Nov to 31 Jan). */

/* light string: fixed right under the navigation bar, hanging over the content */
.xmas-lights{position:fixed;left:0;right:0;top:0;z-index:101;height:16px;display:flex;justify-content:space-between;padding:0 12px;pointer-events:none;
  background:linear-gradient(#0A3F8F,#0A3F8F) 0 1px/100% 2px no-repeat}
.xmas-lights i{position:relative;width:8px;height:10px;margin-top:4px;background:#9CC3FF;box-shadow:0 0 8px 1px currentColor;color:#9CC3FF}
.xmas-lights i:before{content:"";position:absolute;left:2px;top:-3px;width:4px;height:3px;background:#2F3D4F}
.xmas-lights i:nth-child(4n+1){background:#F2B233;color:#F2B233}
.xmas-lights i:nth-child(4n+2){background:#FFFFFF;color:#BFD8FF}
.xmas-lights i:nth-child(4n+3){background:#D64545;color:#D64545}
.xmas-lights i:nth-child(odd){margin-top:6px}
.xmas-lights i:nth-child(n+21){display:none}
@media (min-width:900px){.xmas-lights i:nth-child(n+21){display:block}}

/* pixel snow: transform-only animations, composited at the screen's refresh rate */
.xmas-snow{position:fixed;top:0;bottom:0;z-index:45;width:max(0px,calc((100vw - var(--page-max,1160px)) / 2 - 20px));pointer-events:none;overflow:hidden}.xmas-snow.is-left{left:0}.xmas-snow.is-right{right:0}
.xmas-snow i{position:absolute;top:-40px;will-change:transform;animation:xmasFall var(--fall) linear var(--delay) infinite}
.xmas-snow i:before{content:"";position:absolute;inset:0;background:var(--flake) center/100% 100% no-repeat;image-rendering:pixelated;will-change:transform;animation:xmasSway var(--sway) ease-in-out infinite alternate}
@keyframes xmasFall{from{transform:translate3d(0,0,0)}to{transform:translate3d(0,calc(100vh + 80px),0)}}
@keyframes xmasSway{from{transform:translate3d(calc(var(--drift) * -1),0,0)}to{transform:translate3d(var(--drift),0,0)}}

/* tree with gifts: only where the side margin is wider than the tree, so it never covers page content */
.xmas-tree{position:fixed;left:28px;bottom:28px;z-index:46;width:140px;height:231px;min-height:0;margin:0;padding:0;border:0;border-radius:14px;background:none;box-shadow:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.xmas-tree canvas{display:block;width:100%;height:100%}
.xmas-tree[aria-pressed="true"]{width:200px;height:330px} /* the QR needs its full size to scan */
@media (prefers-reduced-motion:no-preference){.xmas-tree{transition:width .4s ease-out,height .4s ease-out}}
.xmas-tree:focus-visible{outline:3px solid #0F5FC8;outline-offset:4px}
@media (max-width:1599px){.xmas-tree{display:none}}

/* theme switch: in the footer beside Farm's login */
.xmas-toggle{display:inline-flex;align-items:center;gap:8px;margin-top:12px;min-height:44px;padding:8px 16px;border:1.5px solid rgba(255,255,255,.7);border-radius:0;background:transparent;color:#fff;font:inherit;font-size:14px;font-weight:700;cursor:pointer;box-shadow:3px 3px 0 rgba(0,0,0,.25)}
.xmas-toggle:hover{background:rgba(255,255,255,.14)}
.xmas-toggle:active{transform:translate(2px,2px);box-shadow:1px 1px 0 rgba(0,0,0,.25)}
.xmas-toggle:focus-visible{outline:3px solid #FFD54A;outline-offset:3px}
body:not(.xmas-off) .xmas-toggle:before{content:"";width:10px;height:10px;background:#D64545;box-shadow:inset -3px -3px 0 #9B1C1C}
.footer-brand .xmas-toggle{display:flex;width:max-content}
.xmas-toggle.is-floating{position:fixed;left:12px;bottom:12px;z-index:47;border-color:#0A3F8F;background:#fff;color:#0A3F8F;box-shadow:3px 3px 0 #0A3F8F}

/* 8-bit Santa on the right edge + chimney at the bottom right with snow round its base */
.xmas-santa{position:fixed;right:2px;top:0;z-index:48;width:36px;height:42px;padding:0;border:0;background:none;cursor:pointer;transform:translateY(var(--y0,120px))}
.xs-body{position:absolute;inset:0;display:block;filter:drop-shadow(1px 0 0 #0A3F8F) drop-shadow(-1px 0 0 #0A3F8F) drop-shadow(0 1px 0 #0A3F8F) drop-shadow(0 -1px 0 #0A3F8F)}
.xs-body svg{position:absolute;inset:0;width:100%;height:100%}
.xs-b,.xs-front{visibility:hidden}
.xmas-santa.is-front .xs-a,.xmas-santa.is-front .xs-b{visibility:hidden!important;animation:none!important}
.xmas-santa.is-front .xs-front{visibility:visible}
.xmas-santa:focus-visible{outline:3px solid #F2B233;outline-offset:2px}
.xs-bubble{position:absolute;right:calc(100% + 10px);top:0;padding:6px 10px;background:#fff;color:#0A3F8F;border:2px solid #0A3F8F;box-shadow:3px 3px 0 #0A3F8F;font-size:14px;font-weight:700;line-height:1.3;white-space:nowrap;opacity:0;transform:translateX(6px);transition:opacity .15s,transform .15s;pointer-events:none}
.xs-bubble:after{content:"";position:absolute;right:-8px;top:10px;width:8px;height:6px;background:#0A3F8F}
.xs-bubble.is-on{opacity:1;transform:none}
.xmas-chimney{position:fixed;right:0;bottom:0;z-index:49;width:88px;height:40px;pointer-events:none;filter:drop-shadow(0 -1px 0 rgba(10,63,143,.6))}
.xmas-chimney svg{display:block;width:100%;height:100%}
.xmas-chimney i{position:absolute;left:38px;top:-10px;width:10px;height:10px;background:#E7EEF7;box-shadow:0 0 0 1px rgba(10,63,143,.3);opacity:0}
.xmas-chimney.is-puff i{animation:xmasPuff 1.2s steps(8) forwards}
.xmas-chimney.is-puff i:nth-of-type(2){left:48px;animation-delay:.25s}
.xmas-chimney.is-puff i:nth-of-type(3){left:30px;animation-delay:.5s}
@keyframes xmasPuff{0%{opacity:.95;transform:translateY(0)}100%{opacity:0;transform:translateY(-44px) scale(1.6)}}
.xmas-fx{position:fixed;z-index:50;pointer-events:none;font-weight:800;line-height:1}
.xmas-fx.is-heart{color:#D64545;font-size:20px;text-shadow:2px 2px 0 #fff}
.xmas-fx.is-star{color:#F2B233;font-size:20px;text-shadow:2px 2px 0 #0A3F8F}
.xmas-fx.is-gift{width:20px;height:20px}
.xmas-fx.is-gift svg{display:block;width:100%;height:100%}
.xmas-fx.is-ball{width:10px;height:10px;background:#fff;box-shadow:0 0 0 2px #5B9BEA}
.xmas-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* Santa and chimney only where the right margin has room for them */
@media (max-width:1239px){.xmas-santa,.xmas-chimney{display:none}}

@media (prefers-reduced-motion:no-preference){
  .xmas-lights i{animation:xmasBlink 1.2s steps(2,jump-none) infinite;animation-delay:calc(var(--i) * -0.3s)}
  .xmas-santa{animation:xmasClimb 18s ease-in-out infinite alternate}
  .xmas-santa.is-acting{animation-play-state:paused}
  .xmas-santa .xs-a{animation:xmasFrameA .45s steps(1) infinite}
  .xmas-santa .xs-b{animation:xmasFrameB .45s steps(1) infinite}
  .xmas-santa.is-acting .xs-a,.xmas-santa.is-acting .xs-b{animation-play-state:paused}
  @keyframes xmasBlink{50%{opacity:.25}}
  @keyframes xmasClimb{from{transform:translateY(var(--y0,120px))}to{transform:translateY(var(--y1,500px))}}
  @keyframes xmasFrameA{50%{visibility:hidden}}
  @keyframes xmasFrameB{50%{visibility:visible}}
}
@media (prefers-reduced-motion:reduce){.xmas-santa,.xmas-chimney{display:none}}
body.xmas-off :is(.xmas-snow,.xmas-tree,.xmas-lights,.xmas-mini-tree,.xmas-santa,.xmas-chimney,.xmas-fx){display:none}
@media print{.xmas-snow,.xmas-tree,.xmas-lights,.xmas-mini-tree,.xmas-toggle,.xmas-santa,.xmas-chimney,.xmas-fx{display:none}}
