/* ===================================
KvTourInfo Widget Styles
根據 UI 設計稿調整
=================================== */

/* 外部樣式 */
body.phpBlogInfo #td_ContentTop {
    position: static !important;
}

/* 共用樣式 */
.kv-tour-list,
.kv-tour-info {
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
    display: none; /* 預設隱藏，由 JS 根據頁面類型顯示 */
}

/* ===================================
BlogList 文章列表樣式
=================================== */

.kv-tour-list {
    padding: 1.25rem 0;
}

.tour-list-container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 0.9375rem;
}

.tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28.125rem, 1fr));
    gap: 1.875rem;
    margin-bottom: 2.5rem;
}

/* 文章卡片 */
.tour-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tour-card:hover {
    transform: translateY(-0.3125rem);
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
}

/* 卡片頭部 */
.tour-card-header {
    display: flex;
    align-items: center;
    padding: 0.9375rem 1.25rem;
    border-bottom: 0.0625rem solid #f0f0f0;
}

.location-icon {
    width: 1.875rem;
    height: 1.875rem;
    background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.location-icon svg {
    width: 1rem;
    height: 1rem;
    fill: white;
}

.tour-card-title {
    flex: 1;
    min-width: 0;
}

.tour-card-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.1875rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tour-card-title h3 a {
    color: #333;
    text-decoration: none;
}

.tour-card-title h3 a:hover {
    color: #7CB342;
}

.tour-card-location {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: #666;
}

.tour-card-location svg {
    width: 0.75rem;
    height: 0.75rem;
    fill: #666;
    margin-right: 0.25rem;
}

.days-badge {
    background: white;
    border: 0.125rem solid #7CB342;
    border-radius: 50%;
    width: 3.125rem;
    height: 3.125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    color: #7CB342;
    flex-shrink: 0;
}

.days-badge small {
    font-size: 0.6875rem;
    font-weight: normal;
    color: #666;
}

/* 卡片圖片 */
.tour-card-image {
    width: 100%;
    height: 12.5rem;
    overflow: hidden;
    position: relative;
}

.tour-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tour-card:hover .tour-card-image img {
    transform: scale(1.05);
}

/* 卡片內容 */
.tour-card-content {
    padding: 0.9375rem 1.25rem 1.25rem;
}

.tour-tag-section {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
    flex-wrap: wrap;
}

.tour-tag-label {
    background: #fff3e0;
    color: #f57c00;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tour-tag-type {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.tour-card-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分頁 */
.pagination-wrapper {
    margin-top: 2.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.625rem 1.25rem;
    background: white;
    border: 0.0625rem solid #ddd;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: #7CB342;
    color: white;
    border-color: #7CB342;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.3125rem;
}

.page-number {
    min-width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 0.0625rem solid #ddd;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
    transition: all 0.3s;
}

.page-number:hover {
    background: #f5f5f5;
}

.page-number.active {
    background: #7CB342;
    color: white;
    border-color: #7CB342;
}

/* ===================================
BlogInfo 文章詳情樣式
=================================== */

.kv-tour-info {
    background: #f5f5f5;
    min-height: 100vh;
}

.tour-info-container {
    margin: 0 auto;
    background: white;
}

/* 標題區 */
.title-section {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-section::before {
    content: '';
    width: 0.25rem;
    height: 1.75rem;
    background: #7CB342;
    border-radius: 0.125rem;
    flex-shrink: 0;
}

.tour-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    flex: 1;
}

/* 圖片輪播 */
.carousel-section {
    position: relative;
}

.carousel-container {
    width: 100%;
    height: 18.75rem;
    overflow: hidden;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 輪播下方按鈕區 */
.carousel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    padding: 0.9375rem 1.25rem;
    background: white;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 1.25rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.map-btn {
    background: #C5E1A5;
    color: #558B2F;
    border: none;
}

.action-btn.add-btn {
    background: #A5D6A7;
    color: #2E7D32;
    border: none;
}

.action-btn:hover {
    opacity: 0.85;
}

/* 簡介區 */
.intro-section {
    padding: 1.25rem;
    background: white;
}

.intro-text {
    line-height: 1.8;
    color: #555;
    font-size: 0.9375rem;
    margin: 0;
}

.intro-text p {
    margin: 0;
}

.tour_map {
    padding: 0 1.25rem 1.25rem;
    background: #fff;
}

.tour_map__canvas {
    width: 100%;
    height: 22.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    isolation: isolate;
}

.tour_map__hint {
    margin: 0.5rem 0 0;
    color: #888;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.tour_map__pin.leaflet-div-icon {
    background: transparent;
    border: none;
}

.tour_map__pin_dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0.125rem solid #fff;
    border-radius: 50%;
    background: #6ABA01;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.28);
}

/* 行程摘要區 */
.itinerary-summary {
    padding: 1.25rem;
    background: #ECEFF1;
    margin: 0 1.25rem;
    border-radius: 0.75rem;
}

.day-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.day-label::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    background: #7CB342;
    border-radius: 50%;
}

.itinerary-brief {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.8;
}

/* 行程詳情區 */
.itinerary-section {
    padding: 1.25rem;
}

.day-section {
    margin-bottom: 1.875rem;
}

/* 行程天數標籤容器 */
.day-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
}

.day-header {
    display: inline-block;
    background: #505D63;
    color: #FBFAF8;
    padding: 0.75rem 1.75rem;
    border-radius: 1.5625rem 1.5625rem 0 0;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-left: 1.25rem;
    margin-bottom: -1.875rem;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.day-header:last-child {
    margin-right: 0;
}

.day-header.active {
    background: #6ABA01;
    color: #FBFAF8;
    z-index: 1;
}

/* 景點項目 */
.attraction-item {
    display: flex;
    gap: 0.9375rem;
    margin-bottom: 1.25rem;
    padding: 0.9375rem;
    background: #FAFAFA;
    border-radius: 1.25rem;
    position: relative;
}

.attraction-image {
    width: 8.75rem;
    height: 8.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
}

.attraction-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attraction-content {
    flex: 1;
    min-width: 0;
    padding-right: 1.25rem;
    text-align: justify;
}

.attraction-header {
    margin-bottom: 0.5rem;
}

.attraction-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.attraction-stay {
    font-size: 0.8125rem;
    color: #888;
}

.attraction-meta {
    display: flex;
    gap: 0.9375rem;
    margin-bottom: 0.625rem;
    font-size: 0.8125rem;
    color: #666;
    flex-wrap: wrap;
}

.attraction-description {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 了解更多連結 */
.attraction-more {
    margin-top: 0.625rem;
}

.more-link {
    color: #6ABA01;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.3s;
}

.more-link:hover {
    color: #558B2F;
    text-decoration: underline;
}

/* 右側箭頭連結 */
.attraction-arrow-link {
    position: static;
    float: right;
    transition: transform 0.3s;
}

.attraction-arrow-link svg {
    width: 2.8125rem;
    height: 2.625rem;
}

/* 相關推薦 */
.related-section {
    padding: 1.5625rem 1.25rem;
    background: white;
}

.related-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    color: #333;
    text-align: center;
}

.related-grid {
    display: flex;
    gap: 0.9375rem;
    overflow-x: auto;
    padding-bottom: 0.625rem;
}

.related-card {
    flex-shrink: 0;
    width: 10rem;
    text-align: center;
}

.related-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-image {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 0.625rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 0 0.3125rem;
}

.related-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-location {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.related-location::before {
    content: '📍';
    font-size: 0.625rem;
}

.related-days {
    display: none;
}

/* 載入動畫 */
.loading {
    text-align: center;
    padding: 2.5rem;
    font-size: 1rem;
    color: #666;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* 響應式設計 */
@media (max-width: 48rem) {
    .tour-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .carousel-container {
        height: 13.75rem;
    }

    .tour_map__canvas {
        height: 16rem;
    }

    .tour-title {
        font-size: 1.125rem;
    }

    .attraction-item {
        flex-direction: column;
    }

    .attraction-image {
        width: 100%;
        height: 11.25rem;
    }

    .attraction-content {
        padding-right: 0;
    }

    .attraction-arrow-link {
        top: auto;
        bottom: 0.9375rem;
        right: 0.9375rem;
    }

    .related-image {
        width: 6.25rem;
        height: 6.25rem;
    }

    .related-card {
        width: 8.125rem;
    }
}

@media (max-width: 30rem) {
    .tour-card-title h3 {
        font-size: 1rem;
    }

    .days-badge {
        width: 2.8125rem;
        height: 2.8125rem;
        font-size: 1.125rem;
    }

    .title-section {
        padding: 0.9375rem;
    }

    .tour-title {
        font-size: 1rem;
    }
}