/* ============================================================
   CEA Post Carousel
   ============================================================ */

/* Swiper 核心最小集 */
.cea-post-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
    box-sizing: content-box;
}
.cea-post-carousel .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    position: relative;
}

/* ---- overflow 控制 ---- */

/* Elementor widget container 不截断 */
.elementor-widget-cea-post-carousel .elementor-widget-container {
    overflow: visible;
}

/*
 * 外层容器：
 *   水平方向 → 裁剪（不显示左右溢出边缘）
 *   垂直方向 → 放开 100px（中间 scale 放大后上下凸出来要显示）
 *
 * clip-path: inset(top right bottom left)
 * 负值 = 允许该方向溢出超出元素边界的对应距离
 */
.cea-post-carousel-wrapper {
    position: relative;
    clip-path: inset(-100px 0px);
    user-select: none;
    -webkit-user-select: none;
}

/* Swiper 本体：visible，幻灯片可渲染到容器之外 */
.cea-post-carousel.swiper {
    overflow: visible !important;
}

/* ---- 卡片 ---- */
.cea-slide-inner {
    display: block;
    width: 100%;
    height: 480px;
    background-color: #c8cdd2;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* ---- 层叠缩放：中间放大压住两侧 ---- */
/*
 * 侧边卡片正常大小(scale 1)，中间放大(scale 1.15)
 * 放大后中间的边缘会物理遮挡两侧卡片的内侧，z-index 确保层叠顺序
 */
.cea-post-carousel .swiper-slide {
    transform: scale(1);
    transition: transform 0.4s ease;
    z-index: 1;
}
.cea-post-carousel .swiper-slide-active {
    transform: scale(1.15);
    z-index: 2;
}

/* ---- 遮罩：默认隐藏，只有中间激活卡片显示 ---- */
.cea-slide-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(50, 70, 90, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.cea-post-carousel .swiper-slide-active .cea-slide-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ---- 遮罩内容 ---- */
.cea-slide-content {
    text-align: center;
    width: 100%;
    max-width: 480px;
}
.cea-slide-title {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
}
.cea-slide-title a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s;
}
.cea-slide-title a:hover {
    opacity: 0.85;
}
.cea-slide-excerpt {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
}

/* ---- 按钮 ---- */
.cea-slide-btn {
    display: inline-block;
    padding: 10px 30px;
    background-color: #ff6b35;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.2s, transform 0.2s;
}
.cea-slide-btn:hover {
    opacity: 0.88;
    color: #ffffff;
    transform: translateY(-1px);
}

/* ---- 导航箭头 ---- */
.cea-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 50%;
    padding: 0;
    transition: background-color 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.cea-carousel-nav:hover {
    background-color: rgba(0, 0, 0, 0.6);
}
.cea-carousel-nav svg {
    display: block;
    pointer-events: none;
}
.cea-carousel-prev { left: 10px; }
.cea-carousel-next { right: 10px; }
.cea-carousel-nav.swiper-button-disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ---- 响应式 ---- */
@media (max-width: 1023px) {
    .cea-slide-title { font-size: 18px; }
}
@media (max-width: 767px) {
    .cea-slide-inner  { height: 320px; }
    .cea-slide-title  { font-size: 16px; margin-bottom: 8px; }
    .cea-slide-excerpt { display: none; }
    .cea-slide-btn    { padding: 8px 20px; font-size: 13px; }
    .cea-carousel-nav { width: 34px; height: 34px; }
    .cea-carousel-nav svg { width: 16px; height: 16px; }
    .cea-carousel-prev { left: 6px; }
    .cea-carousel-next { right: 6px; }
    /* 移动端禁用 scale，避免内容被压太小 */
    .cea-post-carousel .swiper-slide,
    .cea-post-carousel .swiper-slide-active {
        transform: scale(1) !important;
    }
}
