@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');


/* carousel */
.carousel {
    height: 100vh;
    margin-top: -15px;
    width: 100vw;
    overflow: hidden;
    position: relative;
}
.carousel .list .item {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0 0 0 0;
    /* GPU acceleration */
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.carousel .list .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    backface-visibility: hidden;
}
.carousel .list .item .content {
    position: absolute;
    top: 20%;
    width: 1140px;
    max-width: 80%;
    left: 35%;
    transform: translateX(-50%);
    padding-right: 30%;
    box-sizing: border-box;
    color: #fff;
    text-shadow: 0 5px 10px #0004;
    backface-visibility: hidden;
}
.carousel .list .item .author {
    font-weight: bold;
    letter-spacing: 10px;
}

.carousel .list .item .topic {
    font-size: 5em;
    font-weight: bold;
    line-height: 1.3em;
}
.carousel .list .item .topic {
    font-size: 5em;
    font-weight: bold;
    line-height: 1.3em;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    color: #000000;
    -webkit-text-stroke: 1px white; /* white outline */
    -webkit-text-fill-color: #F1683A; /* fill color */
    text-shadow:
       0 0 5px white,
       0 0 10px white,
       0 0 15px white;
}

.carousel .list .item .des {
    font-size: 24px; /* adjust as needed */
    color: #000000;
    line-height: 1.5;
    margin-top: 10px;
    text-shadow:
       0 0 5px white,
       0 0 10px white,
       0 0 15px white;
}




.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: 400;
}
/* 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: 0.5s;
}
.arrows button:hover {
    background-color: #fff;
    color: #000;
}

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

/* Animate content text of 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 0.5s 1s linear 1 forwards;
}
@keyframes showContent {
    to {
        transform: translateY(0);
        filter: blur(0);
        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;
}

/* Animate image transform on next click */
.carousel.next .list .item:nth-child(1) img {
    animation: showImageTransform 0.5s linear forwards;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}
@keyframes showImageTransform {
    from {
        transform: translate(calc(50% - 75px), 50px) scale(0.15);
        border-radius: 30px;
    }
    to {
        transform: translate(0, 0) scale(1);
        border-radius: 0;
    }
}

/* Animate last thumbnail on next */
.carousel.next .thumbnail .item:nth-last-child(1) {
    overflow: hidden;
    animation: showThumbnail 0.5s linear forwards;
}
@keyframes showThumbnail {
    from {
        width: 0;
        opacity: 0;
    }
}

/* Animate thumbnail container on next */
.carousel.next .thumbnail {
    animation: effectNext 0.5s linear forwards;
}
@keyframes effectNext {
    from {
        transform: translateX(150px);
    }
}

/* Set z-index on prev */
.carousel.prev .list .item img {
    z-index: 100;
}

/* Animate image out frame on prev */
.carousel.prev .list .item:nth-child(2) img {
    animation: outFrameTransform 0.5s linear forwards;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}
@keyframes outFrameTransform {
    from {
        transform: translate(0, 0) scale(1);
        border-radius: 0;
    }
    to {
        transform: translate(calc(0px), 50px) scale(0.15);
        border-radius: 20px;
    }
}

/* Animate first thumbnail on prev */
.carousel.prev .thumbnail .item:nth-child(1) {
    overflow: hidden;
    opacity: 0;
    animation: showThumbnail 0.5s linear forwards;
}

/* Disable arrow pointer events during animation */
.carousel.next .arrows button,
.carousel.prev .arrows button {
    pointer-events: none;
}

/* Animate content out on prev */
.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 forwards !important;
}
@keyframes contentOut {
    to {
        transform: translateY(-150px);
        filter: blur(20px);
        opacity: 0;
    }
}

/* Running time bar */
.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 forwards;
}
@keyframes runningTime {
    from { width: 100%; }
    to { width: 0; }
}

/* Responsive styles */
@media screen and (max-width: 678px) {
    .carousel .list .item .content {
        padding-right: 0;
        width: 90%;
        max-width: 90%;
        left: 50%;
        transform: translateX(-50%);
        top: 15%;
        text-align: center;
    }
    .carousel .list .item .author {
        font-size: 14px;
        letter-spacing: 5px;
        margin-bottom: 10px;
    }
    .carousel .list .item .title,
    .carousel .list .item .topic {
        font-size: 2.5em;
        line-height: 1.2em;
        word-break: break-word;
    }
    .carousel .list .item .topic {
        color: #f1683a;
    }
    .carousel .list .item .des {
        font-size: 40px;
        margin-top: 10px;
        line-height: 1.5;
    }
    .carousel .list .item .buttons {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 40px;
        gap: 10px;
        justify-items: center;
        margin-top: 20px;
    }
    .carousel .list .item .buttons button {
        font-size: 12px;
        padding: 8px 12px;
        letter-spacing: 2px;
        height: 40px;
        width: 100%;
    }
    .thumbnail {
        gap: 10px;
        bottom: 20px;
    }
    .thumbnail .item {
        width: 100px;
        height: 140px;
    }
    .thumbnail .item .content .title {
        font-size: 12px;
    }
    .thumbnail .item .content .description {
        font-size: 10px;
    }
    .arrows {
        top: 90%;
        right: 50%;
        transform: translateX(50%);
        width: 120px;
        max-width: 90%;
        gap: 10px;
        justify-content: center;
    }
    .arrows button {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

@media screen and (min-width: 679px) and (max-width: 1024px) {
    .carousel .list .item .content {
        width: 90%;
        max-width: 90%;
        left: 50%;
        transform: translateX(-50%);
        top: 18%;
        padding-right: 10%;
        text-align: center;
    }
    .carousel .list .item .author {
        font-size: 16px;
        letter-spacing: 6px;
        margin-bottom: 12px;
    }
    .carousel .list .item .title,
    .carousel .list .item .topic {
        font-size: 3.5em;
        line-height: 1.2em;
    }
    .carousel .list .item .topic {
        color: #f1683a;
    }
    .carousel .list .item .des {
        font-size: 40px;
        margin-top: 10px;
        line-height: 1.5;
    }
    .carousel .list .item .buttons {
        grid-template-columns: repeat(2, 140px);
        grid-template-rows: 45px;
        gap: 10px;
        justify-content: center;
        margin-top: 20px;
    }
    .carousel .list .item .buttons button {
        font-size: 14px;
        padding: 10px 16px;
    }
    .thumbnail {
        gap: 15px;
        bottom: 40px;
    }
    .thumbnail .item {
        width: 120px;
        height: 180px;
    }
    .thumbnail .item .content .title {
        font-size: 14px;
    }
    .thumbnail .item .content .description {
        font-size: 12px;
    }
    .arrows {
        top: 85%;
        right: 50%;
        transform: translateX(50%);
        width: 160px;
        max-width: 80%;
        gap: 12px;
        justify-content: center;
    }
    .arrows button {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}
