/* ------------- PAGES PROJET (images + texte) ------------- */
body:is(:has(.images-projets-HAUT), :has(.carrousel)) {
    height: auto;
    min-height: auto;
    --row-unit: calc((100vh - 46px) / 8);
    grid-template-rows: auto;
}

main:is(:has(.images-projets-HAUT), :has(.carrousel)) {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    grid-template-columns: unset;
    grid-template-rows: unset;
    grid-row: auto;
    align-self: start;
    --half-col: calc(100% / var(--grid-cols, 8) / 2);
}



/* HAUTTTTTTTTTTTTT */
.images-projets-HAUT {
    display: flex;
    align-self: center;
    width: calc(5 / 8 * 100%);
    height: calc(6 * var(--row-unit));
    gap: 3rem;
}

.images-projets-HAUT img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* 2 HAUT  */
.images-projets-HAUT-double {
    align-self: center;
    width: calc(5 / 8 * 100%);
    height: calc(6 * var(--row-unit));
}

main:is(:has(.images-projets-HAUT), :has(.carrousel)) > .long {
    grid-column: unset;
    grid-row: unset;
}

.espace{
        grid-column: 1 / -1;
        padding-inline-start: calc(100% / var(--grid-cols));
        padding-left: 100px;
    }

    .espacedouble {
        grid-column: 1 / -1;
        padding-inline-start: calc(2 * 100% / var(--grid-cols));
        padding-left: 200px;
    }

    /* HAUT gauche */
    .images-projets-HAUT.gauche {
        align-self: flex-start;
    }

    .images-projets-HAUT.collé-texte {
        height: auto;
    }

    .images-projets-HAUT.collé-texte img {
        width: 100%;
        height: auto;
        max-height: calc(6 * var(--row-unit));
        object-fit: contain;
        /* margin-bottom: 3rem; */
    }

    .images-projets-HAUT.haut-5-lignes {
        width: calc(6 / 8 * 100%);
        height: calc(5 * var(--row-unit));
    }

    .images-projets-HAUT.haut-5-lignes img {
        height: 100%;
        max-height: calc(8 * var(--row-unit));
    }

    .images-projets-HAUT.collé-texte.haut-5-lignes {
        height: auto;
    }

    .images-projets-HAUT.collé-texte.haut-5-lignes img {
        max-height: calc(8 * var(--row-unit));
    }

    main:is(:has(.images-projets-HAUT), :has(.carrousel)) > header + .carrousel {
        margin-top: -2.5rem;
    }

    /* HAUT gaucheeeeee aligné */
    .images-projets-HAUT.haut-contenu-gauche {
        width: auto;
        max-width: calc(5 / 8 * 100%);
        height: calc(5 * var(--row-unit));
    }

    .images-projets-HAUT.haut-contenu-gauche img {
        width: auto;
        height: calc(5 * var(--row-unit));
        max-height: calc(6 * var(--row-unit));
        object-fit: contain;
        object-position: left;
    }

    /* HAUT droite JVDDDDDDDDDDDD*/
    .images-projets-HAUT.haut-contenu-droite {
        align-self: flex-end;
        width: calc(5 / 8 * 100%);
        margin-inline-end: calc(100% / var(--grid-cols, 8));
    }

    .images-projets-HAUT.haut-contenu-droite img {
        object-position: right;
    }

/* UNIIIIIIIIIIFORM */
.images-projets-HAUT.uniforme-affiche {
    align-self: flex-start;
    margin-inline-start: calc(100% / var(--grid-cols, 8));
}

.images-projets-HAUT.uniforme-affiche img {
    object-position: left;
}

.uni{
    margin-top: -3rem;
}

/* BASSSSSSSSSSSSSSS */


/* 2 gauche  */
.images-projets-BAS {
    display: flex;
    gap: 5rem;
    align-self: start;
    margin-inline-start: calc(100% / var(--grid-cols, 8));
    height: calc(4 * var(--row-unit));
}

.images-projets-BAS img {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* BAS colonnes empilées + tel (Jeunes Vertexs) */
.BAS-colonnes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.BAS-colonnes img {
    flex: unset;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.images-projets-BAS-jv {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 8), minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 3rem;
    align-items: start;
    margin-inline-start: 0;
    width: 100%;
    height: auto;
}

.images-projets-BAS-jv .BAS-colonnes {
    grid-column: 1 / 4;
    grid-row: 1;
    justify-self: start;
}

.images-projets-BAS-jv .tel-jv {
    grid-column: 5 / -1;
    grid-row: 2;
    flex: unset;
    width: 100%;
    height: auto;
    max-height: calc(4 * var(--row-unit));
    object-fit: contain;
    object-position: left top;
    align-self: start;
}

/* BAS Axécycle */
.images-projets-BAS-axecycle {
    grid-template-rows: auto auto;
}

.images-projets-BAS-axecycle .axecycle-stickers {
    grid-column: 1 / 5;
    grid-row: 1;
    width: 100%;
    height: auto;
    max-height: calc(3 * var(--row-unit));
    object-fit: contain;
    object-position: left top;
}

.images-projets-BAS-axecycle .axecycle-tshirt {
    grid-column: 3 / -1;
    grid-row: 1;
    justify-self: end;
    align-self: start;
    width: auto;
    max-width: 100%;
    height: calc(5 * var(--row-unit));
    object-fit: contain;
    object-position: right top;
}

.images-projets-BAS-axecycle .axecycle-bidon {
    grid-column: 1 / 7;
    grid-row: 2;
    width: 100%;
    height: auto;
    max-height: calc(5 * var(--row-unit));
    object-fit: contain;
    object-position: left top;
}



/* BAS CENTRE  */

.images-projets-BAS-centre {
    align-self: center;
    width: calc(5 / 8 * 100%);
    height: calc(6 * var(--row-unit));
}

.images-projets-BAS-centre img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ------------- CARROUSEL ------------- */
.carrousel {
    align-self: center;
    width: 100%;
}

.carrousel-principal {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: calc(5 / 8 * 100%);
    margin-inline: auto;
    height: auto;
}

.carrousel-image-grande {
    flex: 1;
    min-width: 0;
    height: auto;
    line-height: 0;
    padding-bottom: 10px;

}

.carrousel-image-grande img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(6 * var(--row-unit));
    object-fit: contain;
}

.carrousel-nav {
    flex: 0 0 4rem;
    width: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    font-size: 3rem;
    font-variation-settings: var(--fv-regular);
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.carrousel-nav:hover {
    font-variation-settings: var(--fv-bold);
}

.carrousel-miniatures {
    --carrousel-thumb-gap: 0.35rem;
    --carrousel-strip-width: calc(5 / 8 * 100%);
    --carrousel-thumb-width: calc((var(--carrousel-strip-width) - 14 * var(--carrousel-thumb-gap)) / 15);
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: var(--carrousel-thumb-gap);
    width: 100%;
    margin-inline: auto;
    margin-top: 0;
    line-height: 0;
}

.carrousel-miniature {
    flex: 0 0 var(--carrousel-thumb-width);
    width: var(--carrousel-thumb-width);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.55;
}

.carrousel-miniature.is-active,
.carrousel-miniature:hover {
    opacity: 1;
}

.carrousel-miniature img {
    display: block;
    width: 100%;
    height: calc(0.42 * var(--row-unit));
    object-fit: contain;
}

main:is(:has(.images-projets-HAUT), :has(.carrousel)) .contact-info {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
    grid-auto-rows: min-content;
    align-self: start;
    padding-block-end: 0;
}

main:is(:has(.images-projets-HAUT), :has(.carrousel)) .contact-info > div:nth-child(4) {
    grid-column: 4 / -1;
    grid-row: 4;
}

/* ------------- PAGES PROJET (galerie) ------------- */
.projet-titre {
    font-size: 3.25rem;
    line-height: 1;
}

header h3 {
    grid-column: 1 / 7;
    grid-row: 2;
}

body:has(.projet-contenu) {
    height: auto;
    min-height: 100vh;
    --row-unit: calc((100vh - 46px) / 8);
    grid-template-rows: repeat(12, var(--row-unit));
}

main:has(.projet-contenu) {
    grid-row: 1 / 13;
}

.projet-contenu {
    grid-column: 1 / -1;
    grid-row: 2 / -1;
    display: grid;
    grid-template-columns: subgrid;
    grid-auto-rows: min-content;
    align-content: start;
    padding-block-start: 1.5rem;
}

.projet-galerie {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    grid-auto-rows: min-content;
    row-gap: 2.5rem;
}

.projet-galerie img {
    grid-column: 1 / -1;
    display: block;
    width: 100%;
    height: auto;
    max-inline-size: 100%;
    object-fit: contain;
}

.projet-galerie img.projet-image--demi {
    grid-column: 1 / 5;
}

.projet-galerie img.projet-image--demi + img.projet-image--demi {
    grid-column: 5 / -1;
}

@media (max-width: 767px) {
    body:has(.projet-contenu) {
        --row-unit: calc((100vh - 32px) / 8);
    }

    body:is(:has(.images-projets-HAUT), :has(.carrousel)) {
        --row-unit: calc((100vh - 32px) / 8);
    }

    main:is(:has(.images-projets-HAUT), :has(.carrousel)) {
        gap: 3rem;
    }

    .projet-titre {
        font-size: clamp(1.6rem, 4.5vw, 2.5rem);
    }

    header > .projet-titre {
        margin-top: 1.8rem;
        grid-row: 2;
        grid-column: 1 / -1;
    }

    header h3 {
        grid-row: 3;
    }

    .images-projets-HAUT,
    .images-projets-HAUT-double,
    .images-projets-HAUT.haut-contenu-gauche {
        width: calc(7 / 8 * 100%);
        height: auto;
        max-height: calc(5 * var(--row-unit));
    }

    .images-projets-HAUT img,
    .images-projets-HAUT-double img {
        width: 100%;
        height: auto;
        max-height: calc(5 * var(--row-unit));
    }

    .images-projets-HAUT.haut-contenu-gauche img {
        width: 100%;
        height: auto;
        max-height: calc(5 * var(--row-unit));
    }

    .images-projets-HAUT.collé-texte img {
        max-height: calc(4 * var(--row-unit));
    }

    .images-projets-HAUT.haut-5-lignes,
    .images-projets-HAUT.haut-5-lignes img,
    .images-projets-HAUT.collé-texte.haut-5-lignes img {
        max-height: calc(8 * var(--row-unit));
    }

    .images-projets-HAUT.haut-5-lignes {
        width: calc(6 / 8 * 100%);
    }

    .images-projets-HAUT.gauche {
        align-self: center;
    }

    .images-projets-HAUT.haut-contenu-droite {
        align-self: center;
        width: calc(7 / 8 * 100%);
        margin-inline-end: calc(100% / var(--grid-cols));
    }

    .images-projets-BAS {
        gap: 1rem;
        align-self: center;
        margin-inline: calc(100% / var(--grid-cols));
        height: auto;
        width: calc(7 / 8 * 100%);
        max-width: 100%;
    }

    .images-projets-BAS img {
        flex: 1 1 0;
        max-width: none;
    }

    .images-projets-BAS-centre {
        width: calc(7 / 8 * 100%);
        height: auto;
    }

    .images-projets-BAS-centre img {
        height: auto;
        max-height: calc(5 * var(--row-unit));
    }

    .images-projets-BAS-jv {
        margin-inline: 0;
        width: 100%;
    }

    .images-projets-BAS-jv .BAS-colonnes {
        grid-column: 1 / 4;
        grid-row: 1;
    }

    .images-projets-BAS-jv .tel-jv {
        grid-column: 4 / -1;
        grid-row: 2;
        margin-top: calc(-1 * var(--row-unit));
        max-height: calc(5 * var(--row-unit));
    }

    .images-projets-BAS-axecycle {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: -3rem;
    }

    .images-projets-BAS-axecycle .axecycle-stickers,
    .images-projets-BAS-axecycle .axecycle-tshirt,
    .images-projets-BAS-axecycle .axecycle-bidon {
        grid-column: unset;
        grid-row: unset;
        width: 100%;
        height: auto;
        max-height: calc(5 * var(--row-unit));
        margin-top: 0;
        justify-self: unset;
        object-position: center;
    }

    .images-projets-BAS-axecycle .axecycle-bidon {
        margin-top: calc(1 * var(--row-unit));
    }

    .espace {
        padding-left: calc(100% / var(--grid-cols));
    }

    .espacedouble {
        padding-left: calc(2 * 100% / var(--grid-cols));
    }
    .carrousel {
        width: 100%;
    }

    .carrousel-principal {
        width: calc(8 / 8 * 100%);
        gap: 0rem;
        height: auto;
    }

    .carrousel-nav {
        flex: 0 0 2rem;
        width: 2rem;
        font-size: 2rem;
    }

    .carrousel-nav:hover {
        font-variation-settings: var(--fv-bold);
    }

    .carrousel-image-grande img {
        height: auto;
        max-height: calc(4 * var(--row-unit));
    }

    .carrousel-miniatures {
        display: grid;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 0 var(--carrousel-thumb-gap);
        width: 100%;
        margin-inline: 0;
    }

    .carrousel-miniature {
        flex: unset;
        width: 100%;
    }

    .carrousel-miniature img {
        height: calc(0.4 * var(--row-unit));
    }

    main:is(:has(.images-projets-HAUT), :has(.carrousel)) .contact-info > div:nth-child(4) {
        grid-column: 2 / -1;
    }

    .projet-galerie {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .projet-galerie img {
        flex: 0 0 100%;
        width: auto;
        max-width: 100%;
    }

    .projet-galerie img.projet-image--demi {
        flex: 0 1 calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
}
