/* ==========================================================================
   THANKSGIVING theme  (public/themes/thanksgiving)
   Everything is prefixed tgx-. Only transform/opacity are animated.
   Layer sits under the site nav (z-index 50) and never blocks clicks.
   No pop-up in this theme.
   ========================================================================== */

html.theme-thanksgiving ::selection { background: #e8761a; color: #1d1106; }

#tgx-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
html.tgx-off #tgx-layer { display: none !important; }

/* warm amber haze at the edges */
.tgx-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% 112%, rgba(232, 118, 26, .24), transparent 70%),
    radial-gradient(ellipse 45% 35% at 0% 0%, rgba(192, 57, 43, .16), transparent 70%),
    radial-gradient(ellipse 45% 35% at 100% 8%, rgba(240, 180, 41, .14), transparent 70%);
  animation: tgx-pulse 7s ease-in-out infinite;
}
@keyframes tgx-pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* ---------- falling leaves ---------- */
.tgx-leaf {
  position: absolute;
  top: -70px;
  left: var(--x, 10%);
  opacity: .9;
  animation: tgx-fall var(--d, 16s) linear var(--s, 0s) infinite;
  will-change: transform;
}
.tgx-leaf img { display: block; animation: tgx-sway var(--w, 3.4s) ease-in-out infinite alternate; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
.tgx-l1  { --x: 6%;  --d: 17s; --s: -3s;  --w: 3.2s; }
.tgx-l2  { --x: 16%; --d: 21s; --s: -12s; --w: 4.1s; }
.tgx-l3  { --x: 27%; --d: 15s; --s: -7s;  --w: 3.6s; }
.tgx-l4  { --x: 38%; --d: 23s; --s: -18s; --w: 2.9s; }
.tgx-l5  { --x: 49%; --d: 18s; --s: -1s;  --w: 3.8s; }
.tgx-l6  { --x: 60%; --d: 20s; --s: -14s; --w: 3.1s; }
.tgx-l7  { --x: 71%; --d: 16s; --s: -9s;  --w: 4.3s; }
.tgx-l8  { --x: 81%; --d: 22s; --s: -5s;  --w: 3.3s; }
.tgx-l9  { --x: 90%; --d: 19s; --s: -16s; --w: 3.7s; }
.tgx-l10 { --x: 44%; --d: 25s; --s: -21s; --w: 4.4s; }
@keyframes tgx-fall { from { transform: translateY(0); } to { transform: translateY(calc(100vh + 140px)); } }
@keyframes tgx-sway {
  from { transform: translateX(-34px) rotate(-40deg); }
  to   { transform: translateX(34px) rotate(55deg); }
}

/* ---------- floating pilgrim hats ---------- */
.tgx-hat {
  position: absolute;
  left: 0;
  top: var(--y, 30%);
  opacity: 0;
  animation: tgx-drift var(--d, 40s) linear var(--s, 0s) infinite;
  will-change: transform, opacity;
}
.tgx-hat img { display: block; animation: tgx-bob 3.4s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(245, 197, 24, .35)); }
.tgx-h1 { --y: 24%; --d: 44s; --s: -10s; }
.tgx-h2 { --y: 50%; --d: 36s; --s: -26s; }
.tgx-h3 { --y: 68%; --d: 50s; --s: -34s; }
.tgx-h2 img { animation-duration: 2.7s; animation-delay: -1s; }
@keyframes tgx-bob { 0%, 100% { transform: translateY(-9px) rotate(-8deg); } 50% { transform: translateY(9px) rotate(8deg); } }
@keyframes tgx-drift {
  0%   { transform: translateX(-120px); opacity: 0; }
  8%   { opacity: .6; }
  92%  { opacity: .6; }
  100% { transform: translateX(calc(100vw + 120px)); opacity: 0; }
}

/* ---------- leaf garland ---------- */
.tgx-garland { position: absolute; top: 60px; left: 8px; transform-origin: 0 0; animation: tgx-garland-sway 5s ease-in-out infinite alternate; }
.tgx-gl { transform-box: fill-box; transform-origin: 50% 0; animation: tgx-leaf-swing 2.6s ease-in-out infinite alternate; }
.tgx-gl2 { animation-delay: -.7s; } .tgx-gl3 { animation-delay: -1.4s; } .tgx-gl4 { animation-delay: -.3s; } .tgx-gl5 { animation-delay: -1.9s; }
@keyframes tgx-garland-sway { from { transform: rotate(-1deg); } to { transform: rotate(1.4deg); } }
@keyframes tgx-leaf-swing { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }

/* ---------- wooden sign ---------- */
.tgx-sign {
  position: absolute;
  top: 64px;
  right: 22px;
  width: 178px;
  transform-origin: 50% -30px;
  animation: tgx-swing 4.6s ease-in-out infinite alternate;
}
.tgx-rope {
  position: absolute;
  top: -34px;
  width: 3px;
  height: 40px;
  background: repeating-linear-gradient(#c9a26b 0 4px, #8a6738 4px 7px);
  border-radius: 2px;
}
.tgx-rope-l { left: 24px; }
.tgx-rope-r { right: 24px; }
.tgx-sign-hat { position: absolute; left: -12px; top: -4px; z-index: 2; transform: rotate(-14deg); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.tgx-board {
  position: relative;
  padding: 14px 12px 12px;
  text-align: center;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .10) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, #7a4d27, #4b2d14);
  border: 2px solid #d99a45;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(232, 118, 26, .55), 0 0 40px rgba(232, 118, 26, .22), inset 0 0 14px rgba(0, 0, 0, .35);
}
.tgx-title {
  display: block;
  font-family: 'Oswald', 'Jost', sans-serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #ffe9b8;
  text-shadow: 0 0 4px #fff2d0, 0 0 12px #f0a53a, 0 0 24px #e8761a;
  animation: tgx-glow-text 4.2s ease-in-out infinite;
}
.tgx-count {
  display: block;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 233, 184, .35);
  font: 700 12px/1.3 'Jost', sans-serif;
  letter-spacing: .03em;
  color: #fbd38a;
}
@keyframes tgx-swing { from { transform: rotate(-3.2deg); } to { transform: rotate(3.2deg); } }
@keyframes tgx-glow-text { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }

/* ---------- turkeys walking along the bottom ---------- */
.tgx-walker {
  position: absolute;
  left: 0;
  bottom: 6px;
  animation: tgx-walk var(--d, 34s) linear var(--s, 0s) infinite;
  will-change: transform;
}
.tgx-walker img { display: block; animation: tgx-waddle .55s ease-in-out infinite alternate; transform-origin: 50% 100%; filter: drop-shadow(0 0 8px rgba(232, 118, 26, .35)); }
.tgx-w1 { --d: 38s; --s: -9s; }
.tgx-w2 { --d: 52s; --s: -30s; bottom: 12px; left: auto; right: 0; animation-name: tgx-walk-rev; }
.tgx-w2 img { animation-duration: .7s; transform: scaleX(-1); }
@keyframes tgx-walk     { from { transform: translateX(-140px); } to { transform: translateX(calc(100vw + 140px)); } }
@keyframes tgx-walk-rev { from { transform: translateX(140px); }  to { transform: translateX(calc(-100vw - 140px)); } }
@keyframes tgx-waddle {
  from { translate: 0 0; rotate: -4deg; }
  to   { translate: 0 -5px; rotate: 4deg; }
}

/* ---------- dancing harvest friends ---------- */
.tgx-friends { position: absolute; left: 14px; bottom: -4px; display: flex; align-items: flex-end; gap: 4px; }
.tgx-f { display: block; transform-origin: 50% 100%; animation: tgx-dance .8s ease-in-out infinite alternate; filter: drop-shadow(0 0 7px rgba(240, 180, 41, .3)); }
.tgx-f-corn    { animation-delay: -.2s; }
.tgx-f-pumpkin { animation-duration: .65s; }
.tgx-f-carrot  { animation-delay: -.45s; animation-duration: .9s; }
@keyframes tgx-dance { from { transform: rotate(-9deg) translateY(0); } to { transform: rotate(9deg) translateY(-8px); } }

/* ---------- peeking turkey ---------- */
.tgx-peek { position: absolute; right: 28px; bottom: -10px; width: 110px; animation: tgx-peeking 4.2s ease-in-out infinite; }
.tgx-peek img { display: block; }
.tgx-peek-hat { position: absolute; left: 56%; top: 6%; transform: rotate(14deg); }
@keyframes tgx-peeking { 0%, 100% { transform: translateY(46px); } 45%, 70% { transform: translateY(0); } }

/* ---------- hide button ---------- */
.tgx-toggle {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 45;
  padding: 4px 12px;
  font: 600 11px/1.4 'Jost', sans-serif;
  color: #ffe9b8;
  background: rgba(30, 16, 6, .75);
  border: 1px solid rgba(232, 118, 26, .5);
  border-radius: 999px;
  opacity: .55;
  cursor: pointer;
  transition: opacity .2s;
}
.tgx-toggle:hover, .tgx-toggle:focus-visible { opacity: 1; }
html.tgx-off .tgx-toggle { display: none; }

/* ---------- small screens: fewer things, smaller ---------- */
@media (max-width: 720px) {
  .tgx-l3, .tgx-l5, .tgx-l7, .tgx-l8, .tgx-l9, .tgx-l10, .tgx-h2, .tgx-h3, .tgx-w2, .tgx-garland, .tgx-f-corn, .tgx-f-carrot { display: none; }
  .tgx-sign { width: 128px; right: 10px; top: 58px; }
  .tgx-title { font-size: 13px; letter-spacing: .02em; }
  .tgx-count { font-size: 10px; }
  .tgx-sign-hat { width: 32px; height: auto; left: -8px; top: -2px; }
  .tgx-peek { width: 80px; right: 10px; }
  .tgx-friends { left: 8px; }
  .tgx-toggle { bottom: 6px; }
}

/* ---------- reduced motion: calm, static sign only ---------- */
@media (prefers-reduced-motion: reduce) {
  .tgx-leaf, .tgx-hat, .tgx-garland, .tgx-walker, .tgx-friends, .tgx-peek, .tgx-glow { display: none; }
  .tgx-sign, .tgx-title { animation: none; }
}
