/**
 * 首页轮播图和广告卡片样式
 * 使用 Swiper.js + ACF 数据的新设计
 */

/* ===== 首页轮播图样式 ===== */

/* 减少轮播图和广告区域之间的间距 */
.hero-row {
    margin-left: -8px;
    margin-right: -8px;
}

.hero-row>[class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

/* 移动端进一步减少间距 */
@media (max-width: 767px) {
    .hero-row {
        margin-left: -4px;
        margin-right: -4px;
    }

    .hero-row>[class*="col-"] {
        padding-left: 4px;
        padding-right: 4px;
    }
}

.home-hero-section {
    width: 100%;
    height: 100%;
    position: relative;
}

.main-swiper {
    width: 100%;
    height: calc(3 * 140px + 2 * 0.75rem);
    /* 3个卡片 + 2个间距 */
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

/* 桌面端高度调整 */
@media (min-width: 768px) {
    .main-swiper {
        height: calc(3 * 150px + 2 * 0.75rem);
        /* 3个卡片 + 2个间距 */
    }
}

@media (min-width: 1200px) {
    .main-swiper {
        height: calc(3 * 160px + 2 * 0.75rem);
        /* 3个卡片 + 2个间距 */
    }
    
}

/* 轮播幻灯片样式 */
.main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* 遮罩层 */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

/* 内容容器 */
.slide-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    max-width: 600px;
    color: white;
}

.slide-text-wrapper {
    animation-delay: 0.3s;
}

/* 分类标签 */
.slide-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

/* 标题 */
.slide-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

/* 描述 */
.slide-description {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
}

/* 响应式描述文字控制 */
.slide-description-mobile {
    display: none;
    /* 桌面端隐藏移动端描述 */
}

.slide-description-desktop {
    display: block;
    /* 桌面端显示长描述 */
}

/* 按钮 */
.slide-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #007bff;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px) translateX(-20px);
    transition: all 1.2s ease;
}

.slide-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    color: white;
    text-decoration: none;
}

.slide-button i {
    transition: transform 0.3s ease;
}

.slide-button:hover i {
    transform: translateX(4px);
}

/* 活动幻灯片的动画 */
.swiper-slide-active .slide-category,
.swiper-slide-active .slide-title,
.swiper-slide-active .slide-description,
.swiper-slide-active .slide-button {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* 分页指示器样式 - 数字样式 */
.main-swiper .swiper-pagination {
    bottom: 20px;
    left: 2rem;
    right: auto;
    width: auto;
    text-align: left;
}

.main-swiper .swiper-pagination-bullet {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    opacity: 1;
    margin: 0 4px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.main-swiper .swiper-pagination-bullet-active {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transform: scale(1.1);
}

/* 导航按钮样式 - 隐藏 */
.main-swiper .swiper-button-next,
.main-swiper .swiper-button-prev {
    display: none;
    /* 隐藏导航按钮 */
}

/* 移动端样式调整 */
@media (max-width: 767px) {
    .main-swiper {
        height: calc(3 * 100px + 2 * -2rem);
        /* 3个卡片 + 2个间距（移动端） */
        border-radius: 0;
    }

    .slide-content {
        padding: 1.5rem;
    }

    .slide-title {
        font-size: 1.5rem;
        line-height: 1.1;
    }

    .slide-description {
        font-size: 0.875rem;
        margin-bottom: 1.5rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 移动端显示控制 */
    .slide-description-desktop {
        display: none;
        /* 移动端隐藏桌面端长描述 */
    }

    .slide-description-mobile {
        display: block;
        /* 移动端显示短描述 */
    }

    .slide-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }



    .main-swiper .swiper-pagination {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        white-space: nowrap;
        /* 防止换行 */
    }

    .main-swiper .swiper-pagination-bullet {
        width: 24px;
        height: 24px;
        font-size: 11px;
        margin: 0 2px;
        /* 减少间距和尺寸以适应更多数字 */
    }
}

/* 超小屏幕设备进一步优化 */
@media (max-width: 480px) {
    .main-swiper .swiper-pagination-bullet {
        width: 20px;
        height: 20px;
        font-size: 10px;
        margin: 0 1px;
        /* 超小屏幕进一步减少尺寸 */
    }
}

/* 备用内容样式 */
.hero-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    color: white;
    text-align: center;
}

.placeholder-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.placeholder-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.placeholder-content .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.placeholder-content .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

@media (max-width: 767px) {
    .hero-placeholder {
        height: 300px;
        border-radius: 0;
    }

    .placeholder-content h2 {
        font-size: 1.875rem;
    }

    .placeholder-content p {
        font-size: 1rem;
    }
}

/* ===== 广告卡片样式 ===== */

.home-ads-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    /* 高度由父容器决定，与轮播图保持一致 */
}

.ads-card {
    position: relative;
    flex: 1;
    min-height: 140px;
    /* 基础高度 */
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.ads-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ads-card-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ads-card-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ads-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.ads-card-content {
    position: relative;
    z-index: 2;
    padding: 1.25rem;
    color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ads-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.ads-card-description {
    font-size: 0.875rem;
    line-height: 1.4;
    opacity: 0.9;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ads-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ads-card-link:hover {
    color: #ffd700;
    text-decoration: none;
}

.ads-card-link i {
    transition: transform 0.3s ease;
}

.ads-card-link:hover i {
    transform: translateX(3px);
}

.ads-card-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    text-decoration: none;
}

/* 桌面端广告卡片高度调整 - 与轮播图保持一致 */
@media (min-width: 768px) {
    .ads-card {
        min-height: 150px;
        /* 与轮播图计算保持一致 */
    }
}

@media (min-width: 1200px) {
    .ads-card {
        min-height: 160px;
        /* 与轮播图计算保持一致 */
    }
}

/* 移动端广告卡片样式 - 轮播形式 */
@media (max-width: 767px) {
    .home-ads-section {
        /* 移动端改为轮播容器 */
        position: relative;
        overflow: hidden;
        border-radius: 0;
        height: auto;
    }

    /* 移动端广告轮播图 */
    .mobile-ads-swiper {
        width: 100%;
        height: 200px;
        /* 固定高度 */
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .mobile-ads-swiper .swiper-slide {
        height: 100%;
    }

    .ads-card {
        min-height: 200px;
        height: 100%;
        margin: 0;
        border-radius: 8px;
    }

    .ads-card-content {
        padding: 1.25rem;
    }

    .ads-card-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        font-weight: 600;
    }

    .ads-card-description {
        font-size: 0.875rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        line-height: 1.4;
    }

    /* 移动端广告轮播分页器 */
    .mobile-ads-swiper .swiper-pagination {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }

    .mobile-ads-swiper .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        background: rgba(255, 255, 255, 0.6);
        opacity: 1;
        margin: 0 4px;
        border-radius: 50%;
    }

    .mobile-ads-swiper .swiper-pagination-bullet-active {
        background: rgba(255, 255, 255, 0.95);
        transform: scale(1.2);
    }
}