.team-grid__list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4rem 2rem;
}

.team-grid-item {
    width: 100%;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.team-grid-item__toggler {
    aspect-ratio: 1/1;
    width: 3rem;
    background: var(--color-secondary);
    border-radius: 100%;
    color: var(--color-primary);
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    cursor: pointer;
    transition: var(--trans);
}

.team-grid-item.active .team-grid-item__toggler {
    background: var(--color-primary);
    color: var(--color-secondary);
}

.team-grid-item.active .team-grid-item__toggler {
    transform: rotate(45deg);
}

.team-grid-item__toggler::before,
.team-grid-item__toggler::after {
    content: '';
    display: block;
    width: 1rem;
    height: 0.1rem;
    background: currentColor;
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
}

.team-grid-item__toggler::after {
    transform: rotate(90deg);
}

.team-grid-item__wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.team-grid-item__image {
    aspect-ratio: 295/375;
    width: 100%;
}

.team-grid-item__info {
    border-radius: 1rem;
    overflow: hidden;
    position: absolute;
    inset: -0.1rem;
    pointer-events: none;

    transform: translateX(-200%);
    transition: 1s transform;
    transition-delay: 0.2s;
    overflow: hidden;
    backdrop-filter: blur(7.5px);
}

.team-grid-item.active .team-grid-item__info {
    transition-delay: 0s;
    transform: translateX(0);
    pointer-events: all;
}

.team-grid-item__info-overlay {
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.3;
}

.team-grid-item__info-inner {
    justify-content: space-between;
    gap: 2rem;
    padding: 4rem;
    height: 100%;
    background: var(--color-hover);

    position: relative;
    z-index: 1;
    transform: translateX(-100%);  
    transition: 1s ease-out;
}

.team-grid-item.active .team-grid-item__info-inner {
    transform: translateX(0);
    transition-delay: 0.2s;
}

.team-grid-item__info-header {
    display: none;
}

.team-grid-item__text {
    --clamp: 12;
    max-height: 85%;
    margin-bottom: auto;
    overflow-y: auto;
}

.team-grid-item__name {
    font-weight: 700;
}

.team-grid-item .socials {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.team-grid-item .socials__item {
    width: 2.2rem;
    transition: var(--trans);
    cursor: pointer;
}

.team-grid-item .socials__item path {
    fill: var(--color-primary);
}

[data-current-variation="2"] .team-grid__list {
    grid-template-columns: repeat(3, 1fr);
}


[data-current-variation="3"] .team-grid__list {
    grid-template-columns: repeat(2, 1fr);
}

[data-current-variation="3"] .team-grid-item {
    flex-direction: unset;
}

[data-current-variation="3"] .team-grid-item__toggler {
    display: none;
}

[data-current-variation="3"] .team-grid-item__wrapper {
    display: flex;
    width: 100%;
}

[data-current-variation="3"] .team-grid-item__image {
    flex: 1;
    position: relative;
    z-index: 1;
}

[data-current-variation="3"] .team-grid-item__info {
    flex: 1;
    position: relative;
    inset: unset;
    transform: unset;
    transition: unset;
    margin-left: -2rem;
    pointer-events: all;
}

[data-current-variation="3"] .team-grid-item__info-inner {
    transform: unset;
    transition: unset;
    margin-left: 2rem;
}

[data-current-variation="3"] .team-grid-item > .team-grid-item__name,
[data-current-variation="3"] .team-grid-item > .team-grid-item__profession {
    display: none;
}

[data-current-variation="3"] .team-grid-item__info-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

[data-current-variation="3"] .team-grid-item__info-header .team-grid-item__name {
    color: var(--color-primary);
}


@media (hover: hover) and (pointer: fine) {
    .team-grid-item__toggler:hover {
        background: var(--color-primary);
        color: var(--color-secondary);
    }

    .team-grid-item .socials__item:hover {
        opacity: 0.5;
    }
}

@media screen and (max-width: 1024.9px) {
    .team-grid__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-grid__btns {
        padding-top: 3rem;
    }

    [data-current-variation="3"] .team-grid__list {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media screen and (max-width: 575.9px) {
    .team-grid__list {
        grid-template-columns: repeat(1, 1fr);
    }

    .team-grid-item__image {
        aspect-ratio: 335/364;
    }

    [data-current-variation="3"] .team-grid-item__wrapper {
        flex-direction: column;
    }

    [data-current-variation="3"] .team-grid-item__info {
        margin-top: -2rem;
        margin-left: 0;
    }

    [data-current-variation="3"] .team-grid-item__info-inner {
        margin-top: 2rem;
        margin-left: 0;
    }
}