/* Habillage Sapins : graphismes de Noël. La mise en page reste celle du thème. */

/* Pages intérieures (boutique, fiche, panier, commande...) : couleurs et titres de Noël.
   L'accueil garde les couleurs et les polices du thème. */
@font-face { font-family: "Fraunces APEL"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/Fraunces-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "Fraunces APEL Italique"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/Fraunces-italic-latin.woff2") format("woff2"); }

/* Grands titres (titres de page et de section, accueil compris) : Fraunces italique. */
:is(main h1, main h2, footer h2) {
	font-family: "Fraunces APEL Italique", Georgia, serif !important;
	font-style: italic;
	font-weight: 700 !important;
	letter-spacing: -0.01em !important;
	font-synthesis: none;
}

body.apel-skin-sapins:not(.home) {
	--wp--preset--color--bg: #FFF8EC;
	--wp--preset--color--surface: #FBEFD9;
	--wp--preset--color--accent: #C0352F;
	--wp--preset--color--accent-2: #1F5C50;
	--wp--preset--color--band-ink: #FFFFFF;
	--wp--preset--font-family--display: "Fraunces APEL", Georgia, serif;
	--display: "Fraunces APEL", Georgia, serif;
	--noel-candy: repeating-linear-gradient(90deg, #C0352F 0 16px, #fff 16px 32px);
}
body:not(.home) :is(h1, h2, h3, .wp-block-post-title, .woocommerce div.product .product_title) { letter-spacing: -.012em; line-height: 1.06; }
body:not(.home) .apel-band { background: #1F5C50; color: #fff; }
body:not(.home) .apel-footer { background: #FFFDF9; }
body:not(.home).woocommerce ul.products li.product,
body:not(.home) .woocommerce ul.products li.product,
body:not(.home) .woocommerce .cart-collaterals .cart_totals,
body:not(.home).woocommerce-checkout #order_review {
	background-image: var(--noel-candy);
	background-size: 100% 10px;
	background-repeat: no-repeat;
	background-position: top;
}
body:not(.home).woocommerce ul.products li.product,
body:not(.home) .woocommerce ul.products li.product { padding-top: 10px; }

.apel-card__photo.apel-noel-vignette,
.apel-noel-vignette { object-fit: contain !important; }
.apel-card__img > .apel-noel-vignette { display: block; width: 100%; height: 100%; }
/* Visuels 2026 : fond crème des illustrations, pour fondre les bandes latérales. */
.apel-card__img:has(> .apel-noel-vignette), .apel-noel-single { background: #FAE6D3; }
.apel-card__photo { object-fit: contain; }

.woocommerce-product-gallery:has(.apel-noel-single) .woocommerce-product-gallery__trigger { display: none; }

/* L'éditeur de champs du site masque l'astérisque de ce champ, pourtant obligatoire. */
#billing_phone_field label .required { display: inline !important; visibility: visible !important; }

/* En-tête de la boutique */
@media (min-width: 900px) {
	.apel-shop .apel-pagehead__row { position: relative; padding-right: 330px; }
	.apel-shop .apel-pagehead__row::after {
		content: "";
		position: absolute;
		right: 0;
		bottom: 0;
		width: 310px;
		height: 170px;
		pointer-events: none;
		background: url("../img/noel/stand.webp") left bottom / auto 100% no-repeat, url("../img/noel/famille.webp") right bottom / auto 76% no-repeat;
	}
}

/* Village au-dessus du pied de page */
footer.wp-block-template-part {
	padding-top: 29.03vw;
	background: url("../img/noel/village.webp") center top / 100% auto no-repeat;
}
.woocommerce-checkout footer.wp-block-template-part { padding-top: 0; background: none; }

@media (max-width: 781px) {
	footer.wp-block-template-part {
		padding-top: 61.46vw;
		background-image: url("../img/noel/village-mobile.webp");
	}
}

/* Neige qui tombe, derrière les textes : ni au panier ni au paiement. */
body.apel-skin-sapins:not(.woocommerce-cart):not(.woocommerce-checkout)::before,
body.apel-skin-sapins:not(.woocommerce-cart):not(.woocommerce-checkout)::after {
	content: "";
	position: fixed;
	z-index: -1;
	inset: -420px 0 0;
	pointer-events: none;
	background: url("../img/noel/neige-loin.svg") 0 0 / 420px 420px;
	animation: apel-neige-loin 38s linear infinite;
	will-change: transform;
}
body.apel-skin-sapins:not(.woocommerce-cart):not(.woocommerce-checkout)::after {
	inset: -640px 0 0;
	background: url("../img/noel/neige-pres.svg") 90px 0 / 640px 640px;
	animation-name: apel-neige-pres;
	animation-duration: 34s;
}
@keyframes apel-neige-loin { to { transform: translateY(420px); } }
@keyframes apel-neige-pres { to { transform: translateY(640px); } }
@media (prefers-reduced-motion: reduce) {
	body.apel-skin-sapins::before, body.apel-skin-sapins::after,
	.apel-home .apel-section--ink::after { display: none !important; }
}

/* Petits éléments posés dans les espaces libres : ils ne déplacent rien. */
.home .apel-brand,
.home .apel-contact,
.apel-home .apel-section__head,
.apel-home .apel-section--ink,
.apel-home .apel-section--ink h2 { position: relative; }

.home .apel-brand::after,
.home .apel-contact::after,
.apel-home .apel-section__head::after,
.apel-home .apel-section--ink h2::after {
	content: "";
	position: absolute;
	pointer-events: none;
	background-repeat: no-repeat;
}

/* Écrans larges : un élément différent à chaque endroit */
@media (min-width: 1280px) {
	/* Près du logo, posés sur le filet de l'en-tête */
	.home .apel-brand::after {
		left: calc(100% + 18px); bottom: -17px; width: 96px; height: 64px;
		background-image: url("../img/noel/deco-sapin.webp"), url("../img/noel/deco-sapin-2.webp");
		background-size: auto 62px, auto 46px;
		background-position: left bottom, right bottom;
	}
	.apel-home .apel-section--surface .apel-section__head::after {
		left: 45%; bottom: -33px; width: 210px; height: 128px;
		background-image: url("../img/noel/deco-chapelle.webp"), url("../img/noel/deco-chalet.webp");
		background-size: auto 126px, auto 92px;
		background-position: left bottom, right bottom;
	}
	.apel-home .apel-section:not(.apel-section--surface):not(.apel-section--ink) .apel-section__head::after {
		left: 56%; bottom: -32px; width: 200px; height: 132px;
		background-image: url("../img/noel/deco-sapin-guirlande.webp"), url("../img/noel/deco-enfants.webp");
		background-size: auto 130px, auto 96px;
		background-position: left bottom, right bottom;
	}
	/* Vide à gauche du formulaire de contact */
	.home .apel-contact::after {
		left: 0; bottom: 0; width: 222px; height: 130px;
		background-image: url("../img/noel/stand.webp"), url("../img/noel/famille.webp");
		background-size: auto 128px, auto 100px;
		background-position: left bottom, right bottom;
	}
}

/* Écrans plus petits : un seul sapin, dans la marge au-dessus du titre */
@media (max-width: 1279px) {
	.apel-home .apel-section__head::after {
		right: 0; top: -52px; width: 44px; height: 62px;
		background-image: url("../img/noel/deco-sapin-guirlande.webp");
		background-size: contain;
		background-position: right bottom;
	}
	.apel-home .apel-section--surface .apel-section__head::after {
		width: 66px;
		background-image: url("../img/noel/deco-chalet.webp");
	}
}

/* Bande sombre : neige accumulée en haut et sapin à côté du titre */
.apel-home .apel-section--ink::before {
	content: "";
	position: absolute;
	top: -1px; left: 0; right: 0; height: 26px;
	pointer-events: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='26' viewBox='0 0 240 26' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 0h240v8c-14 13-28 15-42 7-13-8-25-7-37 2-13 9-27 8-40 0-12-8-24-8-37 0-14 9-29 8-43-1C28 8 14 10 0 8z'/%3E%3C/svg%3E") 0 0 / 240px 26px repeat-x;
}
.apel-home .apel-section--ink h2::after {
	right: 0; bottom: -12px; width: 66px; height: 92px;
	background-image: url("../img/noel/deco-sapin-neige.webp");
	background-size: contain;
	background-position: right bottom;
}
@media (max-width: 781px) {
	.apel-home .apel-section--ink h2::after { width: 46px; height: 66px; }
}

/* La neige passe aussi devant le fond sombre, mais derrière ses textes. */
.apel-home .apel-section--ink { overflow: hidden; }
.apel-home .apel-section--ink > .apel-wrap { position: relative; z-index: 1; }
.apel-home .apel-section--ink::after {
	content: "";
	position: absolute;
	inset: -640px 0 0;
	pointer-events: none;
	background: url("../img/noel/neige-pres.svg") 90px 0 / 640px 640px;
	animation: apel-neige-pres 34s linear infinite;
	will-change: transform;
}

/* Autres pages : une petite scène propre à chaque page, à droite du titre.
   Boutique et paiement à part. Par défaut (pages légales, compte...), un seul sapin. */
body:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead { position: relative; }
body:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after {
	content: "";
	position: absolute;
	pointer-events: none;
}
@media (min-width: 1100px) {
	body:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead h1 { padding-right: 230px; }
	body:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after {
		right: max(24px, calc((100vw - 1280px) / 2));
		bottom: 0;
		width: 210px;
		height: 124px;
		background: url("../img/noel/deco-sapin-2.webp") right bottom / auto 110px no-repeat;
	}
	body.woocommerce-cart:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { right: 0; }
	body.apel-noel-lapel:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-chapelle.webp") left bottom / auto 122px no-repeat, url("../img/noel/deco-sapin-neige.webp") right bottom / auto 100px no-repeat; }
	body.apel-noel-le-bureau:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-chalet-2.webp") left bottom / auto 92px no-repeat, url("../img/noel/deco-homme.webp") right bottom / auto 108px no-repeat; }
	body.apel-noel-agenda:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/stand.webp") left bottom / auto 118px no-repeat, url("../img/noel/deco-sapin-neige.webp") right bottom / auto 104px no-repeat; }
	body.apel-noel-faq:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-enfants.webp") left bottom / auto 98px no-repeat, url("../img/noel/deco-sapin-guirlande.webp") right bottom / auto 122px no-repeat; }
	body.apel-noel-inscription-benevoles:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/famille.webp") left bottom / auto 100px no-repeat, url("../img/noel/deco-sapin-2.webp") right bottom / auto 118px no-repeat; }
	body.apel-noel-ce-que-finance-lapel:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-enfants.webp") left bottom / auto 98px no-repeat, url("../img/noel/deco-chalet.webp") right bottom / auto 96px no-repeat; }
	body.apel-noel-newsletter:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-chalet.webp") left bottom / auto 96px no-repeat, url("../img/noel/deco-sapin-neige.webp") right bottom / auto 118px no-repeat; }
	body.apel-noel-le-trombi-de-martin:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-sapin-guirlande.webp") left bottom / auto 122px no-repeat, url("../img/noel/deco-homme.webp") right bottom / auto 108px no-repeat; }
	body.apel-noel-panier:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-sapin-guirlande.webp") left bottom / auto 112px no-repeat, url("../img/noel/deco-sapin-2.webp") right bottom / auto 84px no-repeat; }
	body.error404:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after { background: url("../img/noel/deco-homme.webp") left bottom / auto 108px no-repeat, url("../img/noel/deco-sapin-neige.webp") right bottom / auto 118px no-repeat; }
}
@media (max-width: 1099px) {
	body:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead h1 { padding-right: 56px; }
	body:not(.home):not(.woocommerce):not(.woocommerce-checkout) .apel-pagehead::after {
		right: 20px;
		top: 14px;
		width: 44px;
		height: 62px;
		background: url("../img/noel/deco-sapin-guirlande.webp") right bottom / contain no-repeat;
	}
}

/* ---------- Animations (seulement si le script les active) ---------- */

/* 1. Les cartes apparaissent l'une après l'autre */
html.apel-anim :is(.apel-cards > li, .apel-year > li, .apel-agir > li, ul.products > li) {
	opacity: 0;
	translate: 0 22px;
	transition: opacity .6s ease, translate .7s cubic-bezier(.2, .7, .2, 1);
	transition-delay: calc(var(--apel-rang, 0) * 80ms);
}
html.apel-anim :is(.apel-cards > li, .apel-year > li, .apel-agir > li, ul.products > li).is-vu { opacity: 1; translate: 0 0; }

/* Les petits décors poussent, puis se balancent doucement */
html.apel-anim :is(.apel-section__head, .apel-pagehead, .apel-section--ink h2, .apel-contact, .home .apel-brand)::after {
	opacity: 0;
	scale: .55;
	transform-origin: 50% 100%;
	transition: opacity .5s ease .15s, scale .9s cubic-bezier(.3, 1.5, .5, 1) .15s;
}
html.apel-anim :is(.apel-section__head, .apel-pagehead, .apel-section--ink h2, .apel-contact, .home .apel-brand).is-vu::after {
	opacity: 1;
	scale: 1;
	animation: apel-balance 6s ease-in-out 1.2s infinite;
}
@keyframes apel-balance { 0%, 100% { rotate: 0deg; } 30% { rotate: 1.4deg; } 70% { rotate: -1.2deg; } }

/* 2. Illustration de l'accueil : fumée, étoiles qui scintillent, guirlandes */
.apel-hero__art { position: relative; }
.apel-fx { position: absolute; pointer-events: none; }
.apel-fx > span { position: absolute; translate: -50% -50%; border-radius: 50%; }
.apel-fx__fumee {
	width: 4.2%; aspect-ratio: 1;
	background: radial-gradient(circle, #fff 35%, rgba(255, 255, 255, .7) 60%, transparent 72%);
	opacity: 0;
	animation: apel-fumee 4.8s ease-out var(--d) infinite;
}
@keyframes apel-fumee {
	0% { opacity: 0; transform: translate(0, 0) scale(.5); }
	15% { opacity: .95; }
	100% { opacity: 0; transform: translate(130%, -330%) scale(2.1); }
}
.apel-fx__etoile {
	width: var(--t); aspect-ratio: 1;
	background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 12%, rgba(255, 235, 200, .55) 30%, transparent 68%);
	animation: apel-scintille 2.6s ease-in-out var(--d) infinite;
}
.apel-fx__etoile--blanche { background: radial-gradient(circle, #fff 0 14%, rgba(255, 255, 255, .5) 34%, transparent 70%); }
@keyframes apel-scintille { 0%, 100% { opacity: 0; scale: .6; } 50% { opacity: 1; scale: 1.25; } }
.apel-fx__ampoule {
	width: 2.6%; aspect-ratio: 1;
	background: radial-gradient(circle, rgba(255, 246, 190, 1) 0 22%, rgba(255, 200, 80, .55) 45%, transparent 72%);
	animation: apel-ampoule 1.9s ease-in-out var(--d) infinite;
}
@keyframes apel-ampoule { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.apel-fx { display: none; }
}
