/* ========================================
   testimonials 頁面專屬樣式
   紀謙的自在空間 - 個案真實回饋
   配色主題：紫金 (Purple-Gold)
   
   字體規格繼承自 global-style.css
   ======================================== */

/* ========== 頁面專屬配色變數 ========== */
:root {
    /* 紫色系 */
    --purple-dark: #4a1c6b;
    --purple-main: #6b2d9b;
    --purple-light: #9b59b6;
    --purple-pale: #f3e5f9;
    
    /* 金色系 */
    --gold-dark: #b8860b;
    --gold-main: #d4af37;
    --gold-light: #f4d03f;
    --gold-soft: #fef3c7;
    
    /* 背景與文字 */
    --bg-light: #faf8fc;
    --bg-warm: #f8f5f0;
    --text-dark: #2d1b3d;
    --text-gray: #5c4a6e;
    --text-light: #8b7a9e;
    --white: #ffffff;
    --border-light: rgba(74, 28, 107, 0.12);
    
    /* 漸層 */
    --gradient-purple: linear-gradient(135deg, #6b2d9b 0%, #9b59b6 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    --gradient-hero: linear-gradient(135deg, #4a1c6b 0%, #6b2d9b 50%, #2d1b3d 100%);
    
    /* 陰影 */
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.3);
    --shadow-card: 0 10px 40px rgba(74, 28, 107, 0.1);
    --shadow-purple-sm: 0 1px 3px rgba(74, 28, 107, 0.1);
    --shadow-purple-md: 0 4px 12px rgba(74, 28, 107, 0.15);
    --shadow-purple-lg: 0 10px 30px rgba(74, 28, 107, 0.2);
}

/* ========== 頁面基礎設定 ========== */
body {
    color: var(--text-dark);
    background-color: var(--bg-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: var(--container-2xl);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.gold-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== Hero Section ========== */
.hero {
    min-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--gradient-hero);
    padding-top: 90px;
    padding-bottom: var(--space-12);
    overflow: hidden;
    text-align: center;
}

.hero-bg-decor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-tag {
    display: inline-block;
    color: var(--gold-main);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    letter-spacing: var(--tracking-wider);
    margin-bottom: var(--space-5);
    padding: var(--space-2) var(--space-6);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: var(--radius-full);
}

.hero h1 {
    color: var(--white);
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    margin-bottom: var(--space-6);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    max-width: 600px;
    margin: 0 auto;
}

.hero-scroll-hint {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--text-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    animation: bounce 2s ease-in-out infinite;
}

.hero-scroll-hint svg {
    width: 20px;
    height: 20px;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ========== 篩選列 ========== */
.filter-section {
    position: sticky;
    top: 64px;
    z-index: 90;
    background: rgba(250, 248, 252, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-4) 0;
}

.filter-bar {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-2) var(--space-6);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--white);
    color: var(--text-gray);
    font-family: var(--font-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all var(--transition-normal) var(--ease-out);
}

.filter-btn:hover {
    border-color: var(--purple-light);
    color: var(--purple-main);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--gradient-purple);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-purple-sm);
}

.filter-count {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-top: var(--space-3);
    margin-bottom: 0;
}

/* ========== 回饋區段 ========== */
.testimonial-section {
    padding: var(--space-16) 0 var(--space-12);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.testimonial-section:nth-child(odd) {
    background-color: var(--bg-light);
}

.testimonial-section:nth-child(even) {
    background-color: var(--white);
}

.testimonial-section.hidden {
    display: none;
}

/* ========== Section Header ========== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-icon {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-4);
}

.section-header h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--purple-dark);
    margin-bottom: var(--space-4);
}

.section-desc {
    font-size: var(--text-lg);
    color: var(--text-gray);
    max-width: 500px;
    margin: 0 auto var(--space-5);
    line-height: var(--leading-relaxed);
}

.section-link {
    display: inline-block;
    color: var(--purple-main);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast) ease;
}

.section-link:hover {
    color: var(--purple-dark);
    border-bottom-color: var(--purple-dark);
}

/* ========== 圖片畫廊格線 ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--white);
    box-shadow: var(--shadow-purple-sm);
    transition: all var(--transition-normal) var(--ease-out);
    aspect-ratio: 3 / 4;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) var(--ease-out);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-purple-md);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* 圖片 hover overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 50%,
        rgba(74, 28, 107, 0.6) 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-zoom-icon {
    font-size: var(--text-3xl);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transform: scale(0.8);
    transition: transform var(--transition-normal) var(--ease-out);
}

.gallery-item:hover .gallery-zoom-icon {
    transform: scale(1);
}

/* ========== Lightbox 大圖 ========== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxZoomIn 0.3s ease;
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-size: var(--text-3xl);
    border-radius: var(--radius-circle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast) ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    font-size: var(--text-xl);
    border-radius: var(--radius-circle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast) ease;
    z-index: 10;
}

.lightbox-prev { left: var(--space-5); }
.lightbox-next { right: var(--space-5); }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-counter {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    background: rgba(0, 0, 0, 0.4);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
}

/* ========== CTA Section ========== */
.cta-section {
    padding: var(--space-16) 0;
    background: var(--gradient-hero);
    text-align: center;
}

.cta-content h2 {
    color: var(--white);
    font-size: var(--text-4xl);
    margin-bottom: var(--space-5);
}

.cta-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

.cta-buttons {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    transition: all var(--transition-normal) var(--ease-out);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--purple-dark);
    box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ========== 捲動動畫 ========== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* gallery-item 動畫延遲 - 支援更多圖片 */
.gallery-item.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.gallery-item.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.gallery-item.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.gallery-item.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.gallery-item.animate-on-scroll:nth-child(5) { transition-delay: 320ms; }
.gallery-item.animate-on-scroll:nth-child(6) { transition-delay: 400ms; }
.gallery-item.animate-on-scroll:nth-child(7) { transition-delay: 480ms; }
.gallery-item.animate-on-scroll:nth-child(8) { transition-delay: 560ms; }
.gallery-item.animate-on-scroll:nth-child(9) { transition-delay: 640ms; }
.gallery-item.animate-on-scroll:nth-child(10) { transition-delay: 720ms; }
.gallery-item.animate-on-scroll:nth-child(11) { transition-delay: 800ms; }
.gallery-item.animate-on-scroll:nth-child(12) { transition-delay: 880ms; }
.gallery-item.animate-on-scroll:nth-child(13) { transition-delay: 960ms; }
.gallery-item.animate-on-scroll:nth-child(14) { transition-delay: 1040ms; }
.gallery-item.animate-on-scroll:nth-child(15) { transition-delay: 1120ms; }
.gallery-item.animate-on-scroll:nth-child(n+16) { transition-delay: 1200ms; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RWD 響應式設計 ========== */

/* 平板橫向 */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-3);
    }
    
    .hero {
        min-height: 45vh;
    }
}

/* 平板直向 */
@media (max-width: 768px) {
    .hero {
        min-height: 40vh;
        padding-top: 80px;
        padding-bottom: var(--space-10);
    }
    
    .hero h1 {
        font-size: var(--text-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    .hero-scroll-hint {
        display: none;
    }
    
    .filter-section {
        top: 56px;
    }
    
    .filter-bar {
        gap: var(--space-2);
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .testimonial-section {
        padding: var(--space-12) 0 var(--space-10);
    }
    
    .section-header {
        margin-bottom: var(--space-8);
    }
    
    .section-header h2 {
        font-size: var(--text-3xl);
    }
    
    .section-desc {
        font-size: var(--text-base);
    }
    
    /* Lightbox 手機版 */
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: var(--text-base);
    }
    
    .lightbox-prev { left: var(--space-3); }
    .lightbox-next { right: var(--space-3); }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        top: var(--space-3);
        right: var(--space-3);
        font-size: var(--text-2xl);
    }
    
    .cta-content h2 {
        font-size: var(--text-3xl);
    }
    
    .cta-content p {
        font-size: var(--text-base);
    }
}

/* 手機 */
@media (max-width: 480px) {
    .hero h1 {
        font-size: var(--text-3xl);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }
    
    .gallery-item {
        border-radius: var(--radius-sm);
    }
    
    .filter-btn {
        padding: 6px var(--space-3);
    }
    
    .section-header h2 {
        font-size: var(--text-2xl);
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
}
