/* ============================================
   PAGE D'ACCUEIL SOMBRE - JUKEBOX-CAB
   ============================================
   Reprend l'ambiance de l'application : bleu nuit profond, plaques
   translucides, accents lumineux. Tout est porte par body.page-sombre,
   de sorte que les pages non encore reprises gardent leur apparence.
   ============================================ */

body.page-sombre {
    --nuit:          #1c2a4a;
    --nuit-2:        #24365e;
    --plaque:        rgba(255, 255, 255, 0.08);
    --plaque-survol: rgba(255, 255, 255, 0.13);
    --liseré:        rgba(255, 255, 255, 0.18);
    --liseré-vif:    rgba(140, 195, 255, 0.55);
    --accent:        #5aa9f8;
    --accent-doux:   rgba(90, 169, 248, 0.14);
    --texte:         #eef3fb;
    --texte-2:       rgba(238, 243, 251, 0.82);
    --texte-3:       rgba(238, 243, 251, 0.62);

    background: var(--nuit);
    color: var(--texte);
}

body.page-sombre .section { background: transparent; }

/* La barre de navigation s'accorde au fond */
body.page-sombre .navbar {
    background: rgba(22, 32, 58, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--liseré);
}

/* ============================================
   HERO
   ============================================ */
.hero-sombre {
    position: relative;
    padding: 9.5rem 0 5rem;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 78% 18%, rgba(95, 160, 245, 0.16), transparent 62%),
        linear-gradient(180deg, var(--nuit-2) 0%, var(--nuit) 100%);
}

/* Halo diffus derriere la capture. Pose en ::before du conteneur plutot
   qu'en image : rien a telecharger, et il suit la largeur de l'ecran. */
.hero-lueur {
    position: absolute;
    top: -22%;
    right: -12%;
    width: 65%;
    height: 130%;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(120, 185, 255, 0.17), transparent 75%);
    filter: blur(14px);
}

.hero-sombre-contenu {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 3.5rem;
    align-items: center;
}

.hero-accroche {
    display: inline-block;
    margin: 0 0 1.1rem;
    padding: 0.32rem 0.85rem;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-doux);
    border: 1px solid var(--liseré-vif);
    border-radius: 999px;
}

.hero-sombre h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #ffffff 25%, #9ec5f2 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-phrase {
    margin: 0 0 2rem;
    font-size: 1.16rem;
    line-height: 1.68;
    color: var(--texte-2);
    max-width: 34rem;
}

.hero-boutons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 2rem;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--texte-3);
    font-size: 0.92rem;
}

.hero-points li { display: flex; align-items: center; gap: 0.45rem; }

.hero-sombre-capture {
    margin: 0;
    min-width: 0;        /* sans quoi l'image impose sa largeur naturelle */
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--liseré);
    box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    background: var(--nuit-2);
}

.hero-sombre-capture img,
.hero-sombre-capture video { display: block; width: 100%; height: auto; }

/* Le cadre porte le tour anime : il lui faut un repere pour le bouton. */
.hero-sombre-tour { position: relative; }

/* Bouton "Revoir" : il n'apparait que si la lecture automatique est
   refusee par le navigateur, ou si le visiteur a demande moins
   d'animations. Le reste du temps il reste masque par l'attribut hidden. */
.hero-tour-bouton {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-size: 0.86rem;
    color: #fff;
    cursor: pointer;
    border: 1px solid var(--liseré-vif);
    border-radius: 999px;
    background: rgba(10, 18, 36, 0.72);
    backdrop-filter: blur(6px);
    transition: background 0.25s ease, transform 0.25s ease;
}

.hero-tour-bouton:hover {
    background: rgba(18, 32, 62, 0.9);
    transform: translateY(-2px);
}

.hero-tour-bouton[hidden] { display: none; }

/* Triangle de lecture dessine, pas un emoji : le rendu d'un emoji depend
   de la police du systeme, et varie d'un visiteur a l'autre. */
.hero-tour-icone {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 9px;
    border-color: transparent transparent transparent currentColor;
}

/* ---- Les deux outils du site (recherche, langues) ----
   Places sous les fonctionnalites, la ou l'on cherche a explorer : le
   champ de recherche et le selecteur de langue vivent tous deux dans la
   barre du haut, ou l'oeil ne va pas sans raison. */
.outils-site {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    max-width: 920px;
    margin: 2.2rem auto 0;
}

.outil-site {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--liseré);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    box-sizing: border-box;
}

.outil-site svg {
    flex: none;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    color: var(--accent, #5aa9f8);
}

.outil-site strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.98rem;
    color: #fff;
}

.outil-site span {
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.66);
}

/* ============================================
   BOUTONS
   ============================================ */
.btn-sombre {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1.5rem;
    border-radius: 11px;
    border: 1px solid var(--liseré);
    background: var(--plaque);
    color: var(--texte);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.25;
    transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.btn-sombre:hover {
    background: var(--plaque-survol);
    border-color: var(--liseré-vif);
    transform: translateY(-2px);
}

.btn-sombre span { display: flex; flex-direction: column; }
.btn-sombre small { font-size: 0.76rem; color: var(--texte-3); font-weight: 400; margin-top: 2px; }

.btn-sombre-primaire {
    background: linear-gradient(140deg, #2f7fe0, #1d5fb5);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 30px rgba(35, 110, 210, 0.35);
}

.btn-sombre-primaire:hover {
    background: linear-gradient(140deg, #3b8df0, #2569c4);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sombre-primaire small { color: rgba(255, 255, 255, 0.78); }

.btn-sombre-large { width: 100%; justify-content: center; padding: 1.1rem 1.5rem; }

.btn-sombre-don {
    background: linear-gradient(140deg, #f0b429, #d99214);
    color: #1b1403;
    border-color: rgba(255, 255, 255, 0.28);
    font-weight: 700;
}

.btn-sombre-don:hover { background: linear-gradient(140deg, #ffc53d, #e8a01d); }

.icone-trait { width: 26px; height: 26px; flex: none; }
.icone-mini  { width: 17px; height: 17px; flex: none; opacity: 0.85; }

/* ============================================
   BANDE DE CHIFFRES
   ============================================ */
.bande-chiffres {
    padding: 2.2rem 0;
    border-top: 1px solid var(--liseré);
    border-bottom: 1px solid var(--liseré);
    background: rgba(255, 255, 255, 0.015);
}

.chiffres {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.chiffre strong {
    display: block;
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    font-weight: 700;
    color: var(--texte);
    letter-spacing: -0.01em;
}

.chiffre span {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.86rem;
    color: var(--texte-3);
}

.chiffres-compacts {
    grid-template-columns: repeat(2, 1fr);
    margin: 1.6rem 0 0;
    padding: 1.1rem 0 0;
    border-top: 1px solid var(--liseré);
}

.chiffres-compacts .chiffre strong { font-size: 1.5rem; }

/* ============================================
   EN-TETES DE SECTION
   ============================================ */
.entete-section { text-align: center; margin-bottom: 3rem; }

.entete-section h2 {
    font-size: clamp(1.7rem, 3.6vw, 2.5rem);
    margin: 0 0 0.6rem;
    letter-spacing: -0.015em;
}

.entete-section p { color: var(--texte-3); margin: 0; font-size: 1.02rem; }

.section-pied { text-align: center; margin-top: 2.5rem; }

/* ============================================
   CARTES DE FONCTIONS
   ============================================ */
.cartes-vitrine {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.4rem;
}

.carte-vitrine {
    display: flex;
    flex-direction: column;
    padding: 1.8rem;
    border-radius: 15px;
    border: 1px solid var(--liseré);
    background: var(--plaque);
    color: inherit;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.carte-vitrine:hover {
    background: var(--plaque-survol);
    border-color: var(--liseré-vif);
    transform: translateY(-5px);
}

.carte-icone {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 1.1rem;
    border-radius: 12px;
    background: var(--accent-doux);
    color: var(--accent);
}

.carte-vitrine h3 { margin: 0 0 0.6rem; font-size: 1.16rem; line-height: 1.35; }
.carte-vitrine p  { margin: 0 0 1.2rem; color: var(--texte-2); line-height: 1.65; flex: 1; font-size: 0.95rem; }

.carte-lien { color: var(--accent); font-size: 0.9rem; font-weight: 500; }

/* ============================================
   GALERIE
   ============================================ */
body.page-sombre .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1.4rem;
}

body.page-sombre .gallery-item {
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid var(--liseré);
    background: var(--nuit-2);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

body.page-sombre .gallery-item:hover {
    transform: translateY(-4px);
    border-color: var(--liseré-vif);
}

body.page-sombre .gallery-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top center;
}

body.page-sombre .gallery-caption {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--liseré);
}

body.page-sombre .gallery-caption small { color: var(--texte-3); font-size: 0.86rem; }

/* ============================================
   TELECHARGEMENT
   ============================================ */
.telecharger-grille {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 2rem;
    align-items: start;
}

.bloc-telecharger,
.bloc-prerequis {
    padding: 1.9rem;
    border-radius: 15px;
    border: 1px solid var(--liseré);
    background: var(--plaque);
}

.bloc-prerequis h3 {
    font-size: 1.05rem;
    margin: 0 0 0.9rem;
    color: var(--texte);
}

.bloc-prerequis h3 + * { margin-top: 0; }
.bloc-prerequis ul + h3,
.bloc-prerequis ol + h3 { margin-top: 1.7rem; }

.liste-cochee, .liste-numerotee { margin: 0; color: var(--texte-2); line-height: 1.85; }
.liste-cochee { list-style: none; padding: 0; }
.liste-cochee li { display: flex; align-items: center; gap: 0.6rem; }
.liste-cochee svg { color: #46c47d; }
.liste-numerotee { padding-left: 1.3rem; }
.liste-numerotee code {
    background: rgba(255, 255, 255, 0.07);
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    font-size: 0.88em;
}

.lien-nouveautes { margin: 1.3rem 0 0; text-align: center; }

.lien-nouveautes a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.92rem;
}

.lien-nouveautes a:hover { text-decoration: underline; }

.bloc-prerequis-pied { margin: 1.4rem 0 0; }
.bloc-prerequis-pied a { color: var(--accent); text-decoration: none; font-size: 0.93rem; }
.bloc-prerequis-pied a:hover { text-decoration: underline; }

/* ============================================
   SOUTIEN
   ============================================ */
.soutien-carte {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2.6rem 2rem;
    text-align: center;
    border-radius: 18px;
    border: 1px solid rgba(240, 180, 41, 0.28);
    background:
        radial-gradient(700px 240px at 50% 0%, rgba(240, 180, 41, 0.11), transparent 70%),
        var(--plaque);
}

.soutien-icone {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    background: rgba(240, 180, 41, 0.15);
    color: #f0b429;
}

.soutien-carte h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 1rem; }
.soutien-carte p  { color: var(--texte-2); line-height: 1.7; margin: 0 0 1.8rem; }
.soutien-merci    { color: var(--texte-3); font-size: 0.88rem; margin: 1.2rem 0 0 !important; }

/* ============================================
   PAGES SECONDAIRES SOMBRES (nouveautes...)
   ============================================ */
.page-entete {
    padding: 9rem 0 3rem;
    background: linear-gradient(180deg, var(--nuit-2), var(--nuit));
    border-bottom: 1px solid var(--liseré);
}

.page-entete h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.6rem; }
.page-sous-titre { color: var(--texte-2); margin: 0; }

body.page-sombre .fil-ariane { margin-bottom: 1rem; font-size: 0.9rem; color: var(--texte-3); }
body.page-sombre .fil-ariane a { color: var(--accent); text-decoration: none; }
body.page-sombre .fil-ariane span { margin: 0 0.4rem; }

.historique { max-width: 50rem; margin: 0 auto; }
.historique-pied { text-align: center; margin-top: 3rem; }

body.page-sombre .update-highlight {
    background: var(--plaque) !important;
    border-left-color: var(--accent) !important;
    border-radius: 10px !important;
    padding: 1.2rem 1.4rem !important;
}

body.page-sombre .update-highlight h5 { color: var(--accent) !important; }
body.page-sombre .update-highlight li { color: var(--texte-2); line-height: 1.7; }

/* ============================================
   PIED DE PAGE
   ============================================ */
body.page-sombre .footer {
    background: var(--nuit-2);
    border-top: 1px solid var(--liseré);
}

/* ============================================
   ADAPTATION AUX PETITS ECRANS
   ============================================ */
@media (max-width: 980px) {
    .hero-sombre { padding: 7.5rem 0 3.5rem; }
    .hero-sombre-contenu { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero-phrase { max-width: none; }
    .telecharger-grille { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .hero-boutons { flex-direction: column; align-items: stretch; }
    .btn-sombre { justify-content: center; }
    .chiffres { grid-template-columns: repeat(2, 1fr); }
    .carte-vitrine, .bloc-telecharger, .bloc-prerequis { padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .btn-sombre, .carte-vitrine, body.page-sombre .gallery-item {
        transition: none;
    }
    .btn-sombre:hover, .carte-vitrine:hover, body.page-sombre .gallery-item:hover {
        transform: none;
    }
}

/* ============================================
   ANIMATIONS
   ============================================
   L'apparition au defilement passe par .animate-on-scroll, deja observe
   par js/main.js (IntersectionObserver qui pose .visible).
   Tout est neutralise sous prefers-reduced-motion, en fin de fichier.
   ============================================ */

/* ---- Entree du hero ---- */
@keyframes entree-haut {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes entree-droite {
    from { opacity: 0; transform: translateX(42px) scale(0.97); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes respire {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.06); }
}

.hero-accroche  { animation: entree-haut 0.6s ease both 0.05s; }
.hero-sombre h1 { animation: entree-haut 0.7s ease both 0.15s; }
.hero-phrase    { animation: entree-haut 0.7s ease both 0.25s; }
.hero-boutons   { animation: entree-haut 0.7s ease both 0.35s; }
.hero-points    { animation: entree-haut 0.7s ease both 0.45s; }

.hero-sombre-capture {
    animation: entree-droite 0.9s cubic-bezier(.22,.68,.32,1) both 0.2s;
}

/* Le halo respire lentement : la page n'est jamais tout a fait immobile */
.hero-lueur { animation: respire 9s ease-in-out infinite; }

/* La capture se souleve legerement au survol */
.hero-sombre-capture {
    transition: transform 0.5s cubic-bezier(.22,.68,.32,1), box-shadow 0.5s ease;
}

.hero-sombre-capture:hover {
    transform: translateY(-7px);
    box-shadow: 0 50px 110px rgba(0, 0, 0, 0.66), 0 0 0 1px var(--liseré-vif) inset;
}

/* ---- Apparition au defilement ---- */
.apparait {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(.22,.68,.32,1);
}

.apparait.visible { opacity: 1; transform: translateY(0); }

/* Les cartes et les captures arrivent l'une apres l'autre */
.cartes-vitrine .carte-vitrine,
.section-galerie .gallery-item {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.22,.68,.32,1),
                background 0.25s ease, border-color 0.25s ease;
}

.cartes-vitrine.visible .carte-vitrine,
.section-galerie .gallery-grid.visible .gallery-item {
    opacity: 1;
    transform: translateY(0);
}

.cartes-vitrine.visible .carte-vitrine:nth-child(1),
.section-galerie .gallery-grid.visible .gallery-item:nth-child(1) { transition-delay: 0s; }
.cartes-vitrine.visible .carte-vitrine:nth-child(2),
.section-galerie .gallery-grid.visible .gallery-item:nth-child(2) { transition-delay: .07s; }
.cartes-vitrine.visible .carte-vitrine:nth-child(3),
.section-galerie .gallery-grid.visible .gallery-item:nth-child(3) { transition-delay: .14s; }
.cartes-vitrine.visible .carte-vitrine:nth-child(4),
.section-galerie .gallery-grid.visible .gallery-item:nth-child(4) { transition-delay: .21s; }
.cartes-vitrine.visible .carte-vitrine:nth-child(5),
.section-galerie .gallery-grid.visible .gallery-item:nth-child(5) { transition-delay: .28s; }
.cartes-vitrine.visible .carte-vitrine:nth-child(6),
.section-galerie .gallery-grid.visible .gallery-item:nth-child(6) { transition-delay: .35s; }
.section-galerie .gallery-grid.visible .gallery-item:nth-child(7) { transition-delay: .42s; }
.section-galerie .gallery-grid.visible .gallery-item:nth-child(8) { transition-delay: .49s; }

/* Le survol d'une carte garde la priorite sur l'apparition */
.cartes-vitrine.visible .carte-vitrine:hover { transform: translateY(-5px); }

/* L'icone de la carte prend vie au survol */
.carte-vitrine .carte-icone {
    transition: background 0.25s ease, color 0.25s ease, transform 0.35s cubic-bezier(.3,1.4,.5,1);
}

.carte-vitrine:hover .carte-icone {
    transform: scale(1.1) rotate(-4deg);
    background: rgba(90, 169, 248, 0.24);
}

.carte-vitrine .carte-lien { transition: transform 0.25s ease; display: inline-block; }
.carte-vitrine:hover .carte-lien { transform: translateX(5px); }

/* ---- Les chiffres comptent en arrivant ---- */
.chiffre strong { transition: color 0.3s ease; }
.bande-chiffres .chiffre { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.bande-chiffres .chiffres.visible .chiffre { opacity: 1; transform: translateY(0); }
.bande-chiffres .chiffres.visible .chiffre:nth-child(2) { transition-delay: .08s; }
.bande-chiffres .chiffres.visible .chiffre:nth-child(3) { transition-delay: .16s; }
.bande-chiffres .chiffres.visible .chiffre:nth-child(4) { transition-delay: .24s; }

/* ---- Boutons ---- */
.btn-sombre-primaire { position: relative; overflow: hidden; }

.btn-sombre-primaire::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.26) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.65s ease;
}

.btn-sombre-primaire:hover::after { transform: translateX(120%); }

.btn-sombre svg { transition: transform 0.3s ease; }
.btn-sombre:hover svg { transform: translateY(2px); }
.btn-sombre-don:hover svg { transform: scale(1.12); }

/* ---- Respect du reglage systeme ---- */
@media (prefers-reduced-motion: reduce) {
    .hero-accroche, .hero-sombre h1, .hero-phrase, .hero-boutons,
    .hero-points, .hero-sombre-capture, .hero-lueur {
        animation: none !important;
    }
    .apparait, .cartes-vitrine .carte-vitrine,
    .section-galerie .gallery-item, .bande-chiffres .chiffre {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .btn-sombre-primaire::after { display: none; }
}

/* ---- Encart des notes de mise a jour ---- */
.encart-nouveautes {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 1.4rem;
    padding: 0.95rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--liseré-vif);
    background: var(--accent-doux);
    color: inherit;
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.encart-nouveautes:hover {
    background: rgba(90, 169, 248, 0.2);
    transform: translateY(-2px);
}

.encart-nouveautes-icone {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: rgba(90, 169, 248, 0.22);
    color: var(--accent);
}

.encart-nouveautes-texte { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.encart-nouveautes-texte strong { font-size: 0.97rem; color: var(--texte); }
.encart-nouveautes-texte small  { font-size: 0.83rem; color: var(--texte-3); margin-top: 2px; }

.encart-nouveautes-fleche {
    color: var(--accent);
    font-size: 1.2rem;
    flex: none;
    transition: transform 0.25s ease;
}

.encart-nouveautes:hover .encart-nouveautes-fleche { transform: translateX(4px); }

/* .animate-on-scroll (animations.css) masque l'element jusqu'a .visible.
   Les conteneurs qui n'animent que leurs enfants (cartes, galerie,
   chiffres) ne doivent donc pas etre masques eux-memes. */
.cartes-vitrine.animate-on-scroll,
.gallery-grid.animate-on-scroll,
.chiffres.animate-on-scroll {
    opacity: 1;
    transform: none;
}

/* Garde-fou : sans JavaScript, rien ne doit rester masque.
   La classe js-actif est posee par un script inline avant le rendu. */
html:not(.js-actif) .animate-on-scroll,
html:not(.js-actif) .apparait,
html:not(.js-actif) .cartes-vitrine .carte-vitrine,
html:not(.js-actif) .section-galerie .gallery-item,
html:not(.js-actif) .bande-chiffres .chiffre {
    opacity: 1 !important;
    transform: none !important;
}

/* ============================================
   CALCUL DES LARGEURS
   ============================================
   Le site n'a pas de reset global : tout est en content-box. Un
   width:100% ajoute donc le padding PAR-DESSUS la largeur du parent,
   et le bouton de telechargement debordait de 49 px de son cadre.
   On passe en border-box les blocs de cette page, et eux seuls : le
   reste du site a ete construit en content-box et doit le rester.
   ============================================ */
.btn-sombre,
.carte-vitrine,
.bloc-telecharger,
.bloc-prerequis,
.encart-nouveautes,
.soutien-carte,
.hero-sombre-capture,
.bande-chiffres,
.chiffre,
.page-entete,
.historique,
body.page-sombre .gallery-item,
body.page-sombre .gallery-caption {
    box-sizing: border-box;
}

/* ============================================
   TYPOGRAPHIE
   ============================================
   Le site s'appuyait sur Segoe UI, c'est-a-dire sur la police du
   systeme : le rendu changeait selon la machine du visiteur. Deux
   familles sont desormais chargees - Outfit pour les titres, qui a du
   caractere, et Inter pour le texte courant, dessinee pour l'ecran.
   La pile de secours reste celle d'avant : si le chargement echoue,
   le site retrouve exactement son ancien rendu.
   ============================================ */
:root {
    --police-titres: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --police-texte:  'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.page-sombre {
    font-family: var(--police-texte);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.page-sombre h1,
body.page-sombre h2,
body.page-sombre h3,
body.page-sombre h4,
body.page-sombre .nav-title,
body.page-sombre .chiffre strong,
body.page-sombre .hero-sombre h1 {
    font-family: var(--police-titres);
    letter-spacing: -0.015em;
}

/* Les chiffres s'alignent en colonne : utile dans la bande de
   statistiques, ou des nombres de largeurs differentes se suivent. */
body.page-sombre .chiffre strong,
body.page-sombre .chiffres-compacts strong {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ============================================
   RECHERCHE DU SITE
   ============================================ */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.recherche-site-boite {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.recherche-site-boite:focus-within {
    border-color: rgba(140, 195, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}

.recherche-site-label { display: flex; color: rgba(255, 255, 255, 0.6); }
.recherche-site-label svg { width: 15px; height: 15px; }

#recherche-site {
    width: 8.5rem;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
    padding: 0.12rem 0;
    transition: width 0.25s ease;
}

#recherche-site::placeholder { color: rgba(255, 255, 255, 0.45); }
#recherche-site:focus { width: 12rem; }
#recherche-site::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; }

.recherche-resultats {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: min(26rem, 80vw);
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.4rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #1a2740;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    z-index: 1200;
}

.recherche-liste { list-style: none; margin: 0; padding: 0; }

.recherche-liste a {
    display: block;
    padding: 0.6rem 0.75rem;
    border-radius: 9px;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease;
}

.recherche-liste a:hover { background: rgba(255, 255, 255, 0.08); }

.recherche-titre { display: block; font-weight: 600; font-size: 0.93rem; color: #eef3fb; }
.recherche-desc  { display: block; font-size: 0.82rem; color: rgba(238, 243, 251, 0.64);
                   margin-top: 1px; line-height: 1.45; }
.recherche-cat   { display: inline-block; margin-top: 0.35rem; padding: 0.08rem 0.45rem;
                   font-size: 0.7rem; border-radius: 999px;
                   background: rgba(90, 169, 248, 0.18); color: #8cc3ff; }

.recherche-vide { margin: 0; padding: 0.9rem 0.8rem; color: rgba(238, 243, 251, 0.6);
                  font-size: 0.88rem; text-align: center; }

@media (max-width: 1500px) {
    #recherche-site { width: 6rem; }
    #recherche-site:focus { width: 10rem; }
}

@media (max-width: 1100px) {
    .recherche-site-boite { display: none; }
}

/* Une fonctionnalite atteinte par une ancre ne doit pas se retrouver
   sous le bandeau fixe. */
body.page-sombre .feature-item[id] { scroll-margin-top: 6rem; }

/* ============================================
   BARRE DE NAVIGATION : TENIR DANS L'ECRAN
   ============================================
   Le bandeau porte desormais dix liens, la recherche et le selecteur de
   langue. Son contenu mesurait 1629 px pour un conteneur plafonne a
   1264 : il debordait de 365 px, et le selecteur de langue finissait a
   1949 px sur un ecran de 1920 - donc coupe.
   Le conteneur du bandeau est elargi, les espacements resserres, et les
   elements les moins essentiels s'effacent quand la place manque.
   ============================================ */
body.page-sombre .navbar .container {
    max-width: min(1780px, 100% - 2rem);
    gap: 1rem;
}

body.page-sombre .nav-menu {
    gap: 0.1rem;
    flex-wrap: nowrap;
}

body.page-sombre .nav-link {
    padding: 0.4rem 0.52rem;
    font-size: 0.88rem;
    white-space: nowrap;
}

body.page-sombre .nav-badge-bonus,
body.page-sombre .nav-badge-pi {
    font-size: 0.58rem;
    padding: 0.08rem 0.32rem;
}

body.page-sombre .nav-title { font-size: 1.15rem; }
body.page-sombre .nav-logo  { width: 34px; height: 34px; }

/* Le panneau de resultats s'accroche a l'ecran et non a son champ :
   accroche au champ, il sortait a droite des que le bandeau etait
   serre. */
.recherche-resultats {
    position: fixed;
    top: 4.6rem;
    right: 1rem;
    left: auto;
}

/* Sous 1550 px, les deux badges prennent de la place pour rien */
@media (max-width: 1550px) {
    body.page-sombre .nav-badge-bonus,
    body.page-sombre .nav-badge-pi { display: none; }
    body.page-sombre .nav-link { padding: 0.4rem 0.42rem; font-size: 0.84rem; }
}


/* Le menu mobile prend le relais sous 1024 px. Entre 1024 et 1380, le
   bandeau complet doit tenir : la recherche s'efface plus tot et les
   liens se resserrent encore. Mesure : 16 px depassaient a 1400 px. */
@media (max-width: 1460px) {
    .recherche-site-boite { display: none; }
}

@media (max-width: 1240px) {
    body.page-sombre .nav-link { padding: 0.38rem 0.3rem; font-size: 0.8rem; }
    body.page-sombre .nav-title { font-size: 1.02rem; }
    body.page-sombre .selecteur-langue a { padding: 0.26rem 0.42rem; font-size: 0.74rem; }
}

/* ============================================
   MENU REPLIABLE DES 1100 PX
   ============================================
   Le menu repliable ne prenait le relais qu'a 768 px. Entre 768 et
   1024, les dix liens ne tiennent pas : 58 px depassaient encore a
   1024 px. Les regles du mode replie (responsive.css) sont reprises
   ici pour la plage intermediaire.
   ============================================ */
@media (max-width: 1100px) and (min-width: 769px) {
    body.page-sombre .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(18, 27, 45, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1.4rem 2rem;
        gap: 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    body.page-sombre .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    body.page-sombre .nav-menu li { width: 100%; }

    body.page-sombre .nav-link {
        display: block;
        padding: 0.72rem 0.4rem;
        font-size: 0.98rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    body.page-sombre .nav-badge-bonus,
    body.page-sombre .nav-badge-pi { display: inline-block; }

    body.page-sombre .nav-toggle { display: flex; }
}
