#section_competences{
    height: 100%;
}

.competences_content {
    display: flex;
    justify-content: flex-end;
    width: 90%;
    margin: auto;
}

.competences_content{
    display: flex;
    flex-wrap: nowrap;
    margin-top: 1rem;
    height: 100%;
    width: 100%;
    border: 4px solid rgba(0, 0, 0, 0);
}

.competence {
    margin: auto;
}

.grid {
    width: 100%;
    min-width: none;
    z-index: 1;
    height: 550px;
    min-height: 550px;
    border-radius: 30px;
    background-color: #fff2e3;
}

.grid ul {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    flex-wrap: wrap;
    list-style-type: none;
    padding: 0;
    justify-content: space-between;
    grid-gap : 0px;

}

.grid > ul > li {
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    border-radius: 40px;
    animation: enter_grid 1s ease;
    flex-direction: column;
    color: black;
    font-size: 16px;
}

.grid > ul > li > a > img{
    width: 100%;
    height: 60px;
    object-fit: contain;
}

.grid > ul > li:hover {
    transform: scale(1.1);
    transition: transform 0.4s ease-in-out;
}

@keyframes enter_grid {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}



.families {
    display: flex; 
    flex-direction: column;
    flex-shrink: 0;
    justify-content: center;
    align-self: stretch;
    width : 35%;
    height: 25%;
    border-radius: 15px 0 0 15px;
    overflow: hidden;
    z-index: 1;
    margin-right: -40px;
    padding-left: 10px;
}

.family {
    display: flex;
    position: relative;
    overflow: hidden;
    height: 8vh;
    padding: 2rem;
    border: 0px solid rgba(0, 0, 0, 0);
    background-color: transparent;
    color: #008286;
    border-radius: 15px 0 0 15px;
    transition: color 0.5s ease;
    align-items: center;
    justify-content: center;
    padding-right: 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}


.family::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0;
    background-color: #fff2e3;
    border-radius: 15px;
    transition: width 0.5s ease;
    z-index: -1;
}

.family.selected::before {
    width: 100%;
}


.family.selected {
    z-index: 2;
    color: black;
    cursor: default; 
}

#stm {
    display: flex;
    flex-direction: row;   
}

@media (max-width: 950px) {
    .competences_content {
        display: grid;
        grid-template-columns: 1fr;
    }

    .families{
        display: contents;
    }

    .family {
        width: 100%;
        margin-bottom: 0;
    }

    .grid {
        display: block;
        width: 100%;
        height: auto;
        margin: 10px 0 20px 0;
    }

    #cao {order: 2;}
    #programming {order: 4;}
    #electronics {order: 6;}
    #ai-data {order: 8;}
}


@media (max-width:420px){
    .grid ul {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .grid ul li {
        font-size: 14px;
    }
}
