/* ============================================================
   RESPONSIVE.CSS - VERSION CLEAN ET UNIQUE
   ============================================================ */

/* --- 1. TABLETTES (Max 1024px) --- */
@media screen and (max-width: 1024px) {
    :root { --container-width: 95%; }
    
    /* Adaptation Hero */
    .hero-card-container { height: auto; min-height: 400px; }

    /* Projets : Mode Vertical Obligatoire */
    .horizontal-scroll-section { height: auto !important; }
    .sticky-wrapper { position: relative; height: auto; width: 100%; overflow: visible; }
    .horizontal-track { display: flex; flex-direction: column; width: 100%; transform: none !important; }
    .project-panel { width: 100%; height: auto; min-height: auto; padding: 40px 0; }
    .project-overlay-ui { display: none; }
    
    /* Cartes Projets */
    .fullscreen-card { flex-direction: column-reverse; width: 100%; height: auto; border: 1px solid rgba(255,255,255,0.1); margin: 0; }
    body.alternate-view .fullscreen-card { border: 1px solid rgba(0,0,0,0.1); }

    .fs-info { flex: 0 0 auto; border-right: none; border-top: 1px solid rgba(255,255,255,0.1); padding: 40px 30px; }
    .fs-visual { flex: 0 0 400px; height: 400px; }
    
    /* Galerie */
    .masonry-grid { column-count: 2; }
    
    /* Cacher les points du slider global (inutiles en vertical) */
    .project-dots { display: none !important; }
}

/* --- 2. MOBILES (Max 768px) --- */
@media screen and (max-width: 768px) {

    /* --- GLOBAL RESET --- */
    html, body { width: 100%; overflow-x: hidden; position: relative; }
    .cursor-dot, .cursor-outline { display: none !important; }
    * { cursor: auto !important; }

    /* --- NAVBAR FIXE --- */
    .navbar { 
        height: 60px; padding: 0; 
        position: fixed !important; top: 0; left: 0; width: 100%;
        z-index: 6000 !important; /* Niveau le plus haut */
        transform: none !important; /* Empêche de disparaître */
        background: var(--bg-color) !important; /* Fond opaque forcé */
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-container { padding: 0 15px; justify-content: space-between; width: 100%; height: 100%; display: flex; align-items: center; }
    
    /* Logo + Hamburger (Gauche) */
    .nav-left { gap: 15px; z-index: 6002; display: flex; align-items: center; }
    .logo { font-size: 1.2rem; }
    
    .hamburger { 
        display: flex !important; flex-direction: column; justify-content: space-between; 
        width: 25px; height: 18px; cursor: pointer; margin-left: 0;
    }
    .hamburger span { width: 100%; height: 2px; background-color: var(--text-color); transition: 0.3s; }
    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .desktop-menu { display: none !important; }

    /* Bouton + Users (Droite) */
    .nav-right { gap: 8px; z-index: 6002; display: flex; align-items: center; }
    .dimension-btn { padding: 6px 10px; font-size: 0.75rem; white-space: nowrap; }
    .btn-text { display: none; }
    #live-users-widget { display: flex !important; padding: 0 5px; height: 30px; border: none; align-items: center; max-width: 80px; }
    #live-count { display: inline-block; font-size: 0.7rem; margin-right: 5px; }
    .user-bubble { width: 20px; height: 20px; font-size: 8px; margin-left: -5px; flex-shrink: 0; }

    /* --- MENU MOBILE OVERLAY --- */
    .mobile-menu-overlay {
        position: fixed; top: 0; left: 0; width: 100vw; height: 0;
        /* Fond Opaque IMPORTANT */
        background-color: var(--bg-color) !important; 
        overflow: hidden; transition: height 0.4s ease;
        z-index: 5999 !important; /* Juste en dessous de la navbar (6000) */
        padding-top: 80px; /* Espace pour la navbar */
        display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    }
    .mobile-menu-overlay.open { height: 100vh !important; }
    .mobile-link { font-size: 1.8rem; margin-bottom: 20px; color: var(--text-color); font-weight: bold; }

    /* --- CONTENU --- */
    main { padding-top: 80px; overflow-x: hidden; width: 100%; }
    .section { padding: 50px 20px; width: 100%; box-sizing: border-box; }
    .hero h1 { font-size: 2.2rem; line-height: 1.2; }
    
    .hero-card-container { flex-direction: column; height: auto; margin-top: 20px; width: 100%; }
    .hero-card-visual { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .hero-card-content { width: 100%; height: 250px; }
    .content-slide { padding: 20px; }

    .skills-grid, .services-grid { grid-template-columns: 1fr; gap: 20px; }
    .skill-card, .service-card { padding: 25px; }

    /* Projets Vertical */
    .horizontal-scroll-section { height: auto !important; }
    .horizontal-track { display: flex; flex-direction: column; width: 100% !important; transform: none !important; }
    .project-panel { width: 100%; height: auto; padding: 40px 0; display: block; }
    .fullscreen-card { flex-direction: column-reverse; width: 100%; height: auto; margin-bottom: 30px; border-radius: 12px; }
    .fs-visual { height: 220px; width: 100%; flex: 0 0 220px; }
    .fs-info { width: 100%; padding: 20px; }
    .fs-info h3 { font-size: 1.8rem; margin-bottom: 10px; }
    
    .desktop-only-btn { display: none !important; }
    .links { flex-direction: column; width: 100%; gap: 10px; }
    .btn-primary, .btn-secondary { width: 100%; text-align: center; padding: 12px; }

    /* Galerie & Contact */
    .masonry-grid { column-count: 1; }
    .creative-header { flex-direction: column; align-items: flex-start; }
    .creative-filters { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 10px; gap: 10px; }
    .filter-btn { flex: 0 0 auto; padding: 8px 16px; font-size: 0.85rem; }

    .contact-container { grid-template-columns: 1fr; gap: 40px; }
    .contact-form-wrapper { padding: 20px; }
    
    .parallax-item { width: 60px !important; opacity: 0.3; } 
}

/* Dans responsive.css, section MOBILE MENU OVERLAY */

.mobile-menu-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 0;
    background-color: var(--bg-color) !important; 
    overflow: hidden; 
    transition: height 0.4s ease, padding 0.4s ease; /* Ajoute transition padding */
    z-index: 5999 !important;
    
    /* MODIFICATION ICI : On met le padding à 0 par défaut pour qu'il soit totalement invisible */
    padding-top: 0; 
    
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start;
}

.mobile-menu-overlay.open { 
    height: 100vh !important; 
    /* MODIFICATION ICI : On ajoute le padding seulement quand c'est ouvert */
    padding-top: 80px; 
}

/* ============================================================
   FIX RESPONSIVE HERO (TABLETTE + MOBILE)
   Cible tout ce qui est plus petit que 1024px (iPad Pro, Laptops tactiles, etc.)
   ============================================================ */
@media screen and (max-width: 1024px) {

    /* 1. La carte passe en colonne (Verticale) */
    .hero-card-container { 
        flex-direction: column !important; 
        width: 90% !important; /* On laisse une marge sur les côtés */
        max-width: 500px; /* On évite qu'elle soit trop large sur tablette */
        height: auto !important; /* IMPORTANT : On casse la hauteur fixe */
        min-height: 600px; /* On force une hauteur minimale confortable */
        margin: 20px auto;
    }

    /* 2. L'image prend toute la largeur en haut */
    .hero-card-visual { 
        width: 100% !important; 
        height: 220px !important; /* Hauteur fixe pour l'image */
        border-right: none !important; 
        border-bottom: 1px solid rgba(255,255,255,0.1); 
    }

    /* 3. La zone de texte prend le reste */
    .hero-card-content { 
        width: 100% !important; 
        height: 380px !important; /* On définit une hauteur pour que le scroll interne marche */
        display: block; /* Sécurité */
    }

    /* 4. Ajustement du texte et du scroll */
    .content-slide {
        padding: 25px !important;
        /* Padding en bas pour être sûr de voir le texte "Cliquer pour la suite" */
        padding-bottom: 60px !important; 
    }
    
    /* Réduction légère de la police pour les tablettes */
    .content-slide h3 { font-size: 1.4rem !important; }
    .content-slide p { font-size: 0.95rem !important; }
}

/* Assure que l'image remplit l'espace sans se déformer */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* L'image remplit tout le cadre sans être écrasée */
    object-position: center; /* Centre l'image si elle est recadrée */
    display: block;
}

/* On force le conteneur à avoir une taille propre */
.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111; /* Fond noir en attendant que l'image charge */
}

