/* Post Carousel Widget Styles */

.post-carousel {
    position: relative;
    width: 100%;
}

.post-carousel .swiper {
    width: 100%;
    height: 100%;
}

.post-carousel .swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-carousel-item {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.post-carousel-item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.post-carousel-item:hover .post-carousel-item-image {
    transform: scale(1.05);
}

.post-carousel-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.post-carousel-item:hover .post-carousel-item-overlay {
    opacity: 1;
}

.post-carousel-item-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    z-index: 2;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.post-carousel-item:hover .post-carousel-item-content {
    transform: translateY(0);
}

.post-carousel-item-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
}

.post-carousel-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-carousel-item-title a:hover {
    color: #007cba;
}

.post-carousel-item-excerpt {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #cccccc;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.post-carousel-item:hover .post-carousel-item-excerpt {
    opacity: 1;
    transform: translateY(0);
}

.post-carousel-item-date {
    font-size: 12px;
    color: #aaaaaa;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
}

.post-carousel-item:hover .post-carousel-item-date {
    opacity: 1;
    transform: translateY(0);
}

/* Navigation Arrows */
.post-carousel .swiper-button-next,
.post-carousel .swiper-button-prev {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.post-carousel .swiper-button-next:hover,
.post-carousel .swiper-button-prev:hover {
    background: #007cba;
    color: #fff;
    transform: scale(1.1);
}

.post-carousel .swiper-button-next::after,
.post-carousel .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Pagination Dots */
.post-carousel .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);;
    opacity: 1;
    transition: all 0.3s ease;
}

.post-carousel .swiper-pagination-bullet-active {
    background: #fff;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .post-carousel-item {
        height: 280px;
    }
    
    .post-carousel-item-title {
        font-size: 16px;
    }
    
    .post-carousel-item-excerpt {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .post-carousel-item-content {
            transform: translateY(0%);
        }
    .post-carousel-item {
        height: 250px;
    }
    
    .post-carousel-item-content {
        padding: 15px;
    }
    
    .post-carousel-item-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .post-carousel-item-excerpt {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .post-carousel .swiper-button-next,
    .post-carousel .swiper-button-prev {
        width: 35px;
        height: 35px;
    }
    
    .post-carousel .swiper-button-next::after,
    .post-carousel .swiper-button-prev::after {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .post-carousel-item {
        height: 200px;
    }
    
    .post-carousel-item-content {
        padding: 12px;
    }
    
    .post-carousel-item-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .post-carousel-item-excerpt {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .post-carousel-item-date {
        font-size: 10px;
    }
    
    .post-carousel .swiper-button-next,
    .post-carousel .swiper-button-prev {
        width: 30px;
        height: 30px;
    }
    
    .post-carousel .swiper-button-next::after,
    .post-carousel .swiper-button-prev::after {
        font-size: 12px;
    }
}

/* Loading State */
.post-carousel.loading {
    opacity: 0.7;
    pointer-events: none;
}

.post-carousel.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fallback for no featured image */
.post-carousel-item-image[style*="background-image: url('')"],
.post-carousel-item-image[style*="background-image: url('null')"] {
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300"%3e%3crect width="400" height="300" fill="%23f0f0f0"/%3e%3ctext x="50%25" y="50%25" text-anchor="middle" dy=".3em" font-family="Arial, sans-serif" font-size="16" fill="%23999"%3eNo Image%3c/text%3e%3c/svg%3e') !important;
}

/* Accessibility improvements */
.post-carousel-item:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.post-carousel-item-title a:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .post-carousel-item-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .post-carousel-item-title {
        color: #ffffff;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    }
    
    .post-carousel-item-excerpt {
        color: #ffffff;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .post-carousel-item,
    .post-carousel-item-image,
    .post-carousel-item-overlay,
    .post-carousel-item-content,
    .post-carousel-item-excerpt,
    .post-carousel-item-date,
    .post-carousel .swiper-button-next,
    .post-carousel .swiper-button-prev,
    .post-carousel .swiper-pagination-bullet {
        transition: none;
    }
    
    .post-carousel-item:hover {
        transform: none;
    }
    
    .post-carousel-item:hover .post-carousel-item-image {
        transform: none;
    }
    
    .post-carousel-item:hover .post-carousel-item-overlay {
        opacity: 1;
    }
    
    .post-carousel-item:hover .post-carousel-item-content {
        transform: translateY(0);
    }
    
    .post-carousel-item:hover .post-carousel-item-excerpt,
    .post-carousel-item:hover .post-carousel-item-date {
        opacity: 1;
        transform: translateY(0);
    }
}
