.ws-expertises {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.ws-expertise {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 32px 24px;
    border-radius: 8px;
    border: 1px solid var(--stroke);
    background-color: white;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 8px 8px 0 0 var(--light-orange);
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;

    &:hover {
        background-color: var(--theme-color);
        color: white;

        .ws-expertise__icon {
            opacity: 0;
        }

        .ws-expertise__icon-hover {
            opacity: 1;
        }

        .ws-expertise__tag {
            color: white;
            background-color: var(--light-transparent);
        }
    }

    & .ws-expertise-modal {
        background-color: var(--theme-color-light);

        & .highlighted {
            width: fit-content;
            color: white;
            background-color: var(--theme-color-contrast);
            padding: 2px 4px;
        }

        & .colored{
            color: var(--orange);
        }

        & ul li:has(.colored) {
            color: var(--orange);
        }

        & .ws-expertise-modal-title {
            color: var(--theme-color);
        }

        & .ws-expertise-modal-close {
            fill: var(--theme-color);
        }

        & .ws-expertise-modal-content {
            /* Firefox only */
            @-moz-document url-prefix() {
                scrollbar-color: var(--theme-color) transparent;
            }
        }

        & .ws-expertise-modal-content::-webkit-scrollbar-thumb {
            background: var(--theme-color);
        }
    }

    &:nth-child(8n + 1), &:nth-child(8n + 3),
    &:nth-child(8n + 6), &:nth-child(8n + 8) {
        --theme-color: var(--orange);
        --theme-color-light: var(--light-orange);
        --theme-color-contrast: var(--blue);
    }

    &:nth-child(8n + 2), &:nth-child(8n + 4),
    &:nth-child(8n + 5), &:nth-child(8n + 7) {
        --theme-color: var(--blue);
        --theme-color-light: var(--light-blue);
        --theme-color-contrast: var(--orange);
    }
}

.ws-expertises__count {
    color: var(--dark-grey);
}

.ws-expertise__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 16px;
}

.ws-expertise__tag {
    transition: color 0.3s ease-in-out;
}

.ws-expertise__icons {
    position: relative;
    height: 100%;
    width: 100%;
}

.ws-expertise__icon {
    position: absolute;
    right: -35px;
    bottom: -55px;
    transition: opacity 0.3s ease-in-out;
}

.ws-expertise__icon-hover {
    position: absolute;
    right: -35px;
    bottom: -55px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.ws-expertise-modal {
    width: 664px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
    border: 0;
    border-radius: 16px;
    z-index: 100;
    cursor: auto;
    overflow: hidden;
    font-family: 'Google Sans Flex';
    animation: slideUp 0.3s ease-in-out forwards;

    &:focus-visible {
        outline: none;
    }

    &.modal-closing {
        animation: slideDown 0.3s ease-in-out forwards;
    }

    @media (max-width: 767px) {
        overflow-y: scroll;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

.ws-expertise-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

.ws-expertise-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    & svg {
        width: 15px;
        cursor: pointer;
    }
}

.ws-expertise-modal-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ws-expertise-modal-excerpt {
    color: var(--dark-grey);
}

.ws-expertise-modal-content {
    max-height: 60vh;
    overflow-y: scroll;
    color: var(--dark-grey);

    @media (max-width: 767px) {
        max-height: 100%;
    }

    &::-webkit-scrollbar {
        width: 7px;
        background: transparent;
    }

    &::-webkit-scrollbar-track {
        background: transparent;
    }

    &::-webkit-scrollbar-thumb {
        border-radius: 50px;
    }

    &::-webkit-scrollbar-button {
        display: none;
        width: 0;
        height: 0;
    }

    /* Firefox only */
    @-moz-document url-prefix() {
        scrollbar-width: thin;
    }
}

.ws-expertise-modal-secteur {
    padding-bottom: 10px;
    font-weight: 600;
    color: var(--dark-grey);
}

.ws-expertise-modal-button-text {
    color: var(--dark-grey);
}

.ws-expertise-modal-footer {
    display: flex;
    gap: 24px;

    @media (max-width: 767px) {
        flex-direction: column;
    }
}

.ws-expertise-modal-divider {
    height: 10px;
    border-bottom: 1px solid #12253052;
    padding-bottom: 25px;
    margin-bottom: 20px;
    width: 80%;
    align-self: center;
}

.ws-expertise-modal-exemple {
    font-weight: 500;
}

.ws-expertise-modal-shape {
    position: absolute;
    background-color: white;
    z-index: -1;

    &.big-circle {
        width: 260px;
        height: 260px;
        border-radius: 50%;
        left: -21px;
        bottom: -182px;
        opacity: 0.25;
    }

    &.small-circle {
        width: 81px;
        height: 81px;
        border-radius: 50%;
        left: -36px;
        bottom: -15px;
        opacity: 0.25;
    }

    &.big-square {
        width: 218px;
        height: 218px;
        right: -50px;
        bottom: -180px;
        opacity: 0.4;
        border-radius: 16px;
        transform: rotate(45deg);
    }

    &.small-square {
        width: 104px;
        height: 104px;
        right: -50px;
        bottom: -30px;
        opacity: 0.4;
        border-radius: 16px;
        transform: rotate(45deg);
    }
}

@media (max-width: 1024px) {
    .ws-expertises {
        grid-template-columns: repeat(3, 1fr);
    }

    .ws-expertise:nth-child(6n + 1), .ws-expertise:nth-child(6n + 3), .ws-expertise:nth-child(6n + 5) {
        --theme-color: var(--orange);
        --theme-color-light: var(--light-orange);
        --theme-color-contrast: var(--blue);
    }

    .ws-expertise:nth-child(6n + 2), .ws-expertise:nth-child(6n + 4), .ws-expertise:nth-child(6n + 6) {
        --theme-color: var(--blue);
        --theme-color-light: var(--light-blue);
        --theme-color-contrast: var(--orange);
    }
}

@media (max-width: 767px) {
    .ws-expertises {
        grid-template-columns: repeat(2, 1fr);
    }

    .ws-expertise:nth-child(4n + 1), .ws-expertise:nth-child(4n + 4) {
        --theme-color: var(--orange);
        --theme-color-light: var(--light-orange);
        --theme-color-contrast: var(--blue);
    }

    .ws-expertise:nth-child(4n + 2), .ws-expertise:nth-child(4n + 3) {
        --theme-color: var(--blue);
        --theme-color-light: var(--light-blue);
        --theme-color-contrast: var(--orange);
    }
}

@media (max-width: 480px) {
    .ws-expertises {
        grid-template-columns: repeat(1, 1fr);
    }

    .ws-expertise:nth-child(odd) {
        --theme-color: var(--orange);
        --theme-color-light: var(--light-orange);
        --theme-color-contrast: var(--blue);
    }

    .ws-expertise:nth-child(even) {
        --theme-color: var(--blue);
        --theme-color-light: var(--light-blue);
        --theme-color-contrast: var(--orange);
    }
}