/* =============================================
   Dynamic Posts Carousel Widget Styles
   ============================================= */

.cew-posts-carousel-wrapper {
    position: relative;
    width: 100%;
}

.cew-posts-carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding-bottom: 20px; /* Leave space for pagination dots */
}

/* ── Individual Slide & Card ── */
.cew-post-card {
    background: #ffffff;
    border-radius: var(--cpc-card-radius, 8px);
    box-shadow: var(--cpc-card-shadow, 0 8px 30px rgba(0, 0, 0, 0.05));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cpc-card-border-color, #f0f0f0);
}

.cew-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

/* ── Card Image ── */
.cew-card-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #f7f7f7;
    overflow: hidden;
}

.cew-card-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cew-post-card:hover .cew-card-image-wrap img {
    transform: scale(1.05);
}

/* ── Card Content ── */
.cew-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Date with Calendar Icon */
.cew-card-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: var(--cpc-date-color, #888888);
    margin-bottom: 12px;
}

.cew-card-date svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.8;
}

/* Title */
.cew-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--cpc-title-color, #111111);
    margin: 0 0 10px 0;
    transition: color 0.2s ease;
}

.cew-card-title a {
    color: inherit;
    text-decoration: none;
}

.cew-card-title a:hover {
    color: var(--cpc-btn-color, #00e5ff);
}

/* Author */
.cew-card-author {
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: var(--cpc-author-color, #888888);
    margin-bottom: 14px;
}

/* Excerpt */
.cew-card-excerpt {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--cpc-excerpt-color, #666666);
    margin: 0 0 20px 0;
    flex-grow: 1;
}

/* CTA Button */
.cew-card-btn-wrap {
    margin-top: auto;
}

.cew-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--cpc-btn-color, #00e5ff);
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.cew-card-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.cew-card-btn:hover {
    gap: 10px;
    color: var(--cpc-btn-hover-color, #00b3cc);
}

.cew-card-btn:hover svg {
    transform: translateX(2px);
}

/* =============================================
   Swiper Navigation Elements
   ============================================= */

/* Arrows */
.cew-posts-carousel-wrapper .swiper-button-next,
.cew-posts-carousel-wrapper .swiper-button-prev {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--cpc-nav-color, #111111);
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    z-index: 10;
}

.cew-posts-carousel-wrapper .swiper-button-next:after,
.cew-posts-carousel-wrapper .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

.cew-posts-carousel-wrapper .swiper-button-next:hover,
.cew-posts-carousel-wrapper .swiper-button-prev:hover {
    background-color: var(--cpc-nav-hover-bg, #00e5ff);
    color: #ffffff;
}

.cew-posts-carousel-wrapper .swiper-button-prev {
    left: -22px;
}

.cew-posts-carousel-wrapper .swiper-button-next {
    right: -22px;
}

/* Dots Pagination */
.cew-posts-carousel-wrapper .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 24px;
}

.cew-posts-carousel-wrapper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #cccccc;
    opacity: 1;
    transition: width 0.2s ease, background-color 0.2s ease, border-radius 0.2s ease;
}

.cew-posts-carousel-wrapper .swiper-pagination-bullet-active {
    width: 24px;
    border-radius: 4px;
    background: var(--cpc-btn-color, #00e5ff);
}

/* Hide controls on mobile if they overflow */
@media (max-width: 767px) {
    .cew-posts-carousel-wrapper .swiper-button-next,
    .cew-posts-carousel-wrapper .swiper-button-prev {
        display: none;
    }
}

/* =============================================
   Grid Layout Styles
   ============================================= */
.cew-posts-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

@media (max-width: 1024px) {
    .cew-posts-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .cew-posts-grid-container {
        grid-template-columns: repeat(1, 1fr);
    }
}
