/* --- VARIABLES ET RESET --- */
:root {
    --color-base: #555; 
    --color-active: #000; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: sans-serif; background-color: #fff; overflow: hidden; }

/* --- INFOBULLE QUI SUIT LE CURSEUR --- */
#cursor-tooltip {
    position: fixed;
    background-color: #000;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.7rem;
    text-transform: uppercase;
    pointer-events: none; /* Pour que la souris passe au travers */
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.2s ease;
}

/* --- SIDEBAR GAUCHE --- */
.sidebar {
    position: fixed; top: 0; left: 0; width: 150px;
    height: 100vh; height: 100dvh; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 50; pointer-events: none; 
}
.brand-container, .social-nav { pointer-events: auto; }

/* --- LA BARRE DE DISTORSION PROGRESSIVE --- */
.glass-distortion-bar {
    position: absolute;
    top: 0; left: 0;
    width: 280px; /* Plus large que le menu pour que l'effet déborde doucement */
    height: 100%;
    z-index: -1;
    pointer-events: none; /* La souris passe au travers */
    
    /* 1. L'EFFET DE FLOU QUI DÉFORME LE FOND */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* 2. LE SECRET : LE MASQUE PROGRESSIF */
    /* Rend l'effet de flou intense à gauche (noir) et invisible à droite (transparent) */
    mask-image: linear-gradient(to right, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 20%, transparent 100%);

    /* 3. LA TEXTURE : RAYURES + GRAIN */
    background-image: 
        /* Les rayures du "Reeded Glass" */
        repeating-linear-gradient(
            to right, 
            rgba(255, 255, 255, 0.15) 0px, 
            rgba(255, 255, 255, 0.15) 2px, 
            rgba(0, 0, 0, 0.05) 2px, 
            rgba(0, 0, 0, 0.05) 5px
        ),
        /* Le Grain (Bruit Fractal) */
        url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.12"/%3E%3C/svg%3E');
}

/* --- LOGO ET MENU DYNAMIQUE --- */
.brand-container { display: flex; align-items: center; position: relative; cursor: pointer; }
.logo { height: 150px; transition: transform 0.2s, filter 0.2s; }

.filter-menu {
    position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center;
    pointer-events: none;
}
/* SEUL LE JAVASCRIPT GÈRE L'OUVERTURE MAINTENANT (Fini le hover CSS) */
.filter-menu.is-active { pointer-events: auto; }

/* ÉTAPE 1 : Les angles cachés sous le logo */
.angles {
    position: absolute; width: 100%; height: 100%;
    transform: translateX(-40px); opacity: 0;
    /* FERMETURE GLOBALE : attendent 0.5s que les angles se resserrent avant de glisser à gauche */
    transition: transform 0.3s ease 0.5s, opacity 0.3s ease 0.5s;
    pointer-events: none;
}
.filter-menu.is-active .angles {
    transform: translateX(0); opacity: 1;
    /* OUVERTURE GLOBALE : Immédiate (0s) */
    transition: transform 0.3s ease 0s, opacity 0.2s ease 0s;
}

/* ÉTAPE 2 : Ouverture des angles (Haut et Bas) */
.angle {
    position: absolute; width: 10px;
    /* FERMETURE GLOBALE : attendent 0.2s que les icônes disparaissent avant de se resserrer à 45px */
    transition: top 0.3s ease 0.2s, bottom 0.3s ease 0.2s;
}
.angle-l { top: 45px; left: 10px; }
.angle-r { bottom: 45px; right: 10px; }

.filter-menu.is-active .angle-l { 
    top: 5px; 
    /* OUVERTURE & RETOUR : attendent 0.3s (le temps du glissement depuis le logo ou de la disparition de la croix) */
    transition: top 0.3s ease 0.3s; 
}
.filter-menu.is-active .angle-r { 
    bottom: -5px; 
    transition: bottom 0.3s ease 0.3s; 
}

/* ÉTAPE 3 : L'apparition des icônes */
.filter-icons {
    display: flex; flex-direction: column; justify-content: center; margin-top : 10px;
    gap: 15px; padding: 15px; 
    height: 132px; /* Hauteur FIXE vitale pour que l'icône restante glisse pile au centre */
    opacity: 0; 
    /* FERMETURE GLOBALE : Les icônes disparaissent immédiatement (0s) */
    transition: opacity 0.2s ease 0s;
}
.filter-menu.is-active .filter-icons {
    opacity: 1; 
    /* OUVERTURE GLOBALE : Apparaissent après 0.6s (quand les angles sont ouverts) */
    transition: opacity 0.3s ease 0.6s;
}

/* --- ANIMATION DES ICÔNES AU CLIC --- */
.f-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0;
    cursor: pointer;
    opacity: 1;
    /* RETOUR (Croix cliquée) : 
       1. Reprennent leur espace (height) après 0.6s (quand les angles sont réouverts)
       2. Réapparaissent en fondu (opacity) après 0.9s */
    transition: height 0.3s ease 0.6s, margin-bottom 0.3s ease 0.6s, opacity 0.3s ease 0.9s, transform 0.2s, filter 0.2s;
}
.f-icon:hover { transform: scale(1.1) }

.f-icon.hidden-icon {
    height: 0; margin-bottom: -15px; /* Annule l'espacement pour recentrer l'icône restante */
    opacity: 0; pointer-events: none;
    /* ALLER (Icône cliquée) : 
       1. Disparaissent immédiatement en fondu (opacity 0s)
       2. Perdent leur hauteur après 0.2s pour faire glisser celle du milieu */
    transition: opacity 0.2s ease 0s, height 0.3s ease 0.2s, margin-bottom 0.3s ease 0.2s;
}

/* --- ÉTAT: CATÉGORIE SÉLECTIONNÉE --- */
/* 1. Les angles se resserrent sur l'icône unique */
.filter-menu.mode-selected .angle-l {
    top: 40px; 
    /* ALLER : Attendent 0.5s que l'icône sélectionnée soit arrivée au centre avant de glisser */
    transition: top 0.3s ease 0.5s;
}
.filter-menu.mode-selected .angle-r {
    bottom: 40px; 
    transition: bottom 0.3s ease 0.5s;
}

/* 2. La croix apparait et disparait */
.filter-controls {
    display: flex; flex-direction: column; align-items: center;
    position: absolute; top: 100%; left: 0; width: 100%; margin-top: -25px;
    opacity: 0; pointer-events: none;
    transform: translateY(35px); /* Départ 15px plus bas */
    /* RETOUR : La croix disparait en descendant IMMÉDIATEMENT (0s) */
    transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;
}
.filter-menu.mode-selected .filter-controls {
    opacity: 1; pointer-events: auto;
    transform: translateY(0); /* Remonte à sa place */
    /* ALLER : La croix apparait en montant APRES 0.8s (quand les angles ont fini) */
    transition: opacity 0.3s ease 0.8s, transform 0.3s ease 0.8s;
}

/* Animation de la croix et des cibles */
.cross-wrapper { position: relative; width: 24px; height: 24px; cursor: pointer; margin-top: 5px; }
.icon-cross { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 18px; }
.icon-target { position: absolute; top: 0; left: 0; width: 100%; transition: transform 0.5s ease; }
.cross-wrapper:hover .icon-target { transform: rotate(360deg); }

/* --- ICÔNES RÉSEAUX / CONTACT --- */
.social-nav { display: flex; flex-direction: column; gap: 20px; margin-top: 40px; }
.nav-icon { width: 30px; transition: transform 0.2s, filter 0.2s; }
.nav-icon:hover { transform: scale(1.2); filter: invert(0%); }

/* --- GALERIE (SCROLL HORIZONTAL) --- */
.gallery {
    display: flex; align-items: center; height: 100vh; height: 100dvh; 
    padding-left: 200px; padding-right: 50px; padding-bottom: 40px;
    overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-item {
    position: relative; height: 85vh; flex-shrink: 0; cursor: pointer;
    transition: opacity 0.5s ease, width 0.5s ease, margin 0.5s ease; margin-right: 30px;
}
.gallery-item.hidden-by-filter { opacity: 0; width: 0 !important; margin: 0; padding: 0; pointer-events: none; }

.item-media { height: 100%; width: auto; object-fit: contain; }


/* L'image elle-même avec une transition d'opacité fluide */
.item-media { 
    height: 100%; 
    width: auto; 
    object-fit: contain; 
    transition: opacity 0.3s ease; 
}

/* Le survol (blanchiment) s'active UNIQUEMENT si l'appareil a une vraie souris */
@media (hover: hover) {
    .gallery-item:hover .item-media {
        opacity: 0.85; /* Réduit l'opacité pour laisser transparaître le fond blanc */
    }
}

/* =========================================
   PAGE À PROPOS / CONTACT (NEWSPAPER STYLE)
   ========================================= */
   .about-container {
    padding-left: 200px;
    padding-right: 50px;
    padding-top: 80px; /* Ajoute un espace fixe en haut au lieu de centrer */
    padding-bottom: 80px;
    min-height: 100vh; /* Permet à la page de grandir si besoin */
    display: flex;
    align-items: flex-start; /* Aligne tout en haut, ça empêche l'effet "mangé" */
}

.about-grid {
    display: grid;
    /* Le secret pour des colonnes TOUJOURS égales : minmax(0, 1fr) */
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 60px;
    width: 100%;
    max-width: 1400px;
}

.about-title {
    font-size: 2rem;
    font-weight: 300;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

/* Le style Journal */
.newspaper-text {
    font-family: 'NomDeLaPolice', sans-serif;
    text-align: justify;
    line-height: 1.3;
    font-size: 0.9rem;
}
.mt-20 { margin-top: 20px; }

/* La photo de profil */
.profile-interactive-container {
    width: 100%;
    aspect-ratio: 4/5; 
    overflow: hidden; /* CRUCIAL : Masque ce qui dépasse quand on zoome */
    cursor: pointer;
}
.profile-pic {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease; 
}
.profile-interactive-container:hover .profile-pic {
    transform: scale(1.05); /* L'image grossit, mais le cadre reste fixe ! */
}

/* Le Formulaire de contact (Design minimaliste façon croquis) */
.contact-form {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-input {
    width: 100%; /* <--- AJOUT VITAL POUR NE PAS DÉPASSER DE L'ÉCRAN */
    border: 1px solid #000;
    background: transparent;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 1rem;
}

.contact-textarea {
    width: 100%; /* <--- AJOUT VITAL ICI AUSSI */
    border: 1px solid #000;
    background: transparent;
    padding: 15px;
    height: 300px; /* Grand espace d'écriture */
    resize: none; /* Empêche de déformer le site */
    font-size: 1rem;
    margin-bottom: 20px;
    font-family: inherit; /* Garde ta typo */
}

.btn-container {
    display: flex;
    justify-content: flex-end; /* Aligne le bouton à droite comme sur le croquis */
}

.contact-btn {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    padding: 10px 30px;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background: #000;
    color: #fff;
}
/* --- CORRECTIONS SPÉCIFIQUES PAGE À PROPOS --- */
body.page-about {
    overflow-y: auto; /* La ligne magique qui rétablit le scroll vertical ! */
    overflow-x: hidden;
}
/* --- FOOTER --- */
footer { position: fixed; bottom: 0; width: 100%; text-align: center; padding: 10px 0; font-size: 12px; color: var(--color-base); z-index: 60; pointer-events: none;}

/* =========================================
   RÈGLES RESPONSIVE (TABLETTES - JUSQU'À 1024PX)
   ========================================= */
   @media (max-width: 1024px) {
    
    /* 1. Correction de la galerie (pour ne pas écraser le footer) */
    .gallery-item {
        height: 70vh; /* On réduit un peu la hauteur */
        max-height: 800px; /* Sécurité maximale */
    }

    /* 2. Correction de la page À Propos (pour la photo) */
    .about-grid {
        /* LA ligne magique : empêche l'image de s'étirer pour copier la hauteur du texte */
        align-items: start; 
        
        /* Optionnel : on réduit l'écart entre les colonnes pour mieux respirer sur tablette */
        gap: 30px; 
    }
}

/* =========================================
   RÈGLES RESPONSIVE (MOBILES & PETITS ÉCRANS)
   ========================================= */
@media (max-width: 768px) {
    .sidebar { width: 100px; position :fixed ; top:0; left:-10px; }
    .logo { height: 100px; }
    .social-nav { margin-top: 20px; gap: 15px; }
    .nav-icon { width: 20px; }
    .icon-cross { width: 15px; }
    
    .f-icon { width: 16px; height: 16px; } 
    .filter-icons { gap: 10px; padding: 10px; height: 88px; /* Hauteur ajustée pour mobile */ }
    .f-icon.hidden-icon { margin-bottom: -10px; }
    .angle { width: 10px; }
    .gallery { padding-left: 120px; }
    .angles { transform: translateX(-20px); }
    .angle-l { top: 30px;left: 3px; }
    .angle-r { bottom: 30px; right: 3px;}
    
    .filter-menu.mode-selected .angle-l { top: 25px; }
    .filter-menu.mode-selected .angle-r { bottom: 25px; }

    /* Optionnel : si tu veux aussi réduire l'espacement entre elles sur mobile */
    .gallery-item {
        margin-right: 15px; /* On réduit un peu l'écart pour gagner de la place */
    }
    .glass-distortion-bar {
        /* On réduit drastiquement la largeur de la 'vitre' derrière le menu sur mobile */
        width: 150px; 
        
        /* On adoucit le masque : il devient très progressif */
        mask-image: linear-gradient(to right, black 10%, transparent 80%);
        -webkit-mask-image: linear-gradient(to right, black 10%, transparent 80%);
        
        /* On renforce le côté "laiteux" (blanchi) */
        background-color: rgba(255, 255, 255, 0.5);
        
        /* On augmente un peu le flou pour que ça reste harmonieux sur petite surface */
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }
    
    /* POUR LA PAGE A PROPOS */
 
    .about-container {
        display: block; /* On casse le flexbox qui forçait la largeur */
        width: 100%;    /* On force à respecter la taille de l'écran */
        padding-left: 90px; 
        padding-right: 20px;
        padding-top: 40px;
    }

    .about-grid {
        display: flex; /* Sur mobile, on remplace la grille par une colonne simple, 0 bug garanti */
        flex-direction: column;
        width: 100%;
        gap: 40px;
    }

    .newspaper-text {
        font-size: 1rem; 
        line-height: 1.2; /* Interlignage plus serré comme tu l'as demandé */
        overflow-wrap: break-word; /* Empêche les mots trop longs de créer un bug de largeur */
    }
    
    /* La colonne de contact s'adapte à 100% de la largeur disponible */
    .about-col {
        width: 100%;
    }
    @media (max-width: 360px) {
        /* CORRECTION POUR LES VIEUX IPHONES ET LE FOOTER */
    .gallery {
        height: 100%; /* Fallback pour les vieux navigateurs */
        padding-bottom: 60px; /* On pousse le contenu vers le haut pour éviter le footer */
        align-items: flex-start; /* On aligne en haut au lieu de centrer */
        padding-top: 30px; 
    }
    
    .gallery-item {
        height: 70vh; /* On réduit la hauteur de l'image sur mobile */
        max-height: 450px; /* Sécurité absolue pour ne pas déborder */
    }
    
    .item-media {
        max-width: 100%; /* Empêche l'image de casser la largeur */
    }
    }
}
/* =========================================
   CORRECTION BUG MOBILE (ANIMATIONS AU CHARGEMENT)
   ========================================= */
   body.is-loading * {
    transition: none !important;
}