/**
 * 精選行程輪播 CSS
 * 完全仿 makoto.com.tw 設計
 */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Unna:ital,wght@0,400;0,700;1,400;1,700&family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@300;400;500;700&display=swap');

/* ========================================
   系統配色變數 - 由 AT Global Color Settings 統一輸出
   變數定義於：at-trip-single/includes/class-global-color-settings.php
   設定位置：外觀 > AT 配色設定
   ======================================== */

/* ========================================
   Section 外框 - 匹配 .collection
   ======================================== */
.at-collection-section {
    background-color: var(--at-collection-border);
    padding-bottom: 0em;
    overflow: hidden;
    position: relative;
}

.at-collection-section .w100-xs {
    width: 100%;
}

.at-collection-section .wrap-cus-r {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2em 0;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .at-collection-section .wrap-cus-r {
        padding: 3em 0;
    }
}

@media (min-width: 1200px) {
    .at-collection-section .wrap-cus-r {
        padding: 4em 0;
    }

    .at-collection-section .collection-item.item-tit {
        width: 20%;
    }

    .at-collection-section .collection-item.item-list {
        width: 80%;
    }

    .at-collection-section .makoto-title.v-title-lr {
        margin-left: 3rem;
    }
}

@media (min-width: 1450px) {
    .at-collection-section .wrap-cus-r {
        padding: 5em 0;
    }

    .at-collection-section .makoto-title.v-title-lr {
        margin-left: 4em;
    }
}

/* 白色背景區塊 */
.at-collection-section .wrap-cus-r::before {
    background-color: #fff;
    content: "";
    height: 68%;
    left: 0;
    position: absolute;
    top: 0;
    width: 300%;
    z-index: -1;
}

.at-collection-section .inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.at-collection-section .clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ========================================
   左側標題區 - 匹配 .collection-item.item-tit
   ======================================== */
.at-collection-section .collection-item.item-tit {
    width: 25%;
    flex-shrink: 0;
    padding-right: 0;
}

/* ========================================
   makoto 原版垂直標題樣式 - 100% 匹配原版
   ======================================== */
.at-collection-section .makoto-title {
    font-family: Unna, "Noto Serif TC", serif;
    font-size: 0.8em;
    line-height: 1.125;
    text-align: center;
}

@media (min-width: 768px) {
    .at-collection-section .makoto-title {
        font-size: 0.85em;
    }

    .at-collection-section .collection-title .makoto-title {
        display: inline-block;
        margin-left: 2.25rem;
    }
}

@media (min-width: 992px) {
    .at-collection-section .makoto-title {
        font-size: 0.9em;
    }
}

@media (min-width: 1200px) {
    .at-collection-section .makoto-title {
        font-size: 1em;
    }

    .at-collection-section .collection-title .makoto-title {
        margin-left: 3rem;
    }
}

@media (min-width: 1450px) {
    .at-collection-section .collection-title .makoto-title {
        margin-left: 4em;
    }
}

/* [class*=v-title-] .inner - 原版樣式 */
.at-collection-section [class*=v-title-] .inner {
    display: inline-block;
    position: relative;
    text-align: left;
}

/* .v-text 基本樣式 */
.at-collection-section .v-text {
    display: inline-block;
    -moz-writing-mode: vertical-rl;
    writing-mode: vertical-rl;
}

/* .v-title-lr .v-text 覆蓋為 vertical-lr */
.at-collection-section .v-title-lr .v-text,
.at-collection-section .verticallr {
    display: inline-block;
    writing-mode: tb-lr;
    -moz-writing-mode: vertical-lr;
    writing-mode: vertical-lr;
}

/* 精選 - 金色大字 */
.at-collection-section .makoto-title .subtit {
    color: var(--at-collection-primary);
    display: block;
    font-size: 3.375em;
}

/* [class*=v-title-] .title - 原版有 margin-top: 2em */
.at-collection-section [class*=v-title-] .title {
    margin-top: 2em;
}

/* 行程席次 - 藍色字 */
.at-collection-section .makoto-title .title {
    color: var(--at-collection-primary);
    font-size: 1.75em;
}

/* Makoto Collections - 絕對定位在右側 */
.at-collection-section .v-title-lr .subtxt {
    left: 3.5em;
    position: absolute;
    top: 0.5em;
}

.at-collection-section .makoto-title .subtxt {
    color: var(--at-collection-text-light);
    display: block;
    font-size: 1.125em;
}

/* ========================================
   導航箭頭 - 100% 匹配 makoto.com.tw 原版
   箭頭在 .collection-slider 內部，用 calc() 定位到左側
   ======================================== */

/* 箭頭基礎樣式 */
.at-collection-section .collection-slider .slick-arrow {
    background-color: #fff;
    border: 1px solid var(--at-collection-primary);
    border-radius: 50px;
    cursor: pointer;
    display: block;
    font-size: 0;
    height: 50px;
    line-height: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    z-index: 10;
    transition: all 0.3s ease;
}

.at-collection-section .collection-slider .slick-arrow:focus,
.at-collection-section .collection-slider .slick-arrow:hover {
    background: transparent;
    color: transparent;
    outline: none;
}

.at-collection-section .collection-slider .slick-arrow:hover {
    background-color: var(--at-collection-primary);
}

.at-collection-section .collection-slider .slick-arrow.slick-disabled {
    cursor: auto;
    opacity: 0.5;
}

/* 響應式箭頭尺寸 */
@media (min-width: 992px) {
    .at-collection-section .collection-slider .slick-arrow {
        height: 55px;
        width: 55px;
    }
}

@media (min-width: 1300px) {
    .at-collection-section .collection-slider .slick-arrow {
        height: 60px;
        width: 60px;
    }
}

/* Prev 箭頭定位 - 左右對稱 */
.at-collection-section .collection-slider .slick-prev {
    left: -20px;
    z-index: 20;
}

@media (min-width: 768px) {
    .at-collection-section .collection-slider .slick-prev {
        left: calc(-33.333% + 3.25rem);
    }
}

/* Next 箭頭定位 - 左右對稱 */
.at-collection-section .collection-slider .slick-next {
    right: -20px;
    left: auto;
    z-index: 20;
}

@media (min-width: 768px) {
    .at-collection-section .collection-slider .slick-next {
        right: auto;
        left: calc(-33.333% + 8.25rem);
    }

    .at-collection-section .collection-slider .slick-arrow {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-left: 10px;
        margin-right: 10px;
    }
}

/* 箭頭圖標 - 使用 border 繪製 (匹配原版) */
.at-collection-section .collection-slider .slick-arrow::before {
    border-style: solid;
    border-width: 2px 2px 0 0;
    border-color: var(--at-collection-primary);
    bottom: 0;
    content: "";
    font-family: none;
    height: 15px;
    margin: auto;
    opacity: 1;
    position: absolute;
    right: 0;
    top: 0;
    width: 15px;
    transition: border-color 0.3s ease;
}

.at-collection-section .collection-slider .slick-arrow:hover::before {
    border-color: #fff;
}

/* Prev 箭頭圖標 */
.at-collection-section .collection-slider .slick-prev::before {
    left: 50%;
    transform: translateX(-50%) rotate(-135deg);
}

@media (min-width: 1200px) {
    .at-collection-section .collection-slider .slick-prev::before {
        left: 40%;
    }
}

/* Next 箭頭圖標 */
.at-collection-section .collection-slider .slick-next::before {
    left: -50%;
    transform: translateX(50%) rotate(45deg);
}

@media (min-width: 1200px) {
    .at-collection-section .collection-slider .slick-next::before {
        left: -40%;
    }
}

/* ========================================
   右側輪播區 - 匹配 .collection-item.item-list
   ======================================== */
.at-collection-section .collection-item.item-list {
    width: 75%;
    min-width: 0;
    overflow: visible;
    /* 允許箭頭溢出顯示 */
}

.at-collection-section .collection-slider {
    margin: 0;
    margin-top: 1em;
    padding-right: 1em;
    padding-left: 0;
    overflow: visible;
    position: relative;
    /* 允許箭頭溢出，position: relative 用於箭頭絕對定位的參考 */
}

.at-collection-section .collection-slider .slick-list {
    overflow: hidden;
    /* 只有 slick-list 隱藏溢出 */
}

@media (min-width: 768px) {
    .at-collection-section .collection-slider {
        margin-top: 2em;
        padding-right: 1em;
    }
}

@media (min-width: 1300px) {
    .at-collection-section .collection-slider {
        padding-left: 0;
        padding-right: 1.5em;
    }
}

.at-collection-section .collection-slider .slick-list {
    overflow: hidden;
}

.at-collection-section .collection-slider .slick-track {
    display: flex;
}

.at-collection-section .collection-slider .slick-slide {
    padding: 0 1em;
    height: auto;
}

@media (min-width: 1300px) {
    .at-collection-section .collection-slider .slick-slide {
        padding: 0 1.5em;
    }
}

.at-collection-section .collection-slider .slick-slide>div {
    height: 100%;
}

/* ========================================
   行程卡片 - 匹配 .collection-tour
   ======================================== */
.at-collection-section .item.collection-tour {
    display: block;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.at-collection-section .item.collection-tour:hover {
    transform: none;
    box-shadow: none;
}

/* 圖片區域 - 匹配 .imgbox */
.at-collection-section .imgbox {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    aspect-ratio: 3 / 4;
}

.at-collection-section .imgbox img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.at-collection-section .imgbox.imgHover:hover img {
    transform: scale(1.05);
}

/* 圖片漸層遮罩 - 精確匹配 makoto */
.at-collection-section .imgbox::before {
    background: linear-gradient(180deg, transparent 0, transparent 55%, rgba(0, 0, 0, .88) 99%, rgba(0, 0, 0, .9));
    bottom: 0;
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    width: 100%;
    z-index: 1;
}

/* 圖片上的資訊 - 匹配 .imgtxt */
.at-collection-section .imgtxt {
    position: absolute;
    bottom: 1.5em;
    left: 0;
    padding: 0 1.25em;
    width: 100%;
    z-index: 2;
    transition: all 0.3s ease;
}

.at-collection-section .tour-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.at-collection-section .tour-info .fitem {
    flex-shrink: 0;
}

/* 更多內容按鈕 - 精確匹配 .btn-explore */
.at-collection-section .btn-explore {
    border: 1px solid #dddede;
    border-radius: 50px;
    color: #666;
    display: inline-block;
    font-family: Unna, "Noto Serif TC", serif;
    line-height: 35px;
    padding: 0 1.25em;
    padding-top: 0.25em;
    position: relative;
    font-size: 0.9333333333rem;
    transition: all 0.3s ease;
    background: transparent;
    text-decoration: none;
}

.at-collection-section .btn-explore::after {
    background-color: var(--at-collection-accent);
    content: "";
    display: block;
    height: 1px;
    left: 90%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    transition: all 0.3s ease;
}

.at-collection-section .btn-explore:hover,
.at-collection-section .btn-explore:focus,
.at-collection-section .btn-explore:active {
    color: #666;
}

.at-collection-section .btn-explore:hover::after,
.at-collection-section .btn-explore:focus::after,
.at-collection-section .btn-explore:active::after {
    width: 40px;
}

/* 卡片內顯示 btn-explore 並設為白色 (匹配 makoto) */
.at-collection-section .item.collection-tour .btn-explore {
    display: inline-block;
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.at-collection-section .item.collection-tour:hover .btn-explore,
.at-collection-section .item.collection-tour:focus .btn-explore,
.at-collection-section .item.collection-tour:active .btn-explore {
    display: inline-block;
    border-color: #fff;
    color: #fff;
}

.at-collection-section .item.collection-tour:hover .btn-explore::after,
.at-collection-section .item.collection-tour:focus .btn-explore::after,
.at-collection-section .item.collection-tour:active .btn-explore::after {
    width: 40px;
}

/* 價格區域 - 精確匹配 .price-box */
.at-collection-section .price-box {
    text-align: right;
    font-family: Amiri, "Noto Serif TC", serif;
    color: #b38757;
}

.at-collection-section .price-box span {
    display: inline-block;
    vertical-align: middle;
}

.at-collection-section .price-box .num {
    font-size: 1.4666666667rem;
    font-weight: 300;
    color: #fff;
    font-family: Amiri, "Noto Serif TC", serif;
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1;
    padding-right: 0.25em;
}

.at-collection-section .price-box .num::before {
    content: attr(data-th) "";
    display: inline-block;
    letter-spacing: inherit;
    margin-right: 5px;
    vertical-align: top;
    font-size: 0.625em;
}

.at-collection-section .price-box .txt {
    font-size: 1rem;
}

/* 行程描述 - 匹配 .tour-des */
.at-collection-section .tour-des {
    color: #fff;
    font-family: Unna, "Noto Serif TC", serif;
    letter-spacing: 0.03em;
    line-height: 1.5;
    margin-top: 0;
    font-size: 0.9333333333rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Hover 顯示描述 */
.at-collection-section .item.collection-tour:hover .tour-des,
.at-collection-section .item.collection-tour:focus .tour-des,
.at-collection-section .item.collection-tour:active .tour-des {
    margin-top: 0.75em;
    max-height: 3em;
    opacity: 1;
}

/* ========================================
   文字區域 - 匹配 .txtbox
   ======================================== */
.at-collection-section .txtbox {
    padding: 0;
    background: transparent;
    margin-top: 1.5em;
}

.at-collection-section .txtbox .date {
    display: block;
    font-size: 1rem;
    color: var(--at-collection-primary);
    margin-bottom: 0;
    letter-spacing: 0.05em;
    font-family: Amiri, "Noto Serif TC", serif;
    font-style: italic;
    text-align: center;
    font-weight: 500;
}

.at-collection-section .txtbox h3.tour-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--at-collection-primary);
    margin: 0.35em 0 0;
    padding: 0 1em;
    line-height: 1.25em;
    text-align: center;
    font-family: Unna, "Noto Serif TC", serif;
    transition: all 0.3s ease;
}

.at-collection-section .txtbox h4.tour-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--at-collection-text-light);
    margin: 0.35em 0 0;
    padding: 0 1em;
    line-height: 1.25em;
    text-align: center;
    font-family: Unna, "Noto Serif TC", serif;
    transition: all 0.3s ease;
}

/* Hover 標題變色 - 淺藍突顯 */
.at-collection-section .item.collection-tour:hover .txtbox h3.tour-title,
.at-collection-section .item.collection-tour:focus .txtbox h3.tour-title,
.at-collection-section .item.collection-tour:active .txtbox h3.tour-title {
    color: var(--at-collection-hover);
}

/* ========================================
   響應式設計 - 匹配 makoto 響應式
   ======================================== */
/* ========================================
   響應式設計 - 匹配 makoto 響應式
   iPad (768px) 強制不 RWD，所以斷點設為 767px
   ======================================== */
@media (max-width: 767px) {

    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .at-collection-section {
        padding-bottom: 0em;
        padding-top: 0;
    }

    .at-collection-section .wrap-cus-r {
        padding: 2em 25px;
        /* Increased from 15px to accommodate arrows at -20px */
        overflow-x: hidden;
        /* Ensure no overflow */
    }

    .at-collection-section .inner {
        flex-direction: column;
    }

    .at-collection-section .collection-item.item-tit {
        width: 100%;
        padding-right: 0;
        margin-bottom: 0px;
        /* User Requested 0px */
    }

    .at-collection-section .makoto-title.v-title-lr {
        margin-left: 0;
        padding: 1em 0;
    }

    .at-collection-section .makoto-title .inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .at-collection-section .makoto-title .v-text {
        writing-mode: horizontal-tb;
        flex-direction: row;
        align-items: baseline;
        gap: 10px;
        margin-bottom: 0;
        font-family: "Noto Serif TC" !important;
    }

    .at-collection-section .makoto-title .subtit {
        font-size: 32px;
        /* User Requested 32px */
    }

    .at-collection-section .makoto-title .title {
        font-size: 18px;
    }

    .at-collection-section .makoto-title .subtxt {
        margin-top: 0;
    }

    .at-collection-section .slick-arrows-custom {
        margin-top: 0;
    }

    .at-collection-section .collection-item.item-list {
        width: 100%;
    }

    /* 手機版箭頭 - 水平垂直對齊於圖片中間 */
    .at-collection-section .collection-slider .slick-prev {
        left: 20px;
        right: auto;
    }

    .at-collection-section .collection-slider .slick-next {
        left: auto;
        right: 30px;
    }

    .at-collection-section .collection-slider .slick-arrow {
        width: 50px;
        height: 50px;
        /* 讓箭頭對齊圖片中間 */
        top: 45%;
        transform: translateY(-50%);
    }

    .at-collection-section .collection-slider .slick-arrow::before {
        height: 12px;
        width: 12px;
    }

    .at-collection-section .price-box .num {
        font-size: 1.2rem;
    }

    .at-collection-section .txtbox h3.tour-title {
        font-size: 18px !important;
    }

    .at-collection-section .txtbox .date {
        font-size: 18px;
    }

    .at-collection-section .txtbox h4.tour-title {
        font-size: 0.85rem;
    }

    .at-collection-section .collection-slider .slick-slide {
        padding: 0 1em;
    }
}

/* 確保 iPad (768px - 991px) 顯示電腦版樣式 (Flex Row) */
@media (min-width: 768px) and (max-width: 991px) {
    .at-collection-section .inner {
        flex-direction: row;
        /* 強制水平排列 */
    }

    .at-collection-section .collection-item.item-tit {
        width: 25%;
        /* 恢復電腦版寬度 */
        margin-bottom: 0;
        padding-right: 0;
    }

    .at-collection-section .collection-item.item-list {
        width: 75%;
        /* 恢復電腦版寬度 */
    }

    .at-collection-section .makoto-title .v-text {
        writing-mode: vertical-rl;
        /* 恢復直排 */
        display: inline-block;
    }

    .at-collection-section .imgtxt {
        padding: 10px;
    }
}

/* 箭頭標準置中對齊 - 使用 Absolute Positioning */
.at-collection-section .collection-slider .slick-arrow {
    display: block !important;
}

.at-collection-section .collection-slider .slick-arrow::before {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    display: block;
    /* 確保寬高一致 */
    width: 12px;
    height: 12px;
}

/* Prev Icon (<) */
.at-collection-section .collection-slider .slick-prev::before {
    transform: translate(-35%, -50%) rotate(-135deg);
}

/* Next Icon (>) */
.at-collection-section .collection-slider .slick-next::before {
    transform: translate(-65%, -50%) rotate(45deg);
}

@media (max-width: 576px) {
    .at-collection-section {
        padding-bottom: 0em;
    }

    .at-collection-section .wrap-cus-r {
        padding: 1.5em 10px;
    }

    .at-collection-section .makoto-title .inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .at-collection-section .slick-arrows-custom {
        margin-top: 15px;
    }

    .at-collection-section .btn-explore {
        padding: 0 1em;
        font-size: 0.8rem;
        line-height: 30px;
    }

    .at-collection-section .collection-slider .slick-slide {
        padding: 0 0.5em;
    }

    .at-collection-section .txtbox {
        margin-top: 1em;
    }
}

/* ========================================
   懶加載圖片
   ======================================== */
.at-collection-section .imgbox img.slick-loading {
    background: #f0f0f0 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" stroke="%23ddd" stroke-width="4" fill="none"/></svg>') center center no-repeat;
    background-size: 40px;
}

/* ========================================
   AOS 動畫補充
   ======================================== */
[data-aos] {
    pointer-events: auto !important;
}

/* ========================================
   手機版標題調整 - 小螢幕改為水平排版
   ======================================== */
@media (max-width: 767px) {
    .at-collection-section .makoto-title.v-title-lr .v-text {
        writing-mode: inherit;
    }

    .at-collection-section .makoto-title.v-title-lr {
        margin-left: 1.5rem;
        text-align: center;
    }

    .at-collection-section .makoto-title.v-title-lr .subtxt {
        position: static;
        margin-top: 0.5em;
    }

    .at-collection-section .makoto-title .subtit,
    .at-collection-section .makoto-title .title {
        display: inline-block;
    }
}

/* ========================================
   強制顯示箭頭 - 解決卡片數等於 slidesToShow 時箭頭被隱藏的問題
   Slick 預設會在卡片數量 ≤ slidesToShow 時隱藏箭頭，
   此規則覆蓋該行為，確保箭頭始終顯示。
   ======================================== */
.at-collection-section .collection-slider .slick-arrow {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* 當卡片不足時，箭頭仍可點擊（infinite 模式會循環播放） */
.at-collection-section .collection-slider .slick-arrow.slick-disabled {
    cursor: pointer;
    opacity: 1 !important;
}