/* Thanksgiving, Valentine's Day, Easter and summer vacation decorations.
   Only linked inside one of those windows (see tracker/seasonal.py);
   static/js/holidays.js builds most of what this styles. Everything
   decorative carries .holiday-fx so one rule can hide it all. */

.holiday-off .holiday-fx { display: none !important; }

@media print {
    .holiday-fx, .holiday-toggle { display: none !important; }
}

/* Room at the top of the nav for the garland. */
html:not(.holiday-off) .top-nav { padding-top: 32px; }

/* ---------- Banner (server-rendered under the top nav) ---------- */
.hol-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    align-self: stretch;
    padding: 7px 16px;
    color: #fbf7f0;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}
.hol-banner strong { font-weight: 800; }
.hol-banner svg { width: 22px; height: 22px; flex: none; }
.hol-banner.hol-valentine { background: #7a1f3d; }
.hol-banner.hol-valentine strong { color: #ffc2d1; }
.hol-banner.hol-easter { background: #4a3a78; }
.hol-banner.hol-easter strong { color: #ffd76a; }
.hol-banner.hol-thanksgiving { background: #5a3417; }
.hol-banner.hol-thanksgiving strong { color: #f2b24a; }
.hol-banner.hol-summer { background: #0b6e8a; }
.hol-banner.hol-summer strong { color: #ffd23f; }

/* The login page centres everything in a flex column, so pin its banner to
   the top, below the garland. base.html pages start with the nav instead. */
body > .hol-banner:first-child { position: absolute; top: 34px; left: 0; right: 0; }

/* ---------- Footer switch (not .holiday-fx: it has to stay to turn back on) ---------- */
footer .holiday-toggle {
    display: inline;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #007bff;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}
footer .holiday-toggle:hover { background: none; color: #0056b3; }

/* ---------- Garland ---------- */
.hol-garland {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    overflow: visible;
    pointer-events: none;
    z-index: 5;
}
.hol-garland .g-item {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: hol-sway var(--sw, 3s) ease-in-out infinite alternate;
    animation-delay: var(--dl, 0s);
}
@keyframes hol-sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

/* ---------- Footer scene ---------- */
.hol-scene-wrap { text-align: center; margin-bottom: 6px; }
.hol-scene {
    --ground: #eef4f9;
    --ground-line: #d3e1ec;
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: flex-end;
    gap: 14px;
    padding: 0 26px 8px;
    isolation: isolate;
}
.hol-scene.valentine { --ground: #fde8ee; --ground-line: #f6c9d6; }
.hol-scene.easter { --ground: #e6f3da; --ground-line: #cbe4b6; }
.hol-scene.thanksgiving { --ground: #f4e6c8; --ground-line: #e3cc9c; }
.hol-scene.summer { --ground: #f6e7c1; --ground-line: #e7cf93; }
.hol-scene::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18px;
    z-index: -1;
    background: var(--ground);
    border-top: 1px solid var(--ground-line);
    border-radius: 50% 50% 8px 8px / 100% 100% 8px 8px;
}
footer .hol-prop {
    position: relative;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    line-height: 0;
    cursor: pointer;
}
footer .hol-prop:hover { background: none; }
footer .hol-prop:focus-visible { outline: 2px solid #007bff; outline-offset: 2px; }
.hol-prop svg { width: 100%; height: auto; overflow: visible; }
.hol-prop.bop { animation: hol-bop .5s ease-out; }
@keyframes hol-bop {
    0% { transform: none; }
    35% { transform: translateY(-8px) scale(1.05, .96); }
    70% { transform: scale(.97, 1.03); }
    100% { transform: none; }
}
.hol-prop .lid { transform-box: fill-box; transform-origin: 20% 100%; transition: transform .3s ease-out; }
.hol-prop.open .lid { transform: translate(-4px, -12px) rotate(-16deg); }
.hol-prop .glory {
    transform-box: fill-box;
    transform-origin: center;
    filter: drop-shadow(0 0 4px #ffd96a);
    animation: hol-glow 2.8s ease-in-out infinite alternate;
    transition: filter .3s;
}
.hol-prop.shine .glory { filter: drop-shadow(0 0 10px #ffe38a) drop-shadow(0 0 3px #fff4c2); }
@keyframes hol-glow { from { opacity: .8; } to { opacity: 1; } }
.hol-prop .rays { transform-box: fill-box; transform-origin: center; }
.hol-prop.spin .rays { animation: hol-spin 1.1s ease-in-out; }
@keyframes hol-spin { to { transform: rotate(180deg); } }
.hol-prop .steam { opacity: 0; transition: opacity .3s, transform .9s ease-out; }
.hol-prop.steam .steam { opacity: .9; transform: translateY(-5px); }
.hol-prop .flag { transform-box: fill-box; transform-origin: 0 50%; animation: hol-flag .9s ease-in-out infinite alternate; }
@keyframes hol-flag { from { transform: skewY(-8deg); } to { transform: skewY(6deg) scaleX(.9); } }

.hol-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, 4px);
    padding: 4px 10px;
    border-radius: 10px;
    background: #1b1d26;
    color: #f2efe8;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.hol-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: #1b1d26;
}
.hol-bubble.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Things that fly, fall and walk ---------- */
.hol-ambient { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 35; }
.hol-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 40; }
.hol-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.hol-mover { position: absolute; left: 0; top: 0; will-change: transform; }
.hol-mover.ground { top: auto; bottom: 4px; }
.hol-mover .rig { display: block; width: 100%; height: 100%; overflow: visible; }
.hol-mover.left .rig { transform: scaleX(-1); }
.hol-mover .hol-bubble {
    background: #fff;
    color: #1d2126;
    font-weight: 400;
    border: 1px solid #e1e5e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.hol-mover .hol-bubble::after { border-top-color: #fff; }
.hol-trail { position: absolute; left: 0; top: 0; width: 10px; height: 10px; animation: hol-trail 1.1s ease-out forwards; }
@keyframes hol-trail { to { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(.3); } }
.hol-mover .wing { transform-box: fill-box; animation: hol-flutter .18s ease-in-out infinite alternate; }
.hol-mover .wing.l { transform-origin: 100% 50%; }
.hol-mover .wing.r { transform-origin: 0 50%; }
@keyframes hol-flutter { from { transform: scaleX(1); } to { transform: scaleX(.25); } }
.hol-mover .turkey .leg-a,
.hol-mover .turkey .leg-b { transform-box: fill-box; transform-origin: 50% 0; animation: hol-step .6s ease-in-out infinite alternate; }
.hol-mover .turkey .leg-b { animation-delay: -.3s; }
@keyframes hol-step { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
.hol-mover .turkey .head { transform-box: fill-box; transform-origin: 30% 100%; animation: hol-peck .6s ease-in-out infinite alternate; }
@keyframes hol-peck { from { transform: rotate(-6deg); } to { transform: rotate(8deg) translateX(2px); } }
.hol-mover .turkey .body { animation: hol-bob .3s ease-in-out infinite alternate; }
@keyframes hol-bob { to { transform: translateY(1.5px); } }
.hol-mover .plane .prop-blur { transform-box: fill-box; transform-origin: center; animation: hol-prop .12s linear infinite alternate; }
@keyframes hol-prop { to { transform: scaleY(.2); } }

/* Reduced motion: decorations stay, nothing moves. holidays.js also never
   starts the movers, the falling leaves or the confetti. */
@media (prefers-reduced-motion: reduce) {
    .hol-garland .g-item,
    .hol-prop .glory,
    .hol-prop .flag,
    .hol-prop.bop,
    .hol-prop.spin .rays { animation: none; }
}

@media (max-width: 640px) {
    .hol-scene { gap: 8px; padding-inline: 10px; }
    .hol-prop.extra { display: none; }
}
