/* The Thanksgiving theme (thanksgiving.js). Every rule here hangs off
   body.thanksgiving or the layer that file builds, so with the theme off none
   of it applies.

   Nothing in here touches a colour that carries meaning -- lines, trains,
   incidents, traffic, the board's figures -- and nothing sits over a card:
   the map layer is inside #mapwrap, below the top bar, the panel, the
   presentation card and the band. Same arrangement as halloween.css. */

:root{
  /* Autumn leaves, from deep red to gold, and the bark they hang from. */
  --tg-c1:#b8362c; --tg-c2:#cf5a1f; --tg-c3:#e5802a; --tg-c4:#eda83a; --tg-c5:#f2c650;
  --tg-vein:rgba(74,30,10,.5); --tg-bark:#6a4325; --tg-bark-dark:#4f3019;
  /* The harvest. */
  --tg-rind:#e0832f; --tg-rind-mid:#cf6f22; --tg-rind-dark:#b85d18; --tg-rib:#8f4510; --tg-pstem:#6b5a2a; --tg-vine:#7c8a3a;
  --tg-cob:#f0c13e; --tg-kernel:#c98f1f; --tg-husk:#cbb27a; --tg-husk-b:#b39657;
  /* The turkey. */
  --tg-plume:#7a4a26; --tg-plume-dark:#5a341a; --tg-face:#d7a77c; --tg-snood:#d6392c; --tg-beak:#f0a030; --tg-feet:#e09a35;
  /* Text: the wordmark, the greeting and the settings switch. */
  --tg-amber:#f2b445;
}

/* The wordmark's .com (or .work) in harvest amber rather than the airport cyan. */
body.thanksgiving .brand h1 span{color:var(--tg-amber)}

/* ---------- leaves (boughs, greeting, falling) ---------- */
.tg-leaf{stroke:rgba(60,25,8,.35); stroke-width:.35; stroke-linejoin:round}
.tg-c1{fill:var(--tg-c1)} .tg-c2{fill:var(--tg-c2)} .tg-c3{fill:var(--tg-c3)} .tg-c4{fill:var(--tg-c4)} .tg-c5{fill:var(--tg-c5)}
.tg-vein{fill:none; stroke:var(--tg-vein); stroke-width:.6; stroke-linecap:round}

/* ---------- greeting in the top bar ----------
   Takes only the bar's spare width (flex-basis 0) so it can never wrap the bar
   onto another row; the container query drops the words, then everything, as
   that spare width shrinks. */
.tg-hello{flex:1 1 0; min-width:0; align-self:center; overflow:hidden; container-type:inline-size;
  display:flex; justify-content:center; pointer-events:none}
.tg-hello-in{display:inline-flex; align-items:center; gap:.55em; white-space:nowrap;
  color:var(--tg-amber); font-weight:700; font-size:var(--fs); letter-spacing:.03em}
.tg-icon{display:block; width:1.35em; height:auto; overflow:visible; transform:rotate(-14deg)}
.tg-icon-r{transform:rotate(16deg) scaleX(-1)}
@container (max-width:15.5em){
  .tg-hello b,.tg-hello .tg-icon-r{display:none}
}
@container (max-width:2em){.tg-hello-in{visibility:hidden}}
body.tv .tg-hello-in{font-size:var(--fs-lg)}

/* ---------- the map layer ---------- */
/* Above the map (Leaflet's own panes stop at 400 inside their container, and
   Google's sit in a stacking context of their own at 0), below every card:
   #mapwrap is a stacking context beneath the bar and the cards, so z-index
   here never reaches them. Leaflet's corner controls (1000) stay on top. */
.tg-layer{position:absolute; inset:0; z-index:500; overflow:hidden; pointer-events:none;
  --t:0px; --l:0px; --rr:0px; --bb:0px; --s:120px; --p:48px}
.tg-layer *{pointer-events:none}

/* Boughs of autumn leaves in the clear area's two top corners, reaching in
   from behind the board's edge and the panel or card beside them. */
.tg-bough{position:absolute; top:var(--t); width:var(--s); height:calc(var(--s) * .7); transition:opacity .6s var(--ease)}
.tg-bough svg{display:block; width:100%; height:100%; overflow:visible;
  filter:drop-shadow(0 1px 1.5px rgba(10,6,2,.55))}
/* The leaves, each an element hung at its stalk on the twig (thanksgiving.js):
   .tg-lf is a point at the stalk, turned and sized; .tg-lf-in is the leaf,
   pivoting on that point. --s / 100 is one unit of the bough's 100 x 70 box. */
.tg-lf{position:absolute; width:0; height:0; transform-origin:0 0}
.tg-lf-in{position:absolute; left:calc(var(--s) * -.11); top:calc(var(--s) * -.215);
  width:calc(var(--s) * .22); height:calc(var(--s) * .225); transform-origin:50% 95.56%}
.tg-bough-l{left:var(--l)}
.tg-bough-r{right:var(--rr); transform:scaleX(-1)}
.tg-narrow .tg-bough-l{display:none}
.tg-twig{fill:none; stroke:var(--tg-bark); stroke-linecap:round}
.tg-twig-l{stroke-width:2.6; stroke:var(--tg-bark-dark)}
.tg-twig-m{stroke-width:1.7}
.tg-twig-s{stroke-width:1.05}
.tg-nut{fill:#a8692e}
.tg-cap{fill:#6b4a2a; stroke:#4f3019; stroke-width:.4}

/* A light breeze. Each bough rocks a little from where it comes in, slowly,
   the two out of step; every leaf stirs on its stalk at its own pace, a little
   more towards the bough's end (thanksgiving.js gives each its duration, start
   and tg-far1..3); and when leaves let go, a gust lifts that bough (.tg-bough-in,
   turned by thanksgiving.js). All of it is transforms the compositor runs. The
   rotations are about the box's top-left corner, which on the mirrored
   right-hand bough is the screen's top-right. */
.tg-bough-in,.tg-bough-rock{position:relative; width:100%; height:100%; transform-origin:0 0}
.tg-bough-rock{animation:tg-breeze 7s ease-in-out infinite alternate}
.tg-bough-r .tg-bough-rock{animation-duration:8.2s; animation-delay:-3.1s}
@keyframes tg-breeze{from{transform:rotate(-.6deg)} to{transform:rotate(1.4deg)}}
.tg-lf-in{animation:tg-far1 4s ease-in-out infinite alternate}
.tg-far2{animation-name:tg-far2}
.tg-far3{animation-name:tg-far3}
@keyframes tg-far1{from{transform:rotate(-3deg)} to{transform:rotate(3deg)}}
@keyframes tg-far2{from{transform:rotate(-4.5deg)} to{transform:rotate(4.5deg)}}
@keyframes tg-far3{from{transform:rotate(-6deg)} to{transform:rotate(6deg)}}

/* The region and backup slides are about the roads' traffic colours, which
   run right into the corners and down to the band there: the boughs and the
   harvest step aside, and the map is left as it is. */
body[data-stage="traffic"] .tg-bough,body[data-stage="hotspot"] .tg-bough,
body[data-stage="traffic"] .tg-harvest,body[data-stage="hotspot"] .tg-harvest{opacity:0}
body[data-stage="traffic"] .tg-bough *,body[data-stage="hotspot"] .tg-bough *{animation-play-state:paused}

/* The harvest, sitting on the band at the right of the clear area: a pumpkin,
   the turkey and an ear of corn leaning on him. */
.tg-harvest{position:absolute; right:calc(var(--rr) + var(--p) * .25); bottom:var(--bb);
  display:flex; align-items:flex-end; transition:opacity .6s var(--ease)}
.tg-h{position:relative; display:block}
.tg-h svg{display:block; width:100%; height:auto; overflow:visible}
.tg-h1{width:var(--p); z-index:1}
.tg-h2{width:calc(var(--p) * .74); margin-right:calc(var(--p) * -.14)}
.tg-h3{width:calc(var(--p) * .56); margin-left:calc(var(--p) * -.16); z-index:2}
/* A soft shadow on the ground under them. */
.tg-h::before{content:""; position:absolute; left:4%; right:4%; bottom:-6%; height:16%; z-index:-1;
  border-radius:50%; background:radial-gradient(closest-side, rgba(0,0,0,.42), rgba(0,0,0,0))}

.tg-rind ellipse{stroke:var(--tg-rib); stroke-width:.9}
.tg-rind ellipse:nth-child(1),.tg-rind ellipse:nth-child(2){fill:var(--tg-rind-dark)}
.tg-rind ellipse:nth-child(3),.tg-rind ellipse:nth-child(4){fill:var(--tg-rind-mid)}
.tg-rind ellipse:nth-child(5){fill:var(--tg-rind)}
.tg-pstem{fill:var(--tg-pstem)}
.tg-vine{fill:none; stroke:var(--tg-vine); stroke-width:1.2; stroke-linecap:round}

.tg-cob{fill:var(--tg-cob)}
.tg-rows{fill:none; stroke:var(--tg-kernel); stroke-width:.7; stroke-linecap:round}
.tg-husk{fill:var(--tg-husk); stroke:#8e7642; stroke-width:.4}
.tg-husk-b{fill:var(--tg-husk-b)}
.tg-stalk{fill:#8e7642}

.tg-quill{stroke:rgba(40,18,6,.45); stroke-width:.5}
.tg-q1{fill:var(--tg-c1)} .tg-q2{fill:var(--tg-plume-dark)} .tg-q3{fill:var(--tg-c2)}
.tg-qi1{fill:var(--tg-c3)} .tg-qi2{fill:var(--tg-c4)} .tg-qi3{fill:var(--tg-c5)}
.tg-body{fill:var(--tg-plume)}
.tg-breast{fill:#8f5b30}
.tg-wing{fill:var(--tg-plume-dark)}
.tg-neck,.tg-face{fill:var(--tg-face)}
.tg-eye{fill:#1d130c}
.tg-glint{fill:#fff}
.tg-beak{fill:var(--tg-beak)}
.tg-snood{fill:var(--tg-snood)}
.tg-legs{fill:none; stroke:var(--tg-feet); stroke-width:1.5; stroke-linecap:round}
/* Every so often he gobbles: a quick bob of the head and a puff of the tail,
   then stillness for the rest of the cycle. */
.tg-head{transform-box:fill-box; transform-origin:50% 100%; animation:tg-gobble 11s ease-in-out infinite}
.tg-tail{transform-box:view-box; transform-origin:32px 34px; animation:tg-fan 11s ease-in-out infinite}
@keyframes tg-gobble{
  0%,86%,100%{transform:none}
  89%{transform:rotate(-9deg)} 92%{transform:rotate(8deg)} 95%{transform:rotate(-6deg)} 97.5%{transform:rotate(3deg)}
}
@keyframes tg-fan{
  0%,86%,100%{transform:none}
  90%,95%{transform:scale(1.06)}
}

/* Falling leaves and the geese: placed and moved by thanksgiving.js. */
.tg-fall{position:absolute; left:0; top:0; opacity:0}
.tg-fall svg{display:block; width:100%; height:auto; overflow:visible;
  filter:drop-shadow(0 1px 1.5px rgba(10,6,2,.55))}
.tg-goose{position:absolute; left:0; top:0}
/* Pale enough to read on the dark map; the black neck and head carry a faint
   light edge so they don't vanish into it. */
.tg-goose svg{display:block; width:100%; height:auto; overflow:visible;
  filter:drop-shadow(0 1px 1.2px rgba(0,0,0,.65))}
.tg-west svg{transform:scaleX(-1)}
.tg-gbody{fill:#bfae96}
.tg-gbelly{fill:#e6dccb}
.tg-gblack{fill:#16120f; stroke:rgba(235,228,214,.45); stroke-width:.5}
.tg-gcheek{fill:#f6f3ec}
.tg-gwing{fill:#8f7d66; stroke:rgba(40,30,20,.5); stroke-width:.4; transform-box:view-box; transform-origin:20px 11.6px;
  animation:tg-flap var(--flap, .6s) ease-in-out infinite alternate}
@keyframes tg-flap{from{transform:scaleY(1)} to{transform:scaleY(-.55)}}

/* ---------- the surprises (thanksgiving.js) ---------- */
/* The turkey out of the Bay. Everything hangs off one point on the water,
   which thanksgiving.js keeps under it as the map moves: the rings spread from
   it, and the clip's bottom edge is the waterline, so he comes up out of it and
   goes back under. --b is his width, --rg the rings' (kept to the water). */
.tg-bay{position:absolute; left:0; top:0; width:0; height:0; --b:120px; --rg:100px}
.tg-ring,.tg-foam,.tg-drop{position:absolute; display:block; border-radius:50%}
.tg-ring{left:calc(var(--rg) * -.5); top:calc(var(--rg) * -.135); width:var(--rg); height:calc(var(--rg) * .27);
  border:1.5px solid rgba(196,226,255,.8); opacity:0}
.tg-foam{left:calc(var(--b) * -.28); top:calc(var(--b) * -.065); width:calc(var(--b) * .56); height:calc(var(--b) * .13);
  border:2px solid transparent; opacity:0}
.tg-foam-back{border-top-color:rgba(214,236,255,.7)}
.tg-foam-front{border-bottom:2.5px solid rgba(235,246,255,.95); z-index:2}
.tg-bay-clip{position:absolute; left:calc(var(--b) * -.75); width:calc(var(--b) * 1.5); bottom:0; height:calc(var(--b) * 1.2);
  overflow:hidden; z-index:1}
.tg-bay-bird{position:absolute; left:calc(var(--b) * .25); bottom:calc(var(--b) * -.11); width:var(--b);
  transform:translateY(100%); transform-origin:50% 100%}
.tg-bay-bird svg{display:block; width:100%; height:auto; overflow:visible; filter:drop-shadow(0 2px 2px rgba(0,0,0,.5))}
.tg-drop{left:calc(var(--b) * -.022); top:calc(var(--b) * -.028); width:calc(var(--b) * .045); height:calc(var(--b) * .056);
  background:rgba(206,232,255,.92); opacity:0; z-index:3}
/* He gobbles twice while he is up, rather than on the harvest turkey's slow cycle. */
.tg-bay .tg-head{animation:tg-gobble 1.6s ease-in-out 1.6s 2}
.tg-bay .tg-tail{animation:tg-fan 1.6s ease-in-out 1.6s 2}

/* The hand with the plate, rising from behind the band: the box's bottom edge
   is the band's top, and it clips, so nothing of the arm shows through the
   band's glass. The art runs half its width below that edge, so the arm
   never shows an end however it bobs. --w is its width. */
.tg-serve{position:absolute; bottom:var(--bb); width:var(--w); height:calc(var(--w) * 1.33); overflow:hidden; --w:150px}
.tg-serve-in{position:absolute; left:0; right:0; bottom:calc(var(--w) * -.5); transform:translateY(105%); transform-origin:50% 68%}
.tg-serve-in svg{display:block; width:100%; height:auto; overflow:visible; filter:drop-shadow(0 2px 3px rgba(0,0,0,.55))}
.tg-sleeve{fill:#a3392a}
.tg-plaid{fill:none; stroke:#6b1f17; stroke-width:3; opacity:.55}
.tg-plaid-thin{fill:none; stroke:#e8b48c; stroke-width:.6; opacity:.4}
.tg-cuff{fill:#86281d}
.tg-button{fill:#eadfca}
.tg-skin{fill:var(--tg-skin, #d9a074); stroke:var(--tg-skin-d, #b37b53); stroke-width:.6; stroke-linejoin:round}
.tg-skin-line{fill:none; stroke:var(--tg-skin-d, #b37b53); stroke-width:.6; stroke-linecap:round}
.tg-nail{fill:rgba(255,255,255,.32)}
.tg-plate-under{fill:#cdbfa9}
.tg-plate-top{fill:#f7f2e8; stroke:#d9cfbd; stroke-width:.6}
.tg-plate-trim{fill:none; stroke:var(--tg-c3); stroke-width:1; opacity:.85}
.tg-plate-well{fill:#e8e2d5}
.tg-food-shadow{fill:rgba(90,60,30,.18)}
.tg-roast{fill:#cd8237}
.tg-roast-d{fill:#a35f26}
.tg-roast-l{fill:#f1b76c; opacity:.9}
.tg-roast-v{fill:none; stroke:#a35f26; stroke-width:.7; opacity:.6}
.tg-herb{fill:#4d7a2b}
.tg-drum{fill:#b96a2c; stroke:#94511f; stroke-width:.5}
.tg-bone{fill:none; stroke:#f6eedc; stroke-width:2.2; stroke-linecap:round}
.tg-knob{fill:#f6eedc}
.tg-ham{fill:#d9786a; stroke:#9f4536; stroke-width:.9}
.tg-score{fill:none; stroke:#f2b98c; stroke-width:.8; opacity:.9}
.tg-pine{fill:none; stroke:#f3cd4e; stroke-width:2.2}
.tg-cherry{fill:#c4122f}
.tg-cran{fill:#9c1832}
.tg-cran-end{fill:#bb2a45}
.tg-ridge{fill:none; stroke:#c7445c; stroke-width:.7}
.tg-shine{fill:none; stroke:rgba(255,255,255,.35); stroke-width:.8}
.tg-greens{fill:#2c6631}
.tg-greens-l{fill:#3f8a40}
.tg-greens-v{fill:none; stroke:#86bf69; stroke-width:.6; stroke-linecap:round}
.tg-pepper{fill:#d0402e}
.tg-mac{fill:#efaa2d; stroke:#c98516; stroke-width:.5}
.tg-noodle{fill:none; stroke:#fbd370; stroke-width:1.3; stroke-linecap:round}
.tg-crust{fill:#b8700f}
.tg-mash{fill:#fff3d2; stroke:#c4a970; stroke-width:.7}
.tg-gravy{fill:#7a4722}
.tg-gravy-l{fill:#b37a49}
.tg-butter{fill:#f8d95e; stroke:#ddb53a; stroke-width:.3}
/* Steam off the turkey, curling up and fading, the three out of step. */
.tg-steam path{fill:none; stroke:rgba(255,255,255,.6); stroke-width:1.3; stroke-linecap:round; opacity:0;
  animation:tg-steam 2.6s ease-in-out infinite}
.tg-steam path:nth-child(2){animation-delay:-.9s}
.tg-steam path:nth-child(3){animation-delay:-1.7s}
@keyframes tg-steam{
  0%{transform:translateY(2px); opacity:0}
  35%{opacity:.85}
  100%{transform:translateY(-6px); opacity:0}
}

/* Holding still: no breeze, no gobbling. Falling leaves, geese and the
   surprises never start. */
@media (prefers-reduced-motion:reduce){
  .tg-head,.tg-tail,.tg-gwing,.tg-bough-rock,.tg-lf-in,.tg-steam path{animation:none}
}

/* ---------- the switch in Presentation settings ---------- */
.ps-tg legend{color:var(--tg-amber)}
.ps-tg .ps-opt input:checked + .sw{background:rgba(242,180,69,.32); border-color:var(--tg-amber)}
.ps-tg .ps-opt input:checked + .sw::after{background:var(--tg-amber)}
