/* La Grange à Fromage — habillage de Noël (voir noel/noel.js).
   Tout est préfixé .theme-noel / .nl- : sans noel.js, cette feuille ne change rien au site. */

.theme-noel { --nl-snow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='.35' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23dbe4f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 22C10 6 34 4 52 12 66 2 96 2 112 12c16-6 38-4 52 2 18-10 50-12 68-2 18-6 40-6 56 1 18-10 48-9 64 0 16-6 38-5 48 9v4c-8 0-10 8-16 8s-6-8-14-8h-40c-6 0-6 12-13 12s-6-12-13-12h-68c-6 0-6 6-11 6s-5-6-11-6h-64c-6 0-5 10-12 10s-6-10-12-10H70c-6 0-6 5-10 5s-4-5-10-5H0z'/%3E%3C/svg%3E"); --nl-gold: #f0c067; }

/* ---------- neige qui tombe : un canvas par-dessus la page, qui ne capte aucun clic ---------- */
.nl-snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1002; pointer-events: none; }

/* ---------- bonnet sur le logo (posé sur la meule) ---------- */
.theme-noel .entete .logo { position: relative; display: inline-block; }
.nl-hat { position: absolute; left: 23.5%; top: -7%; width: 14%; pointer-events: none; transform: rotate(-27deg); transform-origin: 40% 90%; }
.nl-hat svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 1px 1px rgba(43, 36, 24, .3)); }
.nl-hat--logo { animation: nl-hat-in .9s cubic-bezier(.2, .9, .3, 1.3) .5s both; }
@keyframes nl-hat-in { from { opacity: 0; transform: translateY(-140%) rotate(-60deg); } to { opacity: 1; transform: rotate(-27deg); } }

/* ---------- guirlande lumineuse sous l'en-tête ---------- */
.nl-garland { position: absolute; top: 100%; left: 0; right: 0; height: 34px; margin-top: -3px; display: flex; overflow: hidden; pointer-events: none; transition: opacity .3s ease; }
.nl-garland__tile { flex: none; max-width: none; }
.menu-ouvert .nl-garland { opacity: 0; }
.nl-l { animation: nl-twinkle 2.6s ease-in-out infinite; }
.nl-l2 { animation-delay: -.65s; }
.nl-l3 { animation-delay: -1.3s; }
.nl-l4 { animation-delay: -1.95s; }
@keyframes nl-twinkle { 0%, 100% { opacity: 1; } 45% { opacity: .32; } 60% { opacity: 1; } }

/* ---------- grande photo : congère au pied, traîneau, compte à rebours ---------- */
.theme-noel .hero > .conteneur { position: relative; z-index: 1; }
.nl-herodrift { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 0; height: clamp(30px, 5vw, 72px); pointer-events: none; }
.nl-drift { display: block; width: 100%; height: 100%; max-width: none; }

.nl-sleigh { position: absolute; left: 0; top: 0; z-index: 0; width: clamp(230px, 31vw, 440px); pointer-events: none; opacity: 0; will-change: transform; }
.nl-sleigh svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 6px 10px rgba(43, 36, 24, .35)); }
.nl-sleigh__bob { animation: nl-bob 1.5s ease-in-out infinite alternate; }
@keyframes nl-bob { from { transform: translateY(-5px) rotate(-1.2deg); } to { transform: translateY(5px) rotate(1.2deg); } }
.nl-leg { transform-box: fill-box; animation: nl-gallop .42s ease-in-out infinite alternate; }
.nl-leg--f { transform-origin: 6% 8%; }
.nl-leg--h { transform-origin: 94% 8%; animation-direction: alternate-reverse; }
@keyframes nl-gallop { from { transform: rotate(-13deg); } to { transform: rotate(12deg); } }
.nl-nose-glow { animation: nl-nose 1.1s ease-in-out infinite alternate; }
@keyframes nl-nose { from { opacity: .2; } to { opacity: .6; } }

.nl-sleigh--hero { --y0: 30vh; --y1: 16vh; --y2: 4vh; } /* valeurs de secours : noel.js les règle sur la hauteur de la photo */
.nl-sleigh--hero.is-flying { animation: nl-fly 7s linear both; }
.nl-sleigh--hero.nl-sleigh--rtl.is-flying { animation-name: nl-fly-rtl; }
.nl-sleigh--rtl svg { transform: scaleX(-1); }
@keyframes nl-fly {
  0% { opacity: 1; transform: translate(-110%, var(--y0)) rotate(-11deg); }
  50% { opacity: 1; transform: translate(calc(50vw - 50%), var(--y1)) rotate(-8deg); }
  100% { opacity: 1; transform: translate(100vw, var(--y2)) rotate(-11deg); }
}
@keyframes nl-fly-rtl {
  0% { opacity: 1; transform: translate(100vw, var(--y0)) rotate(11deg); }
  50% { opacity: 1; transform: translate(calc(50vw - 50%), var(--y1)) rotate(8deg); }
  100% { opacity: 1; transform: translate(-110%, var(--y2)) rotate(11deg); }
}

.nl-pill {
  position: absolute; z-index: 1; right: clamp(14px, 3vw, 40px); top: clamp(42px, 6vw, 56px); margin: 0;
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px;
  font: 700 12.5px/1 "Montserrat", sans-serif; letter-spacing: .04em; color: #fff;
  background: rgba(43, 36, 24, .55); border: 1px solid rgba(255, 255, 255, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.nl-pill svg { width: 15px; height: 15px; color: var(--nl-gold); flex: none; }

/* ---------- neige posée sur le bord haut des grands blocs (calque à part, par-dessus la page) ---------- */
.nl-caps { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: 5; pointer-events: none; }
.nl-cap {
  position: absolute; z-index: 3; box-sizing: border-box; height: 40px; margin-top: -22px; padding: 0 34px; pointer-events: none;
  background: var(--nl-snow) repeat-x 0 0 / 400px 100%; background-origin: content-box; background-clip: content-box;
  filter: drop-shadow(0 2px 2px rgba(43, 36, 24, .2));
  opacity: 0; transform: scaleY(.2); transform-origin: 50% 56%;
  transition: opacity .5s ease .45s, transform 1s cubic-bezier(.2, .9, .3, 1.15) .45s, translate .45s cubic-bezier(.2, .7, .2, 1);
}
.nl-cap.is-up { translate: 0 -8px; } /* suit les cartes qui se soulèvent au survol */
/* les deux bouts : la neige s'arrondit et retombe au lieu de s'arrêter net */
.nl-cap::before, .nl-cap::after { content: ""; position: absolute; top: 0; width: 34.5px; height: 100%; background: no-repeat 0 0 / 100% 100%; }
.nl-cap::before { left: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 40' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='.35' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23dbe4f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M34 22C27 11 9 12 4 20c-4 6 1 10 8 9 3-.5 4 4 8 4s4-7 9-7h5z'/%3E%3C/svg%3E"); }
.nl-cap::after { right: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 40' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='.35' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23dbe4f7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 22C7 10 25 12 30 20c4 6-1 10-8 9-3-.5-3 6-7 6s-4-9-9-9H0z'/%3E%3C/svg%3E"); }
.nl-cap.is-in { opacity: 1; transform: none; }

/* ---------- pied de page : la neige, les sapins, les cadeaux et la vache ---------- */
.theme-noel .pied { position: relative; }
.nl-foot { position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 2; pointer-events: none; }
.nl-foot__in {
  position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
  width: min(1200px, 100% - 40px); display: flex; align-items: flex-end; gap: 10px;
}
.nl-foot__in > svg { flex: none; display: block; width: auto; max-width: none; overflow: visible; } /* visible : le bonnet de la vache dépasse du cadre du dessin */
.nl-foot .nl-fir--a { height: 118px; }
.nl-foot .nl-fir--b { height: 76px; margin-left: -14px; }
.nl-foot .nl-gift { height: 32px; }
.nl-foot .nl-cow { height: 92px; margin-left: clamp(20px, 9vw, 130px); margin-bottom: -2px; }
.nl-foot .nl-fir--c { height: 84px; margin-left: auto; }
.nl-foot .nl-fir--d { height: 132px; margin-left: -12px; }
.nl-foot .nl-fir--e { height: 68px; margin-left: -10px; }
.nl-foot__snow { position: absolute; left: 0; right: 0; top: -25px; height: 46px; background: var(--nl-snow) repeat-x 50% 0 / 460px 46px; filter: drop-shadow(0 -1px 1px rgba(34, 35, 79, .08)); }

/* ---------- téléphone : le petit Père Noël qui montre le bouton d'appel ---------- */
.nl-santa { display: none; }
@media (max-width: 820px) {
  /* derrière la barre (z-index 70) : le bas du Père Noël disparaît derrière elle ; son doigt montre le bouton d'appel */
  .nl-santa { display: block; position: fixed; left: calc(50% - 71px); bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 69; width: 64px; pointer-events: none; transform-origin: 50% 100%; animation: nl-santa-in .7s cubic-bezier(.2, .9, .3, 1.4) 1.6s both; }
}
.nl-santa svg { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 46% 100%; animation: nl-santa-bob 2.4s ease-in-out 2s infinite alternate; filter: drop-shadow(0 3px 4px rgba(20, 20, 60, .3)); }
.nl-point { transform-box: fill-box; transform-origin: 10% 10%; animation: nl-point .55s ease-in-out 2s infinite alternate; }
.nl-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: nl-blink 4.2s linear 2s infinite; }
@keyframes nl-santa-in { from { transform: translateY(105%); } 70% { transform: translateY(-8%); } to { transform: none; } } /* il monte de derrière la barre */
@keyframes nl-santa-bob { from { transform: rotate(-3.5deg); } to { transform: rotate(3deg); } }
@keyframes nl-point { from { transform: translateY(-5px) rotate(-7deg); } to { transform: translateY(2px) rotate(3deg); } }
@keyframes nl-blink { 0%, 94%, 100% { transform: none; } 97% { transform: scaleY(.1); } }
.menu-ouvert .nl-santa, .saisie .nl-santa, .has-splash .nl-santa { display: none; }

/* ---------- bouton flocon : couper / remettre les animations ---------- */
.nl-toggle {
  position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 58;
  width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: #fff; background: var(--brun, #2b2418); border: 1px solid rgba(205, 165, 38, .6);
  box-shadow: 0 10px 22px -10px rgba(43, 36, 24, .7);
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.nl-toggle svg { width: 21px; height: 21px; }
.nl-toggle:hover { transform: rotate(30deg) scale(1.06); }
.nl-toggle[aria-pressed="false"] { color: rgba(255, 255, 255, .5); background: #4a3f2c; }
.nl-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }

/* ---------- intro de l'accueil, version Noël : le traîneau passe au-dessus du logo, sapins enneigés en bas ---------- */
.nl-sleigh--splash { z-index: 1; width: min(46vw, 420px); --y0: 38vh; --y1: 15vh; --y2: 2vh; --nl-fur: #b3854c; --nl-antler: #7a5530; }
.splash-play .nl-sleigh--splash { animation: nl-fly 3.3s linear .35s both; }
.splash-out .nl-sleigh--splash { visibility: hidden; }
.splash-out .nl-ground { opacity: 0; transition: opacity .3s ease; }
.nl-ground { z-index: 1; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(64px, 13vh, 124px); pointer-events: none; transform: translateY(105%); }
.splash-play .nl-ground { animation: nl-ground 1.1s cubic-bezier(.2, .8, .2, 1) .15s both; }
@keyframes nl-ground { to { transform: none; } }
.nl-ground .nl-drift { position: absolute; left: 0; bottom: 0; height: 62%; }
.nl-ground .nl-fir { position: absolute; bottom: 26%; width: auto; max-width: none; }
.nl-ground .nl-fir--a { left: 3%; height: 132%; }
.nl-ground .nl-fir--b { left: 13%; height: 86%; }
.nl-ground .nl-fir--c { right: 15%; height: 98%; }
.nl-ground .nl-fir--d { right: 4%; height: 148%; }
.nl-hat--splash { opacity: 0; }
.splash-play .nl-hat--splash { animation: nl-hat-drop .8s cubic-bezier(.3, .6, .3, 1) 1.75s both; }
@keyframes nl-hat-drop {
  0% { opacity: 0; transform: translateY(-420%) rotate(-80deg); }
  20% { opacity: 1; }
  62% { opacity: 1; transform: translateY(0) rotate(-20deg); }
  78% { opacity: 1; transform: translateY(-22%) rotate(-33deg); }
  100% { opacity: 1; transform: rotate(-27deg); }
}

/* ---------- téléphone ---------- */
@media (max-width: 820px) {
  .nl-cap { height: 30px; margin-top: -16.5px; padding: 0 25.5px; }
  .nl-cap::before, .nl-cap::after { width: 26px; }
  .nl-sleigh { width: 62vw; }
  .nl-sleigh--splash { width: 70vw; --y0: 36vh; --y1: 18vh; --y2: 5vh; }
  .nl-pill { top: 40px; right: 12px; padding: 8px 12px; font-size: 11px; }
  .nl-toggle { bottom: calc(92px + env(safe-area-inset-bottom)); left: auto; right: 12px; width: 36px; height: 36px; }
  .nl-toggle svg { width: 18px; height: 18px; }
  .nl-foot__in { width: calc(100% - 20px); gap: 6px; bottom: 5px; }
  .nl-foot .nl-fir--a { height: 74px; }
  .nl-foot .nl-fir--b, .nl-foot .nl-fir--e, .nl-foot__in > .nl-gift:nth-of-type(n + 5) { display: none; }
  .nl-foot .nl-cow { height: 58px; margin-left: 6vw; }
  .nl-foot .nl-fir--c { height: 54px; }
  .nl-foot .nl-fir--d { height: 82px; }
  .nl-foot .nl-gift { height: 22px; }
  .nl-foot__snow { top: -20px; height: 36px; background-size: 360px 36px; }
  .nl-ground .nl-fir--b, .nl-ground .nl-fir--c { display: none; }
}

/* ---------- animations coupées (bouton flocon) ou mouvement réduit demandé par l'appareil ---------- */
.noel-calme .nl-l, .noel-calme .nl-sleigh__bob, .noel-calme .nl-leg, .noel-calme .nl-santa svg, .noel-calme .nl-point, .noel-calme .nl-eyes { animation: none; }
.noel-calme .nl-sleigh--hero { display: none; }
@media (prefers-reduced-motion: reduce) {
  .nl-l, .nl-hat--logo, .nl-santa, .nl-santa svg, .nl-point, .nl-eyes { animation: none; }
  .nl-cap { transition: none; }
  .nl-toggle:hover { transform: none; }
}
