/**
 * Destination Slider — trip.com inspired hover CTA
 * TASK-HP-3 + TASK-HP-5
 *
 * - Desktop items: 5 (init in Blade)
 * - Card: rounded + subtle shadow
 * - Hover: darken overlay + CTA "发现更多"
 * - OwlCarousel arrows/dots: unified in design-system.css
 */

/* ============================================
   Section
   ============================================ */
.destination-slider-section {
    position: relative;
    padding: 40px 0 30px;
}

.destination-slider-title {
    font-family: var(--font-heading, "DM Sans");
    font-weight: 700;
    font-size: 24px;
    color: #1a1a2e;
    margin: 0 0 20px;
    padding: 0;
    line-height: 1.3;
}

/* ============================================
   Slider Wrapper — OwlCarousel 容器
   ============================================ */

/* Fallback: 确保 OwlCarousel 未初始化时卡片仍可见 */
.destination-slider-carousel:not(.owl-loaded) {
    display: flex !important;
    overflow-x: auto;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.destination-slider-carousel:not(.owl-loaded) .destination-slider-card {
    flex: 0 0 160px;
    min-width: 160px;
}

.destination-slider-section .owl-stage-outer {
    overflow: hidden;
}

.destination-slider-section .owl-stage {
    display: flex;
    align-items: stretch;
}

.destination-slider-section .owl-item {
    float: none;
}

/* ============================================
   Card
   ============================================ */
.destination-slider-card {
    width: 100%;
}

.destination-slider-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.destination-slider-link:hover {
    text-decoration: none;
    color: inherit;
}

.destination-slider-image {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #e8e8e8;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10); /* TASK-HP-5 D-9 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* TASK-HP-5 D-7: hover overlay (darken background) */
.destination-slider-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1;
    pointer-events: none;
}

/* Hover: scale + stronger shadow */
.destination-slider-card:hover .destination-slider-image {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.destination-slider-card:hover .destination-slider-image::before {
    opacity: 1;
}

/* Bottom gradient for readability */
.destination-slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    border-radius: 0 0 12px 12px;
    pointer-events: none;
    z-index: 2;
}

/* Text content */
.destination-slider-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 12px;
    z-index: 3;
}

.destination-slider-name {
    font-family: var(--font-heading, "DM Sans");
    font-weight: 700;
    font-size: 22px; /* TASK-HP-5 D-6: +2 levels */
    color: #ffffff !important; /* override late-loaded theme heading color */
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* CTA (hidden by default, visible on hover) */
.destination-slider-cta {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, "DM Sans");
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 4;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.destination-slider-cta::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 92px;
    height: 34px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.20);
}

.destination-slider-cta span {
    position: relative;
    z-index: 1;
}

.destination-slider-card:hover .destination-slider-cta {
    opacity: 1;
    transform: translateY(0);
}

/* (legacy, currently hidden by Blade) */
.destination-slider-count {
    font-family: var(--font-body, "DM Sans");
    font-weight: 400;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 无图片时的占位 */
.destination-slider-image:not([style*="background-image"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ============================================
   OwlCarousel 导航（统一样式见 design-system.css）
   ============================================ */
.destination-slider-section .owl-nav {
    z-index: 2;
}

/* ============================================
   Responsive
   ============================================ */

/* 平板 */
@media (max-width: 991px) {
    .destination-slider-section {
        padding: 30px 0 20px;
    }

    .destination-slider-title {
        font-size: 22px;
    }

    .destination-slider-image {
        height: 180px;
    }

    .destination-slider-name {
        font-size: 20px;
    }
}

/* 手机 */
@media (max-width: 767px) {
    .destination-slider-section {
        padding: 24px 0 16px;
    }

    .destination-slider-title {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .destination-slider-image {
        height: 170px;
    }

    .destination-slider-name {
        font-size: 17px; /* TASK-HP-5 D-6: +2 levels (mobile) */
    }

    /* 手机隐藏箭头（靠触摸滑动） */
    .destination-slider-section .owl-nav {
        display: none;
    }
}

/* 小手机 */
@media (max-width: 479px) {
    .destination-slider-image {
        height: 160px;
    }

    .destination-slider-content {
        padding: 10px;
    }

    /* TASK-HP-4 M-3: Smaller cards on very small screens */
    .destination-slider-section .owl-item {
        max-width: 150px;
    }

    .destination-slider-name {
        font-size: 15px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   TASK-HP-4 M-3: Destination slider mobile touch & dots
   ============================================ */
@media (max-width: 767px) {
    /* Ensure touch-friendly swipe */
    .destination-slider-carousel {
        touch-action: pan-x;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Dots centered with good spacing */
    .destination-slider-section .owl-dots {
        display: flex !important;
        justify-content: center !important;
        gap: 8px;
        margin-top: 12px;
        padding: 6px 0;
    }

    /* Text overflow prevention */
    .destination-slider-name {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Section padding */
    .destination-slider-section {
        padding-left: 0;
        padding-right: 0;
    }

    .destination-slider-section .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

