@media (min-width: 1000px) {
    body {
        background-image: url(../Images/Accueil/bg_accueil_compressed2_big.jpg);
        background-size: cover;
        background-attachment: fixed;
        overflow-x: hidden;
    }

    .mainContainer {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        padding-top: 100px;
        padding-bottom: 100px;
        width: 100%;
        height: 300px;
        margin-top: -50px;
        overflow-x: hidden;
    }

    .overlay {
        display: flex;
        position: absolute;
        height: 300px;
        width: 20%;
        justify-content: center;
        align-items: center;
        background-color: rgb(0, 0, 0);
        opacity: 0;
        border-radius: 5px;
        transition: opacity 400ms ease-in-out;
    }

    .grid1 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 50px;
        margin-top: -50px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid2 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 20px;
        margin-top: -20px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid3 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: -10px;
        margin-top: 10px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid4 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 20px;
        margin-top: -20px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid5 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 50px;
        margin-top: -50px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }

    .titre {
        grid-row: 2 / 3;
        font-weight: bold;
        text-decoration: none;
        text-align: center;
        border: 2px solid black;
        padding: 5px;
        background-color: rgb(255, 255, 255);
        width: 60%;
    }
}

@media (min-width: 501px) and (max-width: 1000px) {
    body {
        background-image: url(../Images/Accueil/bg_accueil_compressed2_medium.jpg);
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        overflow-x: hidden;
    }

    .mainContainer {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        padding-top: 100px;
        padding-bottom: 100px;
        height: 300px;
        margin-top: -50px;
    }

    .overlay {
        display: flex;
        position: absolute;
        height: 300px;
        width: 20%;
        justify-content: center;
        align-items: center;
        background-color: rgb(0, 0, 0);
        opacity: 0;
        border-radius: 5px;
        transition: opacity 400ms ease-in-out;
    }

    .grid1 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 50px;
        margin-top: -50px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid2 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 20px;
        margin-top: -20px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid3 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: -10px;
        margin-top: 10px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid4 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 20px;
        margin-top: -20px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }
    
    .grid5 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        margin-bottom: 50px;
        margin-top: -50px;
        box-shadow: 10px 10px 22px black;
        border-radius: 8px;
    }

    .titre {
        grid-row: 2 / 3;
        font-weight: bold;
        text-decoration: none;
        text-align: center;
        border: 2px solid black;
        padding: 5px;
        background-color: rgb(255, 255, 255);
        width: 100%;
    }
}

@media (max-width: 501px) {
    body {
        background-image: url(../Images/Accueil/bg_index_small3.jpg);
        overflow-x: hidden;
    }

    .mainContainer {
        display: grid;
        grid-template-columns: 1fr;
        padding-top: 50px;
        padding-bottom: 50px;
        height: 700px;
    }

    .overlay {
        display: flex;
        position: absolute;
        width: 40%;
    }

    .grid1 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        border-radius: 8px;
        justify-items: center;
        align-items:center;
    }
    
    .grid2 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        justify-items: center;
        align-items: center;
        border-radius: 8px;
    }
    
    .grid3 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        border-radius: 8px;
        justify-items: center;
        align-items:center;
    }
    
    .grid4 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        justify-items: center;
        align-items: center;
        border-radius: 8px;
    }
    
    .grid5 {
        display: grid;
        grid-template-rows: 1fr 1fr 1fr;
        justify-items: center;
        align-items: center;
        border-radius: 8px;
        overflow-x: hidden;
    }

    .titre {
        grid-row: 2 / 3;
        font-weight: bold;
        text-decoration: none;
        text-align: center;
        border: 2px solid black;
        padding: 5px;
        background-color: rgb(255, 255, 255);
        width: 100%;
    }
}

.imgGrid {
    grid-row: 1 / 4;
    border-radius: 8px;
    background-image: var(--image);
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

.overlay:hover{
    opacity: 0.7;
    border-radius: 5px;
}

a {
    text-decoration: none;
    color: black;
}