/* =========================================================
   PiccoleFavole.com — event.css
   HALLOWEEN 2026
   Obiettivo: look vicino al mockup approvato dall'utente.
   NOTA: per ottenere davvero quel risultato serve anche
   l'HTML dedicato delle sezioni evento.
   ========================================================= */

/* ---------- PALETTE ---------- */
:root {
  --ev-bg-1: #06050b;
  --ev-bg-2: #10081c;
  --ev-bg-3: #1a1030;

  --ev-purple: #8d5cff;
  --ev-purple-2: #b26cff;
  --ev-orange: #ff8a2a;
  --ev-orange-2: #ffb347;
  --ev-red: #d92d3a;
  --ev-white: #ffffff;
  --ev-text: #f6f1ff;
  --ev-soft: #ddd2f7;
  --ev-border: rgba(151, 101, 255, .28);
  --ev-border-soft: rgba(255,255,255,.10);
  --ev-panel: rgba(10, 7, 24, .78);
  --ev-panel-strong: rgba(10, 7, 24, .90);
  --ev-shadow: 0 18px 40px rgba(0,0,0,.38);

  --ev-radius-lg: 26px;
  --ev-radius-md: 18px;
  --ev-radius-sm: 14px;
  --ev-max: 1320px;

  /* Asset evento */
  --event-hero-desktop: url("immagini/halloween-hero-desktop.webp");
  --event-hero-mobile: url("immagini/halloween-hero-mobile.webp");
  --event-title-image: url("immagini/halloween-title.webp");
  --event-sign-image: url("immagini/halloween-sign-mistero.webp");
}

/* ---------- BASE ---------- */
html,
body {
  background:
    radial-gradient(circle at 20% 0%, rgba(255,138,42,.06), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(141,92,255,.12), transparent 32%),
    linear-gradient(180deg, var(--ev-bg-1) 0%, var(--ev-bg-2) 48%, #07050e 100%) !important;
  color: var(--ev-text) !important;
}

body {
  overflow-x: hidden;
}


img {
  max-width: 100%;
  display: block;
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(5, 3, 12, .72) !important;
  border-bottom: 1px solid rgba(141,92,255,.18) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.26);
}

.site-header .logo {
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--ev-purple) !important;
  text-shadow: 0 0 14px rgba(141,92,255,.25);
}

.site-header .logo span {
  color: var(--ev-orange) !important;
}

.header-nav a {
  color: #f4edff !important;
  opacity: .92;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--ev-orange) !important;
}

.header-star,
.header-cta,
.area-genitori-btn {
  background: linear-gradient(135deg, rgba(141,92,255,.26), rgba(141,92,255,.12)) !important;
  border: 1px solid rgba(141,92,255,.32) !important;
  color: var(--ev-white) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

/* ---------- CONTAINER ---------- */
.event-wrap,
.event-shell {
  width: min(calc(100% - 40px), var(--ev-max));
  margin-inline: auto;
}

/* ---------- HERO EVENTO ---------- */
.event-home-hero {
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 780px;
  margin: 0 0 30px;
  padding: 34px 34px 28px;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  isolation: isolate;
  border: 0;

  background:
    linear-gradient(
      90deg,
      rgba(3,3,8,.94) 0%,
      rgba(4,3,10,.82) 28%,
      rgba(4,3,10,.28) 58%,
      rgba(4,3,10,.34) 100%
    ),
    linear-gradient(
      180deg,
      rgba(10,7,24,.08) 0%,
      rgba(10,7,24,.10) 55%,
      rgba(5,4,11,.30) 100%
    ),
    var(--event-hero-desktop) center 25% / cover no-repeat;
}

.event-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,.06), transparent 10%),
    radial-gradient(circle at 84% 75%, rgba(255,138,42,.10), transparent 16%),
    radial-gradient(circle at 16% 72%, rgba(141,92,255,.12), transparent 24%);
  z-index: -1;
  pointer-events: none;
}

.event-home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 72%, rgba(5,4,11,.22) 100%);
  z-index: -1;
  pointer-events: none;
}

.event-hero-grid {
  display: grid;
  grid-template-columns: minmax(320px, 470px) 1fr;
  gap: 28px;
  align-items: start;
  min-height: 420px;
}

.event-copy {
  padding: 26px 18px 0 18px;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(22, 14, 40, .84);
  border: 1px solid rgba(255,138,42,.34);
  color: var(--ev-orange-2);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.event-title {
  width: min(100%, 610px);
  aspect-ratio: 16 / 7;
  margin: 0 0 8px;
  background: var(--event-title-image) left center / contain no-repeat;
  overflow: hidden;
  text-indent: -9999px;
  white-space: nowrap;
  filter:
    drop-shadow(0 8px 18px rgba(0,0,0,.48))
    drop-shadow(0 0 12px rgba(141,92,255,.12));
}

.event-title .line-2 {
  display: inline;
}

.event-copy p {
  max-width: 460px;
  margin: 20px 0 24px;
  color: var(--ev-text);
  font-size: 1.18rem;
  line-height: 1.56;
}

.event-copy p strong {
  color: var(--ev-orange);
}

/* ---------- COUNTDOWN ---------- */
.event-countdown {
  width: min(100%, 380px);
  padding: 18px 20px 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(24,16,44,.92), rgba(9,7,22,.94));
  border: 1px solid rgba(141,92,255,.30);
  box-shadow: 0 10px 24px rgba(0,0,0,.30);
}

.event-countdown-title {
  margin: 0 0 14px;
  text-align: center;
  color: var(--ev-purple-2);
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

.count-item {
  text-align: center;
  padding: 8px 6px;
  border-radius: 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
}

.count-num {
  display: block;
  font-size: 2.15rem;
  font-weight: 900;
  color: var(--ev-white);
  line-height: 1;
}

.count-label {
  display: block;
  margin-top: 6px;
  color: var(--ev-soft);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.event-main-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 370px);
  min-height: 62px;
  margin-top: 16px;
  padding: 16px 26px;
  border: 0;
  border-radius: 999px;
  color: #180c1c !important;
  background: linear-gradient(180deg, #ff8a2a, #ff5b3a) !important;
  box-shadow:
    0 14px 28px rgba(0,0,0,.32),
    0 0 22px rgba(255,138,42,.16);
  font-size: 1.08rem;
  font-weight: 900;
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease;
}

.event-main-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.event-note {
  margin-top: 12px;
  color: var(--ev-soft);
  font-size: .92rem;
}

.event-note span {
  color: var(--ev-orange-2);
}

/* ---------- DECORAZIONI HERO ---------- */
.event-cobweb {
  position: absolute;
  width: clamp(120px, 14vw, 240px);
  opacity: .92;
  pointer-events: none;
}

.event-cobweb.left {
  left: 0;
  top: 0;
}

.event-cobweb.right {
  right: 0;
  top: 0;
  transform: scaleX(-1);
}

.event-bat-small,
.event-bat-big {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}

.event-bat-small {
  left: 260px;
  top: 82px;
  width: 64px;
}

.event-bat-big {
  right: 33%;
  top: 90px;
  width: 110px;
  animation: batBob 4.6s ease-in-out infinite;
}

@keyframes batBob {
  0%,100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(10px) rotate(6deg); }
}

/* ---------- CARTELLO MISTERIOSO ---------- */
.event-sign {
  position: absolute;
  right: 42px;
  top: 230px;
  width: clamp(220px, 18vw, 290px);
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--event-sign-image) center / contain no-repeat;
  box-shadow: none;
  transform: rotate(-2deg);
  text-indent: -9999px;
  overflow: hidden;
  color: transparent;
  z-index: 4;
  filter:
    drop-shadow(0 14px 22px rgba(0,0,0,.34))
    drop-shadow(0 0 12px rgba(255,138,42,.10));
}

/* Il testo HTML resta nel DOM per accessibilità, ma non viene mostrato */
.event-sign .paw {
  display: none;
}
/* ---------- TIMELINE/EPISODI ---------- */
.event-story-block {
  margin-top: 34px;
}

.event-story-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 18px;
  text-align: center;
  color: var(--ev-white);
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.event-story-title .accent {
  color: var(--ev-orange);
}

.event-episodes-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 14px;
  align-items: center;
}

.event-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(141,92,255,.32);
  background: rgba(17, 11, 31, .74);
  color: var(--ev-white);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
}

.event-episodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.event-day-card {
  position: relative;
  min-height: 230px;
  padding: 16px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16,11,31,.90), rgba(8,7,18,.96));
  border: 1px solid rgba(141,92,255,.34);
  box-shadow: 0 10px 22px rgba(0,0,0,.26);
}

.event-day-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 26%),
    radial-gradient(circle at 85% 12%, rgba(141,92,255,.12), transparent 18%);
  pointer-events: none;
}

.event-day-card.available {
  border-color: rgba(255,138,42,.58);
  box-shadow:
    0 12px 26px rgba(0,0,0,.30),
    0 0 18px rgba(255,138,42,.12);
}

.event-day-card.available::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46px;
  background: linear-gradient(180deg, rgba(255,138,42,.08), rgba(255,138,42,.22));
  pointer-events: none;
}

.event-day-date {
  display: block;
  margin-bottom: 8px;
  color: var(--ev-white);
  font-size: .82rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.event-day-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(141,92,255,.22);
  color: var(--ev-white);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-day-card.available .event-day-pill {
  background: rgba(255,138,42,.28);
}

.event-day-lock {
  position: absolute;
  top: 14px;
  right: 14px;
  color: rgba(255,255,255,.82);
  font-size: 1.05rem;
}

.event-day-card h3 {
  margin: 0 0 8px;
  color: var(--ev-white);
  font-size: 1.35rem;
  line-height: 1.1;
}

.event-day-card p {
  margin: 0 0 16px;
  color: var(--ev-soft);
  font-size: .94rem;
  line-height: 1.5;
}

.event-day-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ev-soft);
  font-size: .88rem;
  font-weight: 700;
}

.event-day-card.available .event-day-footer {
  color: #ffe5c9;
}

/* ---------- VALORI FINALI ---------- */
.event-values {
  margin-top: 28px;
  padding: 10px 0 0;
}

.event-values-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 18px;
}

.event-value-item {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: start;
}

.event-value-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: linear-gradient(180deg, rgba(31,17,51,.98), rgba(12,8,20,.98));
  border: 1px solid rgba(141,92,255,.34);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}

.event-value-item h4 {
  margin: 4px 0 4px;
  font-size: 1.04rem;
  color: #ffb1ff;
  font-weight: 900;
}

.event-value-item p {
  margin: 0;
  color: var(--ev-soft);
  font-size: .92rem;
  line-height: 1.48;
}

/* ---------- COMPATIBILITÀ GENERICA PER LE ALTRE PAGINE ---------- */
.raccolta-card,
.pers-card,
.book-card,
.feature-card,
.cross-link,
.prequel-card {
  background:
    linear-gradient(160deg, rgba(25,16,44,.95), rgba(10,8,18,.96)) !important;
  border-color: rgba(141,92,255,.22) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}

.raccolta-card:hover,
.pers-card:hover,
.book-card:hover,
.feature-card:hover,
.cross-link:hover {
  border-color: rgba(255,138,42,.48) !important;
}

.btn-primary,
.btn-next,
.btn-submit {
  background: linear-gradient(180deg, #ff8a2a, #ff5b3a) !important;
  border-color: rgba(255,138,42,.44) !important;
  color: #180c1c !important;
}

.site-footer {
  background: #04030a !important;
  border-top-color: rgba(141,92,255,.18) !important;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .event-episodes {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
  .event-values-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .event-title {
    width: min(100%, 560px);
  }

  .event-home-hero {
    min-height: auto;
    padding: 24px 18px 24px;
    border-radius: 0;
  }

  .event-hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .event-copy {
    padding: 10px 4px 0;
  }

  .event-sign {
    position: static;
    width: min(100%, 250px);
    margin: 14px auto 0;
    aspect-ratio: 3 / 2;
    transform: rotate(-1deg);
  }

  .event-bat-small {
    left: 210px;
  }

  .event-bat-big {
    right: 12%;
    top: 110px;
  }

  .event-episodes-row {
    grid-template-columns: 1fr;
  }

  .event-arrow {
    display: none;
  }

  .event-episodes {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 640px) {
  .event-home-hero {
    background:
      linear-gradient(
        180deg,
        rgba(4,3,10,.26) 0%,
        rgba(4,3,10,.44) 35%,
        rgba(4,3,10,.86) 76%,
        #05040a 100%
      ),
      var(--event-hero-mobile) center top / cover no-repeat;
  }

  .event-title {
    width: min(100%, 520px);
    aspect-ratio: 16 / 7;
    margin-inline: auto;
    background-position: center;
  }

  .event-wrap,
  .event-shell {
    width: min(calc(100% - 20px), var(--ev-max));
  }

  .event-home-hero {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: 18px 12px 20px;
  }
.event-copy p {
    font-size: 1.02rem;
  }

  .event-countdown {
    width: 100%;
  }

  .event-sign {
    width: min(100%, 200px);
    margin: 10px auto 0;
    transform: none;
  }

  .count-num {
    font-size: 1.7rem;
  }

  .event-bat-small,
  .event-bat-big {
    display: none;
  }

  .event-episodes {
    grid-template-columns: 1fr;
  }

  .event-values-grid {
    grid-template-columns: 1fr;
  }

  .event-day-card {
    min-height: 210px;
  }
}

.zampy-float img {
  border: 4px solid #fa791c !important;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px #7b5cff,
    0 0 16px rgba(255,138,42,.55),
    0 0 28px rgba(123,92,255,.28),
    0 10px 24px rgba(0,0,0,.35) !important;
}

/* ===== EVENT NAV: Halloween ===== */
.header-nav .event-nav-link {
  display: inline-flex;
  align-items: center;
  color: var(--ev-orange) !important;
  font-weight: 800;
}

/* Stella "La nostra storia" in versione Halloween */
.header-star.halloween-star {
  color: var(--ev-orange) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter:
    drop-shadow(0 0 5px rgba(255,138,42,.65))
    drop-shadow(0 0 11px rgba(255,138,42,.30));
}
.header-star.halloween-star:hover {
  color: var(--ev-orange-light) !important;
  transform: scale(1.35);
  filter:
    drop-shadow(0 0 7px rgba(255,179,71,.90))
    drop-shadow(0 0 14px rgba(255,138,42,.45));
}


/* =========================================================
   INTEGRAZIONE EVENTO DINAMICO — TEST rev03
   Compatibilità con event.js.
   ========================================================= */

.event-nav-link[hidden] {
  display: none !important;
}

.site-header .header-nav .event-nav-link {
  color: var(--ev-orange) !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
 margin: 0 0 0 16px !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.site-header .header-nav .event-nav-link:hover,
.site-header .header-nav .event-nav-link:focus-visible,
.site-header .header-nav .event-nav-link.active {
  color: var(--ev-orange-2) !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}



/* =========================================================
   V2 CORRETTA — HERO RESPONSIVA SENZA TAGLI
   La causa del falso "taglio" era la combinazione di:
   - gradienti inferiori molto scuri;
   - background-size 100% 100% dei test, che stirava l'immagine;
   - allineamenti tablet non uniformi.
   Qui l'immagine usa cover: riempie sempre l'intera hero senza terminare
   prima del contenuto e senza deformazioni.
   ========================================================= */
:root {
  --event-hero-tablet-v2: url("immagini/halloween-hero-tablet-v2.webp");
  --event-hero-mobile-v2: url("immagini/halloween-hero-mobile-v2.webp");
}

.event-home-hero {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  background-repeat: no-repeat !important;
}

/* Desktop */
@media (min-width: 981px) {
  .event-home-hero {
    min-height: 780px;
    background:
      linear-gradient(90deg,
        rgba(3,3,8,.90) 0%,
        rgba(4,3,10,.70) 27%,
        rgba(4,3,10,.20) 58%,
        rgba(4,3,10,.18) 100%),
      linear-gradient(180deg,
        rgba(10,7,24,.04) 0%,
        rgba(10,7,24,.06) 64%,
        rgba(5,4,11,.22) 100%),
      var(--event-hero-desktop) center top / cover no-repeat !important;
  }
}

/* Tablet + mobile: testo realmente centrato e header su una sola riga scorrevole */
@media (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .site-header {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .site-header .logo {
    flex: 0 0 100%;
    text-align: center;
  }

  .header-nav {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 7px;
    -webkit-overflow-scrolling: touch;
  }

  .header-nav a,
  .site-header .header-nav .event-nav-link,
  .header-star {
    flex: 0 0 auto;
    margin-left: 0 !important;
    white-space: nowrap;
  }

  .event-home-hero {
    min-height: 0 !important;
  }

  .event-copy {
    text-align: center;
  }

  .event-badge {
    margin-left: auto;
    margin-right: auto;
  }

  .event-title,
  .event-copy p,
  .event-countdown,
  .event-main-cta-image,
  .event-note {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .event-copy p {
    max-width: 600px;
  }

  .event-sign {
    margin: 16px auto 0 !important;
  }

  .event-story-title {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .event-home-hero {
    background:
      linear-gradient(180deg,
        rgba(4,3,10,.08) 0%,
        rgba(4,3,10,.12) 52%,
        rgba(5,4,10,.24) 100%),
      var(--event-hero-tablet-v2) center top / cover no-repeat !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .event-home-hero {
    background:
      linear-gradient(180deg,
        rgba(4,3,10,.06) 0%,
        rgba(4,3,10,.10) 56%,
        rgba(5,4,10,.22) 100%),
      var(--event-hero-mobile-v2) center top / cover no-repeat !important;
  }

  .event-story-title {
    flex-direction: column;
    gap: 4px;
  }

  .event-note {
    text-align: center;
  }
}


/* ============================================================
   V2 — FIX TABLET/MOBILE 60966
   Desktop invariato.
   Sfondo tablet/mobile pulito: nessun testo/CTA incorporato.
   ============================================================ */

@media (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .event-home-hero {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .event-hero-grid {
    min-height: 0 !important;
    display: block !important;
  }

  .event-copy {
    width: 100% !important;
    max-width: 720px !important;
    margin: 0 auto !important;
    padding: 12px 14px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .event-badge {
    margin: 0 auto 16px !important;
  }

  .event-title {
    margin: 0 auto 10px !important;
    background-position: center !important;
  }

  .event-copy p {
    width: 100% !important;
    max-width: 620px !important;
    margin: 14px auto 20px !important;
    text-align: center !important;
  }

  .event-countdown {
    width: min(100%, 430px) !important;
    margin: 0 auto !important;
  }

  .event-main-cta-image {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .event-note {
    width: 100% !important;
    margin: 10px auto 0 !important;
    text-align: center !important;
  }

  .event-sign {
    position: static !important;
    margin: 18px auto 0 !important;
  }

  .event-story-block {
    margin-top: 26px !important;
  }

  .event-story-title {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* TABLET */
@media (min-width: 641px) and (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .event-home-hero {
    padding: 24px 24px 30px !important;
    background:
      linear-gradient(
        180deg,
        rgba(4,3,10,.10) 0%,
        rgba(4,3,10,.15) 48%,
        rgba(5,4,10,.34) 100%
      ),
      var(--event-hero-tablet-v2) center top / cover no-repeat !important;
  }

  .event-title {
    width: min(82vw, 520px) !important;
  }

  .event-main-cta-image {
    width: min(88%, 560px) !important;
  }

  .event-sign {
    width: min(42vw, 260px) !important;
  }
}

/* MOBILE */
@media (max-width: 640px) {
  .event-home-hero {
    padding: 18px 12px 24px !important;
    background:
      linear-gradient(
        180deg,
        rgba(4,3,10,.08) 0%,
        rgba(4,3,10,.14) 52%,
        rgba(5,4,10,.34) 100%
      ),
      var(--event-hero-mobile-v2) center top / cover no-repeat !important;
  }

  .event-copy {
    padding: 8px 4px 0 !important;
  }

  .event-title {
    width: min(94vw, 500px) !important;
  }

  .event-copy p {
    max-width: 560px !important;
  }

  .event-main-cta-image {
    width: min(96%, 520px) !important;
  }
}


/* ============================================================
   TEST — SFONDO HALLOWEEN PAGINE BASE
   2026-10-16
   - Home evento esclusa: mantiene la propria grafica dedicata.
   - Bosco delle Paure escluso: mantiene i propri sfondi narrativi.
   - Header/stella/link invariati.
   - Asset richiesto nella cartella immagini: immagini/sfondo1.png
   ============================================================ */

body:not(.bosco-page):not(:has(.event-home-hero)) {
  background:
    linear-gradient(
      180deg,
      rgba(5, 4, 10, .16) 0%,
      rgba(5, 4, 10, .08) 42%,
      rgba(5, 4, 10, .18) 100%
    ),
    url("immagini/sfondo6.png") center top / cover fixed no-repeat !important;
  background-color: #08070c !important;
  min-height: 100vh;
}

/* Mantiene leggibili le pagine lunghe senza nascondere lo sfondo. */
body:not(.bosco-page):not(:has(.event-home-hero)) main {
  position: relative;
  z-index: 1;
}

/* Tablet: stesso sfondo, inquadratura centrale. */
@media (min-width: 641px) and (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  body:not(.bosco-page):not(:has(.event-home-hero)) {
    background-position: center top !important;
    background-size: cover !important;
    background-attachment: fixed !important;
  }
}

/* Mobile: sfondo fisso disattivato per evitare scatti sui browser mobili. */
@media (max-width: 640px) {
  body:not(.bosco-page):not(:has(.event-home-hero)) {
    background-image:
      linear-gradient(180deg, rgba(5, 4, 10, .16) 0%, rgba(5, 4, 10, .08) 42%, rgba(5, 4, 10, .18) 100%),
      url("immagini/sfondo6mobile.webp") !important;
    background-position: center top !important;
    background-size: cover !important;
    background-attachment: scroll !important;
  }
}


/* ============================================================
   FIX EVENTO — STELLE + HEADER ORIGINALE
   2026-10-16
   - Disattiva il cielo stellato/lampeggiante del sito base
     soltanto mentre Halloween è attivo.
   - Mantiene la stella-link dell'header.
   - Ripristina dimensioni e pesi tipografici dell'header base.
   ============================================================ */

html[data-event-active="true"][data-event-theme="halloween"] body {
  animation: none !important;
}

/* Stelle decorative delle hero/pagine: OFF durante Halloween.
   Non coinvolge .header-star, che resta visibile e cliccabile. */
html[data-event-active="true"][data-event-theme="halloween"] .star {
  display: none !important;
  animation: none !important;
  opacity: 0 !important;
}

/* HEADER — mantieni proporzioni tipografiche del sito originale */
html[data-event-active="true"][data-event-theme="halloween"] .site-header .logo {
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  letter-spacing: .02em !important;
}

html[data-event-active="true"][data-event-theme="halloween"] .header-nav a,
html[data-event-active="true"][data-event-theme="halloween"] .site-header .header-nav .event-nav-link {
  font-size: var(--font-secondary, 1.2rem) !important;
  font-weight: 600 !important;
}

/* Il link evento non deve apparire più pesante degli altri link. */
html[data-event-active="true"][data-event-theme="halloween"] .header-nav .event-nav-link {
  font-weight: 600 !important;
}

/* La stella "La nostra storia" conserva dimensione, link e comportamento. */
html[data-event-active="true"][data-event-theme="halloween"] .header-star,
html[data-event-active="true"][data-event-theme="halloween"] .header-star.halloween-star {
  font-size: 1.1rem !important;
}

/* Tablet/mobile: lascia prevalere il menu condiviso del sito,
   senza rimpicciolire i testi dell'header. */
@media (max-width: 1180px), (hover:none) and (pointer:coarse) and (max-width:1366px) {
  html[data-event-active="true"][data-event-theme="halloween"].pf-mobile-menu-ready .site-header .logo {
    font-size: 1.08rem !important;
    font-weight: 600 !important;
  }

  html[data-event-active="true"][data-event-theme="halloween"].pf-mobile-menu-ready .header-nav a,
  html[data-event-active="true"][data-event-theme="halloween"].pf-mobile-menu-ready .header-star {
    font-size: var(--font-secondary, 1.12rem) !important;
    font-weight: 600 !important;
  }
}


/* ============================================================
   FIX EVENTO — RIMOZIONE VELO BLU DELLE HERO BASE
   2026-10-16
   Le pagine come Storie/Personaggi usano .hero.hero--story.
   Il gradiente blu appartiene a style_common.css.
   Durante Halloween viene neutralizzato per lasciare visibile
   lo sfondo evento sottostante.
   ============================================================ */

html[data-event-active="true"][data-event-theme="halloween"] .hero--story {
  background: transparent !important;
}

html[data-event-active="true"][data-event-theme="halloween"] .hero--story::before {
  background: none !important;
  content: none !important;
}

/* Evita anche eventuali veli della hero home standard se presenti
   in pagine secondarie, senza toccare la Home Halloween dedicata. */
html[data-event-active="true"][data-event-theme="halloween"] body:not(:has(.event-home-hero)) .hero--home {
  background: transparent !important;
}

/* Home Halloween: immagini dedicate per dispositivo. */
@media (min-width: 641px) and (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  html body .event-home-hero {
    background-image:
      linear-gradient(180deg, rgba(4,3,10,.10) 0%, rgba(4,3,10,.15) 48%, rgba(5,4,10,.34) 100%),
      url("immagini/halloween-hero-tablet-v2.webp") !important;
  }
}
@media (max-width: 640px) {
  html body .event-home-hero {
    background-image:
      linear-gradient(180deg, rgba(4,3,10,.08) 0%, rgba(4,3,10,.14) 52%, rgba(5,4,10,.34) 100%),
      url("immagini/halloween-hero-mobile-v2.webp") !important;
  }
}

/* Sfondo delle pagine base su mobile: proporzionato alla larghezza. */
@media (max-width: 640px) {
  body:not(.bosco-page):not(:has(.event-home-hero)) {
    background-size: 100% 100%, 100% auto !important;
    background-position: center top, center top !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
  }
}

/* Home mobile: hero proporzionata alla larghezza e fissa durante lo scorrimento. */
@media (max-width: 640px) {
  html body .event-home-hero {
    background-size: 100% 100%, 100% auto !important;
    background-position: center top, center top !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: #08070c !important;
  }
}

/* Home tablet: stessa resa approvata su mobile, con immagine dedicata. */
@media (min-width: 641px) and (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  html body .event-home-hero {
    background-size: 100% 100%, 100% auto !important;
    background-position: center top, center top !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    background-color: #08070c !important;
  }
}

/* Tablet: immagine fissa su un livello separato per ridurre i ridisegni. */
@media (min-width: 641px) and (max-width: 980px), (min-width: 981px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  html body .event-home-hero {
    background-image: none !important;
    background-attachment: scroll !important;
    clip-path: inset(0);
  }
  html body .event-home-hero::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
      linear-gradient(180deg, rgba(4,3,10,.10) 0%, rgba(4,3,10,.15) 48%, rgba(5,4,10,.34) 100%),
      url("immagini/halloween-hero-tablet-v2.webp");
    background-size: 100% 100%, 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #08070c;
    transform: translateZ(0);
    will-change: transform;
  }
}

/* Halloween: card delle storie nelle schede dei personaggi. */
html[data-event-active="true"][data-event-theme="halloween"] .storia-card-p,
html[data-event-active="true"][data-event-theme="halloween"] .storia-card-r {
  background: linear-gradient(160deg, rgba(25,16,44,.95), rgba(10,8,18,.96)) !important;
  border-color: rgba(141,92,255,.22) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
html[data-event-active="true"][data-event-theme="halloween"] .storia-card-p:hover,
html[data-event-active="true"][data-event-theme="halloween"] .storia-card-r:hover {
  border-color: rgba(255,138,42,.48) !important;
}

/* Survey: palette condivisa derivata dalla Home allegata. */

/* TEST 03 — Survey e Newsletter allineati alla palette Halloween.
   Solo colori/ombre/bordi: struttura e funzioni restano invariati. */
html[data-event-active="true"][data-event-theme="halloween"] .pf-survey-promo{
  --pf-survey-bg:linear-gradient(145deg,rgba(16,11,29,.97) 0%,rgba(39,22,64,.96) 58%,rgba(67,31,76,.94) 100%);
  --pf-survey-border:rgba(255,138,42,.48);
  --pf-survey-title:#ffb347;
  --pf-survey-text:#f4effc;
  --pf-survey-button:#7b5cff;
  background:var(--pf-survey-bg)!important;
  border-color:var(--pf-survey-border)!important;
  color:var(--pf-survey-text)!important;
  box-shadow:0 18px 42px rgba(0,0,0,.42),0 0 24px rgba(123,92,255,.12)!important;
}
html[data-event-active="true"][data-event-theme="halloween"] .pf-survey-promo__content h3{color:var(--pf-survey-title)!important;}
html[data-event-active="true"][data-event-theme="halloween"] .pf-survey-promo__content p{color:var(--pf-survey-text)!important;}
html[data-event-active="true"][data-event-theme="halloween"] .pf-survey-promo__button{
  border-color:#ff8a2a!important;
  background:linear-gradient(180deg,#8d5cff,#6846d8)!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(0,0,0,.24),0 0 16px rgba(123,92,255,.22);
}
html[data-event-active="true"][data-event-theme="halloween"] .pf-survey-promo__button:hover,html[data-event-active="true"][data-event-theme="halloween"] .pf-survey-promo__button:focus-visible{
  background:linear-gradient(180deg,#ff9c42,#ff6934)!important;
  color:#170c1a!important;
}


/* Halloween: box delle pagine Genitori, Chi siamo e Termini. */
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .box-ai,
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .box-sicurezza,
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .gen-cta,
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .chi-siamo-teaser,
html[data-event-active="true"][data-event-theme="halloween"] .cs-wrapper .chiusura-box,
html[data-event-active="true"][data-event-theme="halloween"] .terms .identity,
html[data-event-active="true"][data-event-theme="halloween"] .terms .index,
html[data-event-active="true"][data-event-theme="halloween"] .terms .notice {
  background: linear-gradient(160deg, rgba(25,16,44,.95), rgba(10,8,18,.96)) !important;
  border-color: rgba(141,92,255,.38) !important;
  color: #f4effc !important;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
}
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .box-ai :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .box-sicurezza :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .gen-cta :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .chi-siamo-teaser :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .cs-wrapper .chiusura-box :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .terms .identity :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .terms .index :is(p, li, dd),
html[data-event-active="true"][data-event-theme="halloween"] .terms .notice :is(p, li, dd) { color: #ded7ef !important; }
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .box-ai :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .box-sicurezza :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .gen-cta :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .chi-siamo-teaser :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .cs-wrapper .chiusura-box :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .terms .identity :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .terms .index :is(h2, h3, strong, dt),
html[data-event-active="true"][data-event-theme="halloween"] .terms .notice :is(h2, h3, strong, dt) { color: #ffb347 !important; }
html[data-event-active="true"][data-event-theme="halloween"] .terms .index a { color: #f4effc !important; }
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .btn-cta-sand {
  background: linear-gradient(180deg, #ff9c42, #ff6934) !important;
  color: #170c1a !important;
}
html[data-event-active="true"][data-event-theme="halloween"] .genitori-wrapper .btn-ghost-sand {
  background: rgba(123,92,255,.16) !important;
  border-color: #ff8a2a !important;
  color: #f4effc !important;
}

/* Halloween: Survey e Invia storie; nessuna modifica agli stati del modulo. */
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .survey-card,
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .suggest,
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .privacy-box,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .step-card,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .info-box,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .parent-section,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .privacy-box,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .schema-field,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .success-card {
 background: linear-gradient(160deg, rgba(25,16,44,.95), rgba(10,8,18,.96)) !important;
 border-color: rgba(141,92,255,.38) !important;
 color: #f4effc !important;
}
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .suggest a,
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .survey-num,
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .survey-card h2,
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .privacy-box h2,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .step-label,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .ps-title,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .pb-title,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .s-prompt { color: #ffb347 !important; }
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .survey-body p,
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .privacy-box ul,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .pb-text,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .ps-sub,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .step-sub { color: #ded7ef !important; }
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .btn-survey-go { background: linear-gradient(180deg,#ff9c42,#ff6934) !important; color:#170c1a !important; }
html[data-event-active="true"][data-event-theme="halloween"] .survey-wrapper .survey-card.open { border-color:#ff8a2a !important; }
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .age-btn,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .field :is(input,textarea,select) {
 background:#100b1c !important; border-color:rgba(141,92,255,.42) !important; color:#f4effc !important;
}
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .age-btn.selected,
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .age-btn[aria-pressed="true"],
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .field :is(input,textarea,select):focus { border-color:#ff8a2a !important; }
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .age-btn[aria-pressed="true"] { background:rgba(123,92,255,.28) !important; }
html[data-event-active="true"][data-event-theme="halloween"] .form-wrap .btn-back { color:#f4effc !important; border-color:#7b5cff !important; }
