/*
 * LWT2026 Promo Carousel Styles
 */

.lwt-promo-swiper {
    width: 100%;
    height: 100vh;
    min-height: 500px;
    background-color: #000;
    position: relative;
    /* This variable will be set via inline style on the container */
    --auto-delay: 5s;
}

.lwt-promo-swiper .swiper-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: content-box;
}

.lwt-promo-swiper .swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Important for Ken Burns */
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

/* Background Image */
.promo-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1);
    will-change: transform;
    /* Start state for the image */
}

/* Ken Burns Effect */
.swiper-slide-active .promo-bg {
    transform: scale(1.05); /* Pienempi skaala tekee tästä hitaamman ja rauhallisemman */
    /* Transition duration matches the autoplay delay */
    transition: transform calc(var(--auto-delay) + 1s) linear;
}

/* Overlay to make text readable */
.promo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

/* Content Container */
.promo-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 800px;
    padding: 0 2rem;
}

.promo-title {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    font-family: var(--wp--preset--font-family--platypi, inherit);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.promo-description {
    display: block;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-family: var(--wp--preset--font-family--literata, inherit);
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out 0.3s;
}

.promo-action {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out 0.6s;
}

/* Title animation */
.promo-title {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out 0.1s;
}

/* Animate content when active */
.swiper-slide-active .promo-title,
.swiper-slide-active .promo-description,
.swiper-slide-active .promo-action {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Button styles */
.promo-btn {
    display: inline-block;
    background-color: var(--wp--preset--color--accent-1, #7A9BDB); /* LWT Blue */
    color: var(--wp--preset--color--contrast, #191919); /* Tummansininen/Musta teksti */
    font-family: var(--wp--preset--font-family--platypi, inherit);
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 0px; /* LWT teemassa kulmikkaampi */
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    /* Pakotetaan linkin tyylit */
}

.promo-btn:hover {
    background-color: var(--wp--preset--color--custom-kulta, #decea0); /* LWT kulta */
    color: var(--wp--preset--color--contrast, #191919);
    transform: translateY(-2px);
}

/* Swiper Controls Customization (Bulletproof CSS Arrows) */
.lwt-promo-swiper .swiper-button-next::after,
.lwt-promo-swiper .swiper-button-prev::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border-top: 4px solid rgba(255, 255, 255, 0.7);
    border-right: 4px solid rgba(255, 255, 255, 0.7);
    transition: border-color 0.3s;
    background: none !important;
    font-family: inherit !important;
}

.lwt-promo-swiper .swiper-button-next:hover::after,
.lwt-promo-swiper .swiper-button-prev:hover::after {
    border-color: #fff;
}

.lwt-promo-swiper .swiper-button-next::after {
    transform: rotate(45deg);
    margin-right: 15px;
}

.lwt-promo-swiper .swiper-button-prev::after {
    transform: rotate(-135deg);
    margin-left: 15px;
}

/* Piilota Swiperin oletusikonit ja fontit jos niitä yritetään ladata foggysta v5:sta */
.lwt-promo-swiper .swiper-button-next i,
.lwt-promo-swiper .swiper-button-prev i,
.lwt-promo-swiper .swiper-button-next svg,
.lwt-promo-swiper .swiper-button-prev svg {
    display: none !important;
}
.lwt-promo-swiper .swiper-button-next,
.lwt-promo-swiper .swiper-button-prev {
    background-image: none !important;
    width: 50px;
    height: 50px;
    margin-top: -25px;
}

.lwt-promo-swiper .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
    width: 10px;
    height: 10px;
}

.lwt-promo-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .promo-content {
        padding: 0 1rem;
    }
    
    .lwt-promo-swiper .swiper-button-next,
    .lwt-promo-swiper .swiper-button-prev {
        display: none; /* Hide arrows on mobile, keep swipe */
    }
}
