/* ============================================================
   PAGE INDEX — Choix du pays / langue ("PAYS" dans Figma)
   Frame 361:1304. Hauteur cible 1080px (1 viewport desktop).
   ============================================================ */

body.index {
    background: var(--color-primary-light-grey);
    min-height: 100vh;
}

/* ----- Hero plein écran avec photo de fond + overlay teal ---------------- */
.indexHero {
    position: relative;
    flex: 1 0 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-10) var(--content-gutter);
    gap: var(--space-10);
    overflow: hidden;
    isolation: isolate;
}

.indexHero__bg {
    /* On ancre l'image aux 4 bords du parent (inset:0). En complément
       on annule le reset base.css `img { max-width: 100%; height: auto }`
       qui empêcherait `object-fit: cover` de fonctionner correctement. */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    object-position: center center;
    max-width: none !important;
    z-index: -2;
    pointer-events: none;
}

/* Overlay teal — léger voile pour adoucir la photo et accrocher le contenu */
.indexHero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 130, 142, 0.55) 0%,
        rgba(0, 130, 142, 0.20) 50%,
        rgba(0, 130, 142, 0.10) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* ----- Logo ESOP 2026 ---------------------------------------------------- */
.indexLogo {
    width: 300px;
    height: auto;
    flex-shrink: 0;
}

.indexLogo img {
    display: block;
    width: 100%;
    height: auto;
    /* Le SVG logo ESOP a un viewBox 300×176.331 (ratio ≈ 1.7). On force le
       ratio côté CSS au cas où le SVG embarque un preserveAspectRatio="none"
       (ce qui était le cas avant correction). */
    aspect-ratio: 300 / 176.331;
    object-fit: contain;
}

/* ----- Carte titre + liste pays (stack avec effet de tab) --------------- */
.indexCard {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
}

/* ----- Titre (bloc blanc, fit-content, légèrement caché sous la liste) - */
.indexTitle {
    background: var(--color-primary-white);
    padding: var(--space-10);
    margin-bottom: -30px;             /* tab : le bas du titre passe sous la liste */
    z-index: 1;
    position: relative;
}

.indexTitle__en,
.indexTitle__fr {
    font-family: var(--font-family-base);
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin: 0;
    white-space: nowrap;
}

.indexTitle__en {
    color: var(--color-primary-dark-blue);
}

.indexTitle__fr {
    color: var(--color-secondary-yellow);
    font-style: italic;
}

/* ----- Wrapper de la liste (inset 140px de la marge hero) -------------- */
.indexList__wrap {
    width: 100%;
    padding: 0 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ----- Liste pays (fond lilac, scrollable si trop d'entrées) ----------- */
.indexList {
    width: 100%;
    background: var(--color-secondary-lilac);
    padding: var(--space-5);
    max-height: 400px;
    overflow-y: auto;
    position: relative;
    z-index: 2;                       /* couvre la partie basse du titre */
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary-light-blue) transparent;
}

/* Scrollbar webkit (Chrome / Safari) */
.indexList::-webkit-scrollbar {
    width: 6px;
}

.indexList::-webkit-scrollbar-thumb {
    background: var(--color-primary-light-blue);
    border-radius: 3px;
}

.indexList::-webkit-scrollbar-track {
    background: transparent;
}

.indexList__items {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.indexList__item {
    display: block;
}

.indexList__btn {
    display: block;
    width: 100%;
    padding: var(--space-2);
    background: var(--color-primary-white);
    color: var(--color-primary-dark-blue);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-tight);
    text-align: left;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.indexList__btn:hover,
.indexList__btn:focus-visible {
    background: var(--color-secondary-teal);
    color: var(--color-primary-white);
    outline: none;
}

/* ----- Responsive --------------------------------------------------- */
@media (max-width: 1024px) {
    .indexHero {
        padding-left: var(--space-5);
        padding-right: var(--space-5);
        gap: var(--space-6);
    }

    .indexLogo {
        width: 220px;
    }

    .indexList__wrap {
        padding: 0 var(--space-6);
    }
}

@media (max-width: 600px) {
    .indexLogo {
        width: 180px;
    }

    .indexTitle {
        padding: var(--space-5) var(--space-6);
        margin-bottom: -20px;
    }

    .indexTitle__en,
    .indexTitle__fr {
        font-size: 24px;
        white-space: normal;
    }

    .indexList__wrap {
        padding: 0;
    }

    .indexList {
        padding: var(--space-3);
        max-height: 320px;
    }
}
