/* ══════════════════════════════════════════════════════════════════════════
   Habillage saisonnier — produit par ~/domino33-work/patch_saisons.py
   Ne pas modifier a la main : relancer le script.

   L'attribut data-season est pose par le script de tete de chaque page, a
   partir de la date du visiteur. Hors des fenetres, l'attribut est absent et
   rien ici ne s'applique : le site est exactement celui d'avant.

   Trois touches seulement, aucune ne touche a la lisibilite :
     · un filigrane derriere le contenu (et non dessus) ;
     · un lisere sous la barre de navigation ;
     · une pastille a cote du logo.
   ══════════════════════════════════════════════════════════════════════════ */

/* Le filigrane doit passer DERRIERE le contenu. Le fond du site est pose sur
   body : on le remonte sur html, sans quoi un pseudo-element en z-index negatif
   serait masque par ce fond. Le fond de la page reste identique a l'oeil. */
html[data-season] { background: var(--cream); }
html[data-season] body { background: transparent; }
/* En sombre la page repose son propre fond avec la meme specificite que la
   notre : on monte d'un cran pour ne pas dependre de l'ordre des feuilles. */
html[data-theme="dark"][data-season] body { background: transparent; }

html[data-season]::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background-image: var(--sz-motif);
  background-size: 155px 155px;
  opacity: var(--sz-op);
}

/* Le lisere. Viser « nav » tout court serait un piege : le pied de page en
   contient une seconde, en position statique, et un enfant absolu s'y echappe
   alors jusqu'au bloc englobant initial pour aller tracer un trait en travers
   de la page. On exclut donc explicitement celle du pied. Les deux barres du
   haut, elles, sont fixe (accueils) ou collante (articles), donc positionnees. */
html[data-season] nav:not(.footer-nav)::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent,
    var(--sz-accent) 18%, var(--sz-accent-2) 50%, var(--sz-accent) 82%, transparent);
}

/* La pastille. Dessinee en image de fond et non en contenu : un lecteur
   d'ecran ne doit pas annoncer « citrouille » au milieu du nom du site. */
html[data-season] .logo::after,
html[data-season] .article-nav-logo::after {
  content: "";
  flex: 0 0 auto;
  width: 22px; height: 22px;
  background: var(--sz-glyphe) center / contain no-repeat;
}
html[data-season] .article-nav-logo::after { width: 18px; height: 18px; }

@media (max-width: 420px) {
  html[data-season] .logo::after,
  html[data-season] .article-nav-logo::after { display: none; }
}

/* ══ Le bandeau saisonnier ══
   Eteint par defaut, et pas seulement invisible : tant qu'aucune saison n'est
   active il n'occupe aucune place et n'est pas lu par les lecteurs d'ecran. */
.sz-bar { display: none; }

html[data-season="noel"] .sz-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0.45rem;
  height: var(--promo-h, 44px);
  padding: 0 1.2rem; text-align: center;
  background: linear-gradient(90deg, #11462f, #1c6b4a 45%, #11462f);
  color: #ffffff; text-decoration: none;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  line-height: 1; white-space: nowrap;
}
html[data-season="noel"] .sz-bar .sz-court { display: none; }
/* Sur les accueils, le bandeau remplace la barre promo au lieu de s'ajouter a
   elle : deux bandes empilees repousseraient tout le site vers le bas. */
html[data-season="noel"] .sz-bar-fixe {
  position: fixed; top: 0; left: 0; right: 0; z-index: 301;
}
html[data-season="noel"] .promo-bar { display: none; }

html[data-season="noel"] .sz-bar b {
  color: #ffe3a8; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; font-size: 0.73rem;
}
html[data-season="noel"] .sz-bar em {
  font-style: normal; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,0.45);
}
html[data-season="noel"] .sz-bar .sz-fl { transition: transform .2s; }
html[data-season="noel"] .sz-bar:hover .sz-fl { transform: translateX(3px); }
html[data-season="noel"] .sz-bar:hover em { text-decoration-color: #ffe3a8; }

/* Sous 560px la phrase longue ne tient plus sur une ligne : on garde le cadeau,
   qui porte l'idee a lui seul, et on laisse tomber le sur-titre. */
@media (max-width: 560px) {
  html[data-season="noel"] .sz-bar { font-size: 0.76rem; gap: 0.35rem; padding: 0 0.7rem; }
  html[data-season="noel"] .sz-bar b,
  html[data-season="noel"] .sz-bar .sz-long { display: none; }
  html[data-season="noel"] .sz-bar .sz-court { display: inline; }
}

/* Noel est la seule saison qu'on assume franchement : six semaines de fenetre
   et une intention d'achat reelle. Le filigrane y est plus present et le
   lisere plus epais que sur les saisons de simple entretien. */
html[data-season="noel"] nav:not(.footer-nav)::after { height: 3px; }
/* Pas de pastille a cote du logo a Noel. Un flocon vert pose contre le nom du
   site se lit comme un corps etranger, pas comme un ornement : le lisere et le
   bandeau disent deja la saison, et ils la disent mieux. */
html[data-season="noel"] .logo::after,
html[data-season="noel"] .article-nav-logo::after { display: none; }

/* ══ Le badge cadeau sur les livres ══
   La carte livre est en overflow:hidden et sans position : on lui en donne une
   pour que le badge se place dedans, et on le garde en retrait des bords pour
   qu'il ne soit pas rogne par l'arrondi. */
.sz-badge { display: none; }
html[data-season="noel"] .book { position: relative; }
html[data-season="noel"] .sz-badge {
  display: inline-flex; align-items: center; gap: 0.32rem;
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: #11462f; color: #ffe3a8;
  font-size: 0.67rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.42rem 0.72rem; border-radius: 100px;
  box-shadow: 0 6px 18px rgba(17,70,47,0.38);
}

/* ══ Le guide cadeau ══
   Un bloc ferme, sur son propre fond : il n'herite donc ni du clair ni du
   sombre, et son contraste ne depend pas du theme choisi par le visiteur. */
.sz-guide { display: none; }
html[data-season="noel"] .sz-guide {
  display: block; position: relative; z-index: 1;
  margin: 0 0 2.6rem; padding: 2rem 1.9rem 2.2rem;
  border-radius: 24px;
  background: linear-gradient(135deg, #0d3625, #16573c 62%, #0d3625);
  border: 1px solid rgba(255,227,168,0.26);
}
html[data-season="noel"] .sz-guide-h { margin-bottom: 1.5rem; }
html[data-season="noel"] .sz-guide-tag {
  display: inline-block; margin-bottom: 0.65rem;
  color: #ffe3a8; font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
}
html[data-season="noel"] .sz-guide h3 {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: clamp(1.5rem, 3.2vw, 2rem); line-height: 1.15;
  color: #ffffff; margin: 0 0 0.5rem;
}
html[data-season="noel"] .sz-guide-h p {
  margin: 0; color: rgba(255,255,255,0.80); font-size: 0.95rem;
}
html[data-season="noel"] .sz-guide-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
html[data-season="noel"] .sz-g {
  display: flex; flex-direction: column; gap: 0.45rem;
  padding: 1.15rem 1.15rem 1.05rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  text-decoration: none; color: #ffffff;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
html[data-season="noel"] .sz-g:hover {
  transform: translateY(-4px);
  border-color: rgba(255,227,168,0.55);
  background: rgba(255,255,255,0.11);
}
/* La nouveaute est signalee une seule fois, sur la carte concernee : un
   marqueur pose partout ne marque plus rien. */
html[data-season="noel"] .sz-g-neuf {
  align-self: flex-start;
  background: #ffe3a8; color: #0d3625;
  font-size: 0.64rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.22rem 0.5rem; border-radius: 100px;
  margin-bottom: 0.1rem;
}
html[data-season="noel"] .sz-g-q {
  color: #ffe3a8; font-size: 0.71rem; font-weight: 800;
  letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.35;
}
html[data-season="noel"] .sz-g-t {
  font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 900;
  line-height: 1.25; color: #ffffff;
}
html[data-season="noel"] .sz-g-w {
  font-size: 0.855rem; line-height: 1.55; color: rgba(255,255,255,0.84);
}
html[data-season="noel"] .sz-g-cta {
  margin-top: auto; padding-top: 0.5rem;
  color: #ffe3a8; font-size: 0.8rem; font-weight: 700;
}

@media (max-width: 560px) {
  html[data-season="noel"] .sz-guide { padding: 1.5rem 1.2rem 1.6rem; border-radius: 20px; }
  html[data-season="noel"] .sz-guide-grid { grid-template-columns: 1fr; }
}

/* ══ La neige ══
   Elle n'existe que sur le hero des accueils. On ne fait pas bouger
   l'arriere-plan de quelqu'un qui lit un article de huit minutes ou qui
   resout une grille. Elle passe derriere le contenu du hero, jamais devant :
   des flocons sur le titre lui mangeraient son contraste. */
/* Les deux themes, parce que le flocon est maintenant DESSINE et non pose en
   point : une etoile a six branches se lit comme un flocon meme en gris pale,
   alors qu'un point de la meme couleur se lit comme de la poussiere. C'est la
   forme qui porte le sens, la couleur n'a plus a tout faire. */
.sz-neige { display: none; }
html[data-season="noel"] .sz-neige {
  display: block; position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  color: #8ea4b4;            /* la couleur des flocons, lue par le canevas */
}
/* La nuit, le texte du hero est clair lui aussi : un flocon pleinement opaque
   passant derriere une lettre ferait tomber son contraste a 1,91, c'est-a-dire
   illisible le temps qu'il passe. On plafonne donc l'opacite du calque — le
   flocon reste bien visible sur le fond, mais ne blanchit plus le texte. */
html[data-theme="dark"][data-season="noel"] .sz-neige {
  color: #e4eef5;
  opacity: 0.45;
}
html[data-season="noel"] .hero-left,
html[data-season="noel"] .hero-right { position: relative; z-index: 1; }

/* Le declencheur ne charge deja pas le fichier dans ce cas ; cette regle
   couvre le visiteur qui change son reglage apres le chargement. */
@media (prefers-reduced-motion: reduce) {
  .sz-neige { display: none !important; }
}

@media print {
  .sz-badge, .sz-guide, .sz-neige { display: none !important; }
}

@media print { .sz-bar { display: none !important; } }

/* Le filigrane est fixe : sur une page imprimee il n'aurait aucun sens, et il
   mangerait de l'encre sur les grilles vierges. */
@media print {
  html[data-season]::before { display: none; }
  html[data-season] nav::after { display: none; }
  html[data-season] .logo::after,
  html[data-season] .article-nav-logo::after { display: none; }
}

/* ── noel ── */
html[data-season="noel"] {
  --sz-accent: #1c6b4a;
  --sz-accent-2: #5bbd92;
  --sz-op: 0.075;
  --sz-motif: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%231c6b4a' stroke-width='3' stroke-linecap='round'><path d='M30 16v30M15 31h30M20 21l20 20M40 21L20 41'/><path d='M88 72v24M76 84h24M79 75l18 18M97 75L79 93'/></g></svg>");
  --sz-glyphe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%231c6b4a' stroke-width='1.9' stroke-linecap='round' d='M12 2v20M3.3 7l17.4 10M20.7 7L3.3 17M12 6l-3-3M12 6l3-3M12 18l-3 3M12 18l3 3'/></svg>");
}
html[data-theme="dark"][data-season="noel"] {
  --sz-accent: #5bbd92;
  --sz-accent-2: #1c6b4a;
  --sz-op: 0.095;
  --sz-motif: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%237fd4ab' stroke-width='3' stroke-linecap='round'><path d='M30 16v30M15 31h30M20 21l20 20M40 21L20 41'/><path d='M88 72v24M76 84h24M79 75l18 18M97 75L79 93'/></g></svg>");
  --sz-glyphe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%235bbd92' stroke-width='1.9' stroke-linecap='round' d='M12 2v20M3.3 7l17.4 10M20.7 7L3.3 17M12 6l-3-3M12 6l3-3M12 18l-3 3M12 18l3 3'/></svg>");
}

/* ── paques ── */
html[data-season="paques"] {
  --sz-accent: #8a6418;
  --sz-accent-2: #e0b45f;
  --sz-op: 0.042;
  --sz-motif: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%231f3160' stroke-width='3' stroke-linecap='round'><path d='M30 18c9 0 16 13 16 23s-7 14-16 14s-16-4-16-14s7-23 16-23'/><path d='M17 40h26'/><path d='M88 60c8 0 14 12 14 21s-6 13-14 13s-14-4-14-13s6-21 14-21'/><path d='M76 80h24'/></g></svg>");
  --sz-glyphe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%238a6418' d='M12 2c4 0 7 6.5 7 11.5S16 21 12 21s-7-2.5-7-7.5S8 2 12 2z'/><path fill='none' stroke='%23faf6ee' stroke-width='1.6' d='M5.6 11h12.8M6 15h12'/></svg>");
}
html[data-theme="dark"][data-season="paques"] {
  --sz-accent: #e0b45f;
  --sz-accent-2: #8a6418;
  --sz-op: 0.062;
  --sz-motif: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%239fbaf5' stroke-width='3' stroke-linecap='round'><path d='M30 18c9 0 16 13 16 23s-7 14-16 14s-16-4-16-14s7-23 16-23'/><path d='M17 40h26'/><path d='M88 60c8 0 14 12 14 21s-6 13-14 13s-14-4-14-13s6-21 14-21'/><path d='M76 80h24'/></g></svg>");
  --sz-glyphe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23e0b45f' d='M12 2c4 0 7 6.5 7 11.5S16 21 12 21s-7-2.5-7-7.5S8 2 12 2z'/><path fill='none' stroke='%23faf6ee' stroke-width='1.6' d='M5.6 11h12.8M6 15h12'/></svg>");
}

/* ── rentree ── */
html[data-season="rentree"] {
  --sz-accent: #2a4485;
  --sz-accent-2: #7e9fe0;
  --sz-op: 0.042;
  --sz-motif: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%231a1815' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M14 54l2-10L40 20l8 8L24 52z'/><path d='M34 26l8 8'/><path d='M72 98q0-24 26-26q2 24-26 26'/><path d='M98 72L76 94'/></g></svg>");
  --sz-glyphe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%232a4485' d='M2 22l1-5L15.5 4.5l4 4L7 21z'/><path fill='none' stroke='%23faf6ee' stroke-width='1.5' d='M13 7l4 4'/></svg>");
}
html[data-theme="dark"][data-season="rentree"] {
  --sz-accent: #7e9fe0;
  --sz-accent-2: #2a4485;
  --sz-op: 0.062;
  --sz-motif: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><g fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M14 54l2-10L40 20l8 8L24 52z'/><path d='M34 26l8 8'/><path d='M72 98q0-24 26-26q2 24-26 26'/><path d='M98 72L76 94'/></g></svg>");
  --sz-glyphe: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%237e9fe0' d='M2 22l1-5L15.5 4.5l4 4L7 21z'/><path fill='none' stroke='%23faf6ee' stroke-width='1.5' d='M13 7l4 4'/></svg>");
}
