@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

body {
    font-family: 'Figtree', sans-serif;
}

/*Ecriture*/
/*Ecriture*/
h1{
    font-weight: 700;
    font-style: Bold;
    font-size: 72px;
    line-height: 100%;
    letter-spacing: 0%;
    vertical-align: middle;
    margin: 10px;
}
h2{
    font-weight: 600;
    font-size: 48px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #9A0217;
    margin-top: 50px;
    margin-bottom: 50px;
}
h3{
    font-weight: 500;
    font-style: Medium;
    font-size: 36px;
    line-height: 100%;
    letter-spacing: 0%;
    color:#9A0217;
}
p{
    font-weight: 400;
    font-style: "Regular";
    font-size: 24px;
    line-height: 100%;
    letter-spacing: 0%;
    text-decoration-style: solid;
    text-decoration-thickness: 0%;
    text-decoration-skip-ink: auto;
}


/*Header*/
/*Navigation*/
nav {
    padding-left: 32px;
    padding-right: 32px;
}
nav ul {
    display: flex;
    justify-content: space-between;
}
nav ul li:not(:first-of-type):not(:last-of-type) {
    margin-top: 40px;
}
nav ul li a{
    font-weight: 700;
    font-style: Bold;
    font-size: 24px;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    color: #9A0217;
    text-decoration: none;
}
nav ul li:last-of-type{
    width: 140px;
    height: 48px;
    border-radius: 12px;
    background-color: #FDAB55;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/*Hero*/
#hero {
    background-image: url(/images/hero.jpg);
    max-width: 100%;
    height: 721px;
    background-size:cover;
    background-repeat: no-repeat;
    background-position: 40% 80%;
}
div#hero h1 {
    color: #FFFDFC;
    position: relative;
    top: 540px;
    padding-left: 36px;
}

/*Sections*/
/*Sections*/
section#sections {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0 48px;
    gap: 24px; /* espace entre les articles */
}
section#sections h2{
    grid-column: 1 / -1;
}
section#sections figure {
    width: 311px;
    height: 450px;
    border-radius: 12px;
}
section#sections figure img{
    width: 311px;
    height: auto;
}


/* Texte déroulant fermé - Version corrigée pour Safari */
.js-enSavoirPlus > span {
    overflow: hidden;
    display: block;
    width: 100%;
    max-height: 2px; /* hauteur fermée */
    /* CORRECTION SAFARI : Transition plus explicite */
    transition: max-height 0.3s ease-in-out;
    /* CORRECTION SAFARI : Forcer l'accélération matérielle */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* CORRECTION SAFARI : S'assurer que le contenu n'est pas coupé pendant l'animation */
    -webkit-overflow-scrolling: touch;
}

.js-enSavoirPlus a{
    color: black;
}

/* État quand un article est ouvert - Version corrigée pour Safari */
section#sections article.ouvert {
    grid-column: 1 / -1; /* prend toute la largeur */
    display: grid;
    grid-template-columns: 311px 1fr; /* figure fixe + contenu flexible */
    grid-template-rows: 450px 1fr 1fr;
    gap: 24px;
    align-items: center;
    padding: 24px 0;
    /* CORRECTION SAFARI : Transition plus stable */
    transition: all 0.3s ease-in-out;
    /* CORRECTION SAFARI : Forcer l'accélération matérielle */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    animation: ouvrirLargeur 0.4s ease-in-out forwards;
}

/* Figure à gauche */
section#sections article.ouvert figure {
    grid-column: 1; /* colonne gauche */
    grid-row: 1;
    width: 311px;
    height: 450px;
    border-radius: 12px;
}

/* Titre et contenu à droite */
section#sections article.ouvert h3{
    grid-column: 1/-1;
    grid-row: 2;
}
section#sections article.ouvert .js-enSavoirPlus {
    grid-column: 2; /* force à aller dans la colonne de droite */
}

/* Le texte déroulé occupe bien la largeur - Version corrigée pour Safari */
section#sections article.ouvert .js-enSavoirPlus > span {
    /* CORRECTION SAFARI : Quand ouvert, on retire toutes les contraintes */
    overflow: visible !important;
    width: 100%;
    columns: 2;
    column-gap: 32px;
    line-height: 1.2;
    /* CORRECTION SAFARI : Forcer le rendu du contenu */
    -webkit-column-break-inside: avoid;
    /* CORRECTION SAFARI : S'assurer que le contenu est bien visible */
    opacity: 1;
    visibility: visible;
    /* CORRECTION SAFARI : Hauteur libre quand ouvert */
    height: auto;
} 

section#sections article.ouvert .js-enSavoirPlus > span strong {
    font-weight: 500;
    font-style: Medium;
    font-size: 36px;
    /* CORRECTION SAFARI : Éviter la coupure des titres dans les colonnes */
    -webkit-column-break-inside: avoid;
    display: block;
    margin-top: 1em;
}

/* Lien "voir moins" aligné à droite */
section#sections article.ouvert .js-enSavoirPlus a {
    display: block;
    margin-top: 16px;
    text-align: right;
}

section#sections article.cache { 
    display: none; 
}


/* Animation pour l'ouverture - Version corrigée pour Safari */
@keyframes ouvrirLargeur {
    from {
        transform: scaleX(0.6);
        opacity: 0.5;
        /* CORRECTION SAFARI : Propriétés additionnelles pour stabilité */
        -webkit-transform: scaleX(0.6);
    }
    to {
        transform: scaleX(1);
        opacity: 1;
        -webkit-transform: scaleX(1);
    }
}


/* CORRECTION SAFARI : Classe pour forcer le rendu du contenu déplié */
.js-enSavoirPlus > span.derouler {
    /* Safari a parfois besoin d'une classe explicite pour bien rendre */
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* CORRECTION SAFARI : Forcer la hauteur automatique */
    height: auto !important;
    /* CORRECTION SAFARI : Permettre au contenu de prendre sa place */
    min-height: fit-content;
}

/* Couleurs par section */
section#sections article#castors figure {
    background-color: #A6C6E9;
}
section#sections article#castors img {
    border-radius: 12px;
}
section#sections article#louveteaux figure {
    background-color: #FFDF01;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
section#sections article#louveteaux img{
    padding-bottom: 60px;
}
section#sections article#scouts figure {
    background-color: #3C3287;
    display: flex;
    justify-content: center;
    align-items: center;
}
section#sections article#pionniers figure{
    background-color: #FFF1BD;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

/*Groupe*/
section#groupe {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
section#groupe h2 {
    padding: 0 48px;
    grid-column: 1 / -1;
}
section#groupe p {
    grid-column: 1 / -1;
    text-align: center;
    max-width: 800px; /* limite la largeur du texte */
    justify-self: center; /* centre le paragraphe dans la grille */
    margin-bottom: 24px;
}
section#groupe figure {
    width: 100%;
    height: auto;
}
section#groupe figure img {
    width: 100%;
    height: auto;
    object-fit: cover; /* optionnel pour garder l'aspect */
    display: block;    /* pour éviter un petit espace sous l'image */
}
section#groupe span#es a{
    color: black;
    text-decoration: none;
}
section#groupe span#es a:hover{
    text-decoration: underline;
}

/*Contact*/
section#contact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
section#contact h2 {
    grid-column: 1 / -1;
    padding: 0 48px;
}
section#contact figure {
    width: 100%;
    height: auto;
}
section#contact figure img {
    max-width: 800px;
    height: auto;
}
/*Formulaire*/
section#contact form {
    display: flex;
    flex-direction: column;
    margin-right: 32px;
    justify-content: center;
    margin-bottom: 48px;
}
section#contact form label {
    font-family: "Figtree";
    font-weight: 400;
    font-style: Regular;
    font-size: 24px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #9A0217;
    padding: 37px 0;
}
section#contact form select,
section#contact form input,
section#contact form textarea {
    border-radius: 12px;
    border: 1px solid #D9D9D9;
}
section#contact form select,
section#contact form textarea {
    width: 100%;
    height: 47px;
}
section#contact form .nom-prenom {
    display: flex;
    gap: 24px;
}
section#contact form .nom-prenom .champ {
    display: flex;
    flex-direction: column; 
    flex: 1; 
}
section#contact form input {
    height: 47px; 
    padding: 0 8px;
}
section#contact form button{
    width: 140px;
    height: 48px;
    border-radius: 12px;
    background-color: #FDAB55;
    color: #FFFDFC;
    font-family: "Figtree";
    font-weight: 700;
    font-style: Bold;
    font-size: 24px;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    vertical-align: middle;
    align-self: center;
    margin-top: 50px;
}

/*Footer*/
footer{
    background-color: #9A0217;
    padding: 12px 32px 12px 32px;
    display: flex;
    align-items: center;
}
footer ul {
    display: flex;
    gap: 24px;
    margin-left: auto;
    margin-right: 0;
}
footer span{
    color: #FFFDFC;
}
footer ul li a {
    color: #FFFDFC;
    font-size: 14px;
    text-decoration: none;
}
footer ul li:nth-of-type(-n+3) i {
    font-size: 26px;
}
footer ul li a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 1380px) {
    section#sections {
    gap: 16px; /* espace entre les articles */
    }
    /* Le texte déroulé occupe bien la largeur */
    section#sections article.ouvert .js-enSavoirPlus > span {
        max-height: none;
        overflow: visible;
        width: 100%;
        columns: 2;
        column-gap: 32px;
        line-height: 1.3;
        font-size: 20px; 
    } 
    section#sections article.ouvert .js-enSavoirPlus > span strong {
        font-weight: 500;
        font-style: Medium;
        font-size: 24px;
    }
    section#sections figure {
    width: 250px;
    height: 380px;
    border-radius: 12px;
    }
    section#sections figure img{
        width: 250px;
        height: auto;
    }
    section#contact figure img {
    max-width: 100%;
    height: auto;
    }
}

@media screen and (max-width: 1100px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    nav ul li:not(:first-of-type):not(:last-of-type) {
        position: absolute;
        left: -2000px;
    }
    div#hero h1{
        position: absolute;
        left: -2000px;
    }
    section#sections {
        grid-template-columns: 1fr; /* Une seule colonne */
    }
    section#sections h3 {
        margin: 10px 0 10px 0;
    }
     section#sections span{
        max-height: 100%;
        padding-bottom: 10px;
        line-height: 1.2;
    }
    section#sections span strong {
        font-weight: 700;
        font-style: Bold;
        font-size: 24px;
    }
    section#sections a{
        display: none;
    }
    /* Empêche un max-height inline de tronquer le texte en mobile */
    section#sections .js-enSavoirPlus > span {
        max-height: none !important;
        overflow: visible;
    }

    
    section#groupe {
        grid-template-columns: 1fr; /* une seule colonne */
    }
    section#groupe, section#contact {
        grid-template-columns: 1fr; /* Une seule colonne */
    }
    section#groupe p {
        text-align: left; /* texte aligné à gauche pour mobile */
        max-width: 100%;
        justify-self: start; /* aligne le p à gauche */
        margin-right: 16px;
        margin-left: 16px;
    }
    section#contact {
        margin-left: 10px;
        margin-right: 10px;
    }
    section#contact form .nom-prenom {
        flex-direction: column; /* Colonne pour les petits écrans */
    }
    section#contact form .nom-prenom .champ {
        width: 100%; /* Prend toute la largeur */
    }
    footer ul{
        flex-direction: column; /* Colonne pour les petits écrans */
        align-items: center; /* Centre les éléments */
    }
}

