/* ==================== PAGE PROJETS ==================== */

.project-filters {
    margin-bottom: 3rem;
    text-align: center;
}

.project-filters h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.6;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    color: var(--secondary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ==================== GRILLE ==================== */

.projects-section {
    margin-bottom: 4rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
}

/* ==================== CARTE ==================== */

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: scale(1);
}

/* Classe pour gérer l'état caché avec une transition douce */
.project-card.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none; /* Empêche les clics pendant la disparition */
    height: 0; /* Réduit la hauteur pour que l'espace se réorganise */
    margin-bottom: -24px; /* Compense le 'gap' de la grille */
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ---- Image : hauteur fixe identique pour toutes les cards ---- */
.project-image {
    width: 100%;
    height: 190px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;     /* image entière visible sans recadrage */
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* ---- Contenu condensé ---- */
.project-content {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.project-content h3 {
    color: var(--secondary-color);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* Description : 3 lignes max avec "..." */
.project-content p {
    color: var(--light-text);
    font-size: 0.83rem;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Tags ---- */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.tag {
    display: inline-block;
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ---- Boutons ---- */
.project-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.project-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.project-btn:not(.secondary) {
    background: var(--primary-color);
    color: white;
}

.project-btn:not(.secondary):hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.project-btn.secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.project-btn.secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.project-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== SECTION TECH ==================== */

.tech-section {
    background: var(--light-bg);
    padding: 4rem 0;
    border-radius: 20px;
    margin-top: 4rem;
}

.tech-section h2 {
    text-align: center;
    color: var(--secondary-color);
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tech-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.tech-item:hover {
    transform: translateY(-5px);
}

.tech-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tech-item h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.tech-item p {
    color: var(--light-text);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-image {
        height: 180px;
    }

    .filter-btn {
        font-size: 0.82rem;
        padding: 7px 14px;
    }

    .project-actions {
        flex-direction: column;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
