/* Bloc « Étapes d'un marché » — deux affichages : frise et navigation.
   Couleurs relevées dans les maquettes N2 et N3. */

.block-market-steps {
    --steps-bord: #B3E1DB;
    --steps-fond: #F1F5F9;
    --steps-actif: var(--charte-turquoise, #81CDC3);
    --steps-survol: #B3E1DB;
    position: relative;
    margin: 40px 0;
}

.block-market-steps__list {
    display: grid;
    grid-template-columns: repeat(var(--steps-colonnes, 4), 1fr);
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.block-market-steps--count-1 { --steps-colonnes: 1; }
.block-market-steps--count-2 { --steps-colonnes: 2; }
.block-market-steps--count-3 { --steps-colonnes: 3; }

.block-market-steps__item {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 32px 25px;
    border: 1px solid var(--steps-bord);
    border-radius: 17px;
    background: var(--steps-fond);
    transition: background-color .3s ease-out;
}

.block-market-steps__eyebrow {
    font-family: var(--charte-body-font);
    font-size: 13px;
    line-height: 18px;
    color: #8D8D8D;
}

.block-market-steps__title {
    margin: 6px 0 0;
    font-family: var(--charte-title-font);
    font-size: 24px;
    font-weight: 500;
    line-height: 28px;
    color: #000;
}

.block-market-steps__text {
    margin: 10px 0 0;
    font-family: var(--charte-body-font);
    font-size: 15px;
    font-weight: 400;
    line-height: 21px;
    color: #44494E;
}

.block-market-steps__figure {
    margin: auto 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--steps-bord);
    font-family: var(--charte-title-font);
    font-size: 28px;
    font-weight: 500;
    line-height: 32px;
    color: #000;
}

.block-market-steps__figure-text {
    margin: 4px 0 0;
    font-family: var(--charte-body-font);
    font-size: 15px;
    line-height: 21px;
    color: #44494E;
}

.block-market-steps__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    font-family: var(--charte-body-font);
    font-size: 15px;
    font-weight: 500;
    color: var(--charte-red);
    text-decoration: underline;
}

.block-market-steps__link .icon {
    width: 15px;
    height: 13px;
}

/* Étape mise en avant (frise) et page en cours (navigation). */
.block-market-steps__item--highlight,
.block-market-steps__item--current {
    border-color: transparent;
    background: var(--steps-actif);
}

.block-market-steps__item--highlight :is(.block-market-steps__eyebrow, .block-market-steps__title, .block-market-steps__text, .block-market-steps__figure, .block-market-steps__figure-text),
.block-market-steps__item--current :is(.block-market-steps__title, .block-market-steps__text) {
    color: #FFF;
}

.block-market-steps__item--highlight .block-market-steps__figure {
    border-top-color: rgba(255, 255, 255, .45);
}

.block-market-steps__item--highlight .block-market-steps__link,
.block-market-steps__item--current .block-market-steps__link {
    color: #FFF;
}

.block-market-steps__badge {
    align-self: flex-end;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #FFF;
    font-family: var(--charte-body-font);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: #44494E;
}


/* ---- Frise : ligne horizontale et pastilles au-dessus des cartes ---- */

.block-market-steps--frise .block-market-steps__list {
    padding-top: 56px;
}

/* Maquette N2 : 26 px entre le texte et le filet du chiffre. La marge « auto »
   du filet ne garantissait rien : dans une carte pleine, le trait collait au texte. */
.block-market-steps--frise .block-market-steps__text {
    margin-bottom: 26px;
}

/* Relevé sur la maquette N2 : filet de 2 px en dégradé vert, pastille pleine de
   23 px cerclée de blanc, puis un trait de 24 px qui descend vers la carte. */
.block-market-steps--frise .block-market-steps__list::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 8%;
    width: 84%;
    height: 2px;
    background: linear-gradient(to right, #01BC7D, #01BCA7);
}

.block-market-steps--frise .block-market-steps__marker {
    position: absolute;
    top: -53px;
    left: 50%;
    width: 23px;
    height: 23px;
    margin-left: -11.5px;
    border: 0;
    border-radius: 50%;
    background: var(--steps-actif);
    box-shadow: 0 0 0 6px #FFF;
}

.block-market-steps--frise .block-market-steps__marker::after {
    content: '';
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    width: 2px;
    height: 24px;
    margin-left: -1px;
    background: #1DC2A5;
}

.block-market-steps--frise .block-market-steps__item {
    background: #FFF;
}

.block-market-steps--frise .block-market-steps__item--highlight {
    background: var(--steps-actif);
}

.block-market-steps__source {
    margin: 24px 0 0;
    font-family: "proxima-nova", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
    color: #8D8D8D;
}


/* ---- Navigation : lien « Vue d'ensemble » et survol ---- */

.block-market-steps__overview {
    margin: 0 0 18px;
    text-align: right;
}

.block-market-steps__overview a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--charte-body-font);
    font-size: 13px;
    font-weight: 500;
    color: var(--charte-red);
    text-decoration: none;
}

.block-market-steps--navigation .block-market-steps__item {
    cursor: default;
}

@media (hover: hover) {
    .block-market-steps--navigation .block-market-steps__item:not(.block-market-steps__item--current):hover {
        background: var(--steps-survol);
    }
}


@media screen and (max-width: 991px) {
    .block-market-steps__list {
        grid-template-columns: repeat(2, 1fr);
    }

    /* La ligne de la frise n'a plus de sens sur deux rangées. */
    .block-market-steps--frise .block-market-steps__list::before,
    .block-market-steps--frise .block-market-steps__marker {
        display: none;
    }

    .block-market-steps--frise .block-market-steps__list {
        padding-top: 0;
    }
}

@media screen and (max-width: 767px) {
    .block-market-steps__list {
        grid-template-columns: 1fr;
    }

    /* Téléphone : la frise bascule à la verticale, filet et pastilles à gauche
       des cartes (maquette N2 mobile). */
    .block-market-steps--frise .block-market-steps__list {
        padding-top: 0;
        padding-left: 34px;
        gap: 16px;
    }

    .block-market-steps--frise .block-market-steps__list::before,
    .block-market-steps--frise .block-market-steps__marker {
        display: block;
    }

    .block-market-steps--frise .block-market-steps__list::before {
        top: 28px;
        bottom: 28px;
        left: 10px;
        width: 2px;
        height: auto;
        background: linear-gradient(to bottom, #01BC7D, #01BCA7);
    }

    .block-market-steps--frise .block-market-steps__marker {
        top: 28px;
        left: -34px;
        margin-left: 0;
    }

    /* Le trait de liaison vertical n'a plus lieu d'être : le filet est déjà vertical. */
    .block-market-steps--frise .block-market-steps__marker::after {
        content: none;
    }

    .block-market-steps__title {
        font-size: 22px;
        line-height: 26px;
    }
}


/* Navigation : titre et flèche sur la même ligne, carte entièrement cliquable. */
.block-market-steps__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.block-market-steps__head .block-market-steps__title {
    margin: 0;
}

.block-market-steps__arrow {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--charte-red);
}

.block-market-steps__item--current .block-market-steps__arrow {
    color: #FFF;
}

.block-market-steps__cover {
    position: absolute;
    inset: 0;
    border-radius: inherit;
}


/* Frise : la carte entière est cliquable et vire au vert au survol, comme en mode
   navigation (recette 12/11). Le lien visible s'étire sur toute la carte, il reste
   le seul lien de la carte pour les lecteurs d'écran. */
.block-market-steps--frise .block-market-steps__item:has(.block-market-steps__link) {
    position: relative;
}

.block-market-steps--frise .block-market-steps__link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

/* Au clavier, la carte réagit comme au survol. */
.block-market-steps--frise .block-market-steps__item:has(.block-market-steps__link):focus-within {
    background: var(--steps-survol);
}

.block-market-steps--frise .block-market-steps__item:has(.block-market-steps__link):focus-within .block-market-steps__figure {
    border-top-color: rgba(255, 255, 255, .55);
}

@media (hover: hover) {
    .block-market-steps--frise .block-market-steps__item:has(.block-market-steps__link):hover {
        background: var(--steps-survol);
    }

    .block-market-steps--frise .block-market-steps__item:has(.block-market-steps__link):hover .block-market-steps__figure {
        border-top-color: rgba(255, 255, 255, .55);
    }
}
