﻿.swiper {
    width: 100%;
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
}

    .swiper-slide img {
        display: block;
        width: 100%;
    }

.source-info {
    text-align: center;
    font-size: 0.875rem;
    color: #8f8f8f;
    margin-top: 1rem;
}

.swiper-button-next,
.swiper-button-prev {
    color: #8631c6;
    transition: background-color 0.3s ease;
}

    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 1.5rem;
    }

.swiper-pagination-bullet {
    width: 1.5rem;
    height: 4px;
    border-radius: 2px;
    background-color: #ffffff;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background-color: #8631c6;
}

.swiper-slide-active {
    transform: none !important;
}

/* latest news Swiper 容器樣式 */
.news-swiper {
    width: 100%;
    padding: 1rem 0 3rem 0;
    overflow: hidden;
}

/* 新聞卡片樣式 */
.news-card {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    height: 20rem;
    position: relative;
}

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        text-decoration: none;
        color: inherit;
    }

    .news-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .news-card:hover img {
        transform: scale(1.05);
    }

.news-card-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.news-card h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.news-card-date {
    margin: 0;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Swiper 導航按鈕樣式 */
.news-swiper .swiper-button-next,
.news-swiper .swiper-button-prev {
    color: #8631c6;
    background: white;
    border: 2px solid #8631c6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    transition: all 0.3s ease;
}

    .news-swiper .swiper-button-next::after,
    .news-swiper .swiper-button-prev::after {
        font-size: 1.2rem;
        font-weight: bold;
    }

    .news-swiper .swiper-button-next:hover,
    .news-swiper .swiper-button-prev:hover {
        background: #8631c6;
        color: white;
        transform: scale(1.1);
    }

/* Swiper 分頁器樣式 */
.news-swiper .swiper-pagination {
    bottom: 10px;
}

.news-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background-color: #ddd;
    opacity: 1;
    transition: all 0.3s ease;
}

.news-swiper .swiper-pagination-bullet-active {
    background-color: #8631c6;
    transform: scale(1.2);
}


.latest-news-swiper {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

    .latest-news-swiper.swiper-initialized {
        opacity: 1;
        visibility: visible;
    }


html body .fancybox-custom .fancybox-container,
html body.fancybox-active .fancybox-custom .fancybox-container {
    width: 80vw !important;
    height: 90vh !important;
    max-width: 80vw !important;
    max-height: 90vh !important;
    min-width: 80vw !important;
    min-height: 80vh !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    position: fixed !important;
}

html body .fancybox-custom .fancybox-content,
html body.fancybox-active .fancybox-custom .fancybox-content {
    width: 80vw !important;
    height: 90vh !important;
    max-width: 80vw !important;
    max-height: 90vh !important;
    min-width: 80vw !important;
    min-height: 80vh !important;
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .fancybox-custom .fancybox-slide,
html body.fancybox-active .fancybox-custom .fancybox-slide {
    padding: 0 !important;
    width: 80vw !important;
    height: 90vh !important;
    max-width: 80vw !important;
    max-height: 90vh !important;
}

.fancybox-custom .fancybox-custom-content,
.fancybox-custom-content {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    width: 100% !important;
}

.fancybox-custom .fancybox-image-container,
.fancybox-image-container {
    flex: 0 0 40% !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

    .fancybox-image-container img {
        width: 100%;
    }

.fancybox-custom .fancybox-text-container,
.fancybox-text-container {
    flex: 1 !important;
    padding: 2rem !important;
    overflow-y: auto !important;
    background: white !important;
    max-height: none !important;
}

html body .fancybox-custom .fancybox-button--close,
html body .fancybox-custom .fancybox-close-small,
html body.fancybox-active .fancybox-custom .fancybox-button--close {
    top: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    color: #333 !important;
    border: 2px solid #8631c6 !important;
    transition: all 0.3s ease !important;
    z-index: 999999 !important;
}

html body .fancybox-custom .fancybox-bg,
html body.fancybox-active .fancybox-custom .fancybox-bg {
    background: rgba(24, 24, 27, 0.85) !important;
}


@media (max-width: 768px) {
    html body .fancybox-custom .fancybox-container,
    html body.fancybox-active .fancybox-custom .fancybox-container {
        width: 95vw !important;
        height: 90vh !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        min-width: 95vw !important;
        min-height: 90vh !important;
    }

    html body .fancybox-custom .fancybox-content,
    html body.fancybox-active .fancybox-custom .fancybox-content {
        width: 95vw !important;
        height: 90vh !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        min-width: 95vw !important;
        min-height: 90vh !important;
    }

    html body .fancybox-custom .fancybox-slide,
    html body.fancybox-active .fancybox-custom .fancybox-slide {
        width: 95vw !important;
        height: 90vh !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
    }

    .fancybox-image-container {
        flex: 0 0 35% !important;
    }

    .fancybox-text-container {
        padding: 1.5rem !important;
    }

        .fancybox-text-container h3 {
            font-size: 1.3rem !important;
        }

        .fancybox-text-container p,
        .fancybox-text-container li {
            font-size: 0.9rem !important;
        }
}

.image-with-overlay {
    position: relative;
    display: inline-block;
    width: 100%;
}

.image-overlay-text {
    position: absolute;
    left: 0;
    right: 0;
    color: white;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1.5rem;
    text-align: center;
    z-index: 2;
    transform: translateY(100%); /* 初始隱藏 */
    transition: transform 0.3s ease;
}


/*  Fancybox 載入後自動顯示 */
.fancybox-slide.fancybox-slide--current .image-overlay-text {
    transform: translateY(0);
}

    .image-overlay-text h3 {
        margin: 0 0 10px 0;
        font-size: 2rem;
        font-weight: bold;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
        line-height: 1.2;
    }

    .image-overlay-text .overlay-smallText {
        margin: 0;
        font-size: 1rem;
        opacity: 0.9;
        font-weight: bolder;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
        line-height: 1.4;
    }

/* 新聞模態框中的按鈕樣式 */

.cta-button {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.purple-button {
    background-color: #8631c6;
    color: white;
    border: none;
}

    .purple-button:hover {
        background-color: #722aa7;
        color: white;
        text-decoration: none;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
