/* Seasonal art is decorative only: it never changes the configured Canopy
   colors and never receives pointer events. */
.canopy-seasonal-overlay {
    background-image: var(--canopy-seasonal-header-art);
    background-position: top center;
    background-repeat: repeat-x;
    background-size: auto clamp(56px, 4vw, 74px);
    height: clamp(56px, 4vw, 74px);
    left: 0;
    opacity: .96;
    pointer-events: none;
    position: fixed;
    top: 0;
    width: 100%;
    /* Canopy Field's permanent workspace shell uses z-index values through
       12000. Keep artwork above it while pointer-events remains disabled. */
    z-index: 12010;
}

/* The Field sidebar is application navigation, not page canvas. Keep themed
   header artwork entirely to its right. */
html.canopy-field .canopy-seasonal-overlay {
    left: var(--cf-sidebar-width);
    width: calc(100% - var(--cf-sidebar-width));
}

/* Carry the selected theme into the lower page without competing with
   content: a softer, mirrored accent anchors long pages and footers. */
body[class*="canopy-seasonal-theme-"]::after {
    background-image: var(--canopy-seasonal-art);
    background-position: bottom left;
    background-repeat: no-repeat;
    background-size: contain;
    bottom: -44px;
    content: "";
    height: clamp(150px, 20vw, 250px);
    left: -20px;
    opacity: .24;
    pointer-events: none;
    position: fixed;
    transform: rotate(180deg) scaleX(-1);
    width: clamp(270px, 36vw, 580px);
    z-index: 2;
}

body.canopy-seasonal-theme-halloween {
    --canopy-seasonal-art: url("/images/seasonal/canopy-theme-halloween.png");
    --canopy-seasonal-header-art: url("/images/seasonal/canopy-theme-halloween-header.png");
}
body.canopy-seasonal-theme-thanksgiving {
    --canopy-seasonal-art: url("/images/seasonal/canopy-theme-thanksgiving.png");
    --canopy-seasonal-header-art: url("/images/seasonal/canopy-theme-thanksgiving-header.png");
}
body.canopy-seasonal-theme-christmas {
    --canopy-seasonal-art: url("/images/seasonal/canopy-theme-christmas.png");
    --canopy-seasonal-header-art: url("/images/seasonal/canopy-theme-christmas-header-lights.png");
}

body.canopy-seasonal-theme-christmas .canopy-seasonal-overlay {
    animation: none;
}

/* Keep the garland behind the animated bulbs so the light string stays clear
   at compact widths as well as across the desktop header. */
body.canopy-seasonal-theme-christmas .canopy-seasonal-overlay::before {
    background:
        radial-gradient(ellipse 11px 6px at 7px 12px, #2b8050 0 42%, transparent 47%) 0 0 / 24px 18px repeat-x,
        radial-gradient(ellipse 11px 6px at 17px 15px, #155e39 0 42%, transparent 47%) 0 0 / 24px 18px repeat-x,
        linear-gradient(176deg, transparent 0 32%, #0d482c 33% 48%, #1c6a3e 49% 61%, transparent 62%) 0 0 / 24px 18px repeat-x;
    content: "";
    filter: drop-shadow(0 2px 1px rgba(5, 52, 27, .42));
    height: 39px;
    inset: 0 0 auto;
    pointer-events: none;
    position: absolute;
}

.canopy-christmas-lightbulbs {
    display: grid;
    grid-template-columns: repeat(32, minmax(0, 1fr));
    height: 100%;
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.canopy-christmas-lightbulbs span {
    animation: canopy-christmas-bulb-flicker 6.7s steps(1, end) infinite;
    animation-delay: calc(var(--canopy-light-index) * -0.41s);
    background: radial-gradient(circle at 50% 34%, #fff 0 12%, #ffe36e 28%, #ff9d2f 56%, transparent 74%);
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 7px 2px rgba(255, 193, 55, .72);
    height: 9px;
    justify-self: center;
    margin-top: 19px;
    width: 6px;
}

.canopy-christmas-lightbulbs span:nth-child(3n) {
    animation-duration: 5.3s;
    background: radial-gradient(circle at 50% 34%, #fff 0 12%, #7dff99 28%, #23b75c 56%, transparent 74%);
    box-shadow: 0 0 7px 2px rgba(70, 230, 113, .7);
    margin-top: 25px;
}

.canopy-christmas-lightbulbs span:nth-child(4n) {
    animation-duration: 8.1s;
    background: radial-gradient(circle at 50% 34%, #fff 0 12%, #78d4ff 28%, #2f82e4 56%, transparent 74%);
    box-shadow: 0 0 7px 2px rgba(65, 154, 255, .72);
    margin-top: 30px;
}

.canopy-christmas-lightbulbs span:nth-child(5n) {
    animation-duration: 4.6s;
    background: radial-gradient(circle at 50% 34%, #fff 0 12%, #ff766d 28%, #df3030 56%, transparent 74%);
    box-shadow: 0 0 7px 2px rgba(245, 65, 65, .72);
    margin-top: 22px;
}
body.canopy-seasonal-theme-new-years-eve {
    --canopy-seasonal-art: url("/images/seasonal/canopy-theme-new-years-eve.png");
    --canopy-seasonal-header-art: url("/images/seasonal/canopy-theme-new-years-eve-header.png");
}
body.canopy-seasonal-theme-easter {
    --canopy-seasonal-art: url("/images/seasonal/canopy-theme-easter.png");
    --canopy-seasonal-header-art: url("/images/seasonal/canopy-theme-easter-header.png");
}
body.canopy-seasonal-theme-fourth-of-july {
    --canopy-seasonal-art: url("/images/seasonal/canopy-theme-fourth-of-july.png");
    --canopy-seasonal-header-art: url("/images/seasonal/canopy-theme-fourth-of-july-header.png");
}

@keyframes canopy-christmas-bulb-flicker {
    0%, 17%, 25%, 52%, 63%, 100% { opacity: 1; }
    19%, 23%, 56%, 60% { opacity: .16; }
}

@media (max-width: 720px) {
    .canopy-seasonal-overlay {
        height: 58px;
    }

    body[class*="canopy-seasonal-theme-"]::after {
        bottom: -30px;
        height: 112px;
        left: -14px;
        opacity: .18;
        width: 245px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .canopy-christmas-lightbulbs span {
        animation: none;
    }
}
