/* Width Controls */
.post-carousel-wrapper {
    margin: 20px auto;
    padding: 0 20px;
}

.carousel-width-full {
    max-width: 100%;
    padding: 0;
}

.carousel-width-content {
    max-width: 1200px;
}

.carousel-width-custom {
    margin-left: auto;
    margin-right: auto;
}

/* Carousel Container */
.post-carousel {
    position: relative;
    overflow: hidden;
}

/* Slide - FIXED HEIGHT STRUCTURE */
.carousel-slide-inner {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.carousel-slide-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Image Container - FIXED HEIGHT */
.carousel-image {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.carousel-slide-inner:hover .carousel-image img {
    transform: scale(1.05);
}

/* Content Area - FLEXIBLE */
.carousel-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    min-height: 0;
}

/* Category Badge */
.carousel-category {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    align-self: flex-start;
    flex-shrink: 0;
}

/* Title */
.carousel-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    flex-shrink: 0;
}

.carousel-title a {
    color: #000000;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-title a:hover {
    color: #0066ff;
}

/* Excerpt */
.carousel-excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #666666;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Button */
.carousel-button {
    display: inline-block;
    padding: 10px 20px;
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
    align-self: flex-start;
    flex-shrink: 0;
}

.carousel-button:hover {
    background: #ffffff;
    color: #0066ff;
    border-color: #0066ff;
    transform: translateX(2px);
}

/* Navigation Arrows */
.swiper-button-prev,
.swiper-button-next {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 18px;
    color: #0066ff;
    font-weight: bold;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #0066ff;
    transform: scale(1.1);
}

.swiper-button-prev:hover:after,
.swiper-button-next:hover:after {
    color: #ffffff;
}

/* Pagination Dots */
.swiper-pagination {
    bottom: -35px !important;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cccccc;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #0066ff;
    width: 24px;
    border-radius: 5px;
}

/* ============================================ */
/* DESKTOP (1024px and above) - 6 cards */
/* ============================================ */
@media (min-width: 1025px) {
    .carousel-image {
        height: 220px;
    }
}

/* ============================================ */
/* TABLET (768px to 1024px) - 3 cards */
/* ============================================ */
@media (max-width: 1024px) and (min-width: 769px) {
    .carousel-image {
        height: 200px;
    }
    
    .carousel-content {
        padding: 18px;
    }
    
    .carousel-title {
        font-size: 15px;
    }
    
    .carousel-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .carousel-button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ============================================ */
/* MOBILE (below 768px) - 2 cards, overlay style */
/* ============================================ */
@media (max-width: 768px) {
    .post-carousel-wrapper {
        padding: 0 15px;
        margin: 30px auto;
    }
    
    /* Image takes full card height */
    .carousel-image {
        height: 280px;
        position: relative;
    }
    
    /* Content overlays on image at bottom */
    .carousel-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
        gap: 8px;
        min-height: auto;
    }
    
    /* Hide category badge on mobile */
    .carousel-category {
        display: none;
    }
    
    /* Title - white text, larger, prominent */
    .carousel-title {
        font-size: 17px;
        line-height: 1.3;
        margin: 0;
    }
    
    .carousel-title a {
        color: #ffffff;
        font-weight: 700;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        -webkit-line-clamp: 2;
    }
    
    .carousel-title a:hover {
        color: #ffffff;
        opacity: 0.9;
    }
    
    /* Hide excerpt on mobile */
    .carousel-excerpt {
        display: none;
    }
    
    /* Hide button on mobile */
    .carousel-button {
        display: none;
    }
    
    /* Adjust card structure */
    .carousel-slide-inner {
        position: relative;
        height: 280px;
    }
    
    /* Smaller navigation arrows */
    .swiper-button-prev,
    .swiper-button-next {
        width: 36px;
        height: 36px;
    }
    
    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 14px;
    }
    
    /* Adjust pagination */
    .swiper-pagination {
        bottom: -30px !important;
    }
}

/* ============================================ */
/* VERY SMALL MOBILE (below 480px) */
/* ============================================ */
@media (max-width: 480px) {
    .post-carousel-wrapper {
        padding: 0 10px;
    }
    
    .carousel-image {
        height: 240px;
    }
    
    .carousel-slide-inner {
        height: 240px;
    }
    
    .carousel-content {
        padding: 15px;
    }
    
    .carousel-title {
        font-size: 15px;
    }
}

/* Loading State */
.post-carousel-wrapper:empty {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-carousel-wrapper:empty:after {
    content: 'Loading carousel...';
    color: #999;
    font-size: 16px;
}