/* Ambiance « hiver » : nuit du solstice. Classe .mpc-hiver posee sur <body> par mpc-site
   (meta mpc_ambiance de l'article, includes/ambiance.php). Le decor est en CSS ; la neige et les titres : hiver.js. */

.mpc-hiver {
  --mpc-nuit-1: #121027;
  --mpc-nuit-2: #1B1834;
  --mpc-nuit-3: #29244A;
  --mpc-braise: #E98E6E;
  --mpc-neige: #F5F3FA;
  background: var(--mpc-nuit-2);
}

/* Le ciel : un calque fixe, compose une fois (pas de background-attachment: fixed, couteux sur mobile) */
.mpc-hiver::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(90% 55% at 50% 118%, color-mix(in srgb, var(--mpc-braise) 34%, transparent), transparent 62%),
    radial-gradient(60% 40% at 82% 0%, color-mix(in srgb, #6B5FA8 30%, transparent), transparent 70%),
    linear-gradient(180deg, var(--mpc-nuit-1) 0%, var(--mpc-nuit-2) 48%, var(--mpc-nuit-3) 100%);
}
/* Quelques etoiles, fixes, dans le haut du ciel */
.mpc-hiver::after {
  content: ""; position: fixed; inset: 0 0 45% 0; z-index: -2; pointer-events: none; opacity: .55;
  background:
    radial-gradient(1.2px 1.2px at 8% 12%, #fff, transparent),
    radial-gradient(1px 1px at 17% 31%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 29% 8%, #fff, transparent),
    radial-gradient(1px 1px at 41% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 56% 6%, #fff, transparent),
    radial-gradient(1px 1px at 63% 34%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 74% 15%, #fff, transparent),
    radial-gradient(1px 1px at 86% 27%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 93% 9%, #fff, transparent),
    radial-gradient(1px 1px at 3% 44%, #fff, transparent),
    radial-gradient(1px 1px at 49% 47%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 97% 52%, #fff, transparent);
}

/* La neige qui tombe : derriere le texte, devant le ciel */
.mpc-neige-toile { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; transition: opacity 1.2s var(--mpc-souple); }
.mpc-neige-toile.is-eteinte { opacity: 0; }

/* Tete et corps de l'article : couleurs de nuit. La suite (cartes creme) et la barre gardent les leurs. */
.mpc-hiver .mpc-article-tete,
.mpc-hiver .mpc-article-corps {
  --mpc-titre: #F7F1E8;
  --mpc-texte: #E2D8CE;
  --mpc-filet: rgb(255 255 255 / .14);
  --mpc-carte: rgb(255 255 255 / .04);
  --mpc-terre: #F4B99A;
  --mpc-terre-fonce: #F7D6C4;
  --mpc-fond: var(--mpc-nuit-2);
  color: var(--mpc-texte);
}
/* Sans image a la une, la tete descend sous la barre */
.mpc-hiver main:not(:has(.mpc-article-figure img, .wp-block-post-featured-image img)) .mpc-article-tete { padding-top: clamp(140px, 10vw + 80px, 200px); }
.mpc-hiver .mpc-article-titre { color: var(--mpc-neige); animation: none; }  /* la mise au point du template cede la place aux flocons */
/* Les H2 en lilas pale, l'heure bleue de la rubrique : la neige blanche se lit dessus */
/* Taille optique automatique : le canvas, qui calcule la neige, ne sait pas dessiner l'opsz 72 du template */
.mpc-hiver .mpc-article-texte h2 { position: relative; color: #BDB3EA; font-variation-settings: normal; }
.mpc-hiver .mpc-article-texte a { color: var(--mpc-terre); }
.mpc-hiver .mpc-article-texte a:hover { color: var(--mpc-terre-fonce); }
.mpc-hiver .mpc-teinte { --mpc-l1: #F4B99A; --mpc-l2: var(--mpc-braise); --mpc-l3: #F7D6C4; }
.mpc-hiver .mpc-pastille--bleue { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18); }
.mpc-hiver .mpc-suite-titre { color: #F7F1E8; }
/* Les titres H3 a H6 prennent le preset « titre » des styles globaux, pas le token : on les rebranche */
.mpc-hiver .mpc-article-texte :is(h3, h4, h5, h6) { color: var(--mpc-titre); }
/* La neige posee sur les H2 (toile calculee par _hiver.js) */
.mpc-congere { position: absolute; left: 0; pointer-events: none; }

/* Le H1 qui se forme : flou au depart (jamais transparent : c'est l'element LCP), net a l'arrivee des flocons */
.mpc-hiver .mpc-article-titre.is-flocons { filter: blur(12px); opacity: .35; }
.mpc-hiver .mpc-article-titre.is-forme { filter: blur(0); opacity: 1; transition: filter 1.3s var(--mpc-souple), opacity 1.3s var(--mpc-souple); }
.mpc-flocons-toile { position: fixed; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }

/* Interrupteur de la neige */
.mpc-neige-bouton {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px 10px; border: 0; border-radius: 999px;
  background: rgb(255 255 255 / .10); color: var(--mpc-neige); backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .18);
  font-family: var(--mpc-mono); font-size: var(--mpc-fs-mono); letter-spacing: .04em; cursor: pointer;
  transition: background var(--mpc-survol);
}
.mpc-neige-bouton:hover { background: rgb(255 255 255 / .18); }
.mpc-neige-bouton svg { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) {
  .mpc-hiver .mpc-article-titre.is-flocons { filter: none; opacity: 1; }
}
