/* ========================================
   Ceramic Pools Slider - Main Styles
   ======================================== */

/* Swiper Base Styles */
@import url('https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css');

/* Container */
.cps-posts-slider-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.cps-posts-slider {
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
}

.swiper-wrapper {
    display: flex;
}

.swiper-slide {
    height: auto;
    display: flex;
}

/* NEW: Hidden posts (before show more) */
.cps-post-item.hidden {
    display: none !important;
}

/* NEW: Middle highlight effect */
.cps-post-item.middle-highlight {
    position: relative;
    z-index: 10;
}

.cps-post-item.middle-highlight .cps-post-card {
    transform: scale(1.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.5s ease;
}

/* NEW: Grid layout (applied when show more is clicked) */
.cps-posts-grid.show-all-posts .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
}

.cps-posts-grid.show-all-posts .swiper-slide {
    width: auto !important;
    margin: 0 !important;
}

/* NEW: Remove middle highlight when showing all */
.cps-posts-grid.show-all-posts .cps-post-item.middle-highlight .cps-post-card {
    transform: scale(1) !important;
    box-shadow: none !important;
}

/* Post Card */
.cps-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* Image Container */
.cps-post-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.cps-post-image img {
    width: 100%;
    height: 100%;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.cps-post-card:hover .cps-post-image img {
    transform: scale(1.05);
}

/* Image Overlay */
.cps-post-image.has-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

/* Category Badge */
.cps-category-badge {
    position: absolute;
    top: 20px;
    left: 0;
    background: #7DD3DD;
    color: #003E47;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    transition: all 0.3s ease;
}

.cps-post-card:hover .cps-category-badge {
    left: 10px;
}

/* Post Content */
.cps-post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Meta Information */
.cps-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #888888;
}

.cps-post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cps-post-meta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Post Title */
.cps-post-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
}

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

.cps-post-title a:hover {
    color: #7DD3DD;
}

/* Post Excerpt */
.cps-post-excerpt {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
    flex-grow: 1;
}

/* Read More Button */
.cps-read-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

.cps-read-more svg {
    width: 20px;
    height: 12px;
    transition: transform 0.3s ease;
}

.cps-read-more:hover {
    color: #7DD3DD;
}

.cps-read-more:hover svg {
    transform: translateX(5px);
}

/* Navigation Arrows */
.swiper-button-prev,
.swiper-button-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
}

.swiper-button-prev:after,
.swiper-button-next:after {
    display: none;
}

.swiper-button-prev svg,
.swiper-button-next svg {
    fill: #ffffff;
    width: 20px;
    height: 20px;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #7DD3DD;
}

.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Pagination */
.swiper-pagination {
    position: relative;
    margin-top: 30px;
}

.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #cccccc;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #7DD3DD;
    width: 30px;
    border-radius: 6px;
}

/* Bottom Button / Show More Button */
.cps-bottom-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.cps-bottom-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: #003E47;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cps-bottom-button svg {
    width: 20px;
    height: 12px;
    transition: transform 0.3s ease;
}

.cps-bottom-button:hover {
    background: #7DD3DD;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(125, 211, 221, 0.3);
}

.cps-bottom-button:hover svg {
    transform: translateX(5px);
}

/* NEW: Hide show more button after it's clicked */
.cps-bottom-button-wrapper.hidden {
    display: none;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .cps-post-title {
        font-size: 22px;
    }
    
    .cps-post-excerpt {
        font-size: 15px;
    }
    
    .cps-post-content {
        padding: 20px;
    }
    
    /* NEW: Middle highlight scale for tablet */
    .cps-post-item.middle-highlight .cps-post-card {
        transform: scale(1.15);
    }
    
    /* NEW: Grid layout for tablet */
    .cps-posts-grid.show-all-posts .swiper-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .cps-post-title {
        font-size: 20px;
    }
    
    .cps-post-excerpt {
        font-size: 14px;
    }
    
    .cps-post-content {
        padding: 18px;
    }
    
    .cps-category-badge {
        font-size: 11px;
        padding: 6px 15px;
    }
    
    .cps-post-meta {
        font-size: 13px;
        gap: 12px;
    }
    
    .swiper-button-prev,
    .swiper-button-next {
        width: 40px;
        height: 40px;
    }
    
    .swiper-button-prev svg,
    .swiper-button-next svg {
        width: 16px;
        height: 16px;
    }
    
    .cps-bottom-button {
        padding: 15px 30px;
        font-size: 15px;
    }
    
    /* NEW: Middle highlight scale for mobile */
    .cps-post-item.middle-highlight .cps-post-card {
        transform: scale(1.1);
    }
    
    /* NEW: Grid layout for mobile */
    .cps-posts-grid.show-all-posts .swiper-wrapper {
        grid-template-columns: repeat(1, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .cps-post-title {
        font-size: 18px;
    }
    
    .cps-post-content {
        padding: 15px;
    }
    
    .cps-category-badge {
        top: 15px;
        font-size: 10px;
        padding: 5px 12px;
    }
    
    .cps-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cps-bottom-button {
        width: 100%;
        justify-content: center;
        padding: 15px 25px;
        font-size: 14px;
    }
}

/* Accessibility */
.cps-post-card:focus-within {
    outline: 2px solid #7DD3DD;
    outline-offset: 2px;
}

.cps-read-more:focus,
.cps-bottom-button:focus,
.swiper-button-prev:focus,
.swiper-button-next:focus {
    outline: 2px solid #7DD3DD;
    outline-offset: 2px;
}

/* Loading State */
.cps-posts-slider-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cps-post-card {
    animation: fadeIn 0.5s ease;
}

/* NEW: Fade in animation for newly shown posts */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cps-post-item.fade-in {
    animation: slideIn 0.5s ease forwards;
}

/* Print Styles */
@media print {
    .swiper-button-prev,
    .swiper-button-next,
    .swiper-pagination,
    .cps-bottom-button-wrapper {
        display: none !important;
    }
    
    .cps-post-card {
        page-break-inside: avoid;
    }
}

/* RTL Support */
[dir="rtl"] .cps-category-badge {
    left: auto;
    right: 0;
}

[dir="rtl"] .cps-post-card:hover .cps-category-badge {
    left: auto;
    right: 10px;
}

[dir="rtl"] .cps-read-more svg,
[dir="rtl"] .cps-bottom-button svg {
    transform: scaleX(-1);
}

[dir="rtl"] .cps-read-more:hover svg,
[dir="rtl"] .cps-bottom-button:hover svg {
    transform: scaleX(-1) translateX(5px);
}
