/* =========================================================
   STYLE SPÉCIAL — NOËL 🎄
   Chargé par base.html seulement quand le style est actif
   (Gestion > Maintenance Système > Style spécial).
   Tout est scopé par body[data-style="noel"] : retirer le style
   = retrouver Lucien à l'identique, sans rien d'autre à défaire.

   Réglages rapides : les variables juste en dessous.
========================================================= */
body[data-style="noel"]{
  /* palette */
  --noel-rouge: #c0272d;
  --noel-vert:  #1e7a46;
  --noel-or:    #e0a92a;

  /* couleurs d'accent de Lucien (pastilles, icônes de la barre, badges…) */
  --clr-red:    var(--noel-rouge);
  --clr-green:  var(--noel-vert);
  --clr-orange: var(--noel-or);

  /* fond coloré (fond.css) : rouge, or, vert, rouge clair */
  --blob-base:   rgba(246,232,226,.40);
  --blob-blue:   rgba(192,39,45,.62);
  --blob-orange: rgba(224,169,42,.62);
  --blob-green:  rgba(30,122,70,.66);
  --blob-red:    rgba(214,92,84,.48);

  /* titres (fond.css) : rouge → vert → or */
  --titre-grad: linear-gradient(120deg, #a31621 0%, #1b6e40 42%, #1b6e40 60%, #b87a00 94%);
}
@supports (background: linear-gradient(in oklch, red, blue)){
  body[data-style="noel"]{
    --titre-grad: linear-gradient(120deg in oklch, #a31621 0%, #1b6e40 42%, #1b6e40 60%, #b87a00 94%);
  }
}
@media (max-width: 991.98px){
  body[data-style="noel"]{
    --blob-blue:   rgba(192,39,45,.46);
    --blob-orange: rgba(224,169,42,.46);
    --blob-green:  rgba(30,122,70,.48);
    --blob-red:    rgba(214,92,84,.34);
  }
}

/* zone de la barre d'état (iPhone) assortie au fond */
html:has(body[data-style="noel"]):not(:has(body.login-page)),
body[data-style="noel"]:not(.login-page){
  background-color: #c9cfe8 !important;
}
html:has(body[data-style="noel"]):not(:has(body.page-accueil)):not(:has(body.login-page)),
body[data-style="noel"]:not(.page-accueil):not(.login-page){
  background-color: #e6e9f6 !important;
}

/* FOND : paysage enneigé (noel-fond.webp) à la place des taches de couleur de fond.css.
   Un voile clair, plus dense en haut (ciel sombre), garde les titres et les tuiles lisibles.
   Réglage : les deux opacités du dégradé (accueil) et « opacity » plus bas (autres pages).
   Si l'image ne charge pas : fond lavande uni. */
body[data-style="noel"]::before{
  left: 0; right: 0; top: 0;
  height: 100lvh;
  translate: none;
  filter: none;
  animation: none;
  will-change: auto;
  background:
    linear-gradient(180deg, rgba(246,243,252,.74) 0%, rgba(246,243,252,.52) 38%, rgba(246,243,252,.14) 78%, rgba(246,243,252,0) 100%),
    url("noel-fond.webp") center bottom / cover no-repeat,
    #cfd4ec;
}
/* autres pages que l'accueil : fond plus discret (voile plus épais) */
body[data-style="noel"]:not(.page-accueil):not(.login-page)::before{
  opacity: .5;
}

/* tuiles de l'accueil : teintes rouge / vert / or (bleu → rouge, vert → vert, orange → or, rouge → rouge clair) */
body[data-style="noel"] .bento-blue   { --tint: rgba(192,39,45,.10); }
body[data-style="noel"] .bento-green  { --tint: rgba(30,122,70,.10); }
body[data-style="noel"] .bento-orange { --tint: rgba(224,169,42,.14); }
body[data-style="noel"] .bento-red    { --tint: rgba(214,92,84,.09); }
body[data-style="noel"] .bento-badge--info{
  background: var(--noel-vert);
  box-shadow: 0 3px 10px rgba(30,122,70,.30), inset 0 1px 0 rgba(255,255,255,.35);
}

/* logo de l'accueil : version Noël (noel-logo.webp) posée par-dessus le logo habituel, qui reste dans
   la page (invisible) : la mise en page et le badge de rôle ne bougent pas.
   Réglage : « 2.01 » = taille de l'image (en hauteur de logo) ; « -.797 » = décalage vertical ;
   « .75 » = marge au-dessus pour que les bonnets ne soient pas rognés. */
body[data-style="noel"] .accueil-entete .logo-wrap{ margin-top: calc(var(--lh, 60px) * .75); }
body[data-style="noel"] .accueil-entete .logo-wrap .img-lucien{ opacity: 0 !important; }
body[data-style="noel"] .accueil-entete .logo-wrap::before{
  content: "";
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(var(--lh, 60px) * -.797);
  height: calc(var(--lh, 60px) * 2.01);
  aspect-ratio: 1894 / 716;
  transform: translateX(-51.5%);
  pointer-events: none;
  background: url("noel-logo.webp") center / contain no-repeat;
}

/* neige : UN seul calque fixe (body::after) qui ne fait que glisser (transform) — plus léger que deux calques.
   Il passe DERRIÈRE les blocs de la page (z-index -1 : devant le fond du ::before, derrière le contenu),
   sauf sur l'accueil où il reste devant. Réglages : « 14s » = vitesse, les cercles = taille des flocons. */
body[data-style="noel"]::after{
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: -500px;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
  background-size: 500px 500px;
  background-image:
    radial-gradient(circle 4.5px at 60px 80px,   #fff 55%, rgba(120,150,185,.5) 85%, transparent),
    radial-gradient(circle 5px   at 250px 260px, #fff 55%, rgba(120,150,185,.5) 85%, transparent),
    radial-gradient(circle 4px   at 420px 120px, #fff 55%, rgba(120,150,185,.5) 85%, transparent),
    radial-gradient(circle 5px   at 150px 440px, #fff 55%, rgba(120,150,185,.5) 85%, transparent),
    radial-gradient(circle 4px   at 370px 400px, #fff 55%, rgba(120,150,185,.5) 85%, transparent),
    radial-gradient(circle 3px   at 200px 30px,  #fff 55%, rgba(120,150,185,.55) 85%, transparent),
    radial-gradient(circle 2.5px at 330px 200px, #fff 55%, rgba(120,150,185,.55) 85%, transparent),
    radial-gradient(circle 3px   at 30px 300px,  #fff 55%, rgba(120,150,185,.55) 85%, transparent),
    radial-gradient(circle 2.5px at 465px 310px, #fff 55%, rgba(120,150,185,.55) 85%, transparent),
    radial-gradient(circle 3px   at 110px 190px, #fff 55%, rgba(120,150,185,.55) 85%, transparent),
    radial-gradient(circle 2.5px at 290px 470px, #fff 55%, rgba(120,150,185,.55) 85%, transparent);
  animation: noelNeige 14s linear infinite;
}
/* accueil : la neige reste devant */
body[data-style="noel"].page-accueil::after{ z-index: 9000; }
@keyframes noelNeige { to { transform: translateY(500px); } }

/* mouvement réduit : pas de neige */
@media (prefers-reduced-motion: reduce){
  body[data-style="noel"]::after{ display: none; }
}
/* impression : rien */
@media print{
  body[data-style="noel"]::after,
  body[data-style="noel"] .accueil-entete .logo-wrap::before{ display: none !important; }
  body[data-style="noel"] .accueil-entete .logo-wrap .img-lucien{ opacity: 1 !important; }
}
