﻿/* 
   Refined "Crazy Slider" for DALENS FURNITURES
   Premium Typography: Forum & Tenor Sans
*/

.carousel {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.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;
    filter: brightness(0.8);
}

.carousel .list .item .content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: var(--container-width);
    padding: 0 40px;
    box-sizing: border-box;
    color: #fff;
    z-index: 200;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.carousel .list .item .author {
    font-family: var(--font-detail);
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    font-size: 14px;
    color: var(--accent-color);
    margin-bottom: 30px;
    display: block;
}

.carousel .list .item .title,
.carousel .list .item .topic {
    font-size: clamp(3.5rem, 8vw, 7.5rem);
    font-weight: 400;
    line-height: 0.95;
    font-family: var(--font-heading);
    text-transform: uppercase;
    margin: 0;
}

.carousel .list .item .topic {
    color: var(--accent-color);
    /* Vibrant Amber */
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-top: 10px;
    opacity: 0.95;
}

.carousel .list .item .des {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.15rem;
    max-width: 550px;
    margin-top: 35px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

.carousel .list .item .buttons {
    display: flex;
    gap: 25px;
    margin-top: 50px;
}

.carousel .list .item .buttons button {
    padding: 15px 35px;
    border: 1px solid var(--white);
    background: transparent;
    color: var(--white);
    font-family: var(--font-detail);
    letter-spacing: 2px;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.carousel .list .item .buttons button:first-child {
    background: var(--white);
    color: var(--primary-color);
}

.carousel .list .item .buttons button:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
}

/* Anchor-based hero buttons (replacing <button> with <a>) */
.carousel .list .item .buttons a {
    padding: 15px 35px;
    border: 1px solid var(--white);
    background: transparent;
    color: var(--white);
    font-family: var(--font-detail);
    letter-spacing: 2px;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
    pointer-events: auto;
}

.carousel .list .item .buttons a:first-child {
    background: var(--white);
    color: var(--primary-color);
}

.carousel .list .item .buttons a:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
}


/* Thumbnail container */
.thumbnail {
    position: absolute;
    bottom: 50px;
    right: 50px;
    /* Moved to right */
    width: max-content;
    z-index: 100;
    display: flex;
    gap: 25px;
}

.thumbnail .item {
    width: 200px;
    height: 300px;
    flex-shrink: 0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.thumbnail .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail .item .content {
    color: #fff;
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    z-index: 10;
}

.thumbnail .item .content .title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
}

.thumbnail .item .content .description {
    font-family: var(--font-detail);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Arrows */
.arrows {
    position: absolute;
    bottom: 50px;
    left: 5%;
    z-index: 100;
    display: flex;
    gap: 15px;
}

.arrows button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.2rem;
    transition: var(--transition-smooth);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.arrows button:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* Animations */
.carousel .list .item:nth-child(1) {
    z-index: 1;
}

.carousel .list .item .content .author,
.carousel .list .item .content .title,
.carousel .list .item .content .topic,
.carousel .list .item .content .des,
.carousel .list .item .content .buttons {
    opacity: 0;
    pointer-events: none;
}

.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.8s cubic-bezier(0.19, 1, 0.22, 1) 1 forwards;
    pointer-events: auto;
}

@keyframes showContent {
    to {
        transform: translateY(0px);
        filter: blur(0px);
        opacity: 1;
    }
}

.carousel .list .item:nth-child(1) .content .title {
    animation-delay: 0.1s;
}

.carousel .list .item:nth-child(1) .content .topic {
    animation-delay: 0.15s;
}

.carousel .list .item:nth-child(1) .content .des {
    animation-delay: 0.2s;
}

.carousel .list .item:nth-child(1) .content .buttons {
    animation-delay: 0.25s;
}

/* Next Animation */
.carousel.next .list .item:nth-child(1) img {
    width: 200px;
    height: 300px;
    position: absolute;
    bottom: 50px;
    right: 50px;
    /* Pop from bottom-right */
    border-radius: 4px;
    animation: showImage 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1 forwards;
    /* Faster, smoother */
    z-index: 100;
}

/* Vignette/Blur effect on the PREVIOUS slide as the new one pops */
.carousel.next .list .item:nth-last-child(1) img {
    animation: vignetteExit 0.6s forwards;
}

@keyframes vignetteExit {
    to {
        filter: brightness(0.3) blur(10px);
        transform: scale(1.1);
    }
}

@keyframes showImage {
    to {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* Time bar */
.carousel .time {
    position: absolute;
    z-index: 1000;
    width: 0%;
    height: 4px;
    background-color: var(--accent-color);
    left: 0;
    top: 0;
}

.carousel.next .time,
.carousel.prev .time {
    animation: runningTime 5s linear 1 forwards;
}

@keyframes runningTime {
    from {
        width: 100%;
    }

    to {
        width: 0;
    }
}

/* ============================
   RESPONSIVE SLIDER
   ============================ */

/* Tablet */
@media screen and (max-width: 1024px) {
    .carousel .list .item .content {
        padding: 0 30px;
        top: 40%;
    }

    .thumbnail {
        right: 30px;
        bottom: 30px;
        gap: 15px;
    }

    .thumbnail .item {
        width: 150px;
        height: 220px;
    }

    .arrows {
        bottom: 30px;
        left: 3%;
    }

    .arrows button {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .carousel .list .item .content {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 0 20px;
        align-items: center;
        text-align: center;
    }

    .carousel .list .item .title,
    .carousel .list .item .topic {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .carousel .list .item .topic {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .carousel .list .item .author {
        font-size: 11px;
        letter-spacing: 3px;
        margin-bottom: 15px;
    }

    .carousel .list .item .des {
        font-size: 0.95rem;
        margin-top: 20px;
        max-width: 100%;
        line-height: 1.6;
    }

    .carousel .list .item .buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 25px;
        width: 100%;
        align-items: center;
    }

    .carousel .list .item .buttons a,
    .carousel .list .item .buttons button {
        width: 100%;
        max-width: 280px;
        text-align: center;
        padding: 14px 20px;
    }

    /* Hide thumbnails on mobile */
    .thumbnail {
        display: none;
    }

    .arrows {
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
    }

    .arrows button {
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }

    /* Adjust next animation for mobile (no thumbnails) */
    .carousel.next .list .item:nth-child(1) img {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

/* Small phones */
@media screen and (max-width: 480px) {
    .carousel .list .item .content {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .carousel .list .item .title,
    .carousel .list .item .topic {
        font-size: clamp(1.8rem, 12vw, 2.8rem);
    }

    .carousel .list .item .des {
        font-size: 0.85rem;
    }
}
