@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap');

@font-face {
    font-family: "LC Mogi";
    src: url("../assets/fonts/woff2/LCMogi-C.woff2") format("woff2"),
    url("../assets/fonts/ttf/LCMogi-C.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.page-content {
    padding-inline: clamp(3rem, 12vw, 12.19rem);
    box-sizing: border-box;
}

h1, h2, h3 {
    font-family: "LC Mogi", monospace;
}

h4, h5, h6 {
    font-family: "IBM Plex Sans", monospace;
}

p {
    font-family: "IBM Plex Sans", monospace;
}

.snap-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    padding-top: 3.75rem;
    scroll-padding-top: 3.75rem;
}

section {
    min-height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#footer-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
}

header {
    background-color: var(--color-primary);
    position: fixed;
    width: 100%;
    z-index: 1000;
    display: flex;
}

.header-content {
    width: 100%;
    display: flex;
    align-items: center;
}

#header-right .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#header-right {
    margin-left: auto;
}

section .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

footer .footer-content {
    gap: 0.5rem;
}

a:visited {
    color: #3e3e3e;
}

/* ============================================
   BARRE DE PROGRESSION
   ============================================ */
.progress {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 0.5rem;
}

.progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.progress-list li {
    width: 1.15831rem;
    height: 1.05869rem;
    border-radius: 50%;
    background: var(--color-tertiary);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.progress-list li:hover {
    transform: scale(1.2);
}

.progress-list li.active {
    background: var(--color-secondary);
    transform: scale(1.15);
}

/* Mobile : dots plus gros */
@media (max-width: 768px) {
    .progress-list li {
        width: 1.5rem;
        height: 1.5rem;
    }

    .progress-list {
        gap: 16px;
    }
}

/* ============================================
   LAYOUT SECTION AVEC CONTENU DYNAMIQUE
   ============================================ */

section .page-content {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.75rem);
    padding-top: 4rem;
    padding-bottom: 3rem;
    gap: 2rem;
}

.stat-header {
    flex-shrink: 0;
}

.stat-title {
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.stat-text {
    margin: 0;
    white-space: pre-line;
    line-height: 1.6;
}


.stat-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    max-height: 50vh;
    overflow: visible;
}


.stat-footer {
    flex-shrink: 0;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    margin-top: auto;
}


.stat-source {
    font-family: "IBM Plex Sans", monospace;
    font-size: 0.9rem;
    color: var(--color-secondary);
    text-decoration: none;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-source:hover {
    opacity: 0.7;
    transform: translateX(2px);
}

.stat-source::after {
    content: "↗";
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.stat-source:hover::after {
    transform: translate(2px, -2px);
}

.stat-source-placeholder {
    min-height: 1.5rem;
    display: block;
}

/* ============================================
   CONTENU VISUEL
   ============================================ */
.stat-content img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

.stat-content canvas {
    max-width: 100%;
    max-height: 100%;
}

.lottie-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    max-height: 100%;
}

/* ============================================
   HOVER EFFECTS SUR ÉLÉMENTS INTERACTIFS
   ============================================ */
.button {
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

#scrollToTopBtn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#scrollToTopBtn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

#scrollToTopBtn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

#scrollToTopBtn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#scrollToTopBtn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .page-content {
        padding-inline: 2rem;
    }

    section .page-content {
        padding-top: 3rem;
        padding-bottom: 2rem;
        gap: 1.5rem;
    }

    .stat-content {
        max-height: 45vh;
        min-height: 150px;
    }

    .lottie-container {
        max-width: 100%;
    }

    .stat-source {
        font-size: 0.85rem;
    }

    #scrollToTopBtn {
        bottom: 90px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding-inline: 1.5rem;
    }

    section .page-content {
        padding-top: 2.5rem;
        padding-bottom: 1.5rem;
        gap: 1.25rem;
    }

    .stat-title {
        font-size: 1.5rem;
    }

    .stat-text {
        font-size: 0.95rem;
    }

    .stat-content {
        max-height: 40vh;
        min-height: 120px;
    }

    .stat-footer {
        min-height: 2rem;
    }

    .stat-source {
        font-size: 0.8rem;
    }
}

/* ============================================
   HOVER TITRE — ESPACEMENT + SOULIGNEMENT
   ============================================ */

.stat-title {
    position: relative;
    display: inline-block;

    transition:
            letter-spacing 0.3s ease,
            transform 0.3s ease;
}

/* underline moderne */
.stat-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.25em;

    width: 100%;
    height: 2px;

    background-color: currentColor;

    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.stat-title:hover {
    letter-spacing: 0.06em;
}

.stat-title:hover::after {
    transform: scaleX(1);
}

/* Désactivation hover sur devices tactiles */
@media (hover: none) {
    .stat-title:hover {
        letter-spacing: normal;
    }

    .stat-title::after {
        display: none;
    }
}
