/* =====================================================================
   Tema NATALE (v2) — decorazioni nei colori del sito, più scenografiche ma sempre eleganti.
   Le decorazioni sono aria-hidden e pointer-events:none: non bloccano mai link e pulsanti.
   Gli elementi li crea theme.js solo se attivi in data/themes/natale.json.
   body.x-paused = il visitatore ha fermato le animazioni col pulsantino.
   ===================================================================== */
.theme-natale { --x-red: #A63A2F; --x-gold: #B58A2A; }

/* ---------- Neve, cometa, slitta: sopra il contenuto ma sotto header, menu e pulsanti ---------- */
.x-snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 35; }
.x-comet, .x-sleigh { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 36; will-change: transform; }
.x-comet svg, .x-sleigh svg { display: block; width: 100%; height: auto; overflow: visible; }
.x-comet { transform-origin: 90% 50%; }
/* filo di luce chiara intorno alla slitta: si stacca sia dalle foto scure sia dall'avorio */
.x-sleigh-in { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 6px 8px rgba(20, 14, 10, .22)); animation: xBob 1.5s ease-in-out infinite alternate; }
.x-deer { transform-box: fill-box; transform-origin: 50% 60%; animation: xGallop .52s ease-in-out infinite alternate; }
.x-deer.g2 { animation-delay: -.26s; }
.x-leg-b, .x-leg-f { transform-box: fill-box; animation: xLeg .52s ease-in-out infinite alternate; }
.x-leg-b { transform-origin: 100% 0; --a: -24deg; } .x-leg-f { transform-origin: 0 0; --a: 24deg; }
.x-dust > * { transform-box: fill-box; transform-origin: center; animation: xDust .9s ease-in-out infinite alternate; }
.x-dust > :nth-child(2n) { animation-delay: -.45s; } .x-dust > :nth-child(3n) { animation-delay: -.7s; }
@keyframes xBob { from { transform: translateY(-4px); } to { transform: translateY(5px); } }
@keyframes xGallop { from { transform: translateY(1.5px) rotate(2deg); } to { transform: translateY(-4px) rotate(-3deg); } }
@keyframes xLeg { to { transform: rotate(var(--a)); } }
@keyframes xDust { from { opacity: .2; transform: scale(.6); } to { opacity: 1; transform: scale(1.25); } }

/* ---------- Ghirlanda appesa sotto l'header (sticky: segue lo scroll) ---------- */
.x-garland { position: absolute; left: 0; right: 0; top: 100%; height: 68px; pointer-events: none; overflow: hidden;
  background-repeat: repeat-x; opacity: 0; animation: xFade 1s .2s ease forwards; }
.x-bulb { position: absolute; top: 14px; width: 13px; height: 19px; margin-left: -6.5px; border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  background: var(--off); box-shadow: inset 2px 2px 3px rgba(255, 255, 255, .35); }
.x-bulb::before { content: ""; position: absolute; left: 3.5px; top: -5px; width: 6px; height: 6px; border-radius: 1.5px; background: #24382C; }
/* lampadina accesa: sta sopra quella spenta e si anima solo l'opacità (leggero per il telefono) */
.x-bulb::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 38% 34%, #fff 0, var(--on) 46%); box-shadow: 0 0 10px 3px var(--glow), 0 0 20px 7px var(--glow); }
.is-blinking .x-bulb::after { animation: xBlink 3.2s linear var(--dl, 0s) infinite; }
/* accesa metà del tempo, spenta l'altra metà, con passaggio morbido: mai un lampeggio veloce */
@keyframes xBlink { 0%, 42% { opacity: 1; } 52%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes xFade { to { opacity: 1; } }

/* ---------- Agrifoglio con pallina dorata: esce dall'angolo in alto a destra della foto ---------- */
.theme-natale .hero-grid { position: relative; }
.x-branch { position: absolute; top: -14px; right: calc(var(--gutter, 16px) - 14px); z-index: 4; width: clamp(128px, 19vw, 262px); pointer-events: none;
  filter: drop-shadow(0 8px 12px rgba(20, 14, 10, .3)); opacity: 0; animation: xFade 1s .5s ease forwards; }
.x-branch svg { display: block; width: 100%; height: auto; overflow: visible; }
.x-bauble { transform-box: view-box; transform-origin: 150px 62px; animation: xSwing 3.8s ease-in-out infinite alternate; }
@keyframes xSwing { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

/* ---------- Augurio in home, sopra il titolo ---------- */
.x-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 10px 14px; max-width: 560px;
  border-radius: var(--radius-sm, 14px); background: linear-gradient(135deg, #fff, #FBF4E6); border: 1px solid rgba(181, 138, 42, .28);
  box-shadow: var(--shadow-sm); font-size: .92rem; line-height: 1.45; color: var(--ink-2, #4A3D33);
  opacity: 0; transform: translateY(6px); animation: xNoteIn .7s .2s var(--ease, ease) forwards; }
.x-note strong { display: block; font-family: var(--font-display, Georgia, serif); font-size: 1.08rem; font-weight: 600; color: var(--x-red); }
.x-note svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }
@keyframes xNoteIn { to { opacity: 1; transform: none; } }

/* ---------- Scena sopra il piè di pagina: colline innevate, abeti, regali ---------- */
.x-scene { position: relative; height: clamp(120px, 13vw, 176px); margin-bottom: -2px; pointer-events: none; overflow: hidden;
  background: linear-gradient(to top, var(--ink, #2B211A) 4px, transparent 4px); }   /* niente riga chiara tra colline e footer */
.x-scene .x-hills { position: absolute; inset: auto 0 -3px; width: 100%; height: 72%; display: block; }
.x-scene .x-tree, .x-scene .x-gift { position: absolute; display: block; height: auto; }
.x-scene .x-tree { bottom: 20%; overflow: visible; }
.x-scene .x-gift { bottom: 5%; }
.x-scene .x-star { animation: xStar 2.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes xStar { from { opacity: .7; transform: scale(.88); } to { opacity: 1; transform: scale(1.15); } }
@media (max-width: 699.98px) {
  .x-scene .x-tree.is-wide, .x-scene .x-gift.is-wide { display: none; }   /* su telefono meno elementi */
}

/* ---------- Pulsantino che ferma / riaccende le animazioni ---------- */
.x-toggle { position: fixed; left: 14px; bottom: calc(var(--bottom-h, 64px) + env(safe-area-inset-bottom) + 17px); z-index: 37; width: 44px; height: 44px; padding: 10px;
  border-radius: 50%; border: 1px solid rgba(43, 33, 26, .12); background: rgba(255, 255, 255, .9); color: #4F7F99; box-shadow: var(--shadow-sm); cursor: pointer; }
.x-toggle svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.x-toggle:hover { color: var(--x-red); }
.x-paused .x-toggle { color: var(--muted, #74675C); opacity: .75; }
body.nav-open .x-toggle { display: none; }
@media (max-width: 899.98px) { .x-toggle { left: 5px; bottom: calc(var(--bottom-h, 64px) + env(safe-area-inset-bottom) + 6px); width: 36px; height: 36px; padding: 8px; opacity: .88; }
  .theme-natale .footer-bottom p:last-child { padding-left: 34px; } }   /* "Privacy e cookie" non finisce sotto il pulsantino */
@media (min-width: 900px) { .x-toggle { bottom: 24px; } }

/* ---------- Animazioni ferme: dal pulsantino o da "riduci animazioni" del sistema ---------- */
.x-paused .x-bulb::after, .x-paused .x-bauble, .x-paused .x-star { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .x-garland, .x-branch, .x-note { animation: none; opacity: 1; transform: none; }
  .x-bulb::after, .x-bauble, .x-scene .x-star { animation: none !important; }
}
/* In stampa il tema non c'è */
@media print { .x-snow, .x-comet, .x-sleigh, .x-garland, .x-branch, .x-scene, .x-note, .x-toggle { display: none !important; } }
