/* Thème de Noël — Écurie du Sorbier
   Chargé sur toutes les pages mais inactif tant que assets/js/noel.js n'a pas
   ajouté la classe "theme-noel" sur <html> (1er décembre – 6 janvier).
   Les couleurs passent par les variables de tokens.css : le reste du site suit. */

/* Palette : vert sapin, rouge baie, or doux */
html.theme-noel {
    --color-forest: #1B5E3A;
    --color-forest-dark: #124127;
    --color-forest-light: #2F7D52;

    --color-terracotta: #B3322F;
    --color-terracotta-dark: #8E2420;
    --color-terracotta-light: #F5C6C3;
    --color-terracotta-tint: #FBE6E4;

    --color-sun: #A97A0E;
    --color-sun-tint: #FFF1CC;

    --color-cream: #FFF8EE;
    --color-cream-deep: #FBE9CF;
}

/* Guirlande de petites lumières sous le menu */
html.theme-noel .header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 12px;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 12px 6px, #E4573D 4px, transparent 5px),
        radial-gradient(circle at 36px 6px, #F2C14E 4px, transparent 5px),
        radial-gradient(circle at 60px 6px, #4CAF63 4px, transparent 5px),
        radial-gradient(circle at 84px 6px, #4FA3D1 4px, transparent 5px);
    background-size: 96px 12px;
    background-repeat: repeat-x;
    filter: drop-shadow(0 0 3px rgba(255, 200, 80, 0.7));
    animation: noel-twinkle 2.4s ease-in-out infinite;
}

@keyframes noel-twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* Petites étoiles dorées devant les surtitres */
html.theme-noel .eyebrow::before {
    content: '✦ ';
    color: var(--color-sun);
}

/* Bandeau « Joyeuses fêtes » dans la pastille du hero */
html.theme-noel .noel-greeting {
    display: block;
    color: var(--color-terracotta);
    margin-bottom: 0.15rem;
}

/* Bord enneigé en haut du footer */
html.theme-noel .footer {
    position: relative;
    background: linear-gradient(135deg, var(--color-forest-dark) 0%, var(--color-forest) 100%);
    padding-top: 56px;
}

html.theme-noel .footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    pointer-events: none;
    background: radial-gradient(circle at 12px 0, #FFFFFF 11px, transparent 12px);
    background-size: 24px 14px;
    background-repeat: repeat-x;
}

/* Neige : ne bloque jamais un clic et reste sous les notifications */
.noel-snow {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 9;
}

.noel-flake {
    position: absolute;
    top: -12px;
    border-radius: 50%;
    background: #FFFFFF;
    /* Liseré bleuté : les flocons restent visibles sur les fonds clairs */
    box-shadow: 0 0 0 1px rgba(120, 175, 215, 0.55), 0 0 4px rgba(120, 175, 215, 0.5);
    opacity: 0.9;
    animation: noel-fall linear infinite;
}

@keyframes noel-fall {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(var(--drift, 0px), 110vh, 0); }
}

@media (prefers-reduced-motion: reduce) {
    html.theme-noel .header::after {
        animation: none;
    }
}

/* ---- Décors supplémentaires ---- */

/* Bandeau de vœux */
.noel-banner {
    background: linear-gradient(90deg, #8E2420 0%, #B3322F 50%, #8E2420 100%);
    color: #FFFFFF;
    text-align: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.55rem 1rem;
    letter-spacing: 0.02em;
    border-bottom: 3px dashed #F2C14E;
}

/* Boules de Noël suspendues à la guirlande */
html.theme-noel .header::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 56px;
    pointer-events: none;
    z-index: 1;
    /* 3 boules par motif de 420px ; chaque fil est une fine bande verticale dans une tuile de 420px */
    background-image:
        radial-gradient(circle at 40px 40px, #D9453B 11px, transparent 12px),
        linear-gradient(90deg, transparent 40px, #C9A24B 40px, #C9A24B 42px, transparent 42px),
        radial-gradient(circle at 190px 34px, #F2C14E 9px, transparent 10px),
        linear-gradient(90deg, transparent 190px, #C9A24B 190px, #C9A24B 192px, transparent 192px),
        radial-gradient(circle at 330px 42px, #4FA3D1 12px, transparent 13px),
        linear-gradient(90deg, transparent 330px, #C9A24B 330px, #C9A24B 332px, transparent 332px);
    background-size:
        420px 56px, 420px 24px,
        420px 56px, 420px 22px,
        420px 56px, 420px 28px;
    background-position: 0 0;
    background-repeat: repeat-x;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.25));
}

/* Sapin à côté du nom */
html.theme-noel .logo::after {
    content: '🎄';
    margin-left: 0.15rem;
}

/* Fond de page très léger : points rouges et verts */
html.theme-noel body {
    background-image:
        radial-gradient(circle at 20px 20px, rgba(179, 50, 47, 0.07) 2px, transparent 3px),
        radial-gradient(circle at 65px 60px, rgba(27, 94, 58, 0.07) 2px, transparent 3px);
    background-size: 90px 90px;
}

/* Cadeau et étoile autour de la photo du hero */
html.theme-noel .hero-image::before,
html.theme-noel .hero-image::after {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    line-height: 1;
}

html.theme-noel .hero-image::before {
    content: '🎁';
    top: -22px;
    right: -6px;
    font-size: 3.4rem;
    transform: rotate(12deg);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
    animation: noel-bob 3.2s ease-in-out infinite;
}

html.theme-noel .hero-image::after {
    content: '⭐';
    top: 38%;
    left: -22px;
    font-size: 2.4rem;
    filter: drop-shadow(0 0 8px rgba(242, 193, 78, 0.9));
    animation: noel-bob 2.6s ease-in-out infinite reverse;
}

@keyframes noel-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
}

/* Bouton principal : fin liseré doré */
html.theme-noel .cta-button {
    box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px #F2C14E;
}

/* Mot de fin dans le footer */
html.theme-noel .footer-bottom::before {
    content: '🎄 Joyeuses fêtes de fin d\2019 année ! 🎁';
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Cristaux de neige */
.noel-crystal {
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #9CCBEA;
    text-shadow: 0 0 4px rgba(90, 150, 200, 0.6);
    line-height: 1;
}

@media (max-width: 768px) {
    html.theme-noel .hero-image::before { right: 4px; font-size: 2.6rem; }
    html.theme-noel .hero-image::after { left: -6px; font-size: 1.9rem; }
    .noel-banner { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
    html.theme-noel .hero-image::before,
    html.theme-noel .hero-image::after {
        animation: none;
    }
}

/* Photo d'accueil : masquée le temps que la photo de Noël remplace l'ancienne (évite un flash) */
html.theme-noel .hero-image img:not(.noel-swapped) {
    opacity: 0;
}

html.theme-noel .hero-image img {
    transition: opacity 0.3s ease;
}

/* Boutons « S'inscrire » des ateliers : vert sapin, pour ne pas ressembler au bouton « Complet » (rouge) */
html.theme-noel .workshop-btn:not(.full) {
    background: var(--color-forest);
}

html.theme-noel .workshop-btn:not(.full):hover {
    background: var(--color-forest-dark);
    box-shadow: 0 5px 15px rgba(27, 94, 58, 0.35);
}

/* Père Noël et son traîneau : survol de l'écran, sans jamais gêner un clic */
.noel-sleigh {
    position: fixed;
    left: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    font-size: 2.6rem;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(255, 215, 120, 0.9)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

.noel-sleigh .noel-sled {
    position: relative;
    display: inline-block;
}

.noel-sleigh .noel-santa {
    position: absolute;
    top: -0.45em;
    left: 0.12em;
    font-size: 0.65em;
}

/* Traînée lumineuse derrière l'attelage */
.noel-sleigh::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 120px;
    height: 3px;
    margin-left: 0.5rem;
    border-radius: 3px;
    /* Le traîneau se déplace vers la gauche (cerfs devant) : la traînée est donc à sa droite.
       Quand l'attelage est retourné pour aller vers la droite, la traînée suit le retournement. */
    background: linear-gradient(90deg, rgba(255, 215, 120, 0.9), rgba(255, 215, 120, 0));
}

@media (max-width: 768px) {
    .noel-sleigh { font-size: 1.7rem; }
    .noel-sleigh::after { width: 70px; }
}
