/**
 * Hero Projet - Styles spécifiques
 * wp-content/themes/custom-theme/src/assets/css/projet/projet.css
 * VERSION 3.0 - Mobile SNAP + ZOOM identique à réalisations
 */

/* ====================================
   🏯 BLOC HERO PROJET - FULLSCREEN CENTRÉ
   ==================================== */
.hero-projet-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    overflow: hidden;
    position: relative;
    padding: var(--space-xl) 0;
}

.hero-projet-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

.hero-projet-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-md);
    min-height: 60vh;
}

/* ====================================
   🎨 ICÔNE
   ==================================== */
.hero-projet-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    opacity: 0;
    transform: translateY(30px) scale(0.8);
}

.hero-projet-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: var(--transition-normal);
}

/* ====================================
   📝 TITRE H1
   ==================================== */
.hero-projet-title-h1 {
    font-family: var(--font-primary);
    font-size: var(--h1-size);
    font-weight: 900;
    line-height: 1;
    color: var(--dark);
    margin-bottom: 0;
    word-spacing: -0.1em;
    opacity: 0;
    transform: translateY(50px);
}

/* ====================================
   📕 SOUS-TITRE H2
   ==================================== */
.hero-projet-title-h2 {
    font-family: var(--font-primary);
    font-size: var(--h4-size);
    font-weight: 400;
    line-height: 1.3;
    color: var(--dark);
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(30px);
}

/* ====================================
   ⬇️ ARROW DOWN
   ==================================== */
.hero-projet-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-lg);
    opacity: 0;
    transform: translateY(20px);
    cursor: pointer;
    transition: var(--transition-normal);
}

.hero-projet-arrow img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    animation: bounce 2s infinite;
}

.hero-projet-arrow:hover {
    transform: translateY(5px);
}

/* ====================================
   ✨ ANIMATIONS GSAP
   ==================================== */
.hero-projet-section.gsap-ready .hero-projet-icon {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
}

.hero-projet-section.gsap-ready .hero-projet-title-h1 {
    opacity: 0;
    transform: translateY(50px);
}

.hero-projet-section.gsap-ready .hero-projet-title-h2 {
    opacity: 0;
    transform: translateY(30px);
}

.hero-projet-section.gsap-ready .hero-projet-arrow {
    opacity: 0;
    transform: translateY(20px);
}

/* États visibles après animation */
.hero-projet-icon.visible,
.hero-projet-title-h1.visible,
.hero-projet-title-h2.visible,
.hero-projet-arrow.visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* ====================================
   🎭 ANIMATION BOUNCE POUR LA FLÈCHE
   ==================================== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ====================================
   🎯 SECTION CARROUSEL PROJET - SCROLL HORIZONTAL
   ==================================== */
.projet-carousel-section {
    overflow-x: visible;
    width: 100%;
    padding-top: var(--space-lg);
}

/* Header du carrousel */
.projet-carousel-header {
    max-width: var(--container-max);
    margin: 0 auto var(--space-lg);
    padding: 0 var(--container-padding);
    width: 100%;
}

.projet-carousel-header-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-sm);
    align-items: center;
    width: 100%;
}

/* Icône alignée à gauche */
.projet-carousel-icon {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: 8px !important;
}

.projet-carousel-icon img {
    width: 30px !important;
    height: 30px !important;
    object-fit: contain !important;
}

/* Titre à droite */
.projet-carousel-content {
    display: flex;
    flex-direction: column;
}

.projet-carousel-title {
    font-family: var(--font-primary);
    font-size: var(--h1-size);
    font-weight: 900;
    line-height: var(--h1-line-height);
    margin-bottom: 0;
    color: var(--dark);
    opacity: 0;
}

/* ====================================
   🎪 CONTENEUR CARROUSEL - SCROLL HORIZONTAL
   ==================================== */
.projet-carousel-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
    overflow: visible;
    display: block;
}

.projet-carousel-wrapper {
    width: 100%;
    overflow: visible;
}

.projet-carousel {
    display: flex;
    gap: var(--space-md);
    will-change: transform;
    position: relative;
    overflow: visible;
}

/* ====================================
   🎴 CARTES PROJET - DESKTOP
   ==================================== */
.projet-carousel-card {
    min-width: 500px;
    width: 500px;
    flex-shrink: 0;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    transition: var(--transition-normal);
    background: var(--white);
    opacity: 0;
    transform: translateY(30px);
    margin: 0 0 40px 0;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 700px;
}

.projet-carousel-card.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.projet-carousel-card:hover {
    transform: translateY(-8px);
}

.projet-carousel-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.projet-carousel-card-link:hover {
    text-decoration: none;
}

/* IMAGE DE LA CARTE */
.projet-carousel-card-image {
    height: 609px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projet-carousel-card:hover .projet-carousel-card-image {
    height: 440px;
}

.projet-carousel-card-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(15, 24, 41, 0.1));
    opacity: 0;
    transition: var(--transition-normal);
}

.projet-carousel-card:hover .projet-carousel-card-image::after {
    opacity: 1;
}

/* CONTENU DE LA CARTE */
.projet-carousel-card-content {
    padding: var(--space-md);
    position: relative;
    display: flex;
    flex-direction: column;
    color: var(--white);
    flex: 1;
    transition: padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projet-carousel-card:hover .projet-carousel-card-content {
    padding: var(--space-md);
}

/* INFO TOUJOURS VISIBLES */
.projet-carousel-card-info {
    position: relative;
    z-index: 2;
    margin-bottom: var(--space-sm);
    transition: margin-bottom 0.5s ease;
    top: -3px;
}

.projet-carousel-card:hover .projet-carousel-card-info {
    margin-bottom: 10px;
}

/* TITRE PRINCIPAL */
.projet-carousel-card-title {
    font-family: var(--font-primary);
    font-size: var(--h4-size);
    font-weight: 900;
    line-height: 30px;
    margin-bottom: 0;
    color: var(--white);
    transition: font-size 0.5s ease, margin-bottom 0.5s ease;
}

.projet-carousel-card:hover .projet-carousel-card-title {
    font-size: var(--h4-size);
    margin-bottom: 0;
}

/* SERVICES */
.projet-carousel-card-services {
    position: relative;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
}

.projet-carousel-card:hover .projet-carousel-card-services {
    max-height: 400px;
    opacity: 1;
}

.projet-carousel-card-service-item {
    font-family: var(--font-inter);
    font-size: var(--p-size);
    font-weight: 300;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    color: var(--white);
    transform: translateY(10px);
    transition: transform 0.3s ease, opacity 0.3s ease, padding 0.3s ease, font-size 0.3s ease;
}

.projet-carousel-card:hover .projet-carousel-card-service-item {
    transform: translateY(0);
    padding: 5px 0;
    font-size: var(--p-size);
}

.projet-carousel-card-service-item:last-child {
    border-bottom: none !important;
}

.projet-carousel-card-service-item::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0;
    height: 1px;
    background: var(--white);
    transition: var(--transition-normal);
}

.projet-carousel-card-service-item:last-child::before {
    display: none !important;
}

.projet-carousel-card:hover .projet-carousel-card-service-item::before {
    width: 100%;
}

.projet-carousel-card:hover .projet-carousel-card-service-item:last-child::before {
    display: none !important;
    width: 0 !important;
}

/* FLÈCHE EN HAUT À DROITE */
.projet-carousel-card-arrow {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 30px;
    height: 30px;
    opacity: 0;
    transform: translate(10px, -10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 10;
}

.projet-carousel-card-arrow img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.projet-carousel-card:hover .projet-carousel-card-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

/* ====================================
   RESPONSIVE DESKTOP
   ==================================== */
@media (max-width: 2000px) {
    .projet-carousel-card {
        min-width: 360px;
        width: 360px;
        height: 420px;
    }

    .projet-carousel-card-image {
        height: 332px;
    }

    .projet-carousel-card:hover .projet-carousel-card-image {
        height: 186px;
    }

    .projet-carousel-card-content {
        padding: var(--space-sm);
    }

    .projet-carousel-card:hover .projet-carousel-card-content {
        padding: var(--space-sm);
    }

    .projet-carousel-card-arrow {
        width: 26px;
        height: 26px;
        top: var(--space-sm);
        right: var(--space-sm);
    }
}

@media (max-width: 1600px) {
    .projet-carousel-card {
        min-width: 340px;
        width: 340px;
        height: 400px;
    }

    .projet-carousel-card-image {
        height: 312px;
    }

    .projet-carousel-card:hover .projet-carousel-card-image {
        height: 167px;
    }
}

@media (max-width: 1024px) {
    .projet-carousel-card {
        min-width: 320px;
        width: 320px;
        height: 440px;
    }

    .projet-carousel-card-image {
        height: 300px;
    }

    .projet-carousel-card:hover .projet-carousel-card-image {
        height: 180px;
    }

    .projet-carousel-card-content {
        padding: var(--space-sm);
    }

    .projet-carousel-card:hover .projet-carousel-card-content {
        padding: 12px var(--space-sm);
    }

    .projet-carousel-card-arrow {
        width: 24px;
        height: 24px;
        top: var(--space-sm);
        right: var(--space-sm);
    }
}

/* ====================================
   📱 MOBILE 968px - SNAP + ZOOM
   COPIE CONFORME DE REALISATIONS
   ==================================== */
@media screen and (max-width: 968px) {
    .projet-carousel-section {
        padding: var(--space-sm) 0;
        overflow: hidden;
    }

    .projet-carousel-header {
        margin-bottom: var(--space-md);
    }

    .projet-carousel-header-wrapper {
        grid-template-columns: 8% 88%;
        gap: var(--space-sm);
        align-items: center;
    }

    .projet-carousel-icon {
        justify-content: flex-start;
        padding-top: 5px;
        margin-bottom: 0;
        align-self: flex-start;
    }

    .projet-carousel-content {
        gap: var(--space-md);
    }

    .projet-carousel-title {
        margin-bottom: var(--space-sm);
    }

    .projet-carousel-container {
        margin-top: 25px;
        margin-bottom: 0;
        overflow: hidden;
        position: relative;
        padding: 0;
    }

    .projet-carousel-wrapper {
        width: 100vw;
        margin-left: 0;
        position: relative;
        overflow: visible;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

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

    /* CARROUSEL MOBILE - IDENTIQUE À RÉALISATIONS */
    .projet-carousel-section .projet-carousel {
        display: flex;
        gap: 10px;
        padding: 0;
        padding-left: calc((100vw - 280px) / 2);
        padding-right: calc((100vw - 280px) / 2);
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;
        -ms-overflow-style: none;
        cursor: grab;
        scroll-behavior: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-padding-left: calc((100vw - 280px) / 2);
        scroll-padding-right: calc((100vw - 280px) / 2);
    }

    .projet-carousel-section .projet-carousel::-webkit-scrollbar {
        display: none;
    }

    .projet-carousel-section .projet-carousel.dragging {
        cursor: grabbing;
        scroll-behavior: auto;
    }

    /* TOUTES LES CARTES EN MOBILE - SCALE 0.85 PAR DÉFAUT */
    .projet-carousel-section .projet-carousel .projet-carousel-card {
        min-width: 280px !important;
        width: 280px !important;
        height: 387px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        scroll-snap-align: center !important;
        scroll-snap-stop: always !important;
        transform-origin: center center !important;

        /* ÉTAT PAR DÉFAUT : PETIT */
        transform: scale(0.85) !important;
        -webkit-transform: scale(0.85) !important;
        opacity: 0.7 !important;

        /* TRANSITION SIMPLE ET PERFORMANTE */
        transition: transform 0.3s ease-out, opacity 0.3s ease-out !important;

        /* GPU optimisation */
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }

    /* CARTE CENTRALE - SCALE 1 */
    .projet-carousel-section .projet-carousel .projet-carousel-card.center-active {
        transform: scale(1) !important;
        -webkit-transform: scale(1) !important;
        opacity: 1 !important;
        z-index: 10 !important;
    }

    /* DÉSACTIVER HOVER EN MOBILE */
    .projet-carousel-section .projet-carousel .projet-carousel-card:hover {
        transform: scale(0.85) translateZ(0) !important;
    }

    .projet-carousel-section .projet-carousel .projet-carousel-card.center-active:hover {
        transform: scale(1.0) translateZ(0) !important;
    }

    .projet-carousel-section .projet-carousel-card:hover .projet-carousel-card-image {
        height: 326px;
    }

    .projet-carousel-section .projet-carousel-card:hover .projet-carousel-card-services {
        max-height: 0;
        opacity: 0;
    }

    .projet-carousel-section .projet-carousel-card:hover .projet-carousel-card-arrow {
        opacity: 0;
    }

    .projet-carousel-section .projet-carousel-card-image {
        height: 326px;
    }

    .projet-carousel-section .projet-carousel-card-content {
        padding: var(--space-sm);
    }

    /* ====================================
       📱 MOBILE - CLASSE INFO-OPEN (double-tap)
       Simule le hover au clic
       ==================================== */
    .projet-carousel-section .projet-carousel .projet-carousel-card.info-open {
        height: 387px !important;
    }

    .projet-carousel-section .projet-carousel-card.info-open .projet-carousel-card-image {
        height: 200px !important;
    }

    .projet-carousel-section .projet-carousel-card.info-open .projet-carousel-card-services {
        max-height: 400px !important;
        opacity: 1 !important;
    }

    .projet-carousel-section .projet-carousel-card.info-open .projet-carousel-card-service-item {
        transform: translateY(0) !important;
        padding: 5px 0 !important;
    }

    .projet-carousel-section .projet-carousel-card.info-open .projet-carousel-card-arrow {
        opacity: 1 !important;
        transform: translate(0, 0) !important;
    }

    .projet-carousel-section .projet-carousel-card.info-open .projet-carousel-card-info {
        margin-bottom: 10px !important;
    }
}

/* 768px */
@media screen and (max-width: 768px) {
    .projet-carousel-section {
        padding: var(--space-lg) 0;
    }

    .projet-carousel-section .projet-carousel .projet-carousel-card {
        min-width: 250px !important;
        width: 250px !important;
        height: 380px !important;
    }

    .projet-carousel-section .projet-carousel {
        gap: 10px;
        padding-left: calc((100vw - 250px) / 2);
        padding-right: calc((100vw - 250px) / 2);
        scroll-padding-left: calc((100vw - 250px) / 2);
        scroll-padding-right: calc((100vw - 250px) / 2);
    }

    .projet-carousel-section .projet-carousel-card-image {
        height: 300px;
    }

    .projet-carousel-section .projet-carousel-card:hover .projet-carousel-card-image {
        height: 300px;
    }
}

/* 480px */
@media screen and (max-width: 480px) {
    .projet-carousel-section {
        padding: var(--space-lg) 0;
        margin: 6em 0 4em;
    }

    .projet-carousel-header-wrapper {
        grid-template-columns: 8% 88%;
        gap: var(--space-xs);
        align-items: center;
    }

    .projet-carousel-icon {
        justify-content: flex-start;
        margin-bottom: 0;
        align-self: flex-start;
        padding-top: 5px;
    }

    .projet-carousel-icon img {
        width: 25px;
        height: 25px;
    }

    .projet-carousel-title {
        text-align: left;
        margin-bottom: 0;
    }

    .projet-carousel-content {
        gap: var(--space-sm);
    }

    .projet-carousel-section .projet-carousel .projet-carousel-card {
        min-width: 280px !important;
        width: 280px !important;
        height: 387px !important;
    }

    .projet-carousel-section .projet-carousel {
        gap: 10px;
        padding-left: calc((100vw - 280px) / 2);
        padding-right: calc((100vw - 280px) / 2);
        scroll-padding-left: calc((100vw - 280px) / 2);
        scroll-padding-right: calc((100vw - 280px) / 2);
    }

    .projet-carousel-section .projet-carousel-card-image {
        height: 326px;
    }

    .projet-carousel-section .projet-carousel-card:hover .projet-carousel-card-image {
        height: 326px;
    }

    .projet-carousel-section .projet-carousel-card-content {
        padding: var(--space-sm);
    }
}

/* ====================================
   📱 RESPONSIVE MOBILE - HERO
   ==================================== */
@media (max-width: 968px) {
    .hero-projet-section {
        min-height: 90vh;
        padding: var(--space-lg) 0;
    }

    .hero-projet-wrapper {
        gap: var(--space-sm);
    }

    .hero-projet-icon img {
        width: 60px;
        height: 60px;
    }

    .hero-projet-title-h1 {
        font-size: var(--h1-size);
        line-height: 1;
    }

    .hero-projet-title-h2 {
        font-size: var(--h4-size);
        line-height: 1.2;
    }

    .hero-projet-arrow {
        margin-top: var(--space-md);
    }

    .hero-projet-arrow img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .hero-projet-section {
        min-height: 85vh;
        padding: var(--space-md) 0;
    }

    .hero-projet-wrapper {
        gap: var(--space-sm);
    }

    .hero-projet-icon img {
        width: 50px;
        height: 50px;
    }

    .hero-projet-title-h1 {
        font-size: var(--h1-size);
        line-height: 1;
    }

    .hero-projet-title-h2 {
        font-size: var(--h4-size);
        line-height: 1.2;
    }

    .hero-projet-arrow img {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .hero-projet-section {
        min-height: 80vh;
        padding: var(--space-sm) 0;
    }

    .hero-projet-wrapper {
        gap: var(--space-xs);
    }

    .hero-projet-icon {
        margin-bottom: var(--space-xs);
    }

    .hero-projet-icon img {
        width: 40px;
        height: 40px;
    }

    .hero-projet-title-h1 {
        font-size: var(--h1-size);
        line-height: 0.9;
    }

    .hero-projet-title-h2 {
        font-size: var(--h4-size);
        line-height: 1.2;
        padding: 0 var(--space-sm);
    }

    .hero-projet-arrow {
        margin-top: var(--space-sm);
    }

    .hero-projet-arrow img {
        width: 30px;
        height: 30px;
    }
}

/* ====================================
   🎭 OPTIMISATION PERFORMANCE
   ==================================== */
.hero-projet-icon,
.hero-projet-title-h1,
.hero-projet-title-h2,
.hero-projet-arrow {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.hero-projet-section {
    contain: layout style;
}

/* ====================================
   🔧 FALLBACK SANS GSAP
   ==================================== */
.hero-projet-section:not(.gsap-ready) .hero-projet-icon,
.hero-projet-section:not(.gsap-ready) .hero-projet-title-h1,
.hero-projet-section:not(.gsap-ready) .hero-projet-title-h2,
.hero-projet-section:not(.gsap-ready) .hero-projet-arrow {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.hero-projet-icon,
.hero-projet-title-h1,
.hero-projet-title-h2,
.hero-projet-arrow {
    transition: none !important;
}

.hero-projet-section.animation-complete .hero-projet-icon,
.hero-projet-section.animation-complete .hero-projet-title-h1,
.hero-projet-section.animation-complete .hero-projet-title-h2,
.hero-projet-section.animation-complete .hero-projet-arrow {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* ====================================
   🎨 OPTIMISATION PERFORMANCE CARROUSEL
   ==================================== */
.projet-carousel-card {
    will-change: transform, opacity;
}

.projet-carousel {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* FALLBACK SANS GSAP - DESKTOP SEULEMENT */
@media screen and (min-width: 969px) {
    .projet-carousel-section:not(.with-gsap) .projet-carousel-icon,
    .projet-carousel-section:not(.with-gsap) .projet-carousel-title,
    .projet-carousel-section:not(.with-gsap) .projet-carousel-card {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}