/* ==========================================================================
   CPT 3D Coverflow Carousel - Fixed & Optimized Frontend Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

.cpt-carousel-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 40px 0;
    box-sizing: border-box;
    overflow: hidden;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Header Title */
.cpt-carousel-header {
    text-align: center;
    margin-bottom: 35px;
}

.cpt-carousel-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.75rem;
    font-weight: 600;
    color: #5c4033;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Swiper Container & 3D Stage */
.cpt-carousel-container.swiper {
    width: 100%;
    padding: 30px 0 50px 0;
    overflow: visible !important; /* Allow top/bottom box-shadows while container handles bounds */
    position: relative;
}

.cpt-carousel-container .swiper-wrapper {
    align-items: center;
    display: flex;
}

/* Slides Base Layout */
.cpt-carousel-container .swiper-slide {
    width: 520px;
    max-width: 75vw;
    height: auto;
    flex-shrink: 0;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.5s ease;
    will-change: transform, filter, opacity;
    box-sizing: border-box;
}

/* Base Card Outer Container */
.cpt-carousel-card {
    position: relative;
    width: 100%;
    height: 360px;
    border-radius: 12px;
    background-color: #1a1a2e;
    overflow: hidden;
    box-sizing: border-box;
    /* GPU Hardware Acceleration to prevent 3D rasterization glitches */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    isolation: isolate;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Background Image Layer (Handles Image & Blur independently from card frame) */
.cpt-carousel-card-bg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: filter 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s ease;
    will-change: filter, transform;
}

/* Overlay gradient behind CTA button */
.cpt-carousel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.45) 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    transition: background 0.3s ease;
}

.cpt-carousel-card:hover::before {
    background: radial-gradient(circle at center, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 100%);
}

.cpt-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-sizing: border-box;
    z-index: 2;
}

/* Post Title & Date */
.cpt-card-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    text-align: center;
}

.cpt-card-date,
.cpt-card-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    text-align: center;
}

/* CTA Pill Button */
.cpt-carousel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e89528;
    color: #2c1810;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 13px 36px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(232, 149, 40, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    line-height: 1.2;
    letter-spacing: 0.01em;
    z-index: 3;
}

.cpt-carousel-btn:hover {
    background: #d97706;
    color: #ffffff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.55);
}

.cpt-carousel-btn:active {
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   SIDE CARDS VS ACTIVE CENTER CARD STYLING (PREVENTS 3D RASTERIZATION GLITCHES)
   ========================================================================== */

/* NON-ACTIVE SIDE SLIDES (Blurred & Darkened) */
.cpt-carousel-container .swiper-slide:not(.swiper-slide-active) {
    z-index: 5 !important;
    opacity: 0.85;
}

.cpt-carousel-container .swiper-slide:not(.swiper-slide-active) .cpt-carousel-card {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.cpt-carousel-container .swiper-slide:not(.swiper-slide-active) .cpt-carousel-card-bg {
    filter: blur(5px) brightness(0.7) contrast(1.05);
}

/* CENTER ACTIVE SLIDE (Enlarged, Clear & Front Focused) */
.cpt-carousel-container .swiper-slide-active {
    z-index: 25 !important;
    opacity: 1;
}

.cpt-carousel-container .swiper-slide-active .cpt-carousel-card {
    box-shadow: 0 25px 55px -10px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.cpt-carousel-container .swiper-slide-active .cpt-carousel-card-bg {
    filter: blur(0px) brightness(1) contrast(1);
}

/* Swiper Arrows Customization */
.cpt-carousel-container .swiper-button-next,
.cpt-carousel-container .swiper-button-prev {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    backdrop-filter: blur(6px);
    transition: all 0.3s ease;
    z-index: 30;
}

.cpt-carousel-container .swiper-button-next:after,
.cpt-carousel-container .swiper-button-prev:after {
    font-size: 20px;
    font-weight: bold;
}

.cpt-carousel-container .swiper-button-next:hover,
.cpt-carousel-container .swiper-button-prev:hover {
    background: #e89528;
    color: #2c1810;
    transform: scale(1.1);
}

/* Pagination Dots */
.cpt-carousel-container .swiper-pagination-bullet {
    background: #5c4033;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.cpt-carousel-container .swiper-pagination-bullet-active {
    background: #e89528;
    opacity: 1;
    width: 24px;
    border-radius: 10px;
}

/* Responsive Tweaks */
@media (max-width: 768px) {
    .cpt-carousel-title {
        font-size: 2.1rem;
    }
    
    .cpt-carousel-container .swiper-slide {
        width: 85vw;
    }

    .cpt-carousel-card {
        height: 310px;
    }

    .cpt-carousel-btn {
        font-size: 0.95rem;
        padding: 11px 28px;
    }
}
