/* ==========================================================
   Journées mondiales — bloc <x-journee-du-jour> + page liste
   v2 : contrastes renforcés (WCAG AA ≥ 4.5:1), tailles relevées.
   Animations : uniquement transform / opacity, pausées hors écran,
   désactivées si "réduire les animations".
   ========================================================== */
.jdj, .jm-hero, .jm-filtres, .jm-item, .jm-mois__titre, .jm-vide {
    --jdj-accent: var(--bs-primary, #b5451b);
    /* accent assombri pour le TEXTE (hashtags, liens) → lisible sur blanc */
    --jdj-accent-text: #9a3412;
    --jdj-accent-text: color-mix(in srgb, var(--jdj-accent) 70%, #000);
    --jdj-accent-soft: color-mix(in srgb, var(--jdj-accent) 10%, transparent);
    --jdj-text: #1f2328;     /* titres, descriptions */
    --jdj-muted: #4b5563;    /* infos secondaires : 7.5:1 sur blanc */
    --jdj-border: #e5e7eb;
}

/* ---------- Bloc ---------- */
.jdj {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid var(--jdj-border);
    color: var(--jdj-text);
    background-image: radial-gradient(circle at 100% 0%, var(--jdj-accent-soft), transparent 55%);
}
.jdj__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.jdj__badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--jdj-accent-text);
}
.jdj__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.jdj__count { font-size: .875rem; font-weight: 600; color: var(--jdj-muted); }

.jdj__slide { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.jdj__slide[hidden] { display: none; }
.jdj__emoji {
    font-size: 2.1rem; line-height: 1;
    width: 54px; height: 54px; display: grid; place-items: center;
    border-radius: 12px; background: var(--jdj-accent-soft);
}
.jdj__cat { font-size: .875rem; color: var(--jdj-muted); font-weight: 500; }
.jdj__titre { font-size: 1.15rem; font-weight: 700; margin: 2px 0 6px; line-height: 1.3; color: var(--jdj-text); }
.jdj__desc { margin: 0 0 6px; font-size: 1rem; line-height: 1.5; color: var(--jdj-text); }
.jdj__tag { font-size: .95rem; color: var(--jdj-accent-text); font-weight: 700; word-break: break-all; }
.jdj__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.jdj__actions .btn { font-size: .95rem; padding: 6px 14px; }
.jdj__vide { margin: 0 0 6px; color: var(--jdj-muted); font-size: 1rem; }

.jdj__dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.jdj__pip {
    width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0;
    background: #cbd5e1; transition: width .3s, background-color .3s;
}
.jdj__pip.is-active { width: 20px; background: var(--jdj-accent); }

.jdj__next { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--jdj-border); }
.jdj__next-label { font-size: .875rem; font-weight: 700; color: var(--jdj-muted); margin-bottom: 6px; }
.jdj__next-item {
    display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center;
    padding: 7px 0; text-decoration: none; color: var(--jdj-text);
}
.jdj__next-item:hover .jdj__next-nom { color: var(--jdj-accent-text); }
.jdj__next-date { font-size: .875rem; font-weight: 700; color: var(--jdj-muted); }
.jdj__next-nom { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jdj__next-dans {
    font-size: .8rem; font-weight: 700; color: var(--jdj-accent-text);
    background: var(--jdj-accent-soft); padding: 2px 8px; border-radius: 10px;
}
.jdj__all { display: inline-block; margin-top: 10px; font-weight: 700; font-size: .95rem; text-decoration: none; color: var(--jdj-accent-text); }

/* Compact (sidebar) */
.jdj--compact { padding: 12px; }
.jdj--compact .jdj__emoji { width: 42px; height: 42px; font-size: 1.6rem; }
.jdj--compact .jdj__titre { font-size: 1rem; }

/* ---------- Animations (légères) ---------- */
.jdj--anime .jdj__dot { animation: jdj-pulse 2s ease-in-out infinite; }
.jdj--anime .jdj__emoji { animation: jdj-float 4s ease-in-out infinite; }
.jdj--anime .jdj__slide.is-active { animation: jdj-in .45s ease-out both; }
.jdj.is-offscreen *, .jdj.is-paused-tab * { animation-play-state: paused !important; }

@keyframes jdj-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes jdj-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes jdj-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .jdj *, .jm-item { animation: none !important; transition: none !important; }
}

/* ---------- Page liste ---------- */
.jm-hero, .jm-filtres { border-radius: 14px; padding: 16px; }
.jm-hero p { color: var(--jdj-muted); font-size: 1rem; }
.jm-filtres { position: sticky; top: 64px; z-index: 5; }
.jm-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.jm-chip {
    flex: 0 0 auto; border: 1px solid #d1d5db; background: #fff; color: var(--jdj-text);
    border-radius: 20px; padding: 6px 14px; font-size: .95rem; white-space: nowrap;
}
.jm-chip.is-active { background: var(--jdj-accent); border-color: var(--jdj-accent); color: #fff; font-weight: 600; }
.jm-vide { padding: 16px; border-radius: 14px; color: var(--jdj-text); }

.jm-mois__titre { font-size: 1.3rem; font-weight: 700; margin: 12px 4px 10px; color: var(--jdj-text); }
.jm-liste { display: grid; gap: 12px; }
@media (min-width: 992px) { .jm-liste { grid-template-columns: 1fr 1fr; } }

.jm-item {
    display: grid; grid-template-columns: 60px 1fr; gap: 14px;
    padding: 16px; border-radius: 12px; border: 1px solid var(--jdj-border);
    color: var(--jdj-text);
    scroll-margin-top: 180px;
}
.jm-item.is-today { border-color: var(--jdj-accent); box-shadow: 0 0 0 3px var(--jdj-accent-soft); }
.jm-item:target { animation: jdj-in .5s ease-out; border-color: var(--jdj-accent); }

.jm-item__date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: var(--jdj-accent-soft); border-radius: 10px; height: 60px;
}
.jm-item__jour { font-size: 1.45rem; font-weight: 800; line-height: 1; color: var(--jdj-accent-text); }
.jm-item__m { font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--jdj-muted); margin-top: 2px; }
/* Journée passée : seule la pastille date passe en gris, le texte reste lisible */
.jm-item.is-past .jm-item__date { background: #f1f5f9; }
.jm-item.is-past .jm-item__jour { color: #64748b; }

.jm-item__meta { font-size: .875rem; color: var(--jdj-muted); font-weight: 500; }
.jm-item__nom { font-size: 1.1rem; font-weight: 700; margin: 3px 0 6px; line-height: 1.35; color: var(--jdj-text); }
.jm-item__desc { margin: 0 0 10px; font-size: 1rem; line-height: 1.5; color: var(--jdj-text); }
.jm-item__foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.jm-item__foot .btn { font-size: .9rem; }
.jm-passee {
    display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 8px;
    font-size: .75rem; font-weight: 600; background: #f1f5f9; color: #475569;
}
