/* ============================================================================
   STYLES SPÉCIFIQUES - PAGE PROJET
   
   Version 15 - Corrections complètes - Décembre 2024
   
   CORRECTIONS :
   - Single + height fonctionne maintenant
   - Gallery simplifié et fiable
   - gap_top et gap_bottom séparés
   ============================================================================ */

/* ========================================
   PROJECT HERO
======================================== */
.project-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--project-color);
    padding: 150px 5vw var(--spacing-xl);
    overflow: hidden;
}

.project-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.3), 
        transparent 50%, 
        rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.project-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1200px;
}

.project-hero__category {
    margin-bottom: var(--spacing-sm);
}

.project-hero__title {
    font-size: clamp(60px, 15vw, 180px);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.project-hero__meta {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    opacity: 0.8;
}

.project-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-hero__meta-item::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-gold);
    border-radius: 50%;
}

/* ========================================
   PROJECT INTRO
======================================== */
.project-intro {
    padding: var(--spacing-lg) 5vw;
    padding-bottom: var(--spacing-md);
    background: var(--color-primary);
}

.project-intro__container {
    max-width: 900px;
    margin: 0 auto;
}

.project-intro__label {
    margin-bottom: var(--spacing-sm);
}

.project-intro__title {
    font-size: clamp(36px, 5vw, 60px);
    margin-bottom: var(--spacing-sm);
    line-height: 1.1;
}

.project-intro__description {
    font-size: 18px;
    line-height: 1.8;
    color: var(--overlay-medium);
    margin-bottom: 0;
}

/* ========================================
   PROJECT SECTION (Parties)
   
   Nouvelles options :
   - gap_top: none, tight, normal, wide
   - gap_bottom: none, tight, normal, wide
======================================== */
.project-section {
    padding: var(--spacing-md) 5vw;
    background: var(--color-primary);
}

/* GAP TOP */
.project-section--gap-top-none {
    padding-top: 0;
}

.project-section--gap-top-tight {
    padding-top: 10px;
}

.project-section--gap-top-normal {
    padding-top: var(--spacing-md);
}

.project-section--gap-top-wide {
    padding-top: var(--spacing-lg);
}

/* GAP BOTTOM */
.project-section--gap-bottom-none {
    padding-bottom: 0;
}

.project-section--gap-bottom-tight {
    padding-bottom: 10px;
}

.project-section--gap-bottom-normal {
    padding-bottom: var(--spacing-md);
}

.project-section--gap-bottom-wide {
    padding-bottom: var(--spacing-lg);
}

.project-section__container {
    max-width: 1400px;
    margin: 0 auto;
}

.project-section__header {
    max-width: 900px;
    margin: 0 auto var(--spacing-sm);
}

.project-section__label {
    margin-bottom: 5px;
}

.project-section__title {
    font-size: clamp(24px, 3vw, 36px);
    margin-bottom: var(--spacing-xs);
    line-height: 1.1;
}

.project-section__text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--overlay-medium);
    max-width: 900px;
    margin: 0 auto;
}

/* ========================================
   IMAGES GALLERY - Base
======================================== */
.images-gallery {
    margin-top: var(--spacing-sm);
}

.gallery-image {
    width: 100%;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    height: 450px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* ========================================
   OPTIONS DE HAUTEUR (globales)
======================================== */
.images-gallery--height-small .gallery-image {
    height: 300px;
}

.images-gallery--height-medium .gallery-image {
    height: 450px;
}

.images-gallery--height-large .gallery-image {
    height: 550px;
}

.images-gallery--height-xlarge .gallery-image {
    height: 700px;
}

.images-gallery--height-xxlarge .gallery-image {
    height: 850px;
}

.images-gallery--height-auto .gallery-image {
    height: auto;
}

/* ========================================
   OPTIONS DE LARGEUR
======================================== */
.images-gallery--width-narrow {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.images-gallery--width-normal {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.images-gallery--width-wide {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.images-gallery--width-full {
    max-width: 100%;
}

/* ========================================
   OPTIONS DE FIT (object-fit)
======================================== */
.images-gallery--fit-cover .gallery-image {
    object-fit: cover;
}

.images-gallery--fit-contain .gallery-image {
    object-fit: contain;
    background: rgba(0, 0, 0, 0.15);
}

.images-gallery--fit-fill .gallery-image {
    object-fit: fill;
}

.images-gallery--fit-scale-down .gallery-image {
    object-fit: scale-down;
}

.images-gallery--fit-none .gallery-image {
    object-fit: none;
}

/* ========================================
   OPTIONS DE GAP
======================================== */
.images-gallery--gap-none {
    gap: 0 !important;
    column-gap: 0 !important;
}

.images-gallery--gap-tight {
    gap: 8px !important;
    column-gap: 8px !important;
}

.images-gallery--gap-small {
    gap: 12px !important;
    column-gap: 12px !important;
}

.images-gallery--gap-normal {
    gap: 20px !important;
    column-gap: 20px !important;
}

.images-gallery--gap-wide {
    gap: 40px !important;
    column-gap: 40px !important;
}

.images-gallery--gap-extra-wide {
    gap: 60px !important;
    column-gap: 60px !important;
}

/* ========================================
   OPTIONS DE GAP-Y
======================================== */
.images-gallery--gap-y-none {
    row-gap: 0 !important;
}

.images-gallery--gap-y-tight {
    row-gap: 8px !important;
}

.images-gallery--gap-y-small {
    row-gap: 12px !important;
}

.images-gallery--gap-y-normal {
    row-gap: 20px !important;
}

.images-gallery--gap-y-wide {
    row-gap: 40px !important;
}

/* ========================================
   OPTIONS DE RADIUS
======================================== */
.images-gallery--radius-none .gallery-image {
    border-radius: 0;
}

.images-gallery--radius-small .gallery-image {
    border-radius: 4px;
}

.images-gallery--radius-normal .gallery-image {
    border-radius: 8px;
}

.images-gallery--radius-large .gallery-image {
    border-radius: 16px;
}

/* ========================================
   LAYOUT: SINGLE
   
   CORRIGÉ : height fonctionne maintenant
======================================== */
.images-gallery--single {
    display: flex;
    justify-content: center;
}

.images-gallery--single .gallery-image {
    width: 100%;
    height: 550px; /* Hauteur par défaut */
    object-fit: cover;
}

/* Hauteurs spécifiques pour single */
.images-gallery--single.images-gallery--height-small .gallery-image {
    height: 300px;
}

.images-gallery--single.images-gallery--height-medium .gallery-image {
    height: 450px;
}

.images-gallery--single.images-gallery--height-large .gallery-image {
    height: 550px;
}

.images-gallery--single.images-gallery--height-xlarge .gallery-image {
    height: 700px;
}

.images-gallery--single.images-gallery--height-xxlarge .gallery-image {
    height: 850px;
}

.images-gallery--single.images-gallery--height-auto .gallery-image {
    height: auto;
    max-height: 85vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ========================================
   LAYOUT: DUO
======================================== */
.images-gallery--duo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.images-gallery--duo .gallery-image {
    width: 100%;
}

/* ========================================
   LAYOUT: TRIO
======================================== */
.images-gallery--trio {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
}

.images-gallery--trio .gallery-image:first-child {
    grid-column: 1 / -1;
    height: 550px;
}

.images-gallery--trio .gallery-image:nth-child(2),
.images-gallery--trio .gallery-image:nth-child(3) {
    height: 350px;
}

/* Hauteurs petites images trio */
.images-gallery--trio.images-gallery--height-small-small .gallery-image:nth-child(2),
.images-gallery--trio.images-gallery--height-small-small .gallery-image:nth-child(3) {
    height: 250px;
}

.images-gallery--trio.images-gallery--height-small-medium .gallery-image:nth-child(2),
.images-gallery--trio.images-gallery--height-small-medium .gallery-image:nth-child(3) {
    height: 350px;
}

.images-gallery--trio.images-gallery--height-small-large .gallery-image:nth-child(2),
.images-gallery--trio.images-gallery--height-small-large .gallery-image:nth-child(3) {
    height: 450px;
}

.images-gallery--trio.images-gallery--height-small-xlarge .gallery-image:nth-child(2),
.images-gallery--trio.images-gallery--height-small-xlarge .gallery-image:nth-child(3) {
    height: 550px;
}

.images-gallery--trio.images-gallery--height-small-auto .gallery-image:nth-child(2),
.images-gallery--trio.images-gallery--height-small-auto .gallery-image:nth-child(3) {
    height: auto;
    object-fit: contain;
}

/* Hauteur grande image trio */
.images-gallery--trio.images-gallery--height-small .gallery-image:first-child {
    height: 350px;
}

.images-gallery--trio.images-gallery--height-medium .gallery-image:first-child {
    height: 450px;
}

.images-gallery--trio.images-gallery--height-large .gallery-image:first-child {
    height: 550px;
}

.images-gallery--trio.images-gallery--height-xlarge .gallery-image:first-child {
    height: 700px;
}

.images-gallery--trio.images-gallery--height-xxlarge .gallery-image:first-child {
    height: 850px;
}

/* ========================================
   LAYOUT: FULL
======================================== */
.images-gallery--full {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.images-gallery--full .gallery-image {
    width: 100%;
    height: 500px;
}

/* ========================================
   LAYOUT: GRID
======================================== */
.images-gallery--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.images-gallery--grid.images-gallery--columns-1 {
    grid-template-columns: 1fr;
}

.images-gallery--grid.images-gallery--columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.images-gallery--grid.images-gallery--columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.images-gallery--grid.images-gallery--columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.images-gallery--grid .gallery-image {
    width: 100%;
}

/* ========================================
   LAYOUT: MASONRY
======================================== */
.images-gallery--masonry {
    column-count: 2;
    column-gap: 20px;
}

.images-gallery--masonry.images-gallery--columns-1 {
    column-count: 1;
}

.images-gallery--masonry.images-gallery--columns-2 {
    column-count: 2;
}

.images-gallery--masonry.images-gallery--columns-3 {
    column-count: 3;
}

.images-gallery--masonry.images-gallery--columns-4 {
    column-count: 4;
}

.images-gallery--masonry .gallery-image {
    break-inside: avoid;
    margin-bottom: 20px;
    height: auto;
    object-fit: contain;
}

.images-gallery--masonry.images-gallery--gap-none .gallery-image {
    margin-bottom: 0;
}

.images-gallery--masonry.images-gallery--gap-tight .gallery-image {
    margin-bottom: 8px;
}

.images-gallery--masonry.images-gallery--gap-small .gallery-image {
    margin-bottom: 12px;
}

.images-gallery--masonry.images-gallery--gap-normal .gallery-image {
    margin-bottom: 20px;
}

.images-gallery--masonry.images-gallery--gap-wide .gallery-image {
    margin-bottom: 40px;
}

/* ========================================
   LAYOUT: SHOWCASE
======================================== */
.images-gallery--showcase {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    padding: 40px 0;
}

.images-gallery--showcase .gallery-image {
    flex: 0 0 auto;
    width: auto;
    height: auto;
    max-height: 500px;
    max-width: 45%;
    object-fit: contain;
}

.images-gallery--showcase.images-gallery--height-small .gallery-image {
    max-height: 300px;
}

.images-gallery--showcase.images-gallery--height-medium .gallery-image {
    max-height: 400px;
}

.images-gallery--showcase.images-gallery--height-large .gallery-image {
    max-height: 500px;
}

.images-gallery--showcase.images-gallery--height-xlarge .gallery-image {
    max-height: 600px;
}

/* ========================================
   LAYOUT: GALLERY
   
   VERSION SIMPLIFIÉE ET FIABLE
   Scroll horizontal classique avec
   conversion du scroll vertical via JS
======================================== */
.images-gallery--gallery {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.images-gallery--gallery:active {
    cursor: grabbing;
}

.images-gallery--gallery .gallery-image {
    flex: 0 0 auto;
    width: auto;
    height: 500px;
    max-width: none;
}

/* Hauteurs pour gallery */
.images-gallery--gallery.images-gallery--height-small .gallery-image {
    height: 300px;
}

.images-gallery--gallery.images-gallery--height-medium .gallery-image {
    height: 450px;
}

.images-gallery--gallery.images-gallery--height-large .gallery-image {
    height: 550px;
}

.images-gallery--gallery.images-gallery--height-xlarge .gallery-image {
    height: 700px;
}

.images-gallery--gallery.images-gallery--height-xxlarge .gallery-image {
    height: 850px;
}

/* Scrollbar stylée */
.images-gallery--gallery::-webkit-scrollbar {
    height: 8px;
}

.images-gallery--gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.images-gallery--gallery::-webkit-scrollbar-thumb {
    background: var(--color-gold);
    border-radius: 4px;
}

.images-gallery--gallery::-webkit-scrollbar-thumb:hover {
    background: #c9a227;
}

/* ========================================
   PROJECT NAVIGATION
======================================== */
.project-nav {
    padding: var(--spacing-lg) 5vw;
    background: var(--color-secondary);
    border-top: 1px solid var(--overlay-light);
}

.project-nav__container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.project-nav__link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 30px;
    border: 2px solid var(--overlay-light);
    transition: all 0.3s ease;
}

.project-nav__link:hover {
    border-color: var(--color-accent);
}

.project-nav__link--back {
    border-color: var(--color-gold);
}

.project-nav__link--back:hover {
    background: var(--color-gold);
    color: var(--color-secondary);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1024px) {
    .gallery-image {
        height: 400px;
    }
    
    .images-gallery--grid.images-gallery--columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .images-gallery--grid.images-gallery--columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .images-gallery--masonry.images-gallery--columns-4,
    .images-gallery--masonry.images-gallery--columns-3 {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .project-intro,
    .project-section {
        padding: var(--spacing-sm) 5vw;
    }
    
    .gallery-image {
        height: 300px;
    }
    
    .images-gallery--grid,
    .images-gallery--duo {
        grid-template-columns: 1fr;
    }
    
    .images-gallery--grid.images-gallery--columns-2,
    .images-gallery--grid.images-gallery--columns-3,
    .images-gallery--grid.images-gallery--columns-4 {
        grid-template-columns: 1fr;
    }
    
    .images-gallery--masonry {
        column-count: 1;
    }
    
    .images-gallery--trio {
        grid-template-columns: 1fr;
    }
    
    .images-gallery--trio .gallery-image:first-child {
        grid-column: 1;
        height: 300px;
    }
    
    .images-gallery--trio .gallery-image:nth-child(2),
    .images-gallery--trio .gallery-image:nth-child(3) {
        height: 250px;
    }
    
    .images-gallery--showcase {
        flex-direction: column;
        align-items: center;
    }
    
    .images-gallery--showcase .gallery-image {
        max-width: 100%;
        max-height: 300px;
    }
    
    .images-gallery--gallery .gallery-image {
        height: 280px;
    }
    
    .images-gallery--full .gallery-image {
        height: 300px;
    }
    
    .images-gallery--single .gallery-image {
        height: 300px;
    }
    
    .project-nav__container {
        flex-direction: column;
    }
}