/*──────────────────
        projects
──────────────────*/

#projects {
        margin-top: 100px;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: var(--main-fonts-color);
}

.work-box {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 0px;
        box-sizing: border-box;
}

#projects h3 {
        padding-top: 70px;
}

#projects p {
        font-family: var(--main-font-family);
        font-size: 1.2rem;
        padding: 0px;
}

.work {
        display: grid;
        /* Solution améliorée pour centrer les projets quand il y en a peu */
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
        padding: 25px;
        max-width: 1200px;
        margin: 0 auto;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
        justify-items: center;

        /* Force l'alignement central des éléments */
        text-align: center;
}

.card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: 500px !important;
        /* ICI LA TAILLE DES CARDS */
        border-radius: 12px !important;
        background: var(--main-decor-color) !important;
        overflow: hidden !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
}

.card {
        position: relative !important;
}

.card .work-img {
        width: 100% !important;
        height: 100% !important;
        border-radius: 10px 10px 0px 0px !important;
        object-fit: cover !important;
        transition: transform 0.5s ease !important;
}

.card .hover-img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 70% !important;
        border-radius: 10px 10px 0px 0px !important;
        object-fit: cover !important;
        opacity: 0 !important;
        transition: opacity 0.5s ease !important;
}

.card:hover .hover-img {
        opacity: 1 !important;
}

.card .work-content {
        text-align: center;
        padding: 8px;
        font-size: 1rem;
        color: var(--main-fonts-color);
        font-family: var(--main-font-family);
        cursor: pointer;
        height: auto;
        min-height: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: white;
        transition: background-color 0.3s ease;
        overflow: visible;
        position: relative;
        margin-top: -60px;
}

.card .work-content .github-link {
        position: absolute;
        bottom: 8px;
        right: 8px;
        text-decoration: none;
        color: #333;
        background: rgba(255, 255, 255, 0.9);
        padding: 6px;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
}

.card .work-content .github-link:hover {
        transform: scale(1.1);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
        background: #333;
        color: white;
}

.card .work-content .tag-container {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        padding: 0 4px;
        width: 100%;
        margin-top: auto;
}

.card .work-content .project-tag {
        white-space: normal;
        line-height: 1.2;
        max-width: none;
}

.card .work-content .project-title {
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
}

.card .work-content .tag-container {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        width: 100%;
        padding: 0 4px;
}

.card a {
        text-decoration: none;
        color: inherit;
}

.card .work-content:hover {
        color: #202020;
        background-color: #f9f9f9;
}

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

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

/* Styles responsifs pour la section projets */
@media only screen and (max-width: 1484px) and (min-width: 1214px) {
        .work {
                padding: 20px 20%;
        }
}

@media only screen and (max-width: 1214px) and (min-width: 1000px) {
        .work {
                padding: 20px 12%;
        }
}


@media only screen and (max-width: 1000px) and (min-width: 768px) {
        .work {
                padding: 20px 10%;
        }
}

@media only screen and (max-width: 768px) {
        .work {
                padding: 20px 6%;
        }
}
/* Masquer les liens GitHub pour les projets sans GitHub */
.card.nogithub .github-link {
    display: none !important;
}

/* Afficher les liens GitHub pour les projets avec GitHub */
.card.hasgithub .github-link {
    display: flex !important;
}
