/* ============ Footer ============ */
.footer-avis .pere-noel {
    display: none;
}

.footer-links-content > .footer-christmas-tree {
    position: relative;
    display: block;
    flex: 0 0 auto;
    align-self: center;
    width: clamp(190px, 24vw, 340px);
    aspect-ratio: 525 / 441;
    max-width: calc(50% - 10px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
}

.footer-christmas-tree .footer-links-section-mascotte {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    margin: 0;
    transform: none;
}

.footer-christmas-tree:focus-visible {
    outline: 2px solid #98252b;
    outline-offset: 4px;
    border-radius: 8px;
}

.footer-christmas-tree-lights {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.footer-christmas-tree-light-layer {
    position: absolute;
    inset: 0;
    background: var(--tree-image) center / 100% 100% no-repeat;
    -webkit-mask-image: var(--light-mask, none);
    mask-image: var(--light-mask, none);
    animation: footer-christmas-tree-twinkle 3.15s ease-in-out infinite;
}

@keyframes footer-christmas-tree-twinkle {
    0%, 73%, 100% { filter: brightness(0.6); }
    28%, 49% { filter: brightness(2.45) saturate(1.5); }
}

.footer-christmas-tree-light-layer--star {
    clip-path: polygon(
        28.5% 9%, 28.7% 13.8%, 32.3% 15.9%, 28.6% 17.9%,
        28.1% 22.1%, 25.7% 19.3%, 24.4% 21.3%, 24.5% 19.2%,
        21.7% 19.5%, 23.8% 15.7%, 21.9% 11.5%, 26.2% 12.5%
    );
    animation: footer-christmas-star-twinkle 4.6s ease-in-out infinite;
}

@keyframes footer-christmas-star-twinkle {
    0%, 72%, 100% { filter: brightness(0.78); }
    33%, 51% { filter: brightness(1.65) saturate(1.22); }
}

@media (prefers-reduced-motion: reduce) {
    .footer-christmas-tree-light-layer {
        animation: none;
        opacity: 0;
    }
}

.footer-links-section-mascotte--noel{
    animation: gelatine 0.5s infinite;
    z-index: 20000;
    position: relative
}

@keyframes gelatine {
    from, to { transform: scale(1, 1) }
    25% { transform: scale(0.9, 1.1); }
    50% { transform: scale(1.1, 0.9); }
    75% { transform: scale(0.95, 1.05)}
}





/*------------------------- Animation xmas emojis ---------------------------*/
.xmas-emojis{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    z-index: 2000;
}

.xmas-emojis li{
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    animation: xmas_emoji_animation 10s linear infinite;
    top: -150px;
}




@keyframes xmas_emoji_animation {

    0%{
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    40%{
        opacity: 1;
    }

    100%{
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }

}




@media (min-width: 1200px) {

    .footer-avis{
        position: relative;
        overflow: hidden;
        padding: 90px 0!important;
    }
    .footer-avis .pere-noel {
        display: block;
        position: absolute;
        height: 210px;
        aspect-ratio: 581 / 549;
        bottom: 0;
        right: 50px;
        --sleigh-image: url("/modules/domadventcalendar/views/front/images/vincent-traineau.png");
        /* Outline of the speech bubble in the original, right-facing image. */
        --sleigh-bubble-edge: 41% 0, 41% 18%, 47% 38%, 54.5% 37.5%,
            56% 41%, 61% 41%, 63% 35%, 92% 23.5%, 92% 0;
    }

    .footer-avis .pere-noel::before,
    .footer-avis .pere-noel::after {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--sleigh-image) center / 100% 100% no-repeat;
    }

    .footer-avis .pere-noel::before {
        clip-path: polygon(0 0, var(--sleigh-bubble-edge), 100% 0, 100% 100%, 0 100%);
        transform: scaleX(-1);
    }

    .footer-avis .pere-noel::after {
        clip-path: polygon(var(--sleigh-bubble-edge));
        transform: translate(-10%, 1%);
    }

    .footer-avis.animated-xmas .pere-noel{
        -webkit-animation:slide-left 4s cubic-bezier(0.52, 0.12, 0.09, 0.46);
        animation:slide-left 4s cubic-bezier(0.52, 0.12, 0.09, 0.46);
    }


    @keyframes slide-left {
        0% {
            bottom: 0;
            right: 50px;
            scale: 1;
            opacity: 1;
        }
        70% {
            right: 100%;
            bottom: 100%;
            rotate: 30deg;
            scale: .3;
            opacity: 0;
        }
        71% {
            right: -100%;
            bottom: 0;
            rotate: 30deg;
            scale: 1;
            opacity: 0;
        }
        100% {
            bottom: 0;
            right: 50px;
            scale: 1;
            opacity: 1;
        }
    }

}