/*
 * Habillage saisonnier (apps.core.seasonal) : chargé seulement quand un thème est actif.
 * Classe « season-<clé> » sur <body>. Décors légers et 100 % CSS :
 *   - liseré coloré sous l'en-tête (.pn-header::after) ;
 *   - petit symbole à droite du nom « PAC-CI », sans toucher au logo (.pn-brand::after, SVG en data-URI) ;
 *   - bandeau de message (.season-banner), que le visiteur peut fermer.
 * Le logo, les textes et les contrastes du site ne sont jamais modifiés.
 */
/* Valeurs par défaut sans spécificité : chaque thème (.season-<clé>) les remplace */
:where(body[class*="season-"]) {
    --season-ribbon: var(--pn-red, #b51822);
    --season-bg: #fdf3f3;
    --season-ink: #7a1016;
    --season-symbol: none;
}

/* ------------------------------------------------------------------ liseré et symbole */
body[class*="season-"] .pn-header::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 4px;
    background: var(--season-ribbon);
    pointer-events: none;
}
body[class*="season-"] .pn-bar .pn-brand { position: relative; }
body[class*="season-"] .pn-bar .pn-brand::after {
    content: "";
    position: absolute;
    right: -28px; top: 50%;
    width: 22px; height: 22px; margin-top: -14px;
    background: var(--season-symbol) center / contain no-repeat;
    filter: drop-shadow(0 1px 1px rgba(0, 32, 69, .25));
    pointer-events: none;
}
@media (max-width: 991.98px) {
    body[class*="season-"] .pn-bar .pn-brand::after { right: -26px; width: 20px; height: 20px; margin-top: -10px; }
}

/* ------------------------------------------------------------------ bandeau */
.season-banner {
    background: var(--season-bg);
    color: var(--season-ink);
    border-bottom: 1px solid rgba(0, 32, 69, .06);
    font-family: "Inter", sans-serif;
    font-size: .9rem;
}
.season-banner[hidden] { display: none; }
.season-banner-inner { display: flex; align-items: center; gap: .75rem; min-height: 44px; padding-top: .4rem; padding-bottom: .4rem; }
.season-banner-icon {
    flex: 0 0 auto; width: 22px; height: 22px;
    background: var(--season-symbol) center / contain no-repeat;
}
.season-banner-text { flex: 1 1 auto; margin: 0; font-weight: 600; line-height: 1.4; }
.season-banner-link { color: inherit; font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.season-banner-link:hover { color: inherit; opacity: .8; }
.season-banner-close {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: transparent; color: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.season-banner-close:hover, .season-banner-close:focus-visible { background: rgba(0, 32, 69, .08); }
body:not([class*="season-"]) .season-banner-icon,
.season-travail .season-banner-icon,
.season-femmes .season-banner-icon,
.season-tuberculose .season-banner-icon,
.season-paludisme .season-banner-icon { display: none; }
@media (max-width: 575.98px) {
    .season-banner { font-size: .85rem; }
    .season-banner-inner { align-items: flex-start; }
    .season-banner-link { display: inline-block; margin-top: .15rem; }
}

/* ------------------------------------------------------------------ thèmes */

/* Nouvel An : liseré bleu et or, étoile ; confettis au premier chargement (seasonal.js) */
.season-nouvel-an {
    --season-ribbon: linear-gradient(90deg, #002045, #d4a017 50%, #002045);
    --season-bg: #fff8e6; --season-ink: #6b4e00;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d4a017' d='M12 1.5l2.9 6.6 7.1.6-5.4 4.7 1.6 7-6.2-3.8-6.2 3.8 1.6-7L2 8.7l7.1-.6z'/%3E%3C/svg%3E");
}

/* Journée des droits des femmes : violet */
.season-femmes { --season-ribbon: #7b3fa0; --season-bg: #f5eefa; --season-ink: #55286f; }

/* Journées mondiales de santé : liserés sobres */
.season-tuberculose { --season-ribbon: #b51822; --season-bg: #fdf3f3; --season-ink: #7a1016; }
.season-paludisme { --season-ribbon: #1f8a4c; --season-bg: #edf8f1; --season-ink: #145c33; }

/* Pâques : pastel, petite fleur */
.season-paques {
    --season-ribbon: linear-gradient(90deg, #f7c6d9, #fbe7a1, #c8e6c9, #bfdcf5);
    --season-bg: #fdf6fa; --season-ink: #7a3558;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23f29bbd'%3E%3Ccircle cx='12' cy='6' r='4.2'/%3E%3Ccircle cx='18' cy='12' r='4.2'/%3E%3Ccircle cx='12' cy='18' r='4.2'/%3E%3Ccircle cx='6' cy='12' r='4.2'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='3.4' fill='%23f6c844'/%3E%3C/svg%3E");
}

/* Fête du Travail : bandeau seul, liseré discret aux couleurs du site */
.season-travail { --season-ribbon: transparent; --season-bg: #eef3f9; --season-ink: #002045; }

/* Aïd el-Fitr et Tabaski : vert et or, croissant et étoile */
.season-aid-el-fitr, .season-tabaski {
    --season-ribbon: linear-gradient(90deg, #146b3a, #c9a227 50%, #146b3a);
    --season-bg: #eff8f1; --season-ink: #0f5130;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23146b3a' d='M14.5 2.5A9.5 9.5 0 1 0 21 18.2 8 8 0 1 1 14.5 2.5z'/%3E%3Cpath fill='%23c9a227' d='M18 5.5l.9 2 2.2.2-1.7 1.4.5 2.1-1.9-1.1-1.9 1.1.5-2.1-1.7-1.4 2.2-.2z'/%3E%3C/svg%3E");
}

/* Fête de l'Indépendance : liseré orange, blanc, vert, mini-drapeau */
.season-independance {
    --season-ribbon: linear-gradient(90deg, #f77f00 0 33.33%, #ffffff 33.33% 66.66%, #009e60 66.66% 100%);
    --season-bg: #fff6ec; --season-ink: #7a3e00;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='8' height='16' fill='%23f77f00'/%3E%3Crect x='8' width='8' height='16' fill='%23fff'/%3E%3Crect x='16' width='8' height='16' fill='%23009e60'/%3E%3Crect width='24' height='16' fill='none' stroke='%23d0d5db' stroke-width='.8'/%3E%3C/svg%3E");
}
/* Le liseré blanc central reste visible sur l'en-tête blanc */
body.season-independance .pn-header::after { box-shadow: 0 1px 0 rgba(0, 32, 69, .08); }

/* Octobre rose (cancer du sein) et Novembre bleu (santé masculine) : rubans de campagne */
.season-octobre-rose {
    --season-ribbon: #e75480; --season-bg: #fdeff4; --season-ink: #9b1d4a;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23e75480' stroke-width='3.2' stroke-linecap='round' d='M7 22l7.5-12.5C16 7 15.6 4.4 13.8 3.3a3.3 3.3 0 0 0-3.6 0C8.4 4.4 8 7 9.5 9.5L17 22'/%3E%3C/svg%3E");
}
.season-novembre-bleu {
    --season-ribbon: #1f6fd1; --season-bg: #edf4fd; --season-ink: #174e94;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%231f6fd1' stroke-width='3.2' stroke-linecap='round' d='M7 22l7.5-12.5C16 7 15.6 4.4 13.8 3.3a3.3 3.3 0 0 0-3.6 0C8.4 4.4 8 7 9.5 9.5L17 22'/%3E%3C/svg%3E");
}

/* Journée nationale de la Paix : blanc et bleu, colombe */
.season-paix {
    --season-ribbon: linear-gradient(90deg, #ffffff, #5b9bd5 50%, #ffffff);
    --season-bg: #eef5fc; --season-ink: #1d4f91;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' stroke='%235b9bd5' stroke-width='1.2' stroke-linejoin='round' d='M3 13c3-.2 5.2-1.6 6.6-4.2C11 6.2 13 4.5 16 4.6c-1 1.2-1.4 2.4-1.2 3.6L20.5 6c-.6 3.4-2.6 5.7-5.6 6.6.6 2.6-.4 5-3.2 6.6-.1-1.8-.7-3.2-2-4.2C7.6 15.8 5.4 15.3 3 13z'/%3E%3Ccircle cx='16.6' cy='6.6' r='.7' fill='%235b9bd5'/%3E%3Cpath fill='%2386b94a' d='M18.6 4.2c1.6-.6 2.8-.2 3.4.6-1.4.5-2.6.3-3.4-.6z'/%3E%3C/svg%3E");
}

/* Journée mondiale de lutte contre le sida : ruban rouge */
.season-sida {
    --season-ribbon: #c8102e; --season-bg: #fdf0f2; --season-ink: #8a0b20;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23c8102e' stroke-width='3.2' stroke-linecap='round' d='M7 22l7.5-12.5C16 7 15.6 4.4 13.8 3.3a3.3 3.3 0 0 0-3.6 0C8.4 4.4 8 7 9.5 9.5L17 22'/%3E%3C/svg%3E");
}

/* Noël : guirlande lumineuse le long de l'en-tête, étoile */
.season-noel {
    --season-ribbon: transparent; --season-bg: #f0f7f2; --season-ink: #14532d;
    --season-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d4a017' d='M12 1.5l2.9 6.6 7.1.6-5.4 4.7 1.6 7-6.2-3.8-6.2 3.8 1.6-7L2 8.7l7.1-.6z'/%3E%3C/svg%3E");
}
body.season-noel .pn-header::after {
    height: 8px; bottom: -5px;
    background:
        radial-gradient(circle, #d62828 2.5px, transparent 3px) 0 50% / 48px 8px repeat-x,
        radial-gradient(circle, #f6c844 2.5px, transparent 3px) 16px 50% / 48px 8px repeat-x,
        radial-gradient(circle, #2a9d5b 2.5px, transparent 3px) 32px 50% / 48px 8px repeat-x;
    animation: season-twinkle 1.6s ease-in-out 4;
}
@keyframes season-twinkle { 50% { opacity: .45; } }

/* ------------------------------------------------------------------ confettis (Nouvel An) */
.season-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2000; }
.season-confetti i {
    position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: .9;
    animation: season-fall var(--d, 2.6s) cubic-bezier(.25, .6, .4, 1) var(--delay, 0s) forwards;
}
@keyframes season-fall {
    to { transform: translate3d(var(--x, 0), 105vh, 0) rotate(var(--r, 540deg)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    body.season-noel .pn-header::after { animation: none; }
    .season-confetti { display: none; }
}
