  
:root { --currentColor: var(--vert); }

/* NAV RETOUR ---------------------------------------------- */
#retour{
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--hauteurMenu);
    padding: 0 var(--padding);
    border-bottom: 1px solid;
    background-color: var(--lightColor);
    z-index: 10;
} 
    #retour a {
        border-bottom: none;
        font-weight: var(--fw-normal);
    }
        #retour a[href="#top"]{
            position: fixed;
            top: 0.691rem; 
            right: var(--padding);
        }
            #retour a span {
                display: none;
            }

/* INTRO ------------------------------- */ 
#intro {
    background-color: var(--blanc);
    padding: 0;
}
.intro-titre > .column:first-of-type {
   margin-bottom: var(--padding);  
}
        /* BLOC 1 : Titre ----------------------- */
        .intro-titre {
            display: flex;
            flex-direction: column;
            padding: 1rem var(--padding) var(--padding);

        }

                .titre span{
                    display: inline-block;
                    font-weight: var(--fw-normal);
                    font-size: var(--fs-xl);
                    margin: 0 .5rem 0 0;
                    width: 100%;
                }
                .titre span:after {
                    content: "";
                    white-space: pre;
                }
            .intro-titre h1 {
                padding-bottom: 0;
            }

            .intro-titre .categories-cloud {
                display: inline-flex;
                height: fit-content;
                width: 100%;
                flex-wrap: wrap;
            }
            /* Catégories - tags */
                span.categories,
                span.tag {
                    font-size: var(--fs-xs);
                    font-weight: var(--fw-normal);
                    border-radius: 1rem;
                    padding: .25rem .5rem .3rem .5rem;
                    margin: .25rem .5rem .25rem 0;
                    text-transform: lowercase;
                }
                span.categories {
                    color: var(--blanc);
                    border: 1px solid transparent;
                    background-color: var(--currentColor);
                }
                span.tag {
                    color: var(--currentColor);
                    border: 1px solid var(--currentColor);
                    background-color: transparent;
                }
                
        /* BLOC 2 : Grille détails ---------------------- */
        #intro > .grid:not(:first-of-type) {
            margin-top: auto; /* Aligne l'élément en bas*/
            border-top: none;
            padding: 0 var(--padding) var(--padding);
        }
            .details, 
            .description {
                margin: 0;

            }
            /* Bloc 2 : Colonne 1 Liste  */
            .details {
                grid-column: 1/-1;
                grid-row: 2 / 3;
                border-top: 1px solid;
                color:var(--currentColor);
                background-color: var(--blanc);
            }
                .details ul {
                    list-style: none;
                }
                    .details li {
                        padding: .5rem 0;
                        margin: 0;
                    }
                    .details li:not(:last-of-type) {
                        border-bottom: 1px solid;
                    }
                        .details li p, .details li.projet-link a {
                            font-size: var(--fs-s);
                            margin-bottom: 0;
                        }
                        .details li .equipe-liste span:after {
                            content:",";
                            white-space: pre;
                        }
                        .details li .equipe-liste span:nth-last-of-type(2):after {
                            content:" et";
                        }
                        .details li .equipe-liste span:last-of-type:after {
                            content:"";
                        }
                        .details li.projet-link a:before {
                            content: "→ ";
                            white-space: pre;
                        }
            /* Bloc 2 : Colonne 2 Résumé  */
            .description {
                grid-column: 1/-1;
                grid-row: 1 / 2;
                padding-top: .5rem;
            } 
                .description p {
                    margin: 0 0 1rem 0;
                }

/* SECTION BASE ------------------------------- */ 
main section, 
#contenu_principal {
    width: 100%;
    padding: 0;
}
section > .layout:first-child,
#contenu_principal{
    border-top:none;
}
/* SECTION LAYOUTS ------------------------------- */ 
main #contenu_principal {
    min-height: fit-content;
}
    /* BLOC Layout */
    main #contenu_principal div.layout {
        padding: var(--padding);
    }


@media screen and (min-width: 1024px) {
/* Masquer MENU au scroll si SOUS-MENU Inactif et Page Projet -------------------- */
#navbar {
    position: sticky;
    top:calc(-1*(var(--hauteurMenu) + var(--bordermenu)));
}

    #navbar #menu-principal{
        position: relative;
    }     
/* MAIN ---------------------------------------------- */
#navbar + main, 
#navbar + div.scroller main {
    padding-top: 0;
}

/* NAV RETOUR ---------------------------------------------- */
#retour {
    grid-column: 1/-1;
}
#retour a span {
    display: contents;
}

/* SECTION INTRO ---------------------------------------------- */
    
.conteneur-titre {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 0;
    min-height: 0;
}
.intro-titre {
    position: relative;
    flex: 1;
    padding: 1rem var(--padding) var(--padding);
        display: grid;
        grid-template-columns: repeat(12, 1fr); /* Définir une grille de 12 colonnes */
        gap: var(--padding);
}
.intro-titre > .column {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    min-height: -webkit-min-content; /* Safari */
    min-height: 100%;
    min-height: 0;
}
.intro-titre > .column:first-of-type {
    margin-bottom: 0;  
 }
.intro-titre > .column:nth-of-type(2) {
    position: relative;
    min-height: calc(100% - 1rem );
    margin-top: 1rem;

}

.intro-titre > .column:nth-of-type(2) img {
    object-fit: scale-down;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--currentColor);
}
/* Bloc 1 : titree  */
    .titre {
        display: inline-flex;
        flex-wrap: nowrap;
    }
        .titre span {
            font-size: var(--t3);
            margin: 0 .15rem .2em 0;
            width: fit-content;
            vertical-align: middle;
        }
        .titre span:after {
            content: " →";
            white-space: pre;
        }

    /* BLOC 2 : Grille  */
    #intro > .grid:not(:first-of-type) {
        border-top: var(--border);
        padding-bottom: var(--padding);
    }

        /* Bloc 2 : Colonne 1 Liste  */
        .details {
            grid-column: span 6;
            grid-row: 1 / 2;
            border-top: none;
        }
            .details li {
                padding: .5rem 0;
            }
            .details li:last-of-type {
                padding-bottom: 0;
            }
            .details li.projet-link a:before {
                content: "";
            }
            .details li.projet-link a:hover:before {
                content: "→ ";
                white-space: pre;
            }
        /* Bloc 2 : Colonne 2 Résumé  */
        .description {
            grid-column: span 6;
            grid-row: 1 / 2;
            padding-top: 0;
        }      
            .description p {
                margin: .6rem 0 0 0;
                font-size: var(--fs-m);
            }

}

/* Pour Safari (ajuster les valeurs si nécessaire) */
@media screen and (min-width: 1024px) and (-webkit-min-device-pixel-ratio: 0) {
    .intro-titre > .column {
        min-height: 1px; /* Forcer la hauteur minimale */
    }
    
    .intro-titre > .column:nth-of-type(2) {
        min-height: 1px; /* Forcer la hauteur minimale */
    }
}
