
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* carousel */
.carousel {
    height: 80vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

.carousel .list .item {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0 0 0 0;
}

.carousel .list .item_img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel .list .item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* border-radius: 12px; */
    background: linear-gradient(to right, var(--bgcolor), rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.travel-info {
    position: absolute;
    top: 25%;
    left: 3%;
    width: 50%;
}

.travel-info h1 {
    color: var(--slidercardTitlecolor);
    font-size: 30px;
    margin-bottom: 17px;
    height: fit-content;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 330px;
}

.travel-info .timestamp {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 17px;
}

.travel-info .timestamp span {
    color: var(--slidercardCatColor);
    font-size: 16px;
    font-weight: 500;
    opacity: 0.6;
}

.travel-info .timestamp span i::before {
    transform: scale(1.5);
}

.travel-info .timestamp .badges {
    display: flex;
    gap: 5px;
    margin-left: 8px;
}

.travel-info .timestamp .badge {
    display: block;
    border: solid 1px #c9c9c9;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 15px;
}

.travel-info .description {
    color: var(--cardDesColor);
    opacity: 0.8;
    font-size: 15px;
    font-weight: 300;
    padding-right: 20px;
    display: -webkit-box;
    white-space: normal;
    text-overflow: ellipsis;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 23px;
    margin-bottom: 35px;
}

.travel-info .btns {
    display: flex;
    gap: 17px;
    text-wrap: nowrap;
}

.travel-info .btns a {
    padding: 9px 23px;
}


/* thumbail */
.thumbnail {
    position: absolute;
    bottom: 50px;
    left: 50%;
    width: max-content;
    z-index: 100;
    display: flex;
    gap: 20px;
}

.thumbnail .item {
    width: 150px;
    height: 220px;
    flex-shrink: 0;
    position: relative;
}

.thumbnail .item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(to top, #000000e6, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.thumbnail .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.thumbnail .item .content {
    color: #fff;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 1;
}

.thumbnail .item .content .title {
    font-weight: 500;
}

.thumbnail .item .content .description {
    font-weight: 300;
}

/* arrows */
.arrows {
    position: absolute;
    top: 90%;
    right: 60%;
    z-index: 100;
    width: 300px;
    max-width: 30%;
    display: flex;
    gap: 15px;
    align-items: center;
}

.arrows button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--themeActiveColor);
    border: none;
    color: white;
    font-family: monospace;
    font-weight: bold;
    transition: .5s;
}

.arrows button:hover {
    background-color: #fff;
    color: var(--themeActiveColor);
}

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

/* animation text in first item */

.carousel .list .item:nth-child(1) .travel-info,
.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;
        z-index: 99;
    }
}

.carousel .list .item:nth-child(1) .travel-info {
    animation-delay: 1.2s !important;
}

/* create animation when next click */
.carousel.next .list .item:nth-child(1) img {
    width: 150px;
    height: 220px;
    position: absolute;
    bottom: 50px;
    left: 50%;
    border-radius: 30px;
    animation: showImage .5s linear 1 forwards;
}


@keyframes showImage {
    to {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

.carousel.next .thumbnail .item:nth-last-child(1) {
    overflow: hidden;
    animation: showThumbnail .5s linear 1 forwards;
}

.carousel.prev .list .item img {
    z-index: 100;
}

@keyframes showThumbnail {
    from {
        width: 0;
        opacity: 0;
    }
}

.carousel.next .thumbnail {
    animation: effectNext .5s linear 1 forwards;
}

@keyframes effectNext {
    from {
        transform: translateX(150px);
    }
}

/* running time */

.carousel .time {
    position: absolute;
    z-index: 1000;
    width: 0%;
    height: 3px;
    background-color: var(--themeActiveColor);
    left: 0;
    top: 0;
}

.carousel.next .time,
.carousel.prev .time {
    animation: runningTime 3s linear 1 forwards;
}

@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 {
    animation: outFrame 0.5s linear 1 forwards;
    position: absolute;
    bottom: 0;
    left: 0;
}

@keyframes outFrame {
    to {
        width: 150px;
        height: 220px;
        bottom: 50px;
        left: 50%;
        border-radius: 30px;
    }
}

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

.carousel.prev .list .item:nth-child(1) img {
    width: 150px;
    height: 220px;
    position: absolute;
    bottom: 50px;
    left: 50%;
    border-radius: 30px;
    animation: showImage .5s linear 1 forwards;
}

.carousel.prev .thumbnail {
    animation: effectPrev .5s linear 1 forwards;
}

@keyframes effectPrev {
    from {
        transform: translateX(-150px);
    }
}

.carousel.prev .thumbnail .item:nth-child(1) {
    animation: showThumbnailPrev .5s linear 1 forwards;
    overflow: hidden;
}

@keyframes showThumbnailPrev {
    from {
        width: 0;
        opacity: 0;
    }
}

@media only screen and (max-width: 560px) {
    .travel-info .btns a {
        padding: 5px 7px;
    }

    .carousel {
        height: 68vh;
        width: 100vw;
        overflow: hidden;
        position: relative;
    }

    .travel-info {
        position: absolute;
        top: 5%;
        left: 3%;
        width: 50%;
    }

    .thumbnail .item {
        width: 140px;
        height: 180px;
        flex-shrink: 0;
        position: relative;
    }
}
