/* season.css: the Christmas look for the homepage and the login page. Loaded ONLY by seasonLib.php,
 * only on those two pages, only while the season is on. Everything decorative is drawn by
 * assets/js/seasonDecor.js into elements with class .od-xmas (aria-hidden, never clickable).
 * Screen only: on paper every decoration is removed and the pages print as they always have. */

@media print {
  .od-xmas, #od-season-snow { display: none !important; }
}

@media screen {

  :root {
    --xmas-night-top: #0d1836;
    --xmas-night-mid: #1b2d5e;
    --xmas-night-low: #2f4d8f;
    --xmas-pine: #1f6b4a;
    --xmas-pine-deep: #17513a;
    --xmas-pine-light: #2e8b57;
    --xmas-berry: #c62f3b;
    --xmas-snow: #f6f9ff;
    --xmas-snow-shade: #c9d8ef;
  }

  .od-xmas { pointer-events: none; user-select: none; }
  .od-xmas svg { display: block; overflow: visible; }

  /* ── String of lights ─────────────────────────────────────────── */
  .od-xmas-lights { position: fixed; left: 0; right: 0; top: 0; height: 44px; z-index: 99; }
  .od-xmas .bulb { animation: odXmasTwinkle 3.2s ease-in-out infinite; }
  .od-xmas .bulb.t1 { animation-delay: -1.1s; }
  .od-xmas .bulb.t2 { animation-delay: -2.2s; animation-duration: 4.1s; }
  .od-xmas .bulb.t3 { animation-delay: -0.5s; animation-duration: 2.7s; }
  @keyframes odXmasTwinkle {
    0%, 100% { opacity: 1; }
    50%      { opacity: .62; }
  }

  /* ── Snowy hills with pines ───────────────────────────────────── */
  .od-xmas-hills { left: 0; right: 0; bottom: 0; overflow: hidden; }
  .od-xmas-hills .hill { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; }
  .od-xmas-hills .tree { position: absolute; bottom: 30%; }
  .od-xmas-hills .tree svg { height: 100%; width: auto; }

  /* ── Snow resting on an edge ──────────────────────────────────── */
  .od-xmas-cap { position: absolute; left: 0; right: 0; }

  /* ═════════════ Login page ═════════════ */
  body.od-xmas-login {
    background: linear-gradient(180deg, var(--xmas-night-top) 0%, var(--xmas-night-mid) 52%, var(--xmas-night-low) 100%) fixed;
  }
  body.od-xmas-login .beam { background: #f1d98a; }               /* warm window light */
  body.od-xmas-login .od-xmas-hills { position: fixed; height: 27vh; min-height: 130px; max-height: 260px; z-index: 0; }
  body.od-xmas-login .login-container,
  body.od-xmas-login > .card { position: relative; overflow: visible; }
  body.od-xmas-login > .card { z-index: 1; }
  body.od-xmas-login .login-container > .od-xmas-cap,
  body.od-xmas-login > .card > .od-xmas-cap { top: -22px; left: -6px; right: -6px; height: 48px; z-index: 2; }
  body.od-xmas-login .login-wrap { padding-top: 64px; }           /* room under the lights */

  /* the sign-in button goes evergreen for the season */
  body.od-xmas-login .submit-btn { background: var(--xmas-pine); }
  body.od-xmas-login .submit-btn:hover {
    background: var(--xmas-pine-light);
    box-shadow: 0 8px 20px rgba(23, 81, 58, .35);
  }

  /* ═════════════ Homepage ═════════════ */
  body.od-xmas-home .od-xmas-lights { top: 70px; height: 36px; }  /* hangs from the navigation bar */
  body.od-xmas-home .hero {
    background: linear-gradient(180deg, var(--xmas-night-top) 0%, var(--xmas-night-mid) 55%, var(--xmas-night-low) 100%);
  }
  body.od-xmas-home .hero-beam { background: #f1d98a; }
  body.od-xmas-home .hero .od-xmas-hills { position: absolute; height: 78px; z-index: 1; }   /* stays under the numbers card */
  body.od-xmas-home .hero-bridge { visibility: hidden; }          /* the snow line takes its place */

  /* the open door: garland, lights and a wreath */
  body.od-xmas-home .hero-door-art .od-xmas-garland { position: absolute; inset: 0; }   /* no z-index: the door paints over it */
  body.od-xmas-home .hero-door-art .od-xmas-wreath {
    position: absolute; left: 50%; top: 15%; width: 264px; height: 176px; margin-left: -132px;
    /* Drawn wide so it reads round on the OPEN, angled door. While the door is still shut it is
       squeezed back to a circle, and it widens in step with the door's own swing (same timing). */
    transform: scaleX(.67);
    animation: odXmasWreathOpen 1.7s cubic-bezier(0.7, 0, 0.2, 1) 0.9s forwards;
  }
  @keyframes odXmasWreathOpen { to { transform: scaleX(1); } }
  body.od-xmas-home .hero-door-art .door-glow {
    background: radial-gradient(ellipse at 40% 50%, rgba(255, 214, 120, .6), rgba(255, 214, 120, 0) 70%);
  }

  /* snow lying along the top of the footer */
  body.od-xmas-home .site-footer { position: relative; }
  body.od-xmas-home .site-footer > .od-xmas-cap { top: -26px; height: 54px; z-index: 1; }

  /* the main call to action goes evergreen; brass stays everywhere else */
  body.od-xmas-home .hero-ctas .pill-brass { background: var(--xmas-pine); border-color: var(--xmas-pine); color: #fff; }
  body.od-xmas-home .hero-ctas .pill-brass:hover { background: var(--xmas-pine-light); border-color: var(--xmas-pine-light); }

  @media (max-width: 640px) {
    .od-xmas-lights { height: 34px; }
    body.od-xmas-login .od-xmas-hills { height: 20vh; min-height: 100px; }
    body.od-xmas-home .hero .od-xmas-hills { height: 56px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .od-xmas .bulb { animation: none; }
    body.od-xmas-home .hero-door-art .od-xmas-wreath { animation: none; transform: none; }   /* the door is simply open */
  }
}
