#carousel-css {
    width: 100%;
    position: relative;
    overflow: hidden;
    height: 360px;
    background: #000;
}

#carousel-css .carousel__items {
    margin: 0;
    padding: 0;
    list-style-type: none;
    width: 100%;
    height: 100%;
    position: relative;
}

#carousel-css .carousel__item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1;
    animation: cssFastTransition 40s infinite linear;
}

#carousel-css .carousel__item .carousel__item__img {
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    width: 100%;
    height: 360px;
}

/* --- THE FAST TRANSITION MATH --- */
/* 1% of 40s is 0.4 seconds. 
   We use 1% for the fade to make it snappy.
*/
@keyframes cssFastTransition {
    0% { opacity: 0; z-index: 1; }
    1% { opacity: 1; z-index: 2; }   /* Quick Fade In (0.4s) */
    20% { opacity: 1; z-index: 2; }  /* Stay visible until 8s mark */
    21% { opacity: 0; z-index: 1; }  /* Quick Fade Out (0.4s) */
    100% { opacity: 0; z-index: 1; }
}

/* Staggered starts in 8-second increments */
#carousel-css .carousel__item:nth-child(1) { animation-delay: 0s; }
#carousel-css .carousel__item:nth-child(2) { animation-delay: 8s; }
#carousel-css .carousel__item:nth-child(3) { animation-delay: 16s; }
#carousel-css .carousel__item:nth-child(4) { animation-delay: 24s; }
#carousel-css .carousel__item:nth-child(5) { animation-delay: 32s; }

/* Responsive */
@media (max-width: 768px) {
    #carousel-css, 
    #carousel-css .carousel__item .carousel__item__img {
        height: 240px;
    }
}