/* --- 1. Main Structure and Scroll Animation --- */
.feat-promo-wrapper {
    padding: 20px 0;
    overflow: hidden; 
}

.feat-promo-wrapper .feat-card-carousel {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.feat-promo-wrapper.start-animation .feat-card-carousel {
    opacity: 1;
    transform: translateY(0);
}

/* --- 2. Header and Floating Subtitle --- */
.feat-main-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--uni-light-colorTheme4);
    margin-bottom: 0;
}

.feat-subtitle-col {
    text-align: left;
    margin-top: 5px; 
}

.feat-subtitle {
    font-family: 'Acme', sans-serif; 
    font-size: 1.1rem;
    color: #6c757d; 
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .feat-subtitle-col {
        text-align: right; 
    }
}

/* --- 3. Card Carousel/Stack Layout --- */
.feat-card-carousel {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    position: relative;
}

.feat-card-list {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
       transition: transform 0.6s ease;
}

.feat-ad-card {
    position: absolute;
    height: 100%;
    max-height: 350px;
    width: 90%;
    max-width: 550px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    background: white;
    transform-origin: center;
    will-change: transform, opacity, z-index;
    overflow: hidden; /* Important for image containment */
}
/* Prevent transitions during initial load */
.feat-card-list:not(.is-transitioning) .feat-ad-card {
    transition: none;
}
.feat-card-content {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    position: relative;
}

/* Background image container */
.feat-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
    z-index: 1;
}

.feat-card-bg.loaded {
    background-size: cover;
    background-position: center;
}

/* FIX: Increased main card width on larger screens */
@media (min-width: 768px) {
    .feat-ad-card {
        max-width: 600px;
    }
}

@media (min-width: 992px) {
    .feat-ad-card.active {
        max-width: 700px;
    }
}

@media (max-width: 576px) {
    .feat-card-carousel {
        height: 320px;
    }
    .feat-ad-card {
        max-width: 90%;
        max-height: 280px;
    }
}

/* --- 4. Card States - Proper Stacking with Center Alignment --- */

/* Active Card (Center and Largest) */
.feat-ad-card.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 100;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

/* Next Card 1 (Right Stack) - Visible and properly positioned */
.feat-ad-card.next1 {
    transform: translateX(35%) scale(0.9);
    opacity: 0.9;
    z-index: 90;
    pointer-events: none;
}

/* Next Card 2 (Further Right Stack) */
.feat-ad-card.next2 {
    transform: translateX(65%) scale(0.8);
    opacity: 0.7;
    z-index: 80;
    pointer-events: none;
}

/* Previous Card 1 (Left Stack) - Mirror of next1 */
.feat-ad-card.prev1 {
    transform: translateX(-35%) scale(0.9);
    opacity: 0.9;
    z-index: 90;
    pointer-events: none;
}

/* Previous Card 2 (Further Left Stack) */
.feat-ad-card.prev2 {
    transform: translateX(-65%) scale(0.8);
    opacity: 0.7;
    z-index: 80;
    pointer-events: none;
}

/* Hidden Cards - Off-screen but ready for loop */
.feat-ad-card.hidden-right {
    transform: translateX(120%) scale(0.7);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.feat-ad-card.hidden-left {
    transform: translateX(-120%) scale(0.7);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

/* Smooth transition when changing states */
.feat-card-list.is-transitioning .feat-ad-card {
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Mobile adjustments for better stacking */
@media (max-width: 768px) {
    .feat-ad-card.next1 {
        transform: translateX(40%) scale(0.85);
    }
    .feat-ad-card.prev1 {
        transform: translateX(-40%) scale(0.85);
    }
    .feat-ad-card.next2,
    .feat-ad-card.prev2 {
        opacity: 0.5;
        transform: translateX(70%) scale(0.7);
    }
    .feat-ad-card.prev2 {
        transform: translateX(-70%) scale(0.7);
    }
}

@media (max-width: 576px) {
    .feat-ad-card.next1 {
        transform: translateX(45%) scale(0.8);
    }
    .feat-ad-card.prev1 {
        transform: translateX(-45%) scale(0.8);
    }
    .feat-ad-card.next2,
    .feat-ad-card.prev2 {
        opacity: 0.3;
        display: none;
    }
}

/* --- 5. Text Overlay --- */
.feat-text-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    padding: 80px 20px 20px;
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    z-index: 2;
}

.feat-card-title {
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 8px;
    line-height: 1.2;
}

.feat-card-desc {
    font-family: 'Acme', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 20px;
    max-height: 4.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.feat-read-bttn {
    background-color: white;
    color: var(--uni-light-colorTheme7);
    font-family: 'Acme', sans-serif;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.feat-read-bttn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* --- 6. Navigation Arrows --- */
.feat-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
}

.feat-arrow:hover {
    background-color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.feat-arrow-left {
    left: 10px;
}

.feat-arrow-right {
    right: 10px;
}

/* Mobile arrow adjustments */
@media (max-width: 576px) {
    .feat-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .feat-arrow-left {
        left: 5px;
    }
    .feat-arrow-right {
        right: 5px;
    }
}

/* --- 7. Loading placeholder animation --- */
.feat-card-bg.lazy-bg {
    position: relative;
    overflow: hidden;
}

.feat-card-bg.lazy-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        #f0f0f0 0%, 
        #f8f8f8 25%, 
        #f0f0f0 50%, 
        #f8f8f8 75%, 
        #f0f0f0 100%);
    background-size: 400% 100%;
    animation: loadingShimmer 1.5s infinite linear;
    z-index: 1;
}

@keyframes loadingShimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.feat-card-bg.loaded::before {
    display: none;
}