/*
 * Christmas look of the portal. Loaded only during the Christmas days (config/festive.php).
 * Everything here is decoration: nothing takes clicks, and the work screens keep their layout and colours.
 * The pictures are in /img/festive.
 *
 * The portal's own stylesheet forces square corners and its own text colours on almost every element with
 * "!important". That is why the few rounded shapes below say "!important" as well.
 */

/* ---- 1. Lights hanging under the top bar (logged-in pages) -------------------------------- */

.festive-lights,
.festive-login-lights {
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    background: url(/img/festive/lights-wire.svg) 0 0 / 200px 30px repeat-x;
}

.festive-lights {
    top: 100%;
    margin-top: -3px; /* the wire starts on the bar's edge */
}

/* Two sets of bulbs, so one set glows while the other dims. */
.festive-lights::before,
.festive-lights::after,
.festive-login-lights::before,
.festive-login-lights::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 30px;
}

.festive-lights::before,
.festive-login-lights::before {
    background: url(/img/festive/lights-a.svg) 0 0 / 200px 30px repeat-x;
    animation: festive-twinkle 3.4s ease-in-out infinite;
}

.festive-lights::after,
.festive-login-lights::after {
    background: url(/img/festive/lights-b.svg) 0 0 / 200px 30px repeat-x;
    animation: festive-twinkle 3.4s ease-in-out -1.7s infinite;
}

@keyframes festive-twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* ---- 2. Snow button in the top bar, and the snow over the pages --------------------------- */

.festive-snow-toggle > a {
    font-size: 22px;
    line-height: 1;
    color: #8aa0b8 !important;
    text-decoration: none !important;
}

.festive-snow-toggle > a:hover,
.festive-snow-toggle > a:focus,
.festive-snow-toggle.is-on > a {
    color: #3d8fd6 !important;
}

/* One fixed layer over the page that never takes a click. */
.festive-snow-page {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9000; /* above the page, below pop-up windows */
}

/* ---- 3. Dashboard banner: snow on its top edge and falling snow (the hat is drawn with the ring) ---- */

.festive-banner {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}

.festive-banner__snow {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.festive-banner__cap {
    position: absolute;
    left: 0;
    top: -9px;
    width: 100%;
    height: 34px;
    filter: drop-shadow(0 2px 2px rgba(20, 45, 95, .18));
}

/* ---- 4. The round floating button becomes a bauble --------------------------------------- */

.festive .quick-nav::before {
    /* the gold cap */
    content: "";
    position: absolute;
    right: 22px; /* the button is 60px wide and sits at the right edge of its holder */
    top: -7px;
    width: 16px;
    height: 10px;
    border-radius: 3px 3px 1px 1px !important;
    background: linear-gradient(90deg, #c9952a, #f6d77a 45%, #c9952a);
    z-index: 2;
    pointer-events: none;
}

.festive .quick-nav::after {
    /* the loop it hangs from */
    content: "";
    position: absolute;
    right: 25px;
    top: -16px;
    width: 10px;
    height: 11px;
    border: 2px solid #d9ab3c;
    border-radius: 50% !important;
    box-sizing: border-box;
    z-index: 1;
    pointer-events: none;
}

.festive .quick-nav .quick-nav-trigger {
    /* a soft shine, as on glass */
    background-image: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 34%);
}

/* ---- 5. Login page: lights on top, a winter scene at the bottom, hat on the logo, holly ---- */

.login .login-container {
    position: relative;
    overflow: hidden;
}

.festive-login-lights {
    top: -3px;
    background-image: url(/img/festive/lights-wire-light.svg);
    z-index: 0;
}

.festive-login-scene {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: auto;
    pointer-events: none;
    z-index: 0;
}

.festive-snow-login {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* The logo, the form and the footer stay in front of the scene and the snow. */
.login .login-container > .logo,
.login .login-container > .login-content,
.login .login-container > .login-footer {
    position: relative;
    z-index: 1;
}

/* The hat sits on the O of the logo. festive.js measures the logo and places the hat, so it fits at any size. */
.festive-logo__hat {
    position: absolute;
    transform: rotate(10deg);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
    pointer-events: none;
}

.festive.login .login-form {
    position: relative;
}

.festive.login .login-form::before {
    content: "";
    position: absolute;
    left: -30px;
    top: -34px;
    width: 86px;
    height: 76px;
    background: url(/img/festive/holly.svg) center / contain no-repeat;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25));
    pointer-events: none;
}

/* ---- People who ask their device for less motion get the still version ------------------ */

@media (prefers-reduced-motion: reduce) {
    .festive-lights::before,
    .festive-lights::after,
    .festive-login-lights::before,
    .festive-login-lights::after {
        animation: none;
    }
}
