.ecc-gallery {
    display: grid;
    gap: 15px;
}

.ecc-gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 200px;
    display: block;
    text-decoration: none;
}

.ecc-gallery-item img {
    width: 100%;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

.ecc-gallery-item::after {
    content: attr(data-overlay);
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

@keyframes ecc-rightEnter {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ecc-leftEnter {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes ecc-topEnter {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes ecc-bottomEnter {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes ecc-rightLeave {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes ecc-leftLeave {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes ecc-topLeave {
    from {
        transform: translateY(0);
        opacity: 1;
    }

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

@keyframes ecc-bottomLeave {
    from {
        transform: translateY(0);
        opacity: 1;
    }

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

.ecc-gallery-item.right:hover::after {
    animation: ecc-rightEnter 0.3s both;
}

.ecc-gallery-item.left:hover::after {
    animation: ecc-leftEnter 0.3s both;
}

.ecc-gallery-item.top:hover::after {
    animation: ecc-topEnter 0.3s both;
}

.ecc-gallery-item.bottom:hover::after {
    animation: ecc-bottomEnter 0.3s both;
}

.ecc-gallery-item.rightLeave::after {
    animation: ecc-rightLeave 0.3s both;
}

.ecc-gallery-item.leftLeave::after {
    animation: ecc-leftLeave 0.3s both;
}

.ecc-gallery-item.topLeave::after {
    animation: ecc-topLeave 0.3s both;
}

.ecc-gallery-item.bottomLeave::after {
    animation: ecc-bottomLeave 0.3s both;
}
