/* ============================================
   萬大發電廠環境教育學習網 - 成果分享內容頁（相簿瀏覽）
   kun 2025-01-17
   ============================================ */

/* ============================================
   4張輪播圖設定覆蓋
   ============================================ */
.banner-carousel .carousel-slide {
    animation: fadeSlide4 16s infinite;
}

.banner-carousel .carousel-slide:nth-child(1) { animation-delay: 0s; }
.banner-carousel .carousel-slide:nth-child(2) { animation-delay: 4s; }
.banner-carousel .carousel-slide:nth-child(3) { animation-delay: 8s; }
.banner-carousel .carousel-slide:nth-child(4) { animation-delay: 12s; }

/* 淡入淡出動畫 (4張圖片版本，每張佔 25%) */
@keyframes fadeSlide4 {
    0%      { opacity: 0; }
    5%      { opacity: 1; }
    25%     { opacity: 1; }
    30%     { opacity: 0; }
    100%    { opacity: 0; }
}

/* ============================================
   GALLERY LIGHTBOX SECTION - 相簿燈箱區塊
   ============================================ */
.gallery-lightbox-section {
    padding: var(--spacing-6xl) var(--container-padding-md);
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-container {
    position: relative;
    max-width: 700px;
    width: 100%;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-3xl);
}

/* ============================================
   CLOSE BUTTON - 關閉按鈕
   ============================================ */
.lightbox-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-2xl);
    text-decoration: none;
    transition: all var(--transition-fast);
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ============================================
   MAIN IMAGE - 主圖區域
   ============================================ */
.lightbox-main {
    margin-bottom: var(--spacing-2xl);
}

.lightbox-main-image {
    width: 100%;
    max-width: 500px;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.lightbox-main-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.lightbox-caption {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    max-width: 500px;
    margin: 0 auto;
    margin-top: -40px;
    position: relative;
    z-index: 5;
}

/* ============================================
   THUMBNAILS - 縮圖區域
   ============================================ */
.lightbox-thumbnails {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* 縮圖導航按鈕 */
.thumb-nav {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.thumb-nav:hover {
    color: var(--color-primary-hover);
    transform: scale(1.1);
}

.thumb-nav:disabled {
    color: var(--color-border);
    cursor: not-allowed;
}

/* 縮圖列表 */
.thumb-list {
    display: flex;
    gap: var(--spacing-md);
    overflow: hidden;
}

.thumb-item {
    width: 100px;
    height: 75px;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--transition-fast);
    border: 3px solid transparent;
    flex-shrink: 0;
}

.thumb-item:hover {
    opacity: 0.9;
}

.thumb-item.active {
    opacity: 1;
    border-color: var(--color-primary);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   DOTS - 分頁指示點
   ============================================ */
.lightbox-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dot:hover {
    background: var(--color-primary-light);
}

.dot.active {
    background: var(--color-primary);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .lightbox-container {
        max-width: 600px;
        padding: var(--spacing-2xl);
    }

    .lightbox-main-image {
        max-width: 450px;
    }

    .lightbox-caption {
        max-width: 450px;
    }

    .thumb-item {
        width: 80px;
        height: 60px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .gallery-lightbox-section {
        padding: var(--spacing-4xl) var(--container-padding-sm);
    }

    .lightbox-container {
        padding: var(--spacing-xl);
    }

    .lightbox-close {
        top: var(--spacing-md);
        right: var(--spacing-md);
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }

    .lightbox-main-image {
        max-width: 100%;
    }

    .lightbox-caption {
        max-width: 100%;
        font-size: var(--font-size-xs);
        margin-top: -36px;
    }

    .thumb-list {
        gap: var(--spacing-sm);
    }

    .thumb-item {
        width: 60px;
        height: 45px;
        border-width: 2px;
    }

    .thumb-nav {
        width: 28px;
        height: 28px;
        font-size: var(--font-size-lg);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .gallery-lightbox-section {
        padding: var(--spacing-3xl) var(--spacing-md);
    }

    .lightbox-container {
        padding: var(--spacing-lg);
        border-radius: var(--radius-md);
    }

    .lightbox-thumbnails {
        gap: var(--spacing-sm);
    }

    .thumb-item {
        width: 50px;
        height: 38px;
    }

    .thumb-list {
        max-width: calc(100% - 70px);
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}
