/*
 * Décor saisonnier (decor-saisonnier.php) : fêtes en décembre (body.cc-fetes),
 * hiver en janvier (body.cc-hiver) ; flocons et bouton communs (body.cc-neige).
 * Pas de color-mix() : couleurs pleines ou rgb() pour les anciens navigateurs.
 */

/* ---------- Fond d'hiver : dégradé glacé + grands flocons pâles ---------- */
.cc-neige__fond {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: #eaf2f8;
	background-image:
		radial-gradient(circle, rgb(255 255 255 / 0.95) 0 1.6px, transparent 2.2px),
		radial-gradient(circle, rgb(255 255 255 / 0.8) 0 1.1px, transparent 1.7px),
		linear-gradient(180deg, #e1edf6 0%, #e9f2f8 40%, #f2f7fb 75%, #fafcfd 100%);
	background-position: 0 0, 37px 53px, 0 0;
	background-repeat: repeat, repeat, no-repeat;
	background-size: 86px 104px, 133px 151px, 100% 100%;
}
/* Grands flocons : seulement SOUS l'en-tête (--cc-neige-haut, posé par neige.js),
   pour qu'aucun ne soit coupé par le menu. */
.cc-neige__fond::before {
	--cc-neige-grand-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%233A5899' stroke-opacity='.07' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg id='a'%3E%3Cpath d='M50 6v88'/%3E%3Cpath d='M50 20l-8-8M50 20l8-8M50 34l-12-12M50 34l12-12M50 80l-8 8M50 80l8 8M50 66l-12 12M50 66l12 12'/%3E%3C/g%3E%3Cuse href='%23a' transform='rotate(60 50 50)'/%3E%3Cuse href='%23a' transform='rotate(120 50 50)'/%3E%3Ccircle cx='50' cy='50' r='7'/%3E%3C/g%3E%3C/svg%3E");
	--cc-neige-grand-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%233A5899' stroke-opacity='.045' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg id='a'%3E%3Cpath d='M50 6v88'/%3E%3Cpath d='M50 20l-8-8M50 20l8-8M50 34l-12-12M50 34l12-12M50 80l-8 8M50 80l8 8M50 66l-12 12M50 66l12 12'/%3E%3C/g%3E%3Cuse href='%23a' transform='rotate(60 50 50)'/%3E%3Cuse href='%23a' transform='rotate(120 50 50)'/%3E%3Ccircle cx='50' cy='50' r='7'/%3E%3C/g%3E%3C/svg%3E");
	content: '';
	position: absolute;
	inset: var(--cc-neige-haut, 190px) 0 0;
	background-image:
		var(--cc-neige-grand-a), var(--cc-neige-grand-b), var(--cc-neige-grand-a), var(--cc-neige-grand-b),
		var(--cc-neige-grand-a), var(--cc-neige-grand-b), var(--cc-neige-grand-a);
	background-position: 4% 4%, 94% 8%, 80% 50%, 8% 44%, 46% 92%, 96% 94%, 30% 18%;
	background-repeat: no-repeat;
	background-size: 120px, 150px, 100px, 130px, 110px, 80px, 64px;
}
@media (min-width: 1024px) {
	.cc-neige__fond { background-size: 96px 116px, 151px 173px, 100% 100%; }
	.cc-neige__fond::before { background-size: 200px, 240px, 160px, 220px, 170px, 130px, 100px; }
}

/* Hiver : les zones crème et rose pâle laissent voir le fond d'hiver. */
body.cc-hiver { background: transparent; }
body.cc-hiver .site-header,
body.cc-hiver .site-header.has-base-background-color { background: rgb(226 237 246 / 0.9) !important; }
body.cc-hiver .has-base-background-color:not(.site-header) { background-color: rgb(255 255 255 / 0.35) !important; }
body.cc-hiver .site-header .has-base-background-color { background-color: transparent !important; }
body.cc-hiver .cc-section--surface { background: rgb(255 255 255 / 0.42); }

/* Mode sombre (choisi par le visiteur) : nuit d'hiver. */
:root[data-theme='dark'] .cc-neige__fond {
	background-color: #131a29;
	background-image:
		radial-gradient(circle, rgb(255 255 255 / 0.35) 0 1.4px, transparent 2px),
		radial-gradient(circle, rgb(255 255 255 / 0.22) 0 1px, transparent 1.6px),
		linear-gradient(180deg, #172238 0%, #151d2e 50%, #131824 100%);
}
:root[data-theme='dark'] .cc-neige__fond::before {
	--cc-neige-grand-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg id='a'%3E%3Cpath d='M50 6v88'/%3E%3Cpath d='M50 20l-8-8M50 20l8-8M50 34l-12-12M50 34l12-12M50 80l-8 8M50 80l8 8M50 66l-12 12M50 66l12 12'/%3E%3C/g%3E%3Cuse href='%23a' transform='rotate(60 50 50)'/%3E%3Cuse href='%23a' transform='rotate(120 50 50)'/%3E%3Ccircle cx='50' cy='50' r='7'/%3E%3C/g%3E%3C/svg%3E");
	--cc-neige-grand-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.04' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg id='a'%3E%3Cpath d='M50 6v88'/%3E%3Cpath d='M50 20l-8-8M50 20l8-8M50 34l-12-12M50 34l12-12M50 80l-8 8M50 80l8 8M50 66l-12 12M50 66l12 12'/%3E%3C/g%3E%3Cuse href='%23a' transform='rotate(60 50 50)'/%3E%3Cuse href='%23a' transform='rotate(120 50 50)'/%3E%3Ccircle cx='50' cy='50' r='7'/%3E%3C/g%3E%3C/svg%3E");
}
:root[data-theme='dark'] body.cc-hiver .site-header,
:root[data-theme='dark'] body.cc-hiver .site-header.has-base-background-color { background: rgb(23 34 56 / 0.9) !important; }
:root[data-theme='dark'] body.cc-hiver .has-base-background-color:not(.site-header) { background-color: rgb(23 22 27 / 0.35) !important; }
:root[data-theme='dark'] body.cc-hiver .site-header .has-base-background-color { background-color: transparent !important; }
:root[data-theme='dark'] body.cc-hiver .cc-section--surface { background: rgb(33 31 40 / 0.55); }

/* ---------- Flocons qui tombent ---------- */
.cc-neige__chute {
	position: fixed;
	inset: 0;
	z-index: 40; /* sous l'en-tête (50) et le bouton « haut de page » (60) */
	pointer-events: none;
	overflow: hidden;
	contain: strict;
}
.cc-neige__flocon {
	position: absolute;
	top: 0;
	display: block;
	pointer-events: none;
	will-change: transform;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cg stroke='%233A5899' stroke-opacity='.5' stroke-width='4.2'%3E%3Cpath d='M12 2.5v19M3.8 7.25l16.4 9.5M3.8 16.75l16.4-9.5'/%3E%3Cpath d='M9.4 4.2L12 6.6l2.6-2.4M9.4 19.8L12 17.4l2.6 2.4'/%3E%3C/g%3E%3Cg stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='M12 2.5v19M3.8 7.25l16.4 9.5M3.8 16.75l16.4-9.5'/%3E%3Cpath d='M9.4 4.2L12 6.6l2.6-2.4M9.4 19.8L12 17.4l2.6 2.4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
	transform: translateY(-6vh);
	animation-name: cc-neige-tombe;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}
.cc-neige__flocon--point {
	border-radius: 50%;
	background: radial-gradient(circle closest-side, #fff 0 58%, #eef3fb 78%, rgb(58 88 153 / 0.5) 90%, transparent 100%);
}
@keyframes cc-neige-tombe {
	0% { transform: translate(0, -6vh) rotate(0deg); }
	25% { transform: translate(16px, 22vh) rotate(45deg); }
	50% { transform: translate(-12px, 50vh) rotate(90deg); }
	75% { transform: translate(10px, 78vh) rotate(135deg); }
	100% { transform: translate(0, 106vh) rotate(180deg); }
}
@media (max-width: 639px) {
	.cc-neige__flocon:nth-child(n+13) { display: none; }
}
body.cc-neige--arretee .cc-neige__chute { display: none; }


/* ---------- Fêtes (décembre) ---------- */
/* Étoiles dorées parmi les flocons. */
.cc-neige__flocon--etoile { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.6 6.6 7 .6-5.3 4.6 1.6 6.9L12 17l-5.9 3.7 1.6-6.9L2.4 9.2l7-.6z' fill='%23E8B04B' stroke='%239a6b18' stroke-width='.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Guirlande de sapin lumineuse, accrochée sous l'en-tête (elle le suit). */
.cc-fetes__deco {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% - 6px);
	height: 54px;
	max-width: none !important; /* l'en-tête est « contraint » : la guirlande traverse tout l'écran */
	margin: 0 !important;
	z-index: 1;
	pointer-events: none;
}
.cc-fetes__guirlande { display: block; width: 100%; height: 54px; overflow: hidden; }
.cc-fetes__halo { animation: cc-fetes-scintille 2.2s ease-in-out infinite alternate; }
@keyframes cc-fetes-scintille {
	0% { opacity: 0.2; }
	100% { opacity: 1; }
}
/* Menu plein écran ouvert (mobile) : pas de décor par-dessus. */
.site-header:has(.wp-block-navigation__responsive-container.is-menu-open) .cc-fetes__deco { display: none; }

/* Boules de Noël « chat » aux deux bords (grands écrans seulement : sinon
   elles passeraient devant le texte). */
.cc-fetes__boules { position: absolute; top: 8px; display: none; align-items: flex-start; gap: 2px; }
.cc-fetes__boules--g { left: max(10px, 1.2vw); }
.cc-fetes__boules--d { right: max(10px, 1.2vw); }
.cc-fetes__boule {
	display: block;
	transform-origin: 50% 0;
	animation: cc-fetes-balance 3.8s ease-in-out infinite alternate;
	filter: drop-shadow(0 3px 3px rgb(29 44 77 / 0.22));
}
.cc-fetes__boule--2 { animation-delay: -1.3s; animation-duration: 3.2s; }
.cc-fetes__boule--3 { animation-delay: -2.1s; animation-duration: 3.5s; }
.cc-fetes__boule--4 { animation-delay: -0.6s; animation-duration: 4.2s; }
@keyframes cc-fetes-balance {
	0% { transform: rotate(-4deg); }
	100% { transform: rotate(4deg); }
}
@media (min-width: 1200px) {
	.cc-fetes__boules { display: flex; }
}

/* Petits sapins aux deux bouts du bandeau du marché de Noël. */
body.cc-fetes .cc-noel-bandeau a::before,
body.cc-fetes .cc-noel-bandeau a::after {
	content: '';
	flex: none;
	width: 16px;
	height: 20px;
	margin: 0 0.4em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 22'%3E%3Cpath d='M9 2l4.6 6.2h-2.6l4.8 6.6H2.2L7 8.2H4.4z' fill='%238fd3a6'/%3E%3Crect x='7.6' y='14.8' width='2.8' height='4.6' fill='%23d9b07a'/%3E%3Cpath d='M9 .3l.7 1.5 1.6.2-1.2 1.1.3 1.6L9 3.9l-1.4.8.3-1.6L6.7 2l1.6-.2z' fill='%23f6d27a'/%3E%3Ccircle cx='6.6' cy='12' r='.9' fill='%23ffd0d0'/%3E%3Ccircle cx='11.4' cy='10.4' r='.9' fill='%23fff3c4'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 600px) {
	body.cc-fetes .cc-noel-bandeau a::before,
	body.cc-fetes .cc-noel-bandeau a::after { display: none; }
}

/* ---------- Bouton « Arrêter la neige » (bas à gauche) ---------- */
.cc-neige__bouton {
	position: fixed;
	left: max(0.9rem, env(safe-area-inset-left, 0px));
	bottom: max(0.9rem, env(safe-area-inset-bottom, 0px));
	z-index: 60;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 2.75rem;
	padding: 0.45rem 0.95rem;
	border: 1px solid rgb(29 44 77 / 0.18);
	border-radius: 999px;
	background: #fff;
	color: #2a4276;
	font: 600 0.875rem/1.2 inherit;
	font-family: inherit;
	box-shadow: 0 2px 8px -2px rgb(29 44 77 / 0.25);
	cursor: pointer;
}
.cc-neige__bouton[hidden] { display: none; }
.cc-neige__bouton:hover { background: #f0f5fb; }
.cc-neige__bouton:focus-visible { outline: 3px solid #3a5899; outline-offset: 2px; }
:root[data-theme='dark'] .cc-neige__bouton { background: #26242f; color: #c9d6f2; border-color: rgb(255 255 255 / 0.18); }
:root[data-theme='dark'] .cc-neige__bouton:hover { background: #302d3a; }
:root[data-theme='dark'] .cc-neige__bouton:focus-visible { outline-color: #93ace6; }

/* Moins d'animations demandé : rien ne tombe, ne scintille ni ne se balance, pas de bouton (décors fixes gardés). */
@media (prefers-reduced-motion: reduce) {
	.cc-neige__chute, .cc-neige__bouton { display: none !important; }
	.cc-fetes__halo, .cc-fetes__boule { animation: none; }
}

/* Impression : ni neige ni fond d'hiver. */
@media print {
	.cc-neige__fond, .cc-neige__chute, .cc-neige__bouton, .cc-fetes__deco { display: none !important; }
	.cc-fetes__halo, .cc-fetes__boule { animation: none; }
}
