/* ============================================================
   1. RESET & BASE
   ============================================================ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Garde la mise en page fixe sur PC */
    background-color: #000;
    color: #fff;
    font-family: sans-serif;
}

/* ============================================================
   2. HEADER (Logo gauche, Nav centrée)
   ============================================================ */
header {
    height: 70px;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Force le centre parfait pour la nav */
    align-items: center;
    padding: 0 50px;
    position: fixed;
    top: 0; 
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.logo { justify-self: start; }
.logo img { height: 70px; width: auto; display: block; }

nav { justify-self: center; display: flex; gap: 15px; }
nav a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 15px;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 2px;
}

nav a:hover {
    background-color: #fff; 
}

header::after { content: ""; } /* Équilibre la grille du header */

/* ============================================================
   3. LAYOUT DU CONTENU (ADAPTATIF PC)
   ============================================================ */
.project-page-fixed {
    padding-top: 90px; /* Espace pour le header */
    height: 100%;
    box-sizing: border-box;
}

.viewport-container {
    height: calc(100vh - 110px); /* Calcule pile l'espace restant sous le header */
    width: 94%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribue l'espace verticalement */
}

/* TITRE AFFINÉ AVEC BARRE BLANCHE */
.project-title-minimal {
    font-size: 1.8rem;
    margin: 0 0 20px 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-left: 3px solid #fff;
    padding-left: 15px;
    flex-shrink: 0;
}

/* GRILLE PRÉCISE (Prend tout l'espace disponible restant) */
.precise-grid {
    display: grid;
    grid-template-columns: 18% 1fr 33%; 
    gap: 40px;
    flex: 1; /* Force la grille à s'étirer au maximum de l'écran */
    min-height: 0; /* Important pour que le overflow interne fonctionne */
    align-items: stretch; /* Les blocs s'étirent sur toute la hauteur de la grille */
    margin-bottom: 20px;
}

/* CONTENEURS INTERNES DE LA GRILLE */
.grid-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.label {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #444;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    flex-shrink: 0;
}

/* STATS (COLONNE GAUCHE) */
.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 2.2;
    overflow-y: auto; /* Sécurité si la liste est longue sur petit écran PC */
}

/* DESCRIPTION (COLONNE CENTRE) */
.glass-box {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px;
    font-family: 'Courier New', monospace;
    font-size: 13.5px;
    line-height: 1.8;
    color: #bbb;
    flex: 1; /* Prend 100% de la hauteur restante du conteneur */
    overflow-y: auto; /* Scroll interne si le texte est long */
}

/* ============================================================
   GALERIE - COMPORTEMENTS PC (ADAPTATION AUTOMATIQUE SANS SCROLL)
   ============================================================ */

/* Base commune pour tous les projets horizontaux (Néon, Reflets...) */
.carousel-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px;
    flex: 1;
    scrollbar-width: none;
}

.carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-wrapper img {
    height: 100%;
    width: auto;
    object-fit: cover;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.carousel-wrapper img:hover {
    transform: scale(1.02);
}

/* ============================================================
   GRILLE SANS SCROLL : ADAPTE LA TAILLE SELON LE NOMBRE D'IMAGES
   ============================================================ */
.carousel-wrapper.gallery-vertical {
    display: flex !important;
    flex-direction: column !important; /* Aligne les lignes verticalement */
    gap: 10px !important;
    height: 100% !important;
    max-height: calc(100vh - 220px) !important; /* Verrouille la taille max à l'écran */
    overflow: hidden !important; /* AUCUN SCROLL INTERNE */
}

/* Crée des rangées flex pour loger les images de façon équitable */
.carousel-wrapper.gallery-vertical img {
    width: 100% !important;
    height: auto !important;
    flex: 1 1 auto !important; /* Les images s'étirent ou rétrécissent pour TOUTES rentrer */
    min-height: 0 !important;   /* Empêche les images de pousser le conteneur */
    object-fit: cover !important;
    display: block !important;
}
/* ============================================================
   4. LIGHTBOX (MODALE)
   ============================================================ */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s ease-out;
    z-index: 10000;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 50px;
    font-size: 60px;
    font-weight: 100;
    cursor: pointer;
    transition: 0.3s ease;
    z-index: 10001;
    user-select: none;
}

.close-lightbox:hover {
    transform: rotate(90deg);
    text-shadow: -2px 0 cyan, 2px 0 magenta;
}

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.95); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ============================================================
   5. COULEURS ACCENTS
   ============================================================ */
.white-text { color: #ffffff; }
.cyan-text { color: #00ffff; }
.yellow-text { color: #ffff00; }
.magenta-text { color: #ff00ff; }
.green-text { color: #00ff00; }

/* ============================================================
   6. RESPONSIVE MOBILE & TABLETTE (Écrans inférieurs à 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    html, body {
        overflow: auto; /* Permet le scroll vertical global sur smartphone */
        height: auto;
    }

    header {
        padding: 0 20px;
    }

    .project-page-fixed {
        padding-top: 90px;
        height: auto;
    }

    .viewport-container {
        height: auto;
        width: 90%;
    }

    .precise-grid {
        display: flex;
        flex-direction: column; /* Aligne les blocs verticalement */
        gap: 35px;
        height: auto;
        margin-bottom: 50px;
    }

    .grid-col {
        height: auto;
    }

    .glass-box {
        height: auto;
        max-height: 300px; /* Évite un bloc texte infini */
        overflow-y: auto;
    }

    .carousel-wrapper {
        height: 250px; /* Hauteur fixe idéale pour le défilement horizontal sur mobile */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Scroll fluide au doigt sur iOS */
    }

    .carousel-wrapper img {
        height: 100%;
    }
    
    .close-lightbox {
        top: 20px;
        right: 20px;
        font-size: 45px;
    }
}
/* Style pour le PDF intégré dans le Brief */
.brief-pdf {
    width: 100%;
    height: 500px; /* Hauteur confortable pour lire le PDF dans la boîte */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #111;
    margin-top: 20px; /* Espace après ton texte */
    display: block;
}