/* Habillage des fetes (hiver neutre, Saint-Nicolas, Noel) : neige qui s'entasse dans la barre, bonnet sur le logo, guirlande lumineuse
   sous la barre, neige legere et traineau dans le fond. N'est charge que pendant la saison
   (voir SeasonalTheme) ; rien ici ne recoit de clic. */

/* ------------------------------------------------ neige dans la barre */
/* Le canvas passe sous les liens et les boutons : la barre devient un contexte d'empilement,
   et le z-index negatif le garde au-dessus de son fond. */
.sh5--xmas .sh5-bar{ isolation: isolate; }
.xmas-snow{
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%; height: 100%;
    border-radius: inherit;
    pointer-events: none;
}

/* ------------------------------------------------ bonnet */
.sh5--xmas .sh5-logo, .sh5-sheet .sh5-logo{ position: relative; }
.xmas-hat{
    position: absolute;
    left: 24%; top: 3%;
    width: 13.5%; height: auto;
    transform: rotate(-17deg);
    transform-origin: 50% 90%;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
    pointer-events: none;
    transition: transform .3s ease;
}
html body .sh5-logo:hover .xmas-hat{ transform: rotate(-26deg) translateY(-1px); }
/* La mitre de saint Nicolas : plus etroite et plus haute que le bonnet, presque droite. */
.xmas-hat--mitre{ left: 25.6%; top: 6%; width: 9.5%; transform: rotate(-9deg); }
html body .sh5-logo:hover .xmas-hat--mitre{ transform: rotate(-16deg) translateY(-1px); }

/* ------------------------------------------------ guirlande */
/* Le fil est une tuile repetee (un feston de 48 px), deux ampoules par feston. Elle est rendue
   avant la barre : la barre et ses menus passent donc devant. */
.xmas-garland{
    --xmas-wire: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14' viewBox='0 0 48 14'%3E%3Cpath d='M0 1 Q24 12 48 1' fill='none' stroke='%238d8597' stroke-width='1.2'/%3E%3C/svg%3E");
    position: absolute;
    left: 18px; right: 18px; top: calc(100% - 3px);
    display: flex;
    height: 28px;
    overflow: hidden;
    pointer-events: none;
    background: var(--xmas-wire) repeat-x 0 0 / 48px 14px;
    transition: opacity .2s ease;
}
[data-theme="light"] .xmas-garland{
    --xmas-wire: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14' viewBox='0 0 48 14'%3E%3Cpath d='M0 1 Q24 12 48 1' fill='none' stroke='%235a4a5e' stroke-width='1.2'/%3E%3C/svg%3E");
}
.sh5.is-mega .xmas-garland{ opacity: 0; }

.xmas-garland i{
    --c: #ff4d4d;
    position: relative;
    flex: 0 0 24px;
    height: 100%;
}
.xmas-garland i:nth-child(5n+2){ --c: #ffd166; }
.xmas-garland i:nth-child(5n+3){ --c: #5fe07a; }
.xmas-garland i:nth-child(5n+4){ --c: #e58fd0; }
.xmas-garland i:nth-child(5n+5){ --c: #6ec5ff; }
.xmas-garland i::before{
    content: "";
    position: absolute; left: 50%; top: 4px;
    width: 4px; height: 4px; margin-left: -2px;
    border-radius: 1px;
    background: #3a3540;
}
.xmas-garland i::after{
    content: "";
    position: absolute; left: 50%; top: 7.5px;
    width: 7px; height: 10px; margin-left: -3.5px;
    border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
    background: radial-gradient(circle at 35% 30%, #fff 0 12%, var(--c) 45%);
    box-shadow: 0 0 9px 2px color-mix(in srgb, var(--c) 75%, transparent);
    animation: xmas-twinkle 3.2s ease-in-out infinite;
}
.xmas-garland i:nth-child(3n+1)::after{ animation-delay: -1.1s; }
.xmas-garland i:nth-child(3n+2)::after{ animation-delay: -2.2s; }
.xmas-garland i:nth-child(7n)::after{ animation-duration: 2.1s; }
[data-theme="light"] .xmas-garland i::after{
    box-shadow: 0 0 7px 1px color-mix(in srgb, var(--c) 70%, transparent), 0 0 0 .5px rgba(60, 40, 60, .25);
}
@keyframes xmas-twinkle{
    0%, 100%{ opacity: 1; filter: brightness(1.15); }
    50%{ opacity: .45; filter: brightness(.8); }
}

/* ------------------------------------------------ fond : neige et traineau */
.xmas-sky{
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.xmas-sky-snow{ position: absolute; inset: 0; width: 100%; height: 100%; }

.xmas-sleigh{
    position: absolute;
    left: 0; top: 0;
    width: 300px;
    margin: -57px 0 0 -150px; /* le point anime est le centre du traineau */
    opacity: 0;
    filter: drop-shadow(0 0 9px rgba(255, 226, 160, .4));
    will-change: transform, opacity;
}
/* Saint Nicolas sur son ane : un attelage plus court que le traineau. */
.xmas-sleigh--nicolas{ width: 200px; margin: -75px 0 0 -100px; }
.xmas-sleigh svg{ display: block; width: 100%; height: auto; overflow: visible; }
[data-theme="light"] .xmas-sleigh{
    filter: drop-shadow(0 4px 8px rgba(77, 47, 73, .3));
}
.xmas-sleigh-nose{ fill: #ff3b3b; }
.xmas-sleigh-nose-glow{ fill: #ff3b3b; opacity: .35; }
.xmas-sleigh-trail{ fill: #ffd98a; }
[data-theme="light"] .xmas-sleigh-trail{ fill: #c9912a; }
.xmas-sleigh-trail circle{ animation: xmas-twinkle 1.1s ease-in-out infinite; }
.xmas-sleigh-trail circle:nth-child(2n){ animation-delay: -.5s; }
.xmas-sleigh-trail circle:nth-child(3n){ animation-delay: -.8s; }

@media (prefers-reduced-motion: reduce){
    .xmas-garland i::after, .xmas-sleigh-trail circle{ animation: none; }
    .xmas-sleigh{ display: none; }
}
