/* Sfondo comune e regolazioni dei riquadri natalizi.
   Opacità: da 0 (trasparente) a 1 (massima).
   Sfocatura: da 0px (spenta) in su. Si applica allo sfondo dietro al riquadro. */
html[data-event-active="true"][data-event-theme="natale"] {
  /* Cambiare qui l’immagine delle pagine ordinarie, anche su mobile. */
  --natale-sfondo-pagine: url("immagini/villaggio-natale.webp");
  --natale-sfondo-velatura: linear-gradient(180deg, #0a0e2a88 0%, #0a0e2a70 42%, #0a0e2aa6 100%);
  /* Come cover su tutto lo schermo. Il villaggio ha proporzioni 3:2. */
  --natale-sfondo-misure: 100% 100dvh, max(100%, 150dvh) auto;
  --christmas-frame: url("assets/cornice-natale.png");
  --natale-frame-mask: linear-gradient(to right, #000 0 7%, transparent 10% 90%, #000 93%);


  --natale-box-opacity: 0.95;
  --natale-box-blur: 2px;

  --natale-panel: linear-gradient(160deg,
    rgb(20 30 64 / var(--natale-box-opacity)),
    rgb(10 14 42 / calc(var(--natale-box-opacity) * 1.01)));
  --natale-panel-border: #e8c57a58;
  --natale-panel-text: #fff3dc;
  --natale-panel-accent: #f9d68f;
}

/* Testata natalizia: lascia vedere lo stesso paesaggio che prosegue nella pagina. */
html[data-event-active="true"][data-event-theme="natale"] .site-header {
  display: grid;
  grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  justify-content: stretch;
  row-gap: 4px;
  padding-block: 8px 12px;
  background: transparent;
}

html[data-event-active="true"][data-event-theme="natale"] .site-header.is-scrolled {
  background: #0a0e2a;
}

html[data-event-active="true"][data-event-theme="natale"] .site-header > .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  min-height: clamp(54px, 14vw, 85px);
  text-align: center !important;
}

html[data-event-active="true"][data-event-theme="natale"] .site-header > .logo img {
  display: block;
  width: min(330px, 60vw, calc(100vw - 120px));
  height: clamp(54px, 14vw, 85px);
  object-fit: contain;
}

html[data-event-active="true"][data-event-theme="natale"] .site-header > .mobile-menu-toggle {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  background-color: #0a0e2ac9;
  color: var(--natale-panel-accent);
}

html[data-event-active="true"][data-event-theme="natale"] .site-header > .header-nav {
  grid-column: 1 / -1;
  justify-content: center;
  text-align: center;
}

html[data-event-active="true"][data-event-theme="natale"] .site-header .header-nav a {
  display: inline-block;
  margin-inline: 3px;
  padding: 6px 12px;
  border-radius: 12px;
  background-color: #0a0e2ac9;
  color: var(--natale-panel-text);
}

html[data-event-active="true"][data-event-theme="natale"] .site-header .header-nav a:is(:hover, :focus-visible, .active) {
  background-color: #171d39;
  color: var(--natale-panel-accent);
}

/* Il villaggio si allinea al bordo superiore dello schermo anche nella testata fissa. */
html[data-event-active="true"][data-event-theme="natale"]:has(> body:not(.advent-page, .bosco-page)):not(:has(.event-home-hero, .winter-intro))::before,
html[data-event-active="true"][data-event-theme="natale"]:has(> body:not(.advent-page, .bosco-page)):not(:has(.event-home-hero, .winter-intro)) .site-header.is-scrolled {
  background: var(--natale-sfondo-velatura) center top no-repeat,
    var(--natale-sfondo-pagine) center top no-repeat #0a0e2a;
  background-size: var(--natale-sfondo-misure);
}

html[data-event-active="true"][data-event-theme="natale"]:has(> body:not(.advent-page, .bosco-page)):not(:has(.event-home-hero, .winter-intro))::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page, .bosco-page):not(:has(.event-home-hero, .winter-intro)) {
  background: transparent !important;
  min-height: 100vh;
  animation: none !important;
}

html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page, .bosco-page):not(:has(.event-home-hero, .winter-intro)) main {
  position: relative;
  z-index: 1;
}

html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page, .bosco-page):not(:has(.event-home-hero, .winter-intro)) :is(.hero--home, .hero--story) {
  background: transparent;
}

html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page, .bosco-page):not(:has(.event-home-hero, .winter-intro)) .hero .star {
  display: none;
}

/* Pannelli delle pagine ordinarie, con lo stesso contrasto di Halloween. */
html[data-event-active="true"][data-event-theme="natale"] :is(
  .raccolta-intro-inner, .raccolta-card, .pers-card, .book-card, .feature-card,
  .cross-link, .prequel-card, .storia-card-p, .storia-card-r,
  .parent-card-inner, .callout-pink, .intro-card, .respiro-inner, .sigla-finale,
  .page-hero-panel, .genitori-wrapper :is(.gen-section, .box-ai, .box-sicurezza, .gen-cta, .chi-siamo-teaser),
  .cs-wrapper :is(.bea-intro, .capitolo, .chiusura-box, .cs-cta), .terms :is(.identity, .index, .notice),
  .survey-wrapper :is(.survey-card, .suggest, .privacy-box),
  .form-wrap :is(.step-card, .info-box, .parent-section, .privacy-box, .schema-field, .success-card)
) {
  background: var(--natale-panel);
  -webkit-backdrop-filter: blur(var(--natale-box-blur));
  backdrop-filter: blur(var(--natale-box-blur));
  border-color: var(--natale-panel-border);
  color: var(--natale-panel-text);
  box-shadow: 0 12px 24px #00000038;
}

html[data-event-active="true"][data-event-theme="natale"] :is(
  .parent-card, .callout-pink, .raccolta-intro-inner,
  .page-hero-panel, .genitori-wrapper :is(.gen-text, .box-ai, .box-sicurezza, .gen-cta, .chi-siamo-teaser),
  .cs-wrapper :is(.bea-intro, .capitolo, .chiusura-box), .terms :is(.identity, .index, .notice),
  .survey-wrapper :is(.survey-card, .suggest, .privacy-box),
  .form-wrap :is(.info-box, .parent-section, .privacy-box, .step-card)
) :is(p, li, dd, .pb-text, .ps-sub, .step-sub) {
  color: var(--natale-panel-text);
}

html[data-event-active="true"][data-event-theme="natale"] :is(
  .parent-card, .callout-pink,
  .genitori-wrapper :is(.box-ai, .box-sicurezza, .gen-cta, .chi-siamo-teaser),
  .cs-wrapper .chiusura-box, .terms :is(.identity, .index, .notice),
  .survey-wrapper :is(.survey-card, .suggest, .privacy-box),
  .form-wrap :is(.info-box, .parent-section, .privacy-box, .step-card)
) :is(h2, h3, h4, strong, dt, .pb-title, .ps-title, .step-label) {
  color: var(--natale-panel-accent);
}

html[data-event-active="true"][data-event-theme="natale"] :is(
  .page-hero-panel, .genitori-wrapper .gen-section, .cs-wrapper :is(.bea-intro, .capitolo, .cs-cta)
) {
  border: 1px solid var(--natale-panel-border);
  border-radius: 18px;
  padding: clamp(16px, 4vw, 32px);
}

html[data-event-active="true"][data-event-theme="natale"] .page-hero-panel {
  max-width: 852px;
  margin-inline: auto;
}

html[data-event-active="true"][data-event-theme="natale"] :is(
  .page-hero-panel .hero-meta, .genitori-wrapper .gen-text :is(em, strong),
  .cs-wrapper .cap-testo :is(em, strong)
) {
  color: var(--natale-panel-text);
}

html[data-event-active="true"][data-event-theme="natale"] .cs-wrapper :is(.cap-titolo, .bea-caption, .cs-cta .btn-ghost) {
  color: var(--natale-panel-accent);
}

html[data-event-active="true"][data-event-theme="natale"] .cs-wrapper .cs-cta .btn-ghost {
  border-color: var(--natale-panel-accent);
}

html[data-event-active="true"][data-event-theme="natale"] .cs-wrapper .cs-cta .btn-ghost:is(:hover, :focus-visible) {
  background: var(--natale-panel-accent);
  color: #0a0e2a;
}

html[data-event-active="true"][data-event-theme="natale"] .genitori-wrapper .gen-cta .btn-ghost-sand {
  background: var(--natale-panel-accent);
  border-color: var(--natale-panel-accent);
  color: #0a0e2a;
}

html[data-event-active="true"][data-event-theme="natale"] .genitori-wrapper .gen-cta .btn-ghost-sand:is(:hover, :focus-visible) {
  background: var(--natale-panel-text);
  border-color: var(--natale-panel-text);
}

html[data-event-active="true"][data-event-theme="natale"] .genitori-wrapper .gen-cta .btn-ghost-sand:focus-visible {
  outline: 2px solid var(--natale-panel-accent);
  outline-offset: 3px;
}

html[data-event-active="true"][data-event-theme="natale"] .terms .index a {
  color: var(--natale-panel-text);
}

html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page, .bosco-page) .story-wrapper .story-text {
  --natale-story-edge: rgb(10 14 42 / calc(var(--natale-box-opacity) * 0.79));
  --natale-story-center: rgb(10 14 42 / calc(var(--natale-box-opacity) * 0.95));
  background: linear-gradient(90deg, var(--natale-story-edge), var(--natale-story-center) 9% 91%, var(--natale-story-edge));
  -webkit-backdrop-filter: blur(var(--natale-box-blur));
  backdrop-filter: blur(var(--natale-box-blur));
  border-radius: 16px;
  padding: clamp(14px, 3vw, 28px);
  color: var(--natale-panel-text);
}


/* La cornice e il footer delle pagine di lettura condividono la grafica dell’Avvento. */
html[data-event-active="true"][data-event-theme="natale"] #site-footer .pf-footer-logo img {
  width: min(220px, 100%);
  max-width: 100%;
  height: auto;
  margin: 0;
  vertical-align: middle;
}

html[data-event-active="true"][data-event-theme="natale"] body:is(.advent-page, :has(.story-wrapper, .story-text)) #site-footer {
  position: relative;
  z-index: 2;
  background: #0a0e2a;
  border-top: 1px solid var(--natale-panel-border);
  color: var(--natale-panel-text);
}

@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page):has(.story-wrapper, .story-text)::after,
  html[data-event-active="true"][data-event-theme="natale"] body:is(.advent-page, :has(.story-wrapper, .story-text)) #site-footer::before {
    content: "";
    inset: 0;
    pointer-events: none;
    background: var(--christmas-frame) center / 100% 100% no-repeat;
    mask-image: var(--natale-frame-mask);
  }

  html[data-event-active="true"][data-event-theme="natale"] body:not(.advent-page):has(.story-wrapper, .story-text)::after {
    position: fixed;
    z-index: 0;
  }

  html[data-event-active="true"][data-event-theme="natale"] body:is(.advent-page, :has(.story-wrapper, .story-text)) #site-footer {
    padding-inline: 10%;
  }

  html[data-event-active="true"][data-event-theme="natale"] body:is(.advent-page, :has(.story-wrapper, .story-text)) #site-footer::before {
    position: absolute;
    background-size: 100% max(100%, 75svh);
    background-position: center bottom;
  }
}
