/* carousel */
.carousel{
    width: 100%;
    overflow: hidden;
    position: relative;
    /* cursor: grab; */
}
.carousel.dragging{
    cursor: grabbing;
}
.carousel .list .item{
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0 0 0 0;
}
.carousel .list .item img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right bottom;
    /* margin-left: auto; */
    will-change: transform;
}
.carousel .list .item .content{
    position: absolute;
    top: 20%;
    /* width: 1140px; */
    max-width: 80%;
    left: 30%;
    transform: translateX(-30%);
    padding-right: 30%;
    /* border: 1px solid #fff4; */
    box-sizing: border-box;
    color: var(--color-text);
    text-shadow: 0 5px 10px #0004;
}
.carousel .list .item .sub-title{
    font-weight: bold;
    letter-spacing: 10px;
    margin-bottom: 10px;
}
.carousel .list .item .title,
.carousel .list .item .topic{
    font-size: 3em;
    font-weight: bold;
    line-height: 1.3em;
    
}
.carousel .list .item .topic{
    color: #f1683a;
}
.carousel .list .item .des{
    margin-bottom: 5px;
}
.carousel .list .item .buttons{
    display: grid;
    grid-template-columns: repeat(2, 130px);
    grid-template-rows: 40px;
    gap: 5px;
    margin-top: 20px;
}
.carousel .list .item .buttons button{
    border: none;
    background-color: #eee;
    letter-spacing: 3px;
    font-family: Poppins;
    font-weight: 500;
}
.carousel .list .item .buttons button:nth-child(2){
    background-color: transparent;
    border: 1px solid #fff;
    color: #eee;
}
/* removed unused thumbnail and arrows */

/* animation */
.carousel .list .item:nth-child(1){
    z-index: 1;
    background-color: var(--color-bg);
}

/* animation text in first item */

.carousel .list .item:nth-child(1) .content .sub-title,
.carousel .list .item:nth-child(1) .content .title,
.carousel .list .item:nth-child(1) .content .topic,
.carousel .list .item:nth-child(1) .content .des,
.carousel .list .item:nth-child(1) .content .buttons
{
    transform: translateY(50px);
    filter: blur(20px);
    opacity: 0;
    animation: showContent .5s 1s linear 1 forwards;
}
@keyframes showContent{
    to{
        transform: translateY(0px);
        filter: blur(0px);
        opacity: 1;
    }
}
.carousel .list .item:nth-child(1) .content .title{
    animation-delay: 1.2s!important;
}
.carousel .list .item:nth-child(1) .content .topic{
    animation-delay: 1.4s!important;
}
.carousel .list .item:nth-child(1) .content .des{
    animation-delay: 1.6s!important;
}
.carousel .list .item:nth-child(1) .content .buttons{
    animation-delay: 1.8s!important;
}
/* create animation when next click */
.carousel.next .list .item:nth-child(1) img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: slideInFromRight 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 1 forwards;
}
@keyframes slideInFromRight{
    from{
        transform: translateX(100%);
        opacity: 1;
    }
    to{
        transform: translateX(0%);
        opacity: 1;
    }
}

/* outgoing slide for next: old first (now last) moves left */
.carousel.next .list .item:nth-last-child(1){
    z-index: 2;
}
.carousel.next .list .item:nth-last-child(1) img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: slideOutToLeft 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) 1 forwards;
}
@keyframes slideOutToLeft{
    from{
        transform: translateX(0%);
        opacity: 1;
    }
    to{
        transform: translateX(-100%);
        opacity: 1;
    }
}

.carousel.prev .list .item img{
    z-index: 100;
}
/* removed unused thumbnail effects */

/* running time */

/* removed unused .time rules */
@keyframes runningTime{
    from{ width: 100%}
    to{width: 0}
}


/* prev click */

.carousel.prev .list .item:nth-child(2){
    z-index: 2;
}

.carousel.prev .list .item:nth-child(2) img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: slideOutToRight 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) 1 forwards;
}
@keyframes slideOutToRight{
    from{
        transform: translateX(0%);
        opacity: 1;
    }
    to{
        transform: translateX(100%);
        opacity: 1;
    }
}

/* incoming slide for prev from left */
.carousel.prev .list .item:nth-child(1) img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: slideInFromLeft 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 1 forwards;
}
@keyframes slideInFromLeft{
    from{
        transform: translateX(-100%);
        opacity: 1;
    }
    to{
        transform: translateX(0%);
        opacity: 1;
    }
}

/* removed unused thumbnail and arrows rules */
.carousel.prev .list .item:nth-child(2) .content .sub-title,
.carousel.prev .list .item:nth-child(2) .content .title,
.carousel.prev .list .item:nth-child(2) .content .topic,
.carousel.prev .list .item:nth-child(2) .content .des,
.carousel.prev .list .item:nth-child(2) .content .buttons
{
    animation: contentOut 1.5s linear 1 forwards!important;
}

/* ensure outgoing text animation also when moving to next (left swipe) */
.carousel.next .list .item:nth-last-child(1) .content .sub-title,
.carousel.next .list .item:nth-last-child(1) .content .title,
.carousel.next .list .item:nth-last-child(1) .content .topic,
.carousel.next .list .item:nth-last-child(1) .content .des,
.carousel.next .list .item:nth-last-child(1) .content .buttons
{
    animation: contentOut 1.5s linear 1 forwards!important;
}

@keyframes contentOut{
    to{
        transform: translateY(-150px);
        filter: blur(20px);
        opacity: 0;
    }
}
@media screen and (max-width: 678px) {
    .carousel .list .item .content{
        padding-right: 0;
    }
    .carousel .list .item .content .title{
        font-size: 30px;
    }
    .carousel .list .item img{
        object-position: center bottom;
    }
}
