/* styles/projectStyle.css - VERSION FUSIONNÉE (Index + Détail) */

/* =========================================
   PARTIE 1 : PAGE D'ACCUEIL (INDEX)
   Design "Mission Cards"
   ========================================= */

/* La Grille de l'index */
#section-projet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

/* La Carte (Conteneur) */
.mission-card {
    background-color: #000;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    height: 450px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.4s ease;
    cursor: pointer;
}

.mission-card:hover {
    border-color: #fff;
}

/* Zone Image */
.card-image {
    height: 220px;
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid #333;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2) brightness(0.8);
    transition: transform 0.6s ease, filter 0.4s ease;
}

.mission-card:hover .card-image img {
    transform: scale(1.05);
    filter: grayscale(100%) contrast(1) brightness(1.1);
}

/* Badge Statut */
.mission-status {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #000;
    color: #fff;
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 4px 10px;
    border: 1px solid #fff;
    letter-spacing: 1px;
    z-index: 2;
}

/* Zone Contenu */
.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.mission-id {
    font-family: monospace;
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: block;
}

.mission-title {
    font-size: 1.8rem;
    font-family: 'Times New Roman', Times, serif;
    text-transform: uppercase;
    margin-bottom: 15px;
    line-height: 1;
}

.mission-desc {
    font-size: 0.9rem;
    color: #aaa;
    font-style: italic;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.arrow-icon {
    transition: transform 0.3s ease;
}

.mission-card:hover .arrow-icon {
    transform: translateX(10px);
}


/* =========================================
   PARTIE 2 : PAGE PROJET (DÉTAIL)
   Design "Tableau de bord technique"
   ========================================= */

/* Grille principale (Layout 2 colonnes) */
.project-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 20px;
    min-height: 60vh;
}

/* --- COLONNE GAUCHE (VISU 3D) --- */
#model-viewer-container {
    width: 100%;
    height: 400px; /* Hauteur fixe réduite pour l'élégance */
    background-color: #000;
    border: 1px solid #333;
    position: relative;
    margin-bottom: 40px;
    overflow: hidden;
}

#loading-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-style: italic;
}

/* --- COLONNE DROITE (TIMELINE) --- */
.sidebar-column {
    border-left: 1px solid #333;
    padding-left: 30px;
    display: flex;
    flex-direction: column;
}

#project-timeline {
    flex-grow: 1;
}

#project-timeline ul {
    border-left: 1px solid #444;
    padding-left: 0;
    margin-left: 5px;
    list-style: none;
}

#project-timeline li {
    margin-bottom: 30px;
    padding-left: 25px;
    position: relative;
}

#project-timeline li span {
    position: absolute;
    left: -5px;
    top: 6px;
    width: 9px;
    height: 9px;
    background: #000;
    border: 1px solid #fff;
    border-radius: 50%;
}

#project-timeline .date {
    font-size: 0.8rem;
    color: #888;
    font-family: monospace;
    display: block;
    margin-bottom: 5px;
}

/* --- RESPONSIVE GLOBAL (Optimisé) --- */
@media (max-width: 768px) {
    
    /* 1. La Grille : On réduit les écarts */
    #section-projet {
        grid-template-columns: 1fr; /* Une seule colonne */
        gap: 25px; /* On réduit l'écart de 40px à 25px */
        padding: 0 10px; /* Une petite marge latérale de sécurité */
    }

    /* 2. La Carte : Plus souple */
    .mission-card {
        height: auto; /* CRUCIAL : La hauteur s'adapte au contenu ! */
        min-height: auto; /* On écrase toute contrainte */
    }

    /* 3. L'image de la carte */
    .card-image {
        height: 200px; /* Un peu moins haut pour laisser voir le titre */
    }

    /* 4. Le contenu texte */
    .card-content {
        padding: 20px; /* Moins de padding pour gagner de la place */
    }

    .mission-title {
        font-size: 1.5rem; /* Titre un peu plus petit pour éviter qu'il prenne 3 lignes */
    }

    .mission-desc {
        /* On augmente le nombre de lignes visibles car on a de la place en hauteur (auto) */
        -webkit-line-clamp: 5; 
    }

    /* 5. La Page Projet (Détail) - On empile tout */
    .project-grid-layout {
        grid-template-columns: 1fr; /* Colonne unique */
        gap: 30px;
    }

    .sidebar-column {
        border-left: none;
        border-top: 1px solid #333; /* On sépare par le haut */
        padding-left: 0;
        padding-top: 30px;
    }

    #model-viewer-container {
        height: 300px; /* Viewer 3D moins haut sur mobile */
    }
}