/* The Christmas theme. While it's on (Admin > Christmas theme: by itself from Thanksgiving through January 6),
   the server marks each page <html data-season="christmas"> and this sheet does the rest. Everything in it is
   RailroaderHub's own palette: the bulbs are its pink, amber, green and cyan, the snow its moonlight white.
   Nothing goes over what people read or use: the lights hang from the header's edge, snow sits on the logo
   and falls only in the home page's sky. The pieces are in the pages but hidden, so without this sheet
   nothing shows. With reduced motion the lights stay lit and the snow stays still.
   The pictures come from web/tools/make_season.py. */

/* make_season.py: begin */
:root {
  --season-strand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='288' height='30' viewBox='0 0 288 30'%3E%3Cpath d='M0 2.0C20 12.0 52 12.0 72 2.0C92 12.0 124 12.0 144 2.0C164 12.0 196 12.0 216 2.0C236 12.0 268 12.0 288 2.0' fill='none' stroke='%233b3268' stroke-width='1.4' stroke-linecap='round'/%3E%3Cpath d='M9.4 9.1C8.3 12.3 9.7 16.5 12.0 18.1C14.3 16.5 15.7 12.3 14.6 9.1Z' fill='%23f0287f' fill-opacity='0.42'/%3E%3Crect x='10.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M33.4 12.1C32.3 15.3 33.7 19.5 36.0 21.1C38.3 19.5 39.7 15.3 38.6 12.1Z' fill='%23ffc35c' fill-opacity='0.42'/%3E%3Crect x='34.1' y='8.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M57.4 9.1C56.3 12.3 57.7 16.5 60.0 18.1C62.3 16.5 63.7 12.3 62.6 9.1Z' fill='%234fe3a1' fill-opacity='0.42'/%3E%3Crect x='58.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M81.4 9.1C80.3 12.3 81.7 16.5 84.0 18.1C86.3 16.5 87.7 12.3 86.6 9.1Z' fill='%2345d4f0' fill-opacity='0.42'/%3E%3Crect x='82.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M105.4 12.1C104.3 15.3 105.7 19.5 108.0 21.1C110.3 19.5 111.7 15.3 110.6 12.1Z' fill='%23f0287f' fill-opacity='0.42'/%3E%3Crect x='106.1' y='8.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M129.4 9.1C128.3 12.3 129.7 16.5 132.0 18.1C134.3 16.5 135.7 12.3 134.6 9.1Z' fill='%23ffc35c' fill-opacity='0.42'/%3E%3Crect x='130.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M153.4 9.1C152.3 12.3 153.7 16.5 156.0 18.1C158.3 16.5 159.7 12.3 158.6 9.1Z' fill='%234fe3a1' fill-opacity='0.42'/%3E%3Crect x='154.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M177.4 12.1C176.3 15.3 177.7 19.5 180.0 21.1C182.3 19.5 183.7 15.3 182.6 12.1Z' fill='%2345d4f0' fill-opacity='0.42'/%3E%3Crect x='178.1' y='8.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M201.4 9.1C200.3 12.3 201.7 16.5 204.0 18.1C206.3 16.5 207.7 12.3 206.6 9.1Z' fill='%23f0287f' fill-opacity='0.42'/%3E%3Crect x='202.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M225.4 9.1C224.3 12.3 225.7 16.5 228.0 18.1C230.3 16.5 231.7 12.3 230.6 9.1Z' fill='%23ffc35c' fill-opacity='0.42'/%3E%3Crect x='226.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M249.4 12.1C248.3 15.3 249.7 19.5 252.0 21.1C254.3 19.5 255.7 15.3 254.6 12.1Z' fill='%234fe3a1' fill-opacity='0.42'/%3E%3Crect x='250.1' y='8.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3Cpath d='M273.4 9.1C272.3 12.3 273.7 16.5 276.0 18.1C278.3 16.5 279.7 12.3 278.6 9.1Z' fill='%2345d4f0' fill-opacity='0.42'/%3E%3Crect x='274.1' y='5.8' width='3.8' height='3.9' rx='0.9' fill='%2351478a'/%3E%3C/svg%3E");
  --season-lit-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='288' height='30' viewBox='0 0 288 30'%3E%3Cdefs%3E%3CradialGradient id='g0'%3E%3Cstop offset='0' stop-color='%23f0287f' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%23f0287f' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g1'%3E%3Cstop offset='0' stop-color='%23ffc35c' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%23ffc35c' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g2'%3E%3Cstop offset='0' stop-color='%234fe3a1' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%234fe3a1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g3'%3E%3Cstop offset='0' stop-color='%2345d4f0' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%2345d4f0' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='12.0' cy='13.7' r='9.5' fill='url%28%23g0%29'/%3E%3Cpath d='M9.4 9.1C8.3 12.3 9.7 16.5 12.0 18.1C14.3 16.5 15.7 12.3 14.6 9.1Z' fill='%23f0287f'/%3E%3Cellipse cx='10.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='60.0' cy='13.7' r='9.5' fill='url%28%23g2%29'/%3E%3Cpath d='M57.4 9.1C56.3 12.3 57.7 16.5 60.0 18.1C62.3 16.5 63.7 12.3 62.6 9.1Z' fill='%234fe3a1'/%3E%3Cellipse cx='58.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='108.0' cy='16.7' r='9.5' fill='url%28%23g0%29'/%3E%3Cpath d='M105.4 12.1C104.3 15.3 105.7 19.5 108.0 21.1C110.3 19.5 111.7 15.3 110.6 12.1Z' fill='%23f0287f'/%3E%3Cellipse cx='106.9' cy='15.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='156.0' cy='13.7' r='9.5' fill='url%28%23g2%29'/%3E%3Cpath d='M153.4 9.1C152.3 12.3 153.7 16.5 156.0 18.1C158.3 16.5 159.7 12.3 158.6 9.1Z' fill='%234fe3a1'/%3E%3Cellipse cx='154.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='204.0' cy='13.7' r='9.5' fill='url%28%23g0%29'/%3E%3Cpath d='M201.4 9.1C200.3 12.3 201.7 16.5 204.0 18.1C206.3 16.5 207.7 12.3 206.6 9.1Z' fill='%23f0287f'/%3E%3Cellipse cx='202.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='252.0' cy='16.7' r='9.5' fill='url%28%23g2%29'/%3E%3Cpath d='M249.4 12.1C248.3 15.3 249.7 19.5 252.0 21.1C254.3 19.5 255.7 15.3 254.6 12.1Z' fill='%234fe3a1'/%3E%3Cellipse cx='250.9' cy='15.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3C/svg%3E");
  --season-lit-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='288' height='30' viewBox='0 0 288 30'%3E%3Cdefs%3E%3CradialGradient id='g0'%3E%3Cstop offset='0' stop-color='%23f0287f' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%23f0287f' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g1'%3E%3Cstop offset='0' stop-color='%23ffc35c' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%23ffc35c' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g2'%3E%3Cstop offset='0' stop-color='%234fe3a1' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%234fe3a1' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='g3'%3E%3Cstop offset='0' stop-color='%2345d4f0' stop-opacity='0.75'/%3E%3Cstop offset='1' stop-color='%2345d4f0' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='36.0' cy='16.7' r='9.5' fill='url%28%23g1%29'/%3E%3Cpath d='M33.4 12.1C32.3 15.3 33.7 19.5 36.0 21.1C38.3 19.5 39.7 15.3 38.6 12.1Z' fill='%23ffc35c'/%3E%3Cellipse cx='34.9' cy='15.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='84.0' cy='13.7' r='9.5' fill='url%28%23g3%29'/%3E%3Cpath d='M81.4 9.1C80.3 12.3 81.7 16.5 84.0 18.1C86.3 16.5 87.7 12.3 86.6 9.1Z' fill='%2345d4f0'/%3E%3Cellipse cx='82.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='132.0' cy='13.7' r='9.5' fill='url%28%23g1%29'/%3E%3Cpath d='M129.4 9.1C128.3 12.3 129.7 16.5 132.0 18.1C134.3 16.5 135.7 12.3 134.6 9.1Z' fill='%23ffc35c'/%3E%3Cellipse cx='130.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='180.0' cy='16.7' r='9.5' fill='url%28%23g3%29'/%3E%3Cpath d='M177.4 12.1C176.3 15.3 177.7 19.5 180.0 21.1C182.3 19.5 183.7 15.3 182.6 12.1Z' fill='%2345d4f0'/%3E%3Cellipse cx='178.9' cy='15.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='228.0' cy='13.7' r='9.5' fill='url%28%23g1%29'/%3E%3Cpath d='M225.4 9.1C224.3 12.3 225.7 16.5 228.0 18.1C230.3 16.5 231.7 12.3 230.6 9.1Z' fill='%23ffc35c'/%3E%3Cellipse cx='226.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3Ccircle cx='276.0' cy='13.7' r='9.5' fill='url%28%23g3%29'/%3E%3Cpath d='M273.4 9.1C272.3 12.3 273.7 16.5 276.0 18.1C278.3 16.5 279.7 12.3 278.6 9.1Z' fill='%2345d4f0'/%3E%3Cellipse cx='274.9' cy='12.1' rx='0.75' ry='1.7' fill='%23f6f1ff' fill-opacity='0.7'/%3E%3C/svg%3E");
  --season-snow-far: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Ccircle cx='133.8' cy='218.2' r='0.83' fill='%23f6f1ff' fill-opacity='0.51'/%3E%3Ccircle cx='140.2' cy='47.0' r='0.85' fill='%23f6f1ff' fill-opacity='0.53'/%3E%3Ccircle cx='187.9' cy='26.0' r='0.91' fill='%23f6f1ff' fill-opacity='0.46'/%3E%3Ccircle cx='191.7' cy='164.8' r='0.65' fill='%23f6f1ff' fill-opacity='0.36'/%3E%3Ccircle cx='227.6' cy='155.6' r='1.09' fill='%23f6f1ff' fill-opacity='0.57'/%3E%3Ccircle cx='7.7' cy='126.6' r='0.68' fill='%23f6f1ff' fill-opacity='0.37'/%3E%3Ccircle cx='60.2' cy='11.2' r='0.70' fill='%23f6f1ff' fill-opacity='0.51'/%3E%3Ccircle cx='199.3' cy='124.4' r='0.82' fill='%23f6f1ff' fill-opacity='0.57'/%3E%3Ccircle cx='157.6' cy='110.1' r='0.85' fill='%23f6f1ff' fill-opacity='0.45'/%3E%3Ccircle cx='234.8' cy='198.8' r='1.10' fill='%23f6f1ff' fill-opacity='0.60'/%3E%3Ccircle cx='57.4' cy='71.1' r='0.76' fill='%23f6f1ff' fill-opacity='0.37'/%3E%3Ccircle cx='96.9' cy='200.3' r='0.98' fill='%23f6f1ff' fill-opacity='0.49'/%3E%3Ccircle cx='200.4' cy='4.3' r='1.08' fill='%23f6f1ff' fill-opacity='0.42'/%3E%3Ccircle cx='113.0' cy='231.3' r='1.06' fill='%23f6f1ff' fill-opacity='0.49'/%3E%3Ccircle cx='150.0' cy='184.5' r='0.64' fill='%23f6f1ff' fill-opacity='0.44'/%3E%3Ccircle cx='81.2' cy='227.5' r='0.64' fill='%23f6f1ff' fill-opacity='0.62'/%3E%3Ccircle cx='61.3' cy='27.6' r='0.66' fill='%23f6f1ff' fill-opacity='0.37'/%3E%3Ccircle cx='45.4' cy='133.7' r='1.00' fill='%23f6f1ff' fill-opacity='0.51'/%3E%3Ccircle cx='173.7' cy='34.5' r='0.70' fill='%23f6f1ff' fill-opacity='0.58'/%3E%3Ccircle cx='101.6' cy='53.5' r='0.66' fill='%23f6f1ff' fill-opacity='0.44'/%3E%3Ccircle cx='190.3' cy='74.6' r='1.09' fill='%23f6f1ff' fill-opacity='0.66'/%3E%3Ccircle cx='95.5' cy='202.1' r='0.71' fill='%23f6f1ff' fill-opacity='0.57'/%3E%3Ccircle cx='233.3' cy='53.6' r='0.65' fill='%23f6f1ff' fill-opacity='0.44'/%3E%3Ccircle cx='80.4' cy='72.8' r='0.99' fill='%23f6f1ff' fill-opacity='0.38'/%3E%3C/svg%3E");
  --season-snow-mid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360' viewBox='0 0 360 360'%3E%3Ccircle cx='336.5' cy='316.9' r='1.75' fill='%23f6f1ff' fill-opacity='0.48'/%3E%3Ccircle cx='153.4' cy='190.5' r='1.56' fill='%23f6f1ff' fill-opacity='0.50'/%3E%3Ccircle cx='160.7' cy='82.7' r='1.32' fill='%23f6f1ff' fill-opacity='0.61'/%3E%3Ccircle cx='35.5' cy='253.3' r='1.21' fill='%23f6f1ff' fill-opacity='0.60'/%3E%3Ccircle cx='261.7' cy='130.8' r='1.51' fill='%23f6f1ff' fill-opacity='0.47'/%3E%3Ccircle cx='211.1' cy='235.1' r='1.67' fill='%23f6f1ff' fill-opacity='0.67'/%3E%3Ccircle cx='132.1' cy='270.6' r='1.78' fill='%23f6f1ff' fill-opacity='0.58'/%3E%3Ccircle cx='236.0' cy='115.3' r='1.54' fill='%23f6f1ff' fill-opacity='0.48'/%3E%3Ccircle cx='256.0' cy='211.6' r='1.48' fill='%23f6f1ff' fill-opacity='0.61'/%3E%3Ccircle cx='69.1' cy='67.9' r='1.59' fill='%23f6f1ff' fill-opacity='0.56'/%3E%3Ccircle cx='73.8' cy='45.5' r='1.69' fill='%23f6f1ff' fill-opacity='0.48'/%3E%3Ccircle cx='101.7' cy='205.4' r='1.22' fill='%23f6f1ff' fill-opacity='0.74'/%3E%3Ccircle cx='134.5' cy='106.2' r='1.40' fill='%23f6f1ff' fill-opacity='0.56'/%3E%3C/svg%3E");
  --season-snow-near: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520' viewBox='0 0 520 520'%3E%3Cdefs%3E%3CradialGradient id='f'%3E%3Cstop offset='0.35' stop-color='%23f6f1ff'/%3E%3Cstop offset='1' stop-color='%23f6f1ff' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='53.5' cy='319.6' r='4.28' fill='url%28%23f%29' fill-opacity='0.84'/%3E%3Ccircle cx='267.6' cy='326.3' r='4.47' fill='url%28%23f%29' fill-opacity='0.68'/%3E%3Ccircle cx='61.7' cy='352.5' r='4.09' fill='url%28%23f%29' fill-opacity='0.76'/%3E%3Ccircle cx='198.6' cy='379.4' r='3.78' fill='url%28%23f%29' fill-opacity='0.71'/%3E%3Ccircle cx='498.3' cy='431.1' r='4.63' fill='url%28%23f%29' fill-opacity='0.58'/%3E%3Ccircle cx='153.1' cy='189.8' r='3.51' fill='url%28%23f%29' fill-opacity='0.80'/%3E%3Ccircle cx='291.7' cy='330.4' r='4.46' fill='url%28%23f%29' fill-opacity='0.75'/%3E%3C/svg%3E");
}
/* make_season.py: end */

/* ---------------------------------------------------------- the lights under the header */

[data-season="christmas"] .season-lights[hidden] {
  display: block !important;
}

.season-lights {
  position: absolute;
  inset: 100% 0 auto;
  height: 30px;
  margin-top: -3px;
  overflow: hidden;
  pointer-events: none;
  background: var(--season-strand) 50% 0 / 288px 30px repeat-x;
}

.season-lights::before,
.season-lights::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--season-lit-a) 50% 0 / 288px 30px repeat-x;
  animation: season-twinkle 3.6s ease-in-out infinite;
}

.season-lights::after {
  background-image: var(--season-lit-b);
  animation-delay: -1.8s;
}

@keyframes season-twinkle {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.16;
  }
}

/* ---------------------------------------------------------- snow on the logo */

[data-season="christmas"] .rh-snow {
  display: inline;
}

[data-season="christmas"] .brand svg {
  overflow: visible;
}

/* ---------------------------------------------------------- the greeting in the footer */

[data-season="christmas"] .season-greeting[hidden] {
  display: block !important;
}

.season-greeting {
  margin-bottom: 4px;
  color: var(--amber);
  font: 680 16px/1.35 var(--display);
}

/* ---------------------------------------------------------- the home page: snow in the sky */

[data-season="christmas"] .season-snow[hidden] {
  display: block !important;
}

.season-snow {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Lighter behind the words, like the map. */
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.45), #000 55%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.45), #000 55%);
}

.season-snow i {
  position: absolute;
  top: calc(-1 * var(--tile));
  right: -24px;
  bottom: 0;
  left: -24px;
  background: var(--flakes) 0 0 / var(--tile) var(--tile) repeat;
  animation: season-fall var(--fall) linear infinite, season-sway var(--sway) ease-in-out infinite alternate;
  will-change: transform;
}

/* Far, middle and near: the nearer, the bigger and faster. */
.season-snow i:nth-child(1) {
  --tile: 240px;
  --flakes: var(--season-snow-far);
  --fall: 30s;
  --sway: 9s;
}

.season-snow i:nth-child(2) {
  --tile: 360px;
  --flakes: var(--season-snow-mid);
  --fall: 20s;
  --sway: 7s;
}

.season-snow i:nth-child(3) {
  --tile: 520px;
  --flakes: var(--season-snow-near);
  --fall: 13s;
  --sway: 5.5s;
}

@keyframes season-fall {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(var(--tile));
  }
}

@keyframes season-sway {
  from {
    translate: -10px 0;
  }

  to {
    translate: 10px 0;
  }
}

/* ---------------------------------------------------------- the home page: the trains lit up */

[data-season="christmas"] .hero-map .car {
  fill: var(--amber);
  animation: season-car 2.8s ease-in-out infinite;
}

[data-season="christmas"] .hero-map .car:nth-of-type(4n + 3) {
  fill: var(--green);
}

[data-season="christmas"] .hero-map .car:nth-of-type(4n) {
  fill: var(--cyan);
}

[data-season="christmas"] .hero-map .car:nth-of-type(4n + 1) {
  fill: var(--pink);
}

[data-season="christmas"] .hero-map .car:nth-of-type(odd) {
  animation-delay: -1.4s;
}

@keyframes season-car {
  0%,
  100% {
    fill-opacity: 1;
  }

  50% {
    fill-opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .season-lights::before,
  .season-lights::after,
  .season-snow i,
  [data-season="christmas"] .hero-map .car {
    animation: none;
  }

  .season-snow i:nth-child(3) {
    display: none;
  }
}
