/**  GENERAL  **/
:root {
    --orange : #ffaf37;
    --gris: #505050;
}
img,
video {
    height: auto;
    max-width: 100%;
}
body {
    background-image: url(resource/bg.png);
    background-repeat: no-repeat;
    background-size: cover;
    font-family: 'Poppins', sans-serif;
    color: white;
}
.center{
    text-align: center;
}
/**  HEADER  **/
header {
    display: flex;
    align-content: center;
    justify-content: space-between;
    align-items: flex-start;
}
header img#logo{
    width: 20rem;
    margin-top: 1rem;
    margin-left: 1rem;
}
header div{
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    font-weight: 600;
    font-size: 1.5rem;
    margin-top: 20px;
    margin-right: 50px;
}
header div:hover{
    cursor: pointer;
}
header div img{
    width: 2rem;
    margin-right: 8px;
}
header div a{
    display: contents;
    color: var(--orange);
    text-decoration: none;
}

/**     MAIN     **/
main{
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
    align-items: center;
}
h1{
    font-size: 3rem;
    width: 60vw;
    text-align: center;
    margin-top: -100px;
    margin-bottom: -60px;
    font-weight: 500;
}

/**     CONTENT     **/
aside{
    max-width: 25%;
    min-width: 25%;
}
article{
    max-width: 45%;
    min-width: 45%;
    padding-top: 10rem;
}
aside .content, article div.pannel {
    background-color: var(--gris);
    margin: 20px;
    font-size: 1.3rem;
    font-weight: 200;
}
aside h2, article div h2 {
    color: var(--orange);
    font-size: 2rem;
    text-align: center;
    font-weight: 400;
    white-space: nowrap;
}

/* Style spécifique pour le titre "Nous sommes à votre écoute" */
article > div:nth-child(3) > h2 {
    white-space: normal; /* Permet au texte de s'envelopper */
    word-wrap: break-word; /* Assure que les mots longs peuvent être coupés */
    hyphens: auto; /* Ajoute des tirets si nécessaire */
}

/** ASIDE(S) **/
aside div.content{
    padding-top: 2rem;
    padding-left: 2rem;
    padding-right: 1.5rem;
    height: 90%;
}
aside img{
    width: 20rem;
    border-radius: 1rem;
}
.border-y-round{
    border-radius: 50% / 20%;
}
.border-x-round{
    border-radius: 15% / 50%;
}

.rightAside div.center{
    margin-top: 5rem;
}

/* ARTICLE CENTER */
a button.ctaBtn{
    color: #000000;
    padding: 20px 80px;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--orange);
    border: 1px solid var(--orange);
    border-radius: 2rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0px 1px 7px rgba(0, 0, 0, 0.1), 0px 4px 5px -2px rgba(0, 0, 0, 0.12), 0px 10px 15px -5px rgba(0, 0, 0, 0.2);
}
a button.ctaBtn:hover{
    background: var(--gris);
    border: 1px solid var(--gris);
    color: #ffffff;
    box-shadow: 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 11px 15px rgba(0, 0, 0, 0.2);
}

article>div:nth-child(2){
    margin-top: 5rem;
    padding: 2rem;
}
article>div:nth-child(3){
    margin-top: 1rem;
    padding: 2rem;
}
article div h2{
    margin-top: -20px;
    margin-bottom: -20px;
}
.flex{
    display: flex;
    flex-direction: row !important;
    width: 95vw;
    align-content: center;
    justify-content: center;
    align-items: stretch;
}

article footer a{
    text-decoration: none;
}
article footer img{
    width:2.5rem;
    margin-left:1rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    /* Header adjustments */
    header {
        flex-direction: column;
        align-items: center;
        margin-bottom: 2rem; /* Ajoute de l'espace sous le header */
    }
    
    header img#logo {
        width: 80%;
        margin: 1rem auto 0;
    }
    
    header div {
        margin: 1rem auto 1.5rem; /* Augmente la marge en bas */
    }
    
    /* Title adjustments */
    h1 {
        font-size: 1.8rem;
        width: 90vw;
        margin-top: 2rem; /* Augmenté pour éviter la superposition */
        margin-bottom: 2rem; /* Augmenté pour plus d'espace */
        position: relative; /* Assure que le titre respecte le flux normal */
    }
    
    /* Restructure the flex layout to column */
    .flex {
        flex-direction: column !important;
        width: 100%;
    }
    
    /* Full width for all sections */
    aside, article {
        max-width: 100%;
        min-width: 100%;
        padding-top: 0;
    }
    
    /* Reorder sections to match the requested order */
    article {
        order: 1;
    }
    
    article > div:nth-child(2) { /* Zone signalétique */
        order: 2;
        margin-top: 1rem;
    }
    
    article > div:nth-child(3) { /* Zone nous sommes à votre écoute */
        order: 3;
    }
    
    .leftAside { /* Zone Equipe Technique */
        order: 4;
    }
    
    .rightAside { /* Zone Nos outils */
        order: 5;
    }
    
    /* Adjust borders for better mobile display */
    .border-y-round, .border-x-round {
        border-radius: 20px;
    }
    
    /* Adjust content padding */
    aside div.content, article div.pannel {
        padding: 1.5rem;
        margin: 10px;
    }
    
    /* Fix button size */
    a button.ctaBtn {
        padding: 15px 40px;
        font-size: 1.2rem;
        width: 80%;
    }
    
    /* Text size adjustments */
    aside h2, article div h2 {
        font-size: 1.5rem;
        margin: 10px 0;
        white-space: normal; /* Permet à tous les titres de s'envelopper en mode mobile */
    }
    
    aside .content, article div.pannel {
        font-size: 1rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.4rem;
        margin-top: 2.5rem; /* Encore plus d'espace pour les très petits écrans */
    }
    
    header img#logo {
        width: 90%;
    }
    
    header div {
        font-size: 1.2rem;
    }
    
    aside h2, article div h2 {
        font-size: 1.3rem;
    }
}

/* 1280x1024 */
@media (max-width:1300px)  {
    .leftAside h2{
        white-space: break-spaces;
    }
    .border-y-round{
        border-radius: 50% / 10%;
    }
    article > div:nth-child(3) > h2{
        margin-top: 5px;
        font-size: 1.8rem;
    }
    h1{
        margin-top: -50px;
    }
}