@import "../settings/_mixins";
@import "../settings/_variables";

.dne-elastic-stack {
    position: relative;

    .elastic-stack {
        position: relative;
        overflow: visible;
        width: 100%;
        height: 100%;
        perspective: 1200px;
        perspective-origin: 50% 200%;
        height: 500px;
        margin: 0 auto;
    }

    .grid-item {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        opacity: 0;
        -webkit-transition: all 0.3s ease-out;
        transition: all 0.3s ease-out;
        width: 100%;

        img {
            display: block;
            height: 100%;
            width: 100%;
            object-fit: cover;
            border-radius: 8px;
        }

        .grid-item-inner {
            padding: 60px;
            display: flex;
            gap: 80px;
            align-items: stretch;
            box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
            background-color: #fff;
            cursor: pointer;
            visibility: visible;
            transform-origin: 50% -10%;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            transform: translate3d(0, 0, -180px);
            width: 100%;
            border-radius: 16px;
            overflow: hidden;
            -webkit-transition: all 0.3s ease-out;
            transition: all 0.3s ease-out;
        }

        &.move-back {
            .grid-item-inner {
                -webkit-transition-timing-function: cubic-bezier(
                    0.175,
                    0.885,
                    0.47,
                    1
                );
                -webkit-transition-timing-function: cubic-bezier(
                    0.175,
                    0.885,
                    0.47,
                    1.515
                );
                transition-timing-function: cubic-bezier(
                    0.175,
                    0.885,
                    0.47,
                    1.515
                );
            }
        }
    }

    .dnetor-elastic-stack-title {
        font-size: 28px;
        margin-bottom: 16px;
        color: #111;
    }

    .dnetor-elastic-stack-description {
        font-size: 16px;
        color: #555555;
        margin-bottom: 32px;
    }

    .dnetor-elastic-stack-btn {
        text-align: center;
        border-radius: 30px;
        font-size: 17px;
        padding: 7px 24px;
        width: 156px;
    }
    .dnetor-elastic-stack-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .dnetor-elastic-stack-thumbnail {
        flex: 0 0 50%;
        max-width: 50%;
        .image {
            width: 100%;
        }
        img {
            width: 100%;
            object-fit: cover;
        }
    }
    .heading-secondary-before {
        font-family: var(--e-global-typography-primary-font-family);
        font-weight: 500;
    }
    .heading-title {
        font-size: 34px;
        font-weight: 600;
    }

    .elastic-stack-button {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        @include d-flex();
        align-items: center;
        justify-content: center;
        background: var(--e-global-color-accent);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        padding: 12px;
        cursor: pointer;
        color: #fff;
        svg {
            fill: #ffffff;
        }

        &:hover {
            cursor: pointer;
        }

        &.dnetor-elastic-stack-prev {
            left: -20px;
        }

        &.dnetor-elastic-stack-next {
            right: -20px;
        }
    }
}

@media (max-width: 767px) {
    .dne-elastic-stack {
        .grid-item {
            .grid-item-inner {
                padding: 30px;
                display: block;
            }
        }
        .dnetor-elastic-stack-content {
            padding-bottom: 20px;
        }
        .dnetor-elastic-stack-thumbnail {
            flex: 0 0 100%;
            max-width: 100%;
            width: 100%;
        }
    }
}
