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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* =========================
   BACKGROUND
========================= */
body {
    background-image: url("background.jpg");
    background-color: rgb(211, 209, 209);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* =========================
   CONTAINER
========================= */
.gallery-container {
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}


/* =========================
   HEADER (CORRIGÉ)
========================= */
.gallery-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;

    height: 160px;        /* hauteur FIXE */
    flex-shrink: 0;       /* empêche compression */
}


/* Bouton accueil */
.home-button {
    position: absolute;
    left: 20px;
    top: 30%;
    transform: translateY(-50%);
    
}

/* Titre */
.title-box {
    width: 75%;
    max-width: 600px;
    min-width: 280px;       /* empêche le rognage */
    height: auto;
    
}

.title-box img {
    width: 50%;
    height: auto;           /* IMPORTANT */
    display: block;
    border-radius: 12px;
}

/* =========================
   CARROUSEL
========================= */
.carousel {
    height: calc(100vh - 220px);
    /* 160px header + 40px padding + marge sécurité */

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;

    flex-shrink: 0;
}


.carousel-window {
    width: 70%;
    height: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(0,0,0,0.35);
}


.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease;
}

.carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* garde proportions */
    flex-shrink: 0;
}


.nav {
    background: transparent;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
}

/* Image du bouton */
.nav img {
    width: 70px;     /* taille des flèches */
    height: auto;

    transition: transform 0.2s ease;
}

/* Effet hover */
.nav img:hover {
    transform: scale(1.1);
}

.nav:focus {
    outline: none;
}

/* =========================
   LIGHTBOX
========================= */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.lightbox.show {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {

    .gallery-header {
        height: 120px;
    }

    .carousel {
        height: calc(100vh - 180px);
        flex-direction: column;
    }

    .carousel-window {
        width: 100%;
        height: 100%;
    }

    .title-box {
        width: 80%;
    }
}