/* Styles spécifiques pour la page graphisme */

/* Fond d'écran spécifique pour la page graphisme */
body.graphisme-page {
    position: relative;
    background-color: #000; /* Couleur de secours au cas où l'image ne se charge pas */
}

/* Fond d'écran PC (par défaut pour les écrans de plus de 400px) */
body.graphisme-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./IMG/Fondpcgraphisme.webp'); /* Chemin vers votre image de fond */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1; /* En arrière-plan */
}

/* Force le menu hamburger à être visible en permanence, quelle que soit la taille de l'écran */
.graphisme-page .hamburger-menu {
    display: block !important; /* Forcer l'affichage du menu hamburger */
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 3100;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

/* Styles pour hamburger animé quand activé */
.graphisme-page .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 8px);
}

.graphisme-page .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.graphisme-page .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -9px);
}

/* Force la navigation à être cachée par défaut, quelle que soit la taille de l'écran */
.graphisme-page #main-nav {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    top: 60px; /* Espace pour le hamburger */
    position: fixed;
    width: 100%;
    padding: 10px 0;
}

/* Styles appliqués quand la navigation est active */
.graphisme-page #main-nav.active {
    opacity: 1;
    visibility: visible;
}

/* Force l'affichage vertical de la liste */
.graphisme-page #main-nav ul {
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
}

.graphisme-page #main-nav ul li {
    display: block;
    width: 100%;
}

.graphisme-page #main-nav ul li a {
    font-size: 20px;
    padding: 12px;
    text-align: center;
}

/* Styles pour la galerie d'images */
.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Passer de 3+ à 2 colonnes */
    grid-gap: 30px; /* Augmenter l'espace entre les projets */
    padding: 100px 40px 60px 40px; /* Augmenter les marges */
    max-width: 1400px; /* Augmenter la largeur max pour plus d'espace */
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 15px; /* Arrondir davantage les coins */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); /* Ombre plus prononcée */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    height: 350px; /* Fixer une hauteur plus grande */
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02); /* Effet de survol plus marqué */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.gallery img {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Titre du projet sur l'image */
.project-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    color: white;
    padding: 20px 15px 15px;
    font-family: "Bebas Neue", sans-serif;
    font-size: 24px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .project-title {
    opacity: 1;
    transform: translateY(0);
}

/* Styles pour le lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.project-name {
    color: white;
    font-family: "Bebas Neue", sans-serif;
    font-size: 24px;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
    letter-spacing: 1px;
}

.close-lightbox {
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-lightbox:hover {
    color: rgba(97, 0, 206, 0.8);
}

.lightbox-body {
    width: 100%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-image-container {
    max-width: 80%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.lightbox-nav {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(97, 0, 206, 0.6);
}

.prev-btn {
    left: 5%;
}

.next-btn {
    right: 5%;
}

.lightbox-nav svg {
    width: 30px;
    height: 30px;
}

.lightbox-footer {
    padding: 10px 0;
    color: white;
    font-family: "Bebas Neue", sans-serif;
    font-size: 18px;
    letter-spacing: 1px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive design */
@media (max-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr); /* Garder 2 colonnes sur écrans moyens */
        padding: 100px 30px 50px 30px;
    }
    
    .gallery-item {
        height: 300px; /* Réduire légèrement la hauteur sur écrans moyens */
    }
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr; /* Passer à 1 colonne sur tablettes */
        grid-gap: 25px;
        padding: 90px 25px 40px 25px;
    }
    
    .gallery-item {
        height: 280px;
    }
    
    .project-title {
        font-size: 18px;
        padding: 12px 8px 8px;
    }
    
    /* Ajustements du lightbox pour tablettes */
    .lightbox-image-container {
        max-width: 90%;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-nav svg {
        width: 25px;
        height: 25px;
    }
    
    .prev-btn {
        left: 2%;
    }
    
    .next-btn {
        right: 2%;
    }
    
    .project-name {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    /* Ajustements du lightbox pour petites tablettes */
    .lightbox-image-container {
        max-width: 95%;
    }
    
    .lightbox-nav {
        width: 35px;
        height: 35px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
    
    .project-name {
        font-size: 18px;
    }
    
    /* Le titre du projet est toujours visible sur mobile */
    .project-title {
        opacity: 1;
        transform: translateY(0);
        font-size: 16px;
        padding: 8px 5px 5px;
    }
}

@media (max-width: 400px) {
    /* Fond d'écran mobile */
    body.graphisme-page::before {
        background-image: url('./IMG/Fonmobilegraphisme.png'); /* Version mobile de l'image de fond */
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-gap: 15px;
        padding-top: 80px; /* Réduire légèrement l'espace supérieur sur mobile */
    }
    
    .hamburger-menu {
        top: 10px;
        right: 10px;
    }
    
    .hamburger-menu span {
        width: 25px;
        height: 2px;
        margin: 5px 0;
    }
    
    /* Ajustements du lightbox pour smartphones */
    .lightbox-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 15px 5px;
    }
    
    .project-name {
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    .close-lightbox {
        position: absolute;
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
    
    .lightbox-body {
        flex-direction: column;
    }
    
    .lightbox-nav {
        width: 30px;
        height: 30px;
        top: auto;
        bottom: -50px;
        transform: none;
    }
    
    .prev-btn {
        left: 30%;
    }
    
    .next-btn {
        right: 30%;
    }
    
    .lightbox-footer {
        margin-top: 60px; /* Espace pour les boutons de navigation maintenant en bas */
    }
}
        height: 35px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .lightbox-nav svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 400px) {
    /* Fond d'écran mobile */
    body::before {
        background-image: url('./IMG/Fonmobilegraphisme.png'); /* Ajustez le chemin selon votre structure */
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-gap: 15px;
        padding-top: 80px; /* Réduire légèrement l'espace supérieur sur mobile */
    }
    
    .hamburger-menu {
        top: 10px;
        right: 10px;
    }
    
    .hamburger-menu span {
        width: 25px;
        height: 2px;
        margin: 5px 0;
    }
    
    /* Ajustements du lightbox pour smartphones */
    .lightbox-body {
        flex-direction: column;
    }
    
    .lightbox-nav {
        width: 30px;
        height: 30px;
        top: auto;
        bottom: -50px;
        transform: none;
    }
    
    .prev-btn {
        left: 30%;
    }
    
    .next-btn {
        right: 30%;
    }
    
    .lightbox-footer {
        margin-top: 60px; /* Espace pour les boutons de navigation maintenant en bas */
    }
    
    .close-lightbox {
        font-size: 30px;
    }
}