* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Arial", sans-serif;
    color: #4b2c2a;
    line-height: 1.5;
    background-image: url("images/BackGround4.jpg");
    margin: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100%;
}

/* conteneur centré */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --------- HEADER --------- */
.topbar {
    background-color: antiquewhite;
    border-bottom: 1px solid #f1c1a9;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.logo img {
    height: 75px;
    /* adapte à ton logo */
}

.main-nav {
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7e4b3a;
    position: relative;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: #c07b5a;
    transition: width 0.3s;
}

.main-nav a:hover::after {
    width: 100%;
}

.nav-socials a {
    margin-left: 12px;
    color: #7e4b3a;
    font-size: 1.1rem;
}

/* --- Bouton burger --- */
.burger {
    display: none;
    /* caché par défaut (desktop) */
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.burger span {
    display: block;
    height: 3px;
    border-radius: 3px;
    background-color: #7e4b3a;
    /* adapte à ta couleur de texte */
}

/* important pour placer le menu déroulant */
.nav-container {
    position: relative;
}

/* --- VERSION MOBILE --- */
@media (max-width: 768px) {

    /* on masque les icônes réseaux en mobile (optionnel) */
    .nav-socials {
        display: none;
    }

    /* le menu devient un bloc déroulant */
    .main-nav {
        position: absolute;
        top: 60px;
        /* en dessous du header */
        right: 0;
        left: 0;
        background-color: antiquewhite;
        display: none;
        /* caché par défaut */
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 15px 0;
        border-top: 1px solid #e2b49a;
    }

    .main-nav a {
        padding: 5px 0;
    }

    /* quand on ouvre le menu avec JS */
    .main-nav.open {
        display: flex;
    }

    /* on affiche le burger en mobile */
    .burger {
        display: flex;
        margin-left: auto;
    }
}

/* Cards */
.gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 40px 20px;
}

.card-stack {
    position: relative;
    width: 260px;
    max-width: 80vw;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    margin: 20px;
}

.card {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition:
        transform 0.4s ease,
        opacity 0.4s ease,
        box-shadow 0.4s ease;
}

.card-img {
    width: 100%;
    height: 60%;
    /* hauteur de la partie image, à ajuster */
    object-fit: cover;
    /* recadre proprement */
    border-radius: 24px 24px 0 0;
}

.card-caption {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #7a2a26;
}

/* Texte de la card */
.card-front h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card-front p {
    font-size: 0.95rem;
    color: #555;
}

.card-back {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

.card-back-1 {
    background: blanchedalmond;
}

.card-back-2 {
    background-color: #af4c0f;
}

.card-stack:hover .card-front {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.25);
}

.card-stack:hover .card-back-1 {
    opacity: 1;
    transform: rotate(-10deg) translate(-25px, 25px);
}

.card-stack:hover .card-back-2 {
    opacity: 1;
    transform: rotate(10deg) translate(25px, 25px);
}

.card-stack:active .card-front {
    transform: translateY(-6px);
}

.card-stack:active .card-back-1,
.card-stack:active .card-back-2 {
    opacity: 1;
}

@media (max-width: 768px) {
    .gallery {
        flex-direction: column;
        align-items: center;
    }

    .card-stack {
        width: 90%;
        /* prend presque toute la largeur du téléphone */
    }
}

/* --------- FOOTER --------- */

footer {
    position: relative;
}

.site-footer {
    background-color: antiquewhite;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2b49a;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 20px;
}

.footer-col h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}


.footer-col p,
.footer-col a {
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    color: #7a2a26;
    display: block;
    margin-bottom: 4px;
}

.footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    /* fixe la hauteur du bloc */
}

.footer-logo img {
    max-width: 150px;
    /* taille max du logo */
    height: auto;
}

.footer-socials a {
    display: inline-block;
    font-size: 1.5rem;
    margin-right: 10px;
}


.footer-col a:hover {
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #e2b49a;
    text-align: center;
    padding: 10px 0;
    font-size: 0.85rem;
}

/* Bouton scroll back top */
#btnTop {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #af4c0f;
    color: blanchedalmond;
    font-size: 24px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;

    position: fixed;
    /* flottant sur la page */
    bottom: 20px;
    right: 20px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

#btnTop.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Effet hover */
#btnTop:hover {
    background-color: blanchedalmond;
    color: #af4c0f;
    transform: translateY(-3px);
}

/* Quand il doit "rentrer" dans le footer */
#btnTop.in-footer {
    position: absolute;
    /* maintenant il se positionne dans le footer */
    bottom: 20px;
    right: 20px;
    box-shadow: none;
    /* optionnel : plus d’ombre dans le footer */
}

/* Quand le bouton "rentre" dans le footer */
.back-to-top.in-footer {
    position: static;
    /* il redevient dans le flux du footer */
    margin-left: auto;
    /* collé à droite de la colonne */
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
}

/* -------- RESPONSIVE -------- */

@media (max-width: 900px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content,
    .contest-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-image img {
        margin: 20px auto 0;
    }

    .social-card {
        padding: 30px 20px;
    }
}