@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;
    margin-top: -50px;
    width: 100vw;
    overflow: hidden;
    position: relative;
    object-fit: cover;
}
.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;
    border-radius: 20px;
}

.carousel .list .item .content{
    position: absolute;
    top: 20%;
    width: 1140px;
    max-width: 80%;
    left: 50%;
    transform: translateX(-50%);
    padding-right: 30%;
    box-sizing: border-box;
    color: #fff;
    text-shadow: 0 5px 10px #0004;
}
.carousel .list .item .author{
    font-weight: bold;
    letter-spacing: 10px;
}
.carousel .list .item .title,
.carousel .list .item .topic{
    font-size: 4em;
    font-weight: bold;
    line-height: 1.3em;
}
.carousel .list .item .topic{
    color: #f1683a;
}
.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;
}
/* 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 img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}
.thumbnail .item .content{
    color: #fff;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
}
.thumbnail .item .content .title{
    font-weight: 500;
}
.thumbnail .item .content .description{
    font-weight: 300;
}
/* arrows */
.arrows{
    position: absolute;
    top: 80%;
    right: 52%;
    z-index: 100;
    width: 300px;
    max-width: 30%;
    display: flex;
    gap: 10px;
    align-items: center;
}
.arrows button{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #eee4;
    border: none;
    color: #fff;
    font-family: monospace;
    font-weight: bold;
    transition: .5s;
}
.arrows button:hover{
    background-color: #fff;
    color: #000;
}

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

/* animation text in first item */

.carousel .list .item:nth-child(1) .content .author,
.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{
    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: #f1683a;
    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: 20px;
    }
}

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

.carousel.prev .list .item:nth-child(2) .content .author,
.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;
}

@keyframes contentOut{
    to{
        transform: translateY(-150px);
        filter: blur(20px);
        opacity: 0;
    }
}




@layer base, demo;
@import url(https://fonts.bunny.net/css?family=abel:400);

@layer demo {
    .carousel {
        --items: 20;
        --carousel-duration: 40s;
        @media (width > 600px) {
            --carousel-duration: 40s;
        }
        --carousel-width: min(
            80vw,
            1200px
        ); /* note - it will "break" if it gets too wide and there aren't enough items */
        --carousel-item-width: 500px;
        --carousel-item-height: 200px;
        --carousel-item-gap: 2rem;

        --clr-cta: rgb(0, 132, 209);

        position: relative;
        width: var(--carousel-width);
        height: var(--carousel-item-height);
        overflow: clip;


        &[reverse] > article {
            animation-direction: reverse;
        }
        /* hover pauses animation */
        &:hover > article {
            animation-play-state: paused;
        }

    .carousel > article:hover{
        filter: grayscale(100%);
    }

    }
    .carousel > article {
        position: absolute;
        top: 50px;
        left: calc(100% + var(--carousel-item-gap));
        width: var(--carousel-item-width);
        height: var(--carousel-item-height);
        display: grid;
        grid-template-rows: 650px auto 1fr auto;
        gap: 0.25rem;

        /* animation */
        will-change: transform;
        animation-name: marquee;
        animation-duration: var(--carousel-duration);
        animation-timing-function: linear;
        animation-iteration-count: infinite;
        animation-delay: calc(
            var(--carousel-duration) / var(--items) * 1 * var(--i) * -1
        );
        &:nth-child(1) {
            --i: 0;
        }
        &:nth-child(2) {
            --i: 1;
        }
        &:nth-child(3) {
            --i: 2;
        }
        &:nth-child(4) {
            --i: 3;
        }
        &:nth-child(5) {
            --i: 4;
        }
        &:nth-child(6) {
            --i: 5;
        }
        &:nth-child(7) {
            --i: 6;
        }
        &:nth-child(8) {
            --i: 7;
        }
        &:nth-child(9) {
            --i: 8;
        }
        &:nth-child(10) {
            --i: 9;
        }
        &:nth-child(11) {
            --i: 10;
        }
        &:nth-child(12) {
            --i: 11;
        }
        &:nth-child(13) {
            --i: 12;
        }
        &:nth-child(14) {
            --i: 13;
        }
        &:nth-child(15) {
            --i: 14;
        }
        &:nth-child(16) {
            --i: 15;
        }
        &:nth-child(17) {
            --i: 16;
        }
        &:nth-child(18) {
            --i: 17;
        }
        &:nth-child(19) {
            --i: 18;
        }
        &:nth-child(20) {
            --i: 19;
        }
        &:nth-child(21) {
            --i: 20;
        }
    }
    .carousel img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 30px;
    }



    @keyframes marquee {
        100% {
            transform: translateX(
                calc(
                    (var(--items) * (var(--carousel-item-width) + var(--carousel-item-gap))) *
                        -1
                )
            );
        }
    }
}

.carousel-item iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}




/* Responsive video wrapper: modern browsers + padding-bottom fallback */
.video-wrapper {
  position: relative;
  width: 100%;
  /* Modern browsers */
  aspect-ratio: 16 / 9;
  /* Fallback for older browsers */
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  display: block;
  border-radius: 6px;
}


/* Place iframe absolutely to fill wrapper */
.video-wrapper iframe,
.video-wrapper object,
.video-wrapper embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}

.video-wrappers {
  position: relative;
  width: 200%;
  /* Modern browsers */
  aspect-ratio: 16 / 9;
  /* Fallback for older browsers */
  padding-bottom: 56.25%;
  height: 113%;
  overflow: hidden;
  display: block;
  border-radius: 6px;
}


/* Place iframe absolutely to fill wrapper */
.video-wrappers iframe,
.video-wrappers object,
.video-wrappers embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}

/* Extra defensive rules to override other CSS (use only if needed) */
iframe {
  max-width: 100%;
  box-sizing: border-box;
}


@media only screen and (max-width: 414px) {

        .carousel img {
        object-fit: cover;
        border-radius: 0px;
    }

        .carousel {       
         --carousel-item-width: 300px;
         --carousel-item-gap: 1px;
    }
        .carousel > article {
           top: 20px;
           grid-template-rows: 500px auto 1fr auto;
    }
        .carousel,
        .carousel-inner {
           height: 65vh;
           overflow: hidden;
    }
        .carousel .list .item .content{
        padding-right: 0;
    }
    .carousel .list .item .content .title{
        font-size: 30px;
    }
    .carousel .list .item .content .topic{
        font-size: 20px;
    }
    .carousel .list .item .content .des{
        font-size: 10px;
        display: none;
    }
    .carousel .list .item .buttons{
    display: grid;
    grid-template-columns: repeat(2, 100px);
    grid-template-rows: 30px;
    gap: 3px;
    margin-top: 10px;
    }
    .carousel .list .item .buttons button{
        border: none;
        background-color: #eee;
        letter-spacing: 1px;
        font-size: 12px;
        font-family: Poppins;
        font-weight: 500;
    }

    .thumbnail .item{
    width: 60px;
    height: 90px;
    flex-shrink: 0;
    position: relative;
    }
    .thumbnail .item img{
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

    .thumbnail .item .content{
        color: #fff;
        position: absolute;
        bottom: 10px;
        left: 10px;
        right: 10px;
        font-size: 8px;
    }

  .video-wrapper {
    /* slightly taller aspect for narrow screens */
    aspect-ratio: 4 / 3;
    padding-bottom: 75%; /* fallback */
  }

  .video-wrappers {
    width: 100%;
    /* slightly taller aspect for narrow screens */
    aspect-ratio: 4 / 3;
    padding-bottom: 75%; /* fallback */
  }

}


