/* ========================================
   PROJECTS CSS - VERSION FINALE HARMONISÉE
   ======================================== */

body {
    transition: background-color 0.8s ease, color 0.5s ease;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

nav { 
    z-index: 1000; 
    position: relative; 
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 40px 40px 40px; 
    box-sizing: border-box;
}

/* --- LISTE DES PROJETS (projects.html) --- */
.projects-grid {
    display: flex;
    flex-direction: column;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.project-card {
    display: grid;
    grid-template-columns: 200px 1fr 180px; 
    gap: 3rem; 
    align-items: center;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    transition: 0.3s;
}

.project-card:hover { 
    background-color: rgba(255, 255, 255, 0.05); 
}

.project-image { 
    width: 200px; 
    height: 120px; 
    overflow: hidden; 
}

/* Image en noir et blanc par défaut sur la grille */
.project-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    filter: grayscale(100%); /* */
    transition: filter 0.5s ease, transform 0.5s ease; /* Transition fluide */
}

/* Effet au survol de la CARTE : l'image retrouve sa couleur */
.project-card:hover .project-image img { 
    filter: grayscale(0%); /* */
    transform: scale(1.05); 
}

.project-card .tech-tags {
    margin: 10px 0;
    gap: 5px;
}

.project-card .tech-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    opacity: 0.8;
}

.project-content h3 { 
    font-size: 1.8rem; 
    margin: 0; 
    color: var(--text-main); 
    text-transform: uppercase; 
}

.project-content p { 
    margin: 10px 0; 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    line-height: 1.4; 
}

.project-card .btn {
    justify-self: end;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 0.75rem;
    color: var(--text-main);
    transition: 0.3s;
}

/* --- DÉTAILS DU PROJET (Pages individuelles) --- */
.project-detail { 
    opacity: 0; 
    animation: fadeIn 0.8s ease forwards; 
}

.detail-header { 
    margin-bottom: 3rem; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 1.5rem; 
}

.detail-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    color: var(--text-main);
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px; /* */
}

/* Écart entre "À propos du projet" et les tags */
.detail-section h3 {
    margin-bottom: 40px; /* */
    color: var(--text-main);
    font-size: 1.4rem;
}

.detail-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
    align-items: start;
}

.tech-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
    margin-bottom: 25px; 
}

.tech-tag { 
    border: 1px solid var(--border-color); 
    padding: 8px 16px; 
    font-size: 0.85rem; 
    color: var(--text-main); 
    background: rgba(255, 255, 255, 0.03);
    text-transform: uppercase;
    font-weight: 600;
}

.detail-description { 
    color: var(--text-muted); 
    line-height: 1.8; 
    text-align: justify; 
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
}

.detail-description:last-of-type {
    margin-bottom: 0;
}

/* Format vidéo 16/9 préservé */
.media-gallery iframe {
    width: 100%;
    aspect-ratio: 16 / 9; /* */
    height: auto;
    display: block;
    border: 1px solid var(--border-color);
}

.media-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border-color);
}

/* --- MODÈLE 3D --- */
model-viewer {
    width: 100%;
    height: 450px; 
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    outline: none;
}

/* --- GALERIE SECONDAIRE --- */
.secondary-gallery {
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
}

.secondary-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.secondary-image-item {
    aspect-ratio: 16 / 9;
    border: 1px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
}

.secondary-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%); /* */
    transition: 0.5s ease;
}

.secondary-image-item:hover img { 
    filter: grayscale(0%); /* */
    transform: scale(1.05); 
}

/* --- BOUTON SOUS IMAGE PRINCIPALE --- */
.btn-under-media {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.btn-under-media--multi {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

.btn-under-media .btn-demo {
    text-align: center;
    padding: 12px 24px;
    border: 1px solid var(--accent);
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.8rem;
    transition: 0.3s;
    display: block;
    box-sizing: border-box;
}

.btn-under-media .btn-demo:hover {
    background: var(--accent);
    color: var(--bg-color);
}

/* --- ACTIONS ET THÈMES --- */
.detail-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 4rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-demo {
    padding: 15px 40px;
    border: 2px solid var(--accent);
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    transition: 0.3s;
}

.btn-demo:hover { 
    background: var(--accent); 
    color: var(--bg-color); 
}

/* Couleurs des thèmes */
.theme-proton { --bg-color: #0a0112; --accent: #bd00ff; --text-main: #f0e6ff; --border-color: rgba(189, 0, 255, 0.3); }
.theme-mario { --bg-color: #0f0202; --accent: #ff3333; --text-main: #fff0f0; --border-color: rgba(255, 51, 51, 0.3); }
.theme-banana { --bg-color: #1a1500; --accent: #ffcc00; --text-main: #fffae0; --border-color: rgba(255, 204, 0, 0.3); }
.theme-dance { --bg-color: #02021a; --accent: #00d4ff; --text-main: #ffffff; --border-color: rgba(0, 212, 255, 0.4); }
.theme-bigbag { --bg-color: #0a0a0a; --accent: #ff0099; --text-main: #ffffff; --border-color: rgba(255, 0, 153, 0.4); }
.theme-goblin { --bg-color: #060d06; --accent: #4caf50; --text-main: #e8f5e9; --border-color: rgba(76, 175, 80, 0.3); }
.theme-horloger { --bg-color: #0e0a04; --accent: #c8972a; --text-main: #fdf3e3; --border-color: rgba(200, 151, 42, 0.3); }
.theme-solaryth { --bg-color: #04060f; --accent: #f5a623; --text-main: #fff8ec; --border-color: rgba(245, 166, 35, 0.3); }

/* --- LIGHTBOX --- */
.project-lightbox {
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.95);
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 10001;
    cursor: default !important;
}

.project-lightbox *,
.project-lightbox img,
.project-lightbox-content {
    cursor: default !important;
}

.project-lightbox.active { 
    display: flex; 
}

.project-lightbox-content { 
    position: relative; 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%; 
    height: 90%;
}

.project-lightbox img { 
    max-width: 100%; /* */
    max-height: 85vh; /* */
    object-fit: contain; /* */
    border: 1px solid #333;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.project-lightbox-close {
    position: absolute; 
    top: -50px; 
    right: 0;
    background: none; 
    border: none; 
    color: white; 
    font-size: 3rem; 
    cursor: pointer !important;
}

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

@media (max-width: 1024px) {
    .project-card { 
        grid-template-columns: 1fr; 
        text-align: center; 
    }
}

.theme-bigbag .media-gallery img {
    max-width: 65%; /* Taille encore plus réduite pour l'affiche verticale */
    margin: 0 auto;
}