
/*CSS DE STYLE*/

/*Défini des "variables" pour les utilisées dans le CSS*/
:root {
    --accent: #6b8e23;
    --fondAccent: #eef3e6;
    --text: #222;
    --bordure: #ddd;
}

body {
    color: var(--text);
}

.btnCache {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btnCache:hover {
    background-color: var(--accent);
    color: white;
}

footer {
    margin-top: 40px;
}

.contenuFooter a {
    color: var(--accent);
    text-decoration: none;
}

.contenuFooter a:hover {
    text-decoration: underline;
}


/*CSS DE PLACEMENT (et un peu de style pour ne pas déclarer deux fois*/
.contenuFooter {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    text-align: center;
}

/*Fait des rangées de 3 images, repeat est pour faire cela jusquà la fin*/
main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    justify-items: center;
}

article.oeuvre {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 5px;

    background-color: var(--fondAccent);
    border: 1px solid var(--bordure);
}


.titreMarmotte {
    font-size: 1.2rem;
    font-style: italic;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;

    color: var(--accent);
}


article img {
    display: block;
    width: 350px;
    height: 350px;
}

.texteCache {
    text-align: center;
    max-width: 350px;
}

@media (max-width: 1205px) {
    main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    article.oeuvre {
        display: grid;
        grid-template-areas: /*Défini les grid et où se place les éléments voulus*/
            "titre titre"
            "img texte"
            "btn btn";
        grid-template-columns: 120px 1fr;
        grid-template-rows: auto auto auto;
        gap: 10px;
        align-items: start;
    }

    .titreMarmotte {
        grid-area: titre;
        text-align: left;
        font-size: 1rem;
    }

    article img {
        grid-area: img;
        width: 120px;
        height: 120px;
    }

    .texteCache {
        grid-area: texte;
        text-align: left;
    }

    .btnCache {
        grid-area: btn;
        justify-self: start;
    }
}
