/* ═══════════════════════════════════════════════════════════════
   PROJECT-EVENT.CSS — MOBILE FIRST
   Base = Mobile (≤640px)
   Breakpoints : 641px (tablet) → 1025px (desktop) → 1441px (large)
   ═══════════════════════════════════════════════════════════════ */

/* ============================================
   1. VARIABLES & BASE
   ============================================ */

@font-face {
    font-family: 'Clash Display';
    src: url('/fonts/ClashDisplay-Variable.woff2') format('woff2');
    font-weight: 200 700;
    font-display: swap;
}

:root {
    --event-bg: #080810;
    --event-text: #f6f6f6;
    --accent-1: rgb(124, 58, 237);
    --accent-2: rgb(79, 70, 229);
    --accent-3: rgb(37, 99, 235);
    --gradient-text: linear-gradient(90deg, var(--accent-1) 0%, var(--accent-2) 49%, var(--accent-3) 100%);
    --glow-1: rgba(124, 58, 237, 0.35);
    --glow-2: rgba(79, 70, 229, 0.30);
    --glow-3: rgba(37, 99, 235, 0.25);
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);
    --grid-row-h: 200px;
    --grid-gap: 4px;
    --grid-visible-rows: 5;
}

.project-type-web {
    --accent-1: rgb(79, 70, 229);
    --accent-2: rgb(37, 99, 235);
    --accent-3: rgb(56, 189, 248);
    --glow-1: rgba(79, 70, 229, 0.35);
    --glow-2: rgba(37, 99, 235, 0.30);
    --glow-3: rgba(56, 189, 248, 0.25);
}

.project-type-event {
    --accent-1: rgb(124, 58, 237);
    --accent-2: rgb(79, 70, 229);
    --accent-3: rgb(37, 99, 235);
    --glow-1: rgba(124, 58, 237, 0.35);
    --glow-2: rgba(79, 70, 229, 0.30);
    --glow-3: rgba(37, 99, 235, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--event-bg);
    background-image:
        radial-gradient(circle at 15% 20%, var(--glow-1) 0%, transparent 65%),
        radial-gradient(circle at 85% 80%, var(--glow-2) 0%, transparent 65%),
        radial-gradient(circle at 50% 50%, var(--glow-3) 0%, transparent 80%),
        radial-gradient(circle at 80% 10%, var(--glow-1) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--event-text);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    position: fixed !important;
    width: 100%;
    z-index: 100 !important;
}

/* ============================================
   2. HERO-EVENT — Mobile base
   ============================================ */

.hero-event {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: #080810;
    /* Fond de secours pour éviter les trous visuels */
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transform: scale(1.2);
    /* Augmenté pour donner plus de marge au parallax */
    will-change: transform;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top, #080810 0%, transparent 55%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, transparent 40%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 5vw 5vh;
    width: 100%;
}

.date-badge {
    font-family: "Clash Display", sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.date-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-3);
    flex-shrink: 0;
}

.hero-content h1 {
    font-family: 'Clash Display', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 0.92;
    margin: 0 0 1.5rem 0;
    text-transform: uppercase;
    color: var(--event-text);
    letter-spacing: -0.02em;
    max-width: 100%;
}

.hero-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    max-width: 50ch;
    line-height: 1.6;
    margin: 0 0 2.5rem 0;
    font-weight: 400;
}

.scroll-instruction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.5;
}

.scroll-instruction span {
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.scroll-instruction .line {
    width: 1px;
    height: 52px;
    background: linear-gradient(to bottom, #fff, transparent);
    animation: scrollLine 2s ease-in-out infinite;
    transform-origin: top;
}

@keyframes scrollLine {
    0% {
        transform: scaleY(0);
        opacity: 1;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }

    100% {
        transform: scaleY(1);
        opacity: 0;
    }
}

/* ============================================
   3. INTRO — Mobile base
   ============================================ */

.intro-event {
    padding: 5rem 5vw;
    text-align: center;
}

.lead-text {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

.highlight {
    color: #fff;
    font-weight: 600;
}

/* ============================================
   4. MASONRY GALLERY — Mobile base
   ============================================ */

.masonry-gallery-section {
    padding: 0 0 2rem;
    position: relative;
    z-index: 15;
    overflow-anchor: none;
    /* Désactive l'ajustement auto du scroll du navigateur pendant l'expansion */
}

.gallery-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 5vw 3rem;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}

.gallery-header-row {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.section-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-3);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-eyebrow::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--accent-3);
    flex-shrink: 0;
}

.section-title-large {
    font-family: 'Clash Display', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--event-text);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.gallery-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 400;
    margin: 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: var(--grid-row-h);
    grid-auto-flow: dense;
    gap: var(--grid-gap);
    padding: 0 var(--grid-gap) 2rem;
    position: relative;
    overflow-anchor: none;
}

.photo-grid.is-truncated {
    max-height: calc((var(--grid-row-h) * 2.5) + (var(--grid-gap) * 2));
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 120px), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 120px), transparent 100%);
}

.grid-item {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
    border-radius: 3px;
    object-fit: cover;
    clip-path: inset(100% 0 0 0);
    filter: saturate(0.8) brightness(0.88);
    will-change: transform, filter, clip-path;
    transform-origin: center center;
    transition: filter 0.4s ease;
    transform-style: preserve-3d;
    position: relative;
}

.grid-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 -60px 80px -40px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.grid-item:hover::after {
    opacity: 1;
}

.grid-item.featured {
    grid-row: span 2;
    border-radius: 5px;
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, 0.12),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

.grid-item.tall {
    grid-row: span 2;
}

.gallery-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 3rem 0 0;
    position: relative;
    z-index: 20;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-load-more-wrap.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gallery-load-more {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 2.2rem;
    font-family: 'Clash Display', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.gallery-load-more:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.2);
}

.gallery-load-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.gallery-load-more:hover svg {
    transform: translateY(2px);
}

/* ============================================
   5. LIGHTBOX — Mobile base
   ============================================ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 10, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.lightbox-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 10;
}

.lightbox-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-3));
    border-radius: 0 2px 2px 0;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0 16px;
    width: 100%;
    max-width: min(1300px, 96vw);
    max-height: 80svh;
    will-change: transform, opacity;
}

.lightbox-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

#lightbox-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.05);
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: blur(40px) saturate(1.5) opacity(0.5);
    z-index: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

#lightbox-img {
    max-width: 100%;
    max-height: 65svh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 4px 20px rgba(0, 0, 0, 0.5),
        0 40px 100px rgba(0, 0, 0, 0.9);
    will-change: transform, opacity;
}

.lightbox-counter {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 500;
    font-family: 'Clash Display', sans-serif;
}

.lightbox-close,
.lightbox-nav {
    position: fixed;
    z-index: 2;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-filmstrip {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 10px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    background: linear-gradient(to top, rgba(4, 4, 10, 0.95), transparent);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lightbox-filmstrip::-webkit-scrollbar {
    display: none;
}

.filmstrip-item {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.35;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.filmstrip-item:hover {
    opacity: 0.7;
    transform: scale(1.08);
}

.filmstrip-item.active {
    opacity: 1;
    border-color: var(--accent-2);
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

@media (max-width: 768px) {
    .lightbox-nav {
        display: none;
    }
}

/* ============================================
   6. PHOTOGRAPHER — Mobile base
   ============================================ */

.photographer-section {
    position: relative;
    z-index: 10;
    padding: 0 0 4rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    height: 50vh;
    overflow: hidden;
}

.photographer-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;
    z-index: -1;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.2) 15%, #000 30%, #000 45%, rgba(0, 0, 0, 0.4) 75%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.2) 15%, #000 30%, #000 45%, rgba(0, 0, 0, 0.4) 75%, transparent 100%);
}

.photographer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    filter: grayscale(40%) contrast(1.1) brightness(0.9);
}

.photographer-content {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    position: relative;
}

.photographer-info {
    width: 100%;
    max-width: 100%;
    margin: auto 1.5rem 0;
}

.role-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent-3);
    display: block;
    margin-bottom: 0.5rem;
}

.photographer-info h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #fff;
    letter-spacing: -0.01em;
}

.photographer-info p {
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.65;
    margin: 0 0 1.5rem 0;
    font-size: 0.95rem;
    max-width: 480px;
}

.portfolio-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 2px;
}

.portfolio-link:hover {
    color: var(--accent-3);
    gap: 0.85rem;
    border-bottom-color: var(--accent-3);
}

/* ============================================
   7. EVENT-CTA — Mobile base
   ============================================ */

.event-cta {
    padding: 8rem 6vw 4rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.event-cta h2 {
    font-family: 'Clash Display', sans-serif;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    background: #fff;
    color: #080810;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 100px;
    /* Désactivé pour laisser GSAP gérer les animations d'entrée sans conflit */
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-download:hover {
    background: var(--accent-2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--accent-2);
}


/* ═══════════════════════════════════════════════════════════════
   TABLETTE (≥ 641px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 641px) {
    :root {
        --grid-row-h: 220px;
        --grid-gap: 5px;
    }

    /* --- Hero --- */
    .hero-content {
        padding: 0 6vw 6vh;
    }

    .hero-content h1 {
        font-size: 4rem;
        max-width: 80vw;
    }

    /* --- Gallery --- */
    .gallery-header {
        padding: 0 6vw 4rem;
    }

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

    .grid-item.featured {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* --- Lightbox --- */
    .lightbox-prev {
        left: 2.5rem;
    }

    .lightbox-next {
        right: 2.5rem;
    }

    .lightbox-content {
        padding: 0 60px;
    }

    .filmstrip-item {
        width: 48px;
        height: 48px;
    }

    .lightbox-filmstrip {
        padding: 12px 60px;
        justify-content: center;
        gap: 4px;
    }

    /* --- Photographer --- */
    .photographer-info h3 {
        font-size: 2.1rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   DESKTOP (≥ 1025px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1025px) {
    :root {
        --grid-row-h: 240px;
        --grid-gap: 6px;
        --grid-visible-rows: 5;
    }

    /* --- Hero --- */
    .hero-content h1 {
        font-size: 5rem;
        max-width: 60vw;
    }

    .hero-content p {
        font-size: 1.05rem;
    }

    /* --- Intro --- */
    .intro-event {
        padding: 7rem 15vw;
    }

    .lead-text {
        font-size: 2rem;
    }

    /* --- Gallery --- */
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-item {
        border-radius: 4px;
    }

    .grid-item.featured {
        border-radius: 6px;
    }

    .section-title-large {
        font-size: 3.5rem;
    }

    /* --- Lightbox --- */
    .lightbox-content {
        padding: 0 100px;
    }

    .filmstrip-item {
        width: 56px;
        height: 56px;
    }

    .lightbox-filmstrip {
        padding: 16px 100px;
        gap: 6px;
    }

    /* --- Photographer --- */
    .photographer-section {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        height: 65vh;
        padding: 0;
    }

    .photographer-image {
        width: 55%;
        height: 100%;
        -webkit-mask-image:
            linear-gradient(to right, #000 20%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0.1) 85%, transparent 100%),
            linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 10%, rgba(0, 0, 0, 0.5) 25%, #000 40%);
        -webkit-mask-composite: source-in;
        mask-image:
            linear-gradient(to right, #000 20%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0.1) 85%, transparent 100%),
            linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 10%, rgba(0, 0, 0, 0.5) 25%, #000 40%);
        mask-composite: intersect;
    }

    .photographer-content {
        justify-content: flex-end;
        align-items: center;
    }

    .photographer-info {
        max-width: 50vw;
        padding-right: 5vw;
        margin-top: 0;
    }

    .photographer-info h3 {
        font-size: 2.4rem;
    }

    /* --- CTA --- */
    .event-cta h2 {
        font-size: 2.8rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   GRAND ÉCRAN (≥ 1441px)
   ═══════════════════════════════════════════════════════════════ */

@media (min-width: 1441px) {
    :root {
        --grid-row-h: 220px;
        --grid-visible-rows: 6;
    }

    .photo-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================
   8. WILL-CHANGE — GPU Optimization
   ============================================ */

.hero-bg,
.grid-item,
.photographer-image,
.photographer-content,
.event-cta h2,
.btn-download {
    will-change: transform, opacity;
}