/* Säsongsteman på startsidan – laddas bara när ett tema är aktivt */

/* ---------- Hälsningsremsa ---------- */
.th-banner { position: relative; z-index: 3; font-size: 15px; }
.th-banner[hidden] { display: none; }
.th-banner-in { display: flex; align-items: center; gap: 12px; padding-top: 9px; padding-bottom: 9px; }
.th-banner p { margin: 0; flex: 1; font-weight: 600; letter-spacing: .1px; }
.th-banner-ico { display: grid; place-items: center; flex-shrink: 0; }
.th-banner-x { background: none; border: 0; color: inherit; opacity: .75; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; flex-shrink: 0; }
.th-banner-x:hover { opacity: 1; background: rgba(0, 0, 0, .12); }
.theme-easter .th-banner { background: #f6e7a1; color: #3d2f55; }
.theme-midsummer .th-banner { background: #2f7d32; color: #fff; }
.theme-halloween .th-banner { background: #f07b12; color: #1d1205; }
.theme-christmas .th-banner { background: #a3192a; color: #fff; }

/* ---------- Remsa under sidhuvudet ---------- */
.top { position: relative; }
.th-strip { position: absolute; left: 0; right: 0; bottom: -38px; height: 54px; z-index: 2; pointer-events: none; overflow: hidden; }
.th-strip svg { display: block; width: 100%; }
.theme-christmas .th-lights .th-bulb path { filter: drop-shadow(0 0 5px currentColor); }
.theme-motion .th-lights .th-bulb { animation: thTwinkle 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes thTwinkle { 0%, 100% { opacity: 1; } 45% { opacity: .35; } 55% { opacity: .9; } }
.theme-motion .th-garland .th-flower, .theme-motion .th-bunting .th-flag { transform-box: fill-box; transform-origin: 50% 0; animation: thSway 4s ease-in-out infinite; animation-delay: var(--d); }
@keyframes thSway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.hero { overflow: hidden; }
.hero-in { position: relative; z-index: 1; }

/* ---------- Dekor i heron ---------- */
.th-corner { position: absolute; z-index: 0; pointer-events: none; }
.th-corner svg { display: block; width: 100%; height: auto; }
.th-br { right: 10px; bottom: 6px; width: 150px; opacity: .95; }
@media (min-width: 1500px) { .th-br { right: calc((100vw - 1180px) / 2 - 190px); width: 180px; } }
.th-tl { left: 0; top: 0; width: 120px; }
@media (min-width: 1500px) { .th-tl { width: 170px; } }
.theme-halloween .th-br { width: 190px; }
.theme-motion .th-feather { animation: thSway 5s ease-in-out infinite; animation-delay: var(--d); }
.theme-motion .th-ring { animation: thSway 6s ease-in-out infinite; animation-delay: var(--d); }
.theme-motion .th-glow { animation: thFlicker 3.2s infinite; }
@keyframes thFlicker { 0%, 100% { opacity: 1; } 8% { opacity: .55; } 10% { opacity: 1; } 52% { opacity: .8; } 54% { opacity: 1; } }
.th-glow { filter: drop-shadow(0 0 4px #ffb300); }
.theme-motion .th-spider { animation: thSpider 7s ease-in-out infinite; }
@keyframes thSpider { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(26px); } }

/* Fladdermöss som flyger över heron då och då */
.th-bats { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.th-bat { position: absolute; left: -80px; top: 20%; opacity: 0; }
.theme-motion .th-bat { animation: thFly 18s linear infinite; }
.th-bat:nth-child(2) { top: 38%; animation-delay: 5s !important; transform: scale(.7); }
.th-bat:nth-child(3) { top: 12%; animation-delay: 9s !important; }
.th-bat:nth-child(4) { top: 55%; animation-delay: 13s !important; transform: scale(.8); }
.theme-motion .th-bat svg { animation: thFlap .35s ease-in-out infinite alternate; transform-origin: 50% 40%; }
@keyframes thFly { 0% { left: -80px; opacity: 0; margin-top: 0; } 4% { opacity: .9; } 30% { margin-top: -30px; } 55% { margin-top: 20px; } 70% { opacity: .9; } 76% { left: 105%; opacity: 0; } 100% { left: 105%; opacity: 0; } }
@keyframes thFlap { from { transform: scaleY(1); } to { transform: scaleY(.45); } }

/* Snö (canvas fylls av themes.js) */
.th-snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---------- Små färgdetaljer ---------- */
.theme-christmas .steps-band, .theme-christmas .conductors { position: relative; }
.theme-halloween .hero { background: radial-gradient(ellipse at 85% 110%, rgba(240, 123, 18, .18), transparent 55%), var(--ink); }
.theme-christmas .hero { background: radial-gradient(ellipse at 80% 0%, rgba(120, 180, 255, .12), transparent 60%), var(--ink); }
.theme-midsummer .hero { background: radial-gradient(ellipse at 90% 100%, rgba(120, 200, 110, .16), transparent 55%), var(--ink); }
.theme-easter .hero { background: radial-gradient(ellipse at 90% 100%, rgba(249, 214, 92, .14), transparent 55%), var(--ink); }

/* Mobil: hörndekoren tar plats från innehållet – visa bara remsan, snön och fladdermössen */
@media (max-width: 900px) {
  .th-corner { display: none; }
  .th-strip { bottom: -30px; height: 44px; }
  .th-strip svg { height: 44px; }
  .th-banner { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-motion .th-bulb, .theme-motion .th-flower, .theme-motion .th-flag, .theme-motion .th-feather, .theme-motion .th-ring,
  .theme-motion .th-glow, .theme-motion .th-spider, .theme-motion .th-bat, .theme-motion .th-bat svg { animation: none !important; }
  .th-bats { display: none; }
}
@media print { .th-banner, .th-strip, .th-corner, .th-bats, .th-snow { display: none !important; } }
.theme .top { z-index: 2; }

/* Spökljud-knapp (halloween) */
.th-sound { position: absolute; z-index: 3; top: 72px; right: 24px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px;
  border: 1px solid rgba(240, 123, 18, .55); background: rgba(20, 12, 4, .7); color: #ffd8ad; font: 600 14px var(--body); cursor: pointer; backdrop-filter: blur(4px); }
.th-sound:hover { border-color: #f07b12; color: #fff; }
.th-sound.on { background: #f07b12; color: #1d1205; border-color: #f07b12; }
.th-sound.on svg path { fill: #fff; }
.th-sound[hidden] { display: none; }
.th-clickable { pointer-events: auto; cursor: pointer; z-index: 2; }
.th-clickable:active { transform: scale(.97); }
@media (max-width: 900px) { .th-sound { top: 14px; right: 12px; padding: 8px; } .th-sound-txt { display: none; } }
.th-sound-svg { display: grid; place-items: center; }
.th-sound-svg svg { width: 20px; height: 20px; }
.th-sound-christmas, .th-sound-easter, .th-sound-midsummer { background: rgba(10, 18, 30, .7); }
.th-sound-christmas { border-color: rgba(255, 120, 120, .5); color: #ffd6d6; }
.th-sound-christmas.on { background: #a3192a; color: #fff; border-color: #a3192a; }
.th-sound-easter { border-color: rgba(249, 214, 92, .55); color: #fbeab0; }
.th-sound-easter.on { background: #f6e7a1; color: #3d2f55; border-color: #f6e7a1; }
.th-sound-midsummer { border-color: rgba(120, 200, 110, .55); color: #d4f2cf; }
.th-sound-midsummer.on { background: #2f7d32; color: #fff; border-color: #2f7d32; }
.th-strip.th-clickable { cursor: pointer; }
