/* ============================================================
   THEME DE NOEL
   Actif uniquement sous html[data-theme="christmas"]
   ============================================================ */

html[data-theme="christmas"] {
    --accent: #dc2626;
    --accent-dim: rgba(220, 38, 38, .18);
    --nav-bg: #0b3d24;
    --nav-border: rgba(255, 215, 0, .18);
    --badge-bg: #dc2626;
}

html[data-theme="christmas"] body {
    background: #061b12;
}

/* ============================================================
   NAVBAR — guirlande lumineuse + neige légère
   La neige est confinée à une fine bande en haut (18px / 10px
   sur mobile) afin de ne jamais recouvrir le logo ou les liens.
   ============================================================ */

html[data-theme="christmas"] .navbar {
    overflow: hidden;
}

html[data-theme="christmas"] .nav-brand-name::after {
    content: ' 🎄';
    display: inline-block;
    animation: ix-twinkle 2.6s ease-in-out infinite;
}

/* Guirlande lumineuse au bord inférieur de la navbar */
html[data-theme="christmas"] .navbar::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    height: 4px;
    background:
        repeating-radial-gradient(circle at 12px 2px, rgba(255, 255, 255, .85) 0 1.4px, transparent 1.6px 24px),
        linear-gradient(90deg, #b91c1c, #15803d, #fbbf24, #15803d, #b91c1c);
    background-size: 24px 100%, 100% 100%;
    pointer-events: none;
}

/* Neige défilant doucement, confinée au bord supérieur */
html[data-theme="christmas"] .navbar::before {
    content: '❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆ ❄ ❅ ❆';
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    display: flex;
    align-items: flex-start;
    width: 200%;
    height: 18px;
    color: rgba(255, 255, 255, .3);
    font-size: 14px;
    line-height: 1;
    letter-spacing: 3vw;
    white-space: nowrap;
    pointer-events: none;
    animation: ix-snow-drift 60s linear infinite;
}

@keyframes ix-snow-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes ix-twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .5; transform: scale(.92); }
}

@media (max-width: 900px) {
    html[data-theme="christmas"] .navbar::before {
        height: 10px;
        font-size: 10px;
    }

    html[data-theme="christmas"] .navbar::after {
        height: 3px;
        background-size: 16px 100%, 100% 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="christmas"] .navbar::before,
    html[data-theme="christmas"] .nav-brand-name::after {
        animation: none;
    }
}

/* ============================================================
   COULEURS GENERALES (espace public / formulaires)
   ============================================================ */

html[data-theme="christmas"] .btn-primary {
    background: #b91c1c;
    /* texte blanc force : certaines pages (noel/index, noel/enfants) definissent
       color:#04222b pour l'accent cyan par defaut -> illisible sur le rouge de Noel.
       Specificite (0,2,1) > .btn-primary des pages, mais < .ix .btn-primary (gold). */
    color: #fff;
    box-shadow: 0 10px 24px rgba(185, 28, 28, .25);
}

html[data-theme="christmas"] .btn-primary:hover {
    background: #991b1b;
}

html[data-theme="christmas"] .admin-link {
    background: rgba(251, 191, 36, .12);
    border-color: rgba(251, 191, 36, .28);
    color: #fde68a !important;
}

/* ============================================================
   ESPACE MEMBRE (index.php / .ix)
   ============================================================ */

html[data-theme="christmas"] .ix {
    --ix-primary: #b91c1c;
    --ix-primary-dark: #7f1d1d;
    --ix-green: #15803d;
    --ix-soft: #fee2e2;
    background:
        linear-gradient(180deg, #f3faf4 0, var(--ix-bg) 260px),
        var(--ix-bg);
}

html[data-theme="christmas"] .ix-hero {
    background:
        radial-gradient(620px circle at 88% -10%, rgba(251, 191, 36, .22), transparent 60%),
        linear-gradient(135deg, rgba(185, 28, 28, .25), rgba(21, 128, 61, .18)),
        #052016;
}

/* Petites étoiles scintillantes derrière le contenu du hero */
html[data-theme="christmas"] .ix-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 12% 22%, rgba(255, 255, 255, .85), transparent 60%),
        radial-gradient(1.5px 1.5px at 28% 64%, rgba(255, 255, 255, .7), transparent 60%),
        radial-gradient(2px 2px at 47% 18%, rgba(255, 255, 255, .8), transparent 60%),
        radial-gradient(1.5px 1.5px at 64% 48%, rgba(255, 255, 255, .65), transparent 60%),
        radial-gradient(2px 2px at 82% 30%, rgba(255, 255, 255, .85), transparent 60%),
        radial-gradient(1.5px 1.5px at 93% 62%, rgba(255, 255, 255, .7), transparent 60%);
    animation: ix-twinkle-stars 4s ease-in-out infinite alternate;
}

@keyframes ix-twinkle-stars {
    from { opacity: .35; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="christmas"] .ix-hero::before {
        animation: none;
        opacity: .7;
    }
}

html[data-theme="christmas"] .ix-hero .ix-kicker {
    color: #fde68a;
}

html[data-theme="christmas"] .ix .btn-primary {
    background: #fbbf24;
    color: #3f1d0a;
    box-shadow: 0 14px 28px rgba(251, 191, 36, .25);
}

html[data-theme="christmas"] .article-card::before {
    background: linear-gradient(180deg, #b91c1c, #15803d);
}

html[data-theme="christmas"] .sidebar-card {
    border-top-color: #b91c1c;
}

html[data-theme="christmas"] .hidden-tag,
html[data-theme="christmas"] .btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

html[data-theme="christmas"] .empty-icon {
    background: linear-gradient(135deg, #fee2e2, #dcfce7);
}

/* ============================================================
   TRAINEAU DU PERE NOEL
   Traverse l'ecran sous la navbar a intervalle regulier.
   Element fixe (hors .navbar -> non rogne par overflow:hidden).
   ============================================================ */

.xmas-sleigh {
    position: fixed;
    top: 78px;
    left: 0;
    z-index: 1190;            /* sous la navbar (1200), au-dessus du contenu */
    pointer-events: none;
    will-change: transform;
    animation: ix-sleigh-fly 24s ease-in-out infinite;
}

.xmas-sleigh-team {
    display: inline-block;
    font-size: 34px;
    line-height: 1;
    white-space: nowrap;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25));
    /* leger tangage du traineau pendant le vol */
    animation: ix-sleigh-bob 2.2s ease-in-out infinite;
}

@keyframes ix-sleigh-fly {
    0%   { transform: translateX(-40vw); }
    40%  { transform: translateX(130vw); }
    100% { transform: translateX(130vw); }   /* parque hors champ le reste du cycle */
}

@keyframes ix-sleigh-bob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-7px) rotate(-1deg); }
}

@media (max-width: 900px) {
    .xmas-sleigh {
        top: 60px;             /* navbar mobile = 52px */
        animation-duration: 20s;
    }

    .xmas-sleigh-team {
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xmas-sleigh {
        display: none;         /* pas d'animation -> on masque plutot que figer a l'ecran */
    }
}
