/* Statistiques : section editoriale independante du CSS existant. */
.stats-editorial-section {
    background: #eaf4f8;
    padding: 54px 0 64px;
    border-bottom: 1px solid #dbe7ee;
}

.stats-editorial-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    gap: 28px;
    align-items: stretch;
}

.stats-editorial-feature,
.stats-editorial-side-card {
    background: #fff;
    border: 1px solid #dce8ee;
    border-radius: 7px;
    padding: 28px;
}

.stats-editorial-feature {
    min-width: 0;
}

.stats-editorial-period {
    color: #587789;
    font-weight: 700;
    font-size: 14px;
    margin: 14px 0 2px;
}

.stats-editorial-feature h2 {
    color: #17394c;
    font-size: clamp(25px, 2.7vw, 39px);
    line-height: 1.18;
    margin: 7px 0 22px;
    letter-spacing: -.03em;
}

.stats-editorial-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 26px;
}

.stats-editorial-copy {
    min-width: 0;
}

.stats-editorial-copy p {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.8;
    color: #3e6173;
}

.stats-editorial-more {
    color: var(--blue, #007fbd);
    font-weight: 750;
    font-size: 14px;
    text-decoration: none;
}

.stats-editorial-more:hover {
    text-decoration: underline;
}

.stats-editorial-chart {
    margin: 0;
    min-width: 0;
}

.stats-editorial-chart img {
    width: 100%;
    height: auto;
    border: 1px solid #e3ebef;
    border-radius: 5px;
    background: #fff;
}

.stats-editorial-sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
    min-height: 0;
}

.stats-editorial-sidebar>.stats-editorial-side-card {
    min-height: 0;
}

.stats-editorial-sidebar>.stats-editorial-side-card:last-child {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stats-editorial-sidebar>.stats-editorial-side-card:last-child .stats-editorial-calendar {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
    scrollbar-gutter: stable;
}

.stats-editorial-side-card .eyebrow {
    margin-bottom: 14px;
    font-size: 12px;
}

.stats-editorial-next {
    font-size: 25px;
    color: #163e54;
}

.stats-editorial-calendar {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.stats-editorial-calendar li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5eef2;
    padding-bottom: 9px;
    font-size: 14px;
}

.stats-editorial-calendar li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.stats-editorial-calendar time {
    color: #345c73;
    font-weight: 750;
    white-space: nowrap;
}


/* Statistiques mondiales */
.stats-world-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.stats-world-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.stats-world-item strong {
    font-size: 15px;
    font-weight: 700;
}

.stats-world-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-world-languages a {
    padding: 8px 12px;
    background: var(--sky);
    color: var(--blue);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

/* Avertissement */
.stats-warning-section {
    padding: 0 0 75px;
    background: var(--back);
}

.stats-warning {
    padding: 30px 36px;
    background: #e8f4f9;
    border-left: 4px solid var(--blue);
    border-radius: 6px;
}

.stats-warning h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.stats-warning p {
    margin: 0;
    color: #446779;
    font-size: 14px;
    line-height: 1.8;
}


@media(max-width: 1020px) {
    .stats-editorial-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .stats-editorial-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto;
    }

    .stats-editorial-sidebar>.stats-editorial-side-card:last-child {
        overflow: visible;
    }

    .stats-editorial-sidebar>.stats-editorial-side-card:last-child .stats-editorial-calendar {
        overflow-y: visible;
        max-height: none;
    }
}

@media(max-width: 690px) {
    .stats-editorial-section {
        padding: 35px 0 45px;
    }

    .stats-editorial-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .stats-editorial-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .stats-editorial-feature,
    .stats-editorial-side-card {
        padding: 20px;
    }

        .stats-world-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-warning {
        padding: 24px;
    }
}






/* =========================================
   FH - Animations page statistiques
   ========================================= */

@media (prefers-reduced-motion: no-preference) {

    /* En-tête */
    .page-hero-content {
        animation: stats-fade-up 450ms ease-out both;
    }

    /* Derniers résultats */
    .stats-editorial-feature {
        animation: stats-fade-up 500ms ease-out 70ms both;
    }

    /* Graphique */
    .stats-editorial-chart {
        animation: stats-fade-in 500ms ease-out 150ms both;
    }

    /* Calendrier à droite */
    .stats-editorial-sidebar {
        animation: stats-slide-left 550ms
                   cubic-bezier(.22, 1, .36, 1) 120ms both;
    }

    /* En-tête des statistiques mensuelles */
    .stats-main > .stats-section-heading:first-child {
        animation: stats-fade-up 450ms ease-out 100ms both;
    }

    /* Documents mensuels en cascade */
    .stats-list-compact .stats-record {
        animation: stats-fade-up 450ms ease-out both;
    }

    .stats-list-compact .stats-record:nth-child(1) {
        animation-delay: 120ms;
    }

    .stats-list-compact .stats-record:nth-child(2) {
        animation-delay: 170ms;
    }

    .stats-list-compact .stats-record:nth-child(3) {
        animation-delay: 220ms;
    }

    .stats-list-compact .stats-record:nth-child(4) {
        animation-delay: 270ms;
    }

    /* Titres des sections suivantes */
    .stats-subsection {
        animation: stats-fade-up 450ms ease-out 100ms both;
    }

    /* Archives et statistiques mondiales */
    .stats-history-list,
    .stats-world-list {
        animation: stats-fade-up 500ms ease-out 140ms both;
    }

    /* Sidebar des résultats annuels */
    .stats-aside {
        animation: stats-slide-left 550ms
                   cubic-bezier(.22, 1, .36, 1) 120ms both;
    }

    /* Avertissement */
    .stats-warning {
        animation: stats-fade-in 450ms ease-out both;
    }

    /* Définition des animations */

    @keyframes stats-fade-in {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    @keyframes stats-fade-up {
        from {
            opacity: 0;
            transform: translateY(14px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes stats-slide-left {
        from {
            opacity: 0;
            transform: translateX(22px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}


/* =========================================
   FH - Adaptation tablettes et smartphones
   ========================================= */

/* Tablettes : suppression du glissement latéral */
@media (max-width: 1020px) and
       (prefers-reduced-motion: no-preference) {

    .stats-editorial-sidebar,
    .stats-aside {
        animation-name: stats-fade-in;
        animation-duration: 350ms;
        animation-delay: 0ms;
    }
}

/* Smartphones : animations très courtes */
@media (max-width: 690px) and
       (prefers-reduced-motion: no-preference) {

    .page-hero-content,
    .stats-editorial-feature,
    .stats-editorial-chart,
    .stats-editorial-sidebar,
    .stats-main > .stats-section-heading:first-child,
    .stats-list-compact .stats-record,
    .stats-subsection,
    .stats-history-list,
    .stats-world-list,
    .stats-aside,
    .stats-warning {
        animation-duration: 250ms;
        animation-delay: 0ms;
    }

    /* Une seule animation pour la liste des PDF */
    .stats-list-compact {
        animation: stats-fade-in 250ms ease-out both;
    }

    .stats-list-compact .stats-record {
        animation: none;
    }
}
