/* ============================================================
   RS Tsaitang Home Slide – Styles
   Base: Desktop 1440px / Mobile 393px
   ============================================================ */

/* ── Reset ─────────────────────────────────────── */
.rs-tsaitang-homeslide,
.rs-tsaitang-homeslide * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.rs-tsaitang-homeslide {
    /* 以 1440 為基準的比例變數 */
    --rs-base-desktop: 1440;
    --rs-base-mobile: 393;
    position: relative;
    width: 100%;
    max-width: 1072px;
    margin: 0 auto;
    font-family: 'Noto Sans TC', 'Noto Sans CJK TC', sans-serif;
}

/* ── 桌機/手機切換 ─────────────────────────────── */
.rs-tsaitang-homeslide__mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .rs-tsaitang-homeslide__desktop {
        display: none !important;
    }
    .rs-tsaitang-homeslide__mobile {
        display: flex !important;
    }
}

/* ============================================================
   桌機版 Desktop
   ============================================================ */
.rs-tsaitang-homeslide__desktop {
    position: relative;
    width: 100%;
    /* 容器比例：1072 / 557 */
    aspect-ratio: 1072 / 557;
}

/* ── 左側：文字區 ──────────────────────────────── */
.rs-tsaitang-homeslide__left {
    position: absolute;
    left: 0;
    top: calc(67 / 557 * 100%);
    width: calc(342 / 1072 * 100%);
}

.rs-tsaitang-homeslide__counter {
    margin-bottom: calc(30 / 557 * 100%);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(16px, calc(23 / 1440 * 100vw), 23px);
    font-weight: 500;
}

.rs-tsaitang-homeslide__current {
    color: #280901;
}

.rs-tsaitang-homeslide__total {
    color: #AEA39D;
}

/* 文字資訊塊（淡入淡出） */
.rs-tsaitang-homeslide__info {
    display: none;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.rs-tsaitang-homeslide__info.is-active {
    display: flex;
}

.rs-tsaitang-homeslide__title-wrap {
    width: 100%;
    padding-bottom: 20px;
    border-bottom: 1px solid #D9D9D9;
}

.rs-tsaitang-homeslide__title {
    color: #280901;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(28px, calc(46 / 1440 * 100vw), 46px);
    font-weight: 500;
    line-height: 1.15;
}

.rs-tsaitang-homeslide__desc {
    color: #505050;
    font-size: clamp(13px, calc(16 / 1440 * 100vw), 16px);
    font-weight: 400;
    line-height: 2;
}

.rs-tsaitang-homeslide__desc p {
    margin: 0;
}

.rs-tsaitang-homeslide__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 232px;
    height: 55px;
    padding: 10px 32px;
    margin-top: 30px;
    background: #fff;
    border: 2px solid #FF8021;
    border-radius: 27.5px;
    color: #FF8021;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1.8px;
    line-height: 28.8px;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: none;
}

.rs-tsaitang-homeslide__btn:hover,
.rs-tsaitang-homeslide__btn:focus,
.rs-tsaitang-homeslide__btn:visited {
    text-decoration: none !important;
    color: #FF8021;
}

/* ── 中間：主圖 ────────────────────────────────── */
.rs-tsaitang-homeslide__main-img {
    position: absolute;
    left: calc(378 / 1072 * 100%);
    top: calc(67 / 557 * 100%);
    width: calc(440 / 1072 * 100%);
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.rs-tsaitang-homeslide__main-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.rs-tsaitang-homeslide__main-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.rs-tsaitang-homeslide__main-slide img {
    width: 198%;
    height: auto;
    object-fit: cover;
}

/* ── 右側：縮圖列 + 箭頭 ──────────────────────── */
.rs-tsaitang-homeslide__right {
    position: absolute;
    right: 0;
    top: 0;
    width: calc(160 / 1072 * 100%);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rs-tsaitang-homeslide__arrow {
    flex-shrink: 0;
    width: clamp(40px, calc(60 / 1440 * 100vw), 60px);
    height: clamp(40px, calc(60 / 1440 * 100vw), 60px);
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rs-tsaitang-homeslide__arrow svg {
    width: 100%;
    height: 100%;
}

.rs-tsaitang-homeslide__thumbs-viewport {
    flex: 1;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin: 10px 0;
}

.rs-tsaitang-homeslide__thumbs-track {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.4s ease;
}

.rs-tsaitang-homeslide__thumb {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 32px;
    overflow: hidden;
    background: #EDE5D9;
    cursor: pointer;
}

.rs-tsaitang-homeslide__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 32px;
}

.rs-tsaitang-homeslide__thumbs-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(180deg, rgba(247, 244, 239, 0) 0%, #F7F4EF 100%);
    pointer-events: none;
}

/* ============================================================
   手機版 Mobile
   ============================================================ */
.rs-tsaitang-homeslide__mobile {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── 主圖 + 箭頭 ──────────────────────────────── */
.rs-tsaitang-homeslide__mob-hero {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 calc(10 / 393 * 100%);
}

.rs-tsaitang-homeslide__mob-arrow {
    flex-shrink: 0;
    width: clamp(36px, calc(48 / 393 * 100vw), 48px);
    height: clamp(36px, calc(48 / 393 * 100vw), 48px);
    border-radius: 50%;
    background: #E65514;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rs-tsaitang-homeslide__mob-arrow svg {
    width: 60%;
    height: 60%;
}

.rs-tsaitang-homeslide__mob-img {
    position: relative;
    width: clamp(200px, calc(260 / 393 * 100vw), 260px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0 auto;
    flex-shrink: 0;
}

.rs-tsaitang-homeslide__mob-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.rs-tsaitang-homeslide__mob-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.rs-tsaitang-homeslide__mob-slide img {
    width: 198%;
    height: auto;
    object-fit: cover;
}

/* ── 手機文字區 ────────────────────────────────── */
.rs-tsaitang-homeslide__mob-info {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: calc(342 / 393 * 100%);
    padding: 32px calc(20 / 393 * 100%) 0;
}

.rs-tsaitang-homeslide__mob-info.is-active {
    display: flex;
}

.rs-tsaitang-homeslide__mob-info .rs-tsaitang-homeslide__title-wrap {
    text-align: left;
}

.rs-tsaitang-homeslide__mob-info .rs-tsaitang-homeslide__title {
    color: #280901;
}

.rs-tsaitang-homeslide__mob-info .rs-tsaitang-homeslide__desc {
    letter-spacing: 1.6px;
}

/* ── 底部縮圖列 ────────────────────────────────── */
.rs-tsaitang-homeslide__mob-thumbs {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 32px 0 0;
    width: 100%;
}

.rs-tsaitang-homeslide__mob-thumb {
    flex-shrink: 0;
    width: clamp(80px, calc(100 / 393 * 100vw), 100px);
    aspect-ratio: 1 / 1;
    border-radius: clamp(16px, calc(20 / 393 * 100vw), 20px);
    overflow: hidden;
    background: #EDE5D9;
    cursor: pointer;
    display: none;
}

.rs-tsaitang-homeslide__mob-thumb.is-visible {
    display: block;
}

.rs-tsaitang-homeslide__mob-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── RWD 中間過渡 ──────────────────────────────── */
@media (min-width: 768px) and (max-width: 1100px) {
    .rs-tsaitang-homeslide {
        max-width: 100%;
        padding: 0 24px;
    }
}
