/* ==========================================================================
   Décoration de Noël — La Chatterie des Sortilèges Coon
   Fichier autonome : chargé uniquement quand NOEL = True dans build/build.py.
   Pour retirer la déco après les fêtes : NOEL = False, puis relancer le build.
   ========================================================================== */

/* ---- Neige (canvas créé par noel.js) ---- */
.noel-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 450;            /* au-dessus du contenu, sous le menu (500) et les pop-ups */
  pointer-events: none;
}

/* ---- Guirlandes sur les titres H1 et H2 ----
   ::before = guirlande + ampoules fixes ; ::after = ampoules qui clignotent. */
h1, h2 { position: relative; padding-top: 26px; }
h1::before, h1::after,
h2::before, h2::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26px;
  background-repeat: repeat-x;
  background-position: center top;
  background-size: 96px 26px;
  pointer-events: none;
}
h1::before, h2::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='26' viewBox='0 0 96 26'><path d='M0 2Q48 24 96 2' fill='none' stroke='%23275f3e' stroke-width='3.6' stroke-linecap='round'/><path d='M0 2Q48 24 96 2' fill='none' stroke='%2362b57f' stroke-width='1.3' stroke-dasharray='1.5 2.5' stroke-linecap='round'/><circle cx='12' cy='11.6' r='6' fill='%23ff4d6a' opacity='.22'/><rect x='10.6' y='6.8' width='2.8' height='2' rx='.6' fill='%237a6a3a'/><ellipse cx='12' cy='11.6' rx='2.6' ry='3.4' fill='%23ff4d6a'/><ellipse cx='11.2' cy='10.4' rx='.8' ry='1.2' fill='%23fff' opacity='.55'/><circle cx='60' cy='17.1' r='6' fill='%23ffd45e' opacity='.22'/><rect x='58.6' y='12.3' width='2.8' height='2' rx='.6' fill='%237a6a3a'/><ellipse cx='60' cy='17.1' rx='2.6' ry='3.4' fill='%23ffd45e'/><ellipse cx='59.2' cy='15.9' rx='.8' ry='1.2' fill='%23fff' opacity='.55'/></svg>");
}
h1::after, h2::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='96' height='26' viewBox='0 0 96 26'><circle cx='36' cy='17.1' r='6' fill='%236ec6ff' opacity='.25'/><rect x='34.6' y='12.3' width='2.8' height='2' rx='.6' fill='%237a6a3a'/><ellipse cx='36' cy='17.1' rx='2.6' ry='3.4' fill='%236ec6ff'/><ellipse cx='35.2' cy='15.9' rx='.8' ry='1.2' fill='%23fff' opacity='.55'/><circle cx='84' cy='11.6' r='6' fill='%23c58bff' opacity='.25'/><rect x='82.6' y='6.8' width='2.8' height='2' rx='.6' fill='%237a6a3a'/><ellipse cx='84' cy='11.6' rx='2.6' ry='3.4' fill='%23c58bff'/><ellipse cx='83.2' cy='10.4' rx='.8' ry='1.2' fill='%23fff' opacity='.55'/></svg>");
  animation: noel-twinkle 2.6s ease-in-out infinite;
}
@keyframes noel-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
/* L'eyebrow au-dessus d'un titre : la guirlande prend déjà la place de sa marge */
.eyebrow:has(+ h1),
.eyebrow:has(+ h2) { margin-bottom: 0; }

/* ---- Bonnet de Père Noël sur le blason (menu + pied de page) ---- */
.brand, .footer-brand { position: relative; }
.brand::after, .footer-brand::after {
  content: "";
  position: absolute;
  left: -9px;
  top: -13px;
  width: 34px;
  height: 31px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='36' viewBox='0 0 40 36'><path d='M6 27C7 14 15 5 29 6C26 12 31 21 36 27Z' fill='%23d6293e'/><path d='M20 12C23 9 26 8 29 6C27 11 29 16 32 22C27 19 23 16 20 12Z' fill='%23b01f33' opacity='.55'/><rect x='2' y='24' width='36' height='9' rx='4.5' fill='%23fdfaf3'/><circle cx='30' cy='6' r='4.6' fill='%23fdfaf3'/></svg>") no-repeat center / contain;
  transform: rotate(-16deg);
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.footer-brand::after { top: -15px; }

/* ---- Guirlande lumineuse sous le menu flottant ---- */
.site-header::after {
  content: "";
  position: absolute;
  top: calc(100% - 3px);
  left: 30px;
  right: 30px;
  height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='16' viewBox='0 0 56 16'><path d='M0 1Q28 9 56 1' fill='none' stroke='%2336855a' stroke-width='1.4' stroke-linecap='round'/><circle cx='14' cy='8.8' r='5' fill='%23ff4d6a' opacity='.25'/><rect x='13' y='4' width='2' height='1.6' rx='.5' fill='%237a6a3a'/><ellipse cx='14' cy='8.8' rx='2.1' ry='2.8' fill='%23ff4d6a'/><circle cx='42' cy='8.8' r='5' fill='%23ffd45e' opacity='.25'/><rect x='41' y='4' width='2' height='1.6' rx='.5' fill='%237a6a3a'/><ellipse cx='42' cy='8.8' rx='2.1' ry='2.8' fill='%23ffd45e'/></svg>") repeat-x center top / 56px 16px;
  pointer-events: none;
  animation: noel-twinkle-soft 3.4s ease-in-out infinite;
}
@keyframes noel-twinkle-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
/* Menu mobile ouvert : on cache la guirlande pour ne pas gêner le panneau */
.site-header:has(.main-nav.is-open)::after { display: none; }

/* ---- Congère de neige au-dessus du pied de page ---- */
.site-footer { position: relative; }
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -21px;
  height: 24px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='24' viewBox='0 0 120 24'><path d='M0 24V19Q10 9 22 17Q34 5 48 15Q62 7 74 16Q88 6 100 15Q110 9 120 18V24Z' fill='%23c9d3ea'/><path d='M0 24V16Q10 6 22 14Q34 2 48 12Q62 4 74 13Q88 3 100 12Q110 6 120 15V24Z' fill='%23f6f3ec'/></svg>") repeat-x left bottom / 120px 24px;
  pointer-events: none;
}

/* ---- Petit mot de fin d'année dans le pied de page (injecté par noel.js) ---- */
.noel-greeting { color: var(--gold-light); font-family: var(--font-script); font-size: 1.7rem; line-height: 1.1; }

/* ---- Mobile ---- */
@media (max-width: 560px) {
  h1, h2 { padding-top: 20px; }
  h1::before, h1::after,
  h2::before, h2::after { height: 20px; background-size: 74px 20px; }
  .brand::after { left: -6px; top: -9px; width: 24px; height: 22px; }
  .site-header::after { left: 18px; right: 18px; }
}
