/* ============================================
   carousel.css - 轮播广告组件样式
   可复用组件：components/carousel_ad.html
   使用方法：{% include 'components/carousel_ad.html' with slot_slug='xxx' %}
   ============================================ */

/* 容器 */
.resources-carousel {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 24px;
    height: 180px;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: var(--color-bg-tertiary);
}

/* 轨道 */
.resources-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* 单张幻灯片 */
.resources-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.resources-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 无图片占位 */
.resources-carousel-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-bg-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* 左右箭头 */
.resources-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, background 0.2s, transform 0.2s;
    pointer-events: none;
}

.resources-carousel:hover .resources-carousel-arrow {
    opacity: 1;
    pointer-events: auto;
}

.resources-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.resources-carousel-arrow.prev { left: 12px; }
.resources-carousel-arrow.next { right: 12px; }

/* 底部指示点 */
.resources-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.resources-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.resources-carousel-dot.active {
    background: #fff;
    transform: scale(1.25);
}

/* 标题叠加层 */
.resources-carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 16px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
    pointer-events: none;
}

.resources-carousel-caption-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.resources-carousel-caption-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-top: 2px;
}
