/* =====================================================================
   THANKSGIVING theme - autumn harvest
   Re-colours the design tokens from css/style.css and adds decorations.
   Page content is untouched. Active only while <html data-festival="thanksgiving">.
   Not in Festivals::$darkDefault - visitors keep their own light/dark choice.
   ===================================================================== */

/* ---------- 1. Tokens: rust, cranberry, harvest gold, olive ---------- */
html[data-festival="thanksgiving"] {
  --bm-primary:   #2a160b;
  --bm-blue:      #b45309;   /* links & accents - 5:1 on cream */
  --bm-blue-600:  #92400e;
  --bm-gold:      #9f1239;   /* cranberry */
  --bm-navy-soft: #55301a;

  --bm-bg:        #fffaf2;
  --bm-light:     #fdf3e3;
  --bm-surface:   #fbefdc;
  --bm-border:    #eedcc0;
  --bm-muted:     #6b5644;
  --bm-ink:       #2b1a0e;

  --bm-grad-hero: radial-gradient(1000px 520px at 85% -10%, rgba(234,88,12,.18), transparent 60%),
                  radial-gradient(900px 500px at 0% 10%, rgba(202,138,4,.16), transparent 55%);
  --bm-grad-blue: linear-gradient(135deg, #9a3412 0%, #b45309 55%, #c2410c 100%);
  --bm-grad-navy: linear-gradient(160deg, #2a160b 0%, #3d2213 60%, #55301a 100%);
  --bm-grad-gold: linear-gradient(135deg, #eab308 0%, #fde68a 100%);
  --bm-grad-cta:  linear-gradient(120deg, #2a160b 0%, #55301a 50%, #9f1239 100%);

  --bm-shadow-blue: 0 20px 50px rgba(180,83,9,.26);
}

html[data-festival="thanksgiving"][data-bs-theme="dark"] {
  --bm-blue:    #fb923c;
  --bm-blue-600:#fdba74;
  --bm-gold:    #fb7185;

  --bm-bg:      #120c07;
  --bm-light:   #1b130c;
  --bm-card:    #1d140c;
  --bm-surface: #160f09;
  --bm-border:  #3a2a1a;
  --bm-ink:     #fbf3e8;
  --bm-muted:   #cdb8a2;

  --bm-grad-hero: radial-gradient(1000px 520px at 85% -10%, rgba(251,146,60,.16), transparent 60%),
                  radial-gradient(900px 500px at 0% 10%, rgba(234,179,8,.10), transparent 55%);
}

/* Headline accent: cranberry -> pumpkin -> wheat -> leaf */
html[data-festival="thanksgiving"] .bm-text-gradient {
  background-image: linear-gradient(100deg, #9f1239 0%, #c2410c 40%, #a16207 70%, #4d7c0f 100%);
}
html[data-festival="thanksgiving"][data-bs-theme="dark"] .bm-text-gradient {
  background-image: linear-gradient(100deg, #fb7185 0%, #fb923c 40%, #facc15 70%, #a3e635 100%);
}

/* ---------- 2. Hard-coded blues in style.css that would clash ---------- */
html[data-festival="thanksgiving"] .btn-bm-primary,
html[data-festival="thanksgiving"] .bm-leadform-fields .btn-bm-primary { box-shadow: 0 10px 24px rgba(180,83,9,.3); }
html[data-festival="thanksgiving"] .btn-bm-primary:hover { box-shadow: 0 0 0 4px rgba(234,179,8,.22), 0 18px 40px rgba(180,83,9,.38); }
html[data-festival="thanksgiving"] .btn-bm-gold,
html[data-festival="thanksgiving"] .btn-bm-gold:hover { color: #2a160b; box-shadow: 0 10px 24px rgba(234,179,8,.35); }

html[data-festival="thanksgiving"] .bm-navbar .nav-link.active { background: rgba(180,83,9,.11); }
html[data-festival="thanksgiving"] .bm-navbar .dropdown-item:hover { background: rgba(180,83,9,.08); }
html[data-festival="thanksgiving"][data-bs-theme="dark"] .bm-navbar { background: rgba(18,12,7,.8); }

html[data-festival="thanksgiving"] .bm-card:hover,
html[data-festival="thanksgiving"] .bm-step:hover,
html[data-festival="thanksgiving"] .bm-stack-card:hover { border-color: rgba(194,65,12,.45); }

html[data-festival="thanksgiving"] .bm-hero2-glow,
html[data-festival="thanksgiving"] .bm-demo-hero-glow {
  background:
    radial-gradient(50% 55% at 22% 0%, rgba(234,179,8,.18), transparent 70%),
    radial-gradient(40% 45% at 85% 10%, rgba(234,88,12,.18), transparent 70%);
}
html[data-festival="thanksgiving"] .bm-hero2-blob.b1,
html[data-festival="thanksgiving"] .bm-demo-blob.b1 { background: radial-gradient(circle, rgba(234,88,12,.30), transparent 70%); }
html[data-festival="thanksgiving"] .bm-hero2-blob.b2,
html[data-festival="thanksgiving"] .bm-demo-blob.b2 { background: radial-gradient(circle, rgba(159,18,57,.24), transparent 70%); }
html[data-festival="thanksgiving"] .bm-hero2-blob.b3 { background: radial-gradient(circle, rgba(202,138,4,.22), transparent 70%); }

html[data-festival="thanksgiving"] .bm-ind-hero::before {
  background: radial-gradient(900px 420px at 78% -10%, rgba(234,88,12,.32), transparent 62%),
              radial-gradient(700px 380px at 8% 110%, rgba(202,138,4,.24), transparent 60%);
}
html[data-festival="thanksgiving"] .bm-metric-band::before {
  background: radial-gradient(700px 320px at 85% 0%, rgba(234,88,12,.32), transparent 62%);
}
html[data-festival="thanksgiving"] .bm-cta::before {
  background: radial-gradient(600px 300px at 90% 0%, rgba(234,179,8,.26), transparent 60%);
}

/* Pale blue icon tiles, chips and tags across the pages */
html[data-festival="thanksgiving"] .bm-card-icon,
html[data-festival="thanksgiving"] .bm-feature-row .fic,
html[data-festival="thanksgiving"] .bm-req-head i,
html[data-festival="thanksgiving"] .bm-token-arrow,
html[data-festival="thanksgiving"] .bm-hero-badge,
html[data-festival="thanksgiving"] .bm-solve-tag.is-answer,
html[data-festival="thanksgiving"] .bm-doc-main code,
html[data-festival="thanksgiving"] .bm-thanks-counter,
html[data-festival="thanksgiving"] .bm-mega-foot:hover { background: rgba(194,65,12,.12); }
html[data-festival="thanksgiving"] .bm-hero-badge,
html[data-festival="thanksgiving"] .bm-thanks-counter { border-color: rgba(194,65,12,.3); }
html[data-festival="thanksgiving"] .bm-card-icon { box-shadow: 0 8px 18px -8px rgba(194,65,12,.42); }
html[data-festival="thanksgiving"] .bm-card:hover .bm-card-icon { background: var(--bm-grad-blue); color: #fff; box-shadow: 0 12px 26px -8px rgba(194,65,12,.55); }
html[data-festival="thanksgiving"] .bm-chip:hover { background: rgba(194,65,12,.07); }
html[data-festival="thanksgiving"] .bm-step-num,
html[data-festival="thanksgiving"] .bm-stack-icon,
html[data-festival="thanksgiving"] .bm-tl-dot,
html[data-festival="thanksgiving"] .bm-doc-rail-cta { box-shadow: 0 10px 22px -10px rgba(194,65,12,.75); }
html[data-festival="thanksgiving"] .bm-step:hover .bm-step-num { box-shadow: 0 16px 30px -10px rgba(194,65,12,.85); }

html[data-festival="thanksgiving"] .bm-leadform-bar,
html[data-festival="thanksgiving"] .bm-thanks-mark { background: linear-gradient(90deg, #9f1239, #c2410c 50%, #a16207); }

/* Live-payments map: rust dots, olive lines */
html[data-festival="thanksgiving"] .bm-worldmap-canvas {
  --map-dot: rgba(180,83,9,.5); --map-line: rgba(77,124,15,.3);
  --map-3d-side: rgba(60,30,10,.92); --map-3d-top-a: #b45309; --map-3d-top-b: #fbbf24;
  --map-ping: #9f1239; --map-ping-gold: #4d7c0f;
}
html[data-festival="thanksgiving"][data-bs-theme="dark"] .bm-worldmap-canvas {
  --map-dot: rgba(251,146,60,.5); --map-line: rgba(163,230,53,.28);
  --map-3d-side: rgba(60,30,10,.95); --map-3d-top-a: #ea580c; --map-3d-top-b: #fdba74;
  --map-ping: #fb7185; --map-ping-gold: #facc15; --map-ping-halo: #120c07;
}

/* Home hero canvas (js/hero-bg.js): map dots, payment arcs and volume line */
html[data-festival="thanksgiving"] .bm-hero2-map { --hero-bg-a: 194,65,12; --hero-bg-b: 202,138,4; }

::selection { background: rgba(234,88,12,.25); }

/* Footer and navy panels: wheat instead of the hard-coded blue-grey */
html[data-festival="thanksgiving"] .bm-footer,
html[data-festival="thanksgiving"] .bm-footer-about,
html[data-festival="thanksgiving"] .bm-footer-links a,
html[data-festival="thanksgiving"] .bm-legal-row a,
html[data-festival="thanksgiving"] .bm-navy-bg p { color: #e6d3bc; }
html[data-festival="thanksgiving"] .bm-footer-links a:hover,
html[data-festival="thanksgiving"] .bm-legal-row a:hover { color: #fbbf24; }
html[data-festival="thanksgiving"] .bm-footer-heading { color: #fb923c; }
html[data-festival="thanksgiving"] .bm-badge { color: #f6ead9; }
html[data-festival="thanksgiving"] .bm-badge i { color: #fbbf24; }
html[data-festival="thanksgiving"] .bm-footer-bottom p { color: #b49a80; }
html[data-festival="thanksgiving"] .bm-footer-badges { border-color: rgba(251,191,36,.18); }
html[data-festival="thanksgiving"] .bm-navy-bg { color: #f6ead9; }
html[data-festival="thanksgiving"] .bm-cta p { color: #f6ead9; }

/* ---------- 3. Navbar: a garland of autumn leaves ---------- */
html[data-festival="thanksgiving"] .bm-navbar { border-bottom-color: rgba(180,83,9,.4); }
html[data-festival="thanksgiving"] .bm-navbar::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 3px); height: 28px;
  pointer-events: none;
  background: url("images/garland.svg") repeat-x left top / 112px 28px;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.15));
}

/* ---------- 4. Hero: cornucopia + wheat sheaf ---------- */
html[data-festival="thanksgiving"] .bm-hero2,
html[data-festival="thanksgiving"] .bm-page-hero,
html[data-festival="thanksgiving"] .bm-ind-hero,
html[data-festival="thanksgiving"] .bm-demo-hero { position: relative; overflow: hidden; }

/* Hero content must sit above the harvest. */
html[data-festival="thanksgiving"] .bm-page-hero > .container,
html[data-festival="thanksgiving"] .bm-demo-hero > .container { position: relative; z-index: 2; }

.bm-tg-horn {
  position: absolute; z-index: 0; pointer-events: none;
  bottom: 8px; right: 3%; width: clamp(190px, 18vw, 280px);
  filter: drop-shadow(0 10px 14px rgba(60,30,10,.22));
}
.bm-tg-wheat {
  position: absolute; z-index: 0; pointer-events: none;
  bottom: -6px; display: flex; align-items: flex-end; gap: 2px;
  right: calc(3% + clamp(190px, 18vw, 280px) - 6px);
}
.bm-tg-wheat img {
  width: 18px; transform-origin: 50% 100%;
  animation: tgSway 3.6s ease-in-out infinite;
}
.bm-tg-wheat img:nth-child(2) { width: 20px; animation-delay: -1s; }
.bm-tg-wheat img:nth-child(3) { width: 16px; animation-delay: -2s; }

/* ---------- 5. Falling leaves (built by thanksgiving.js) ---------- */
.bm-tg-leaf { position: absolute; top: 0; left: 0; width: 26px; will-change: transform; }
.bm-tg-leaf img { display: block; width: 100%; filter: drop-shadow(0 3px 3px rgba(0,0,0,.15)); }

/* ---------- 6. Footer: leaves, pumpkins and a turkey on the top edge ---------- */
html[data-festival="thanksgiving"] .bm-footer { position: relative; }
html[data-festival="thanksgiving"] .bm-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -3px; height: 28px;
  pointer-events: none;
  background: url("images/garland.svg") repeat-x left top / 112px 28px;
}
html[data-festival="thanksgiving"] .bm-footer::after {
  content: ""; position: absolute; right: 6%; bottom: calc(100% - 4px); width: 190px; height: 78px;
  pointer-events: none;
  background:
    url("images/turkey.svg") no-repeat 0 100% / 74px auto,
    url("images/pumpkin.svg") no-repeat 84px 100% / 56px auto,
    url("images/pumpkin.svg") no-repeat 146px 100% / 40px auto;
}

/* ---------- 7. Keyframes ---------- */
@keyframes tgSway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* Effects switched off: decorations stay, motion stops. */
.fx-off .bm-tg-wheat img { animation: none; }

/* ---------- 8. Small screens + reduced motion ---------- */
@media (max-width: 767.98px) {
  /* hero text runs full width here */
  .bm-tg-horn, .bm-tg-wheat { display: none; }
  .bm-tg-leaf { width: 20px; }
  html[data-festival="thanksgiving"] .bm-footer::after { transform: scale(.75); transform-origin: 100% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bm-tg-wheat img { animation: none !important; }
}
