/* =========================================
   CONTENEUR PRINCIPAL (.portfolio-page)
   ========================================= */
.portfolio-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    margin-top: 200px; /* Espace pour le header fixe */
}

/* =========================================
   GRILLE DES PROJETS (.portfolio-grid)
   ========================================= */
.portfolio-grid {
    display: grid;
    /* Grille responsive : colonnes générées automatiquement (min 350px de large) */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* =========================================
   CARTE DE PROJET (.portfolio-card)
   ========================================= */
.portfolio-card {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background-color: #1a1a1a;
    aspect-ratio: 16/9; /* Ratio format vidéo standard */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Image de fond de la carte */
.portfolio-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* =========================================
   OVERLAY & CONTENU (.portfolio-card__overlay)
   ========================================= */
/* Masque assombrissant qui apparaît au survol */
.portfolio-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(0, 0, 0, 0); /* Invisible par défaut */
    transition: background 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
}

/* Conteneur des détails (Date et Bouton) */
.portfolio-card__details {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0; /* Caché par défaut */
    transform: translateY(20px); /* Décalé vers le bas */
    transition: all 0.4s ease;
    height: 0;
    overflow: hidden;
    padding: 10px;
}

/* Date du projet */
.portfolio-card__date {
    font-size: 1.5rem;
    font-family: var(--font-tertiary, "lft-etica-compressed", sans-serif);
    color: var(--txt-color, #ffffff);
    margin-bottom: 15px;
    margin-top: 5px;
}

/* Bouton spécifique à la carte (hérite de .btn) */
.portfolio-card__btn {
    padding: 8px 20px;
    width: 100px;
    height: 20px;
    font-size: 20px;  
    /* La transition de background est déjà gérée en partie par .btn, 
       mais on s'assure qu'elle est fluide ici si besoin */
    transition: background-color 0.2s;
}

/* =========================================
   ANIMATIONS AU SURVOL (HOVER)
   ========================================= */

/* Effet de zoom sur l'image */
.portfolio-card:hover .portfolio-card__img {
    transform: scale(1.03); 
}

/* Assombrissement du fond */
.portfolio-card:hover .portfolio-card__overlay {
    background: rgba(0, 0, 0, 0.85); 
}

/* Si un titre était ajouté plus tard, on prévoit son animation 
   (Actuellement absent de la structure HTML, mais laissé par sécurité) */
.portfolio-card:hover .portfolio-card__title {
    transform: translateY(-10px); 
}

/* Apparition des détails (Date + Bouton) */
.portfolio-card:hover .portfolio-card__details {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    margin-top: 20px;
}

/* =========================================
   VERSION MOBILE & ÉCRANS TACTILES (CORRIGÉE)
   ========================================= */
@media (hover: none) and (pointer: coarse) {
    
    /* 1. On "ouvre" la boîte parent qui écrasait le bouton à 0 pixel */
    .portfolio-card__details {
        height: 100% !important;
        width: 100% !important;
        overflow: visible !important;
        transform: none !important;
        opacity: 1 !important;
    }

    /* 2. On masque la date pour garder ton image complètement épurée */
    .portfolio-card__date {
        display: none !important; 
    }

    /* 3. On étend le bouton sur toute la carte et on le rend transparent */
    .portfolio-card__btn {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 10 !important;
        opacity: 0 !important; /* Le bouton est là, mais invisible */
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 4. On annule les animations visuelles tactiles qui créent des conflits */
    .portfolio-card:hover .portfolio-card__img,
    .portfolio-card:active .portfolio-card__img {
        transform: none !important;
    }

    .portfolio-card:hover .portfolio-card__overlay,
    .portfolio-card:active .portfolio-card__overlay {
        background: transparent !important;
    }
}