/* =====================================================
   About Page — 視差互動與 RWD 優化
   依照 UIUX_STANDARDS.md V2 全站 CSS 變數規範
   ===================================================== */

/* --- Hero Section (視差容器) --- */
.about-hero {
    height: 420px;
    width: 100%;
    background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=1600&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* 桌機視差；JS 會在手機版切換為 scroll */
    position: relative;
    overflow: hidden;
}

.about-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
}

/* --- 浮卡容器 --- */
.brand-card-wrapper {
    max-width: 1000px;
    margin: -100px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.brand-card {
    background: var(--bg-surface, #fff);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.brand-slogan {
    color: var(--color-primary, #AA9177);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.brand-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--text-primary, #3C3A38);
    line-height: 1.4;
}

.brand-desc {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: var(--text-secondary, #7B7874);
    line-height: 1.8;
}

/* 品牌金按鈕（全站 CTA 按鈕，替代 inline style） */
.btn-primary-gold {
    background-color: var(--color-primary, #AA9177);
    border-color: var(--color-primary, #AA9177);
    color: #fff;
}

.btn-primary-gold:hover,
.btn-primary-gold:focus {
    background-color: var(--color-primary-dark, #8A725A);
    border-color: var(--color-primary-dark, #8A725A);
    color: #fff;
}

/* --- Content Container --- */
.content-container {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h3 {
    font-family: 'Noto Serif TC', serif;
    font-size: 2rem;
    margin-bottom: 15px;
    display: inline-block;
    position: relative;
    color: var(--text-primary, #3C3A38);
}

.section-header h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--color-primary, #AA9177);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- Core Values Grid --- */
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 80px;
}

/* 骨架屏初始狀態
   value-card：opacity + transform 雙重淡入
   team-card：僅 opacity（transform 由 JS parallax 全權管理，避免衝突） */
.value-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.team-card {
    opacity: 0;
    transition: opacity 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* JS 加上 revealed class 後顯示 */
.value-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.team-card.revealed {
    opacity: 1;
}

.value-card {
    background: var(--bg-surface, #fff);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-color, #EAE9E8);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.value-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary, #AA9177);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.value-card:hover::before {
    transform: scaleX(1);
}

.value-card:hover {
    box-shadow: 0 10px 30px rgba(170, 145, 119, 0.15);
    border-color: var(--color-primary, #AA9177);
}

.value-icon {
    width: 70px;
    height: 70px;
    background: var(--color-primary-light, #F9F8F6);
    color: var(--color-primary, #AA9177);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    transition: background 0.3s, color 0.3s;
}

.value-card:hover .value-icon {
    background: var(--color-primary, #AA9177);
    color: #fff;
}

.value-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-primary, #3C3A38);
    font-weight: 600;
}

.value-text {
    color: var(--text-secondary, #7B7874);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- Brand Story Quote --- */
.story-quote {
    border-left: 3px solid var(--color-primary, #AA9177);
    padding: 14px 20px;
    margin: 20px 0;
    background: var(--color-primary-light, #F9F8F6);
    border-radius: 0 8px 8px 0;
    font-family: 'Noto Serif TC', serif;
    font-size: 1rem;
    color: var(--text-primary, #3C3A38);
    line-height: 1.7;
    font-style: normal;
}

/* --- Brand Story --- */
.story-section {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 80px;
    background: var(--bg-surface, #fff);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.story-img-box {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    height: 350px;
}

.story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.story-img-box:hover .story-img {
    transform: scale(1.04);
}

.story-content {
    flex: 1;
}

.story-content h3 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary, #3C3A38);
}

.story-content p {
    color: var(--text-secondary, #7B7874);
    line-height: 1.8;
    margin-bottom: 20px;
}

/* --- Team Section --- */
.team-section {
    margin-bottom: 80px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.team-card {
    background: var(--bg-surface, #fff);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    border: 1px solid var(--border-color, #EAE9E8);
    cursor: default;
    will-change: transform; /* 視差效能優化 */
    transition: opacity 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    /* transform 由 JS 控制，不放在這裡 */
}

.team-card:hover {
    box-shadow: 0 12px 32px rgba(170, 145, 119, 0.15);
    border-color: var(--color-primary, #AA9177);
}

.team-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-primary, #AA9177), var(--color-primary-dark, #8A725A));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 2rem;
    color: #fff;
    transition: transform 0.3s ease;
}

.team-card:hover .team-avatar {
    transform: scale(1.1);
}

.team-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #3C3A38);
    margin-bottom: 6px;
}

.team-role {
    font-size: 0.875rem;
    color: var(--color-primary, #AA9177);
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
}

.team-desc {
    font-size: 0.875rem;
    color: var(--text-secondary, #7B7874);
    line-height: 1.6;
    margin: 0;
}

/* --- Stats Banner --- */
.stats-banner {
    background: var(--color-primary, #AA9177);
    color: #fff;
    border-radius: 20px;
    padding: 40px;
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-bottom: 80px;
    box-shadow: 0 8px 24px rgba(170, 145, 119, 0.3);
}

.stat-item h4 {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: #fff;
}

.stat-item p {
    font-size: 0.9rem;
    opacity: 0.9;
    letter-spacing: 1px;
    margin: 0;
}

/* --- Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto 60px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-primary, #AA9177), var(--border-color, #EAE9E8));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
    /* 初始隱藏，JS 觸發後顯示 */
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.slide-from-left {
    transform: translateX(-40px);
}

.timeline-item.slide-from-right {
    transform: translateX(40px);
}

.timeline-item.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 40px;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    top: 4px;
    width: 16px;
    height: 16px;
    background: var(--color-primary, #AA9177);
    border-radius: 50%;
    border: 4px solid var(--bg-surface, #fff);
    box-shadow: 0 0 0 2px var(--color-primary, #AA9177);
    transition: transform 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.4);
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -9px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -9px;
}

.timeline-year {
    font-weight: 700;
    color: var(--color-primary, #AA9177);
    font-size: 1.05rem;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.timeline-content h5 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary, #3C3A38);
}

.timeline-content p {
    color: var(--text-secondary, #7B7874);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* --- CTA 區塊 --- */
.about-cta {
    text-align: center;
    padding: 60px 20px;
}

.about-cta h3 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--text-primary, #3C3A38);
}

/* --- RWD --- */
@media (max-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 平板：核心價值 3 欄 → 2 欄（最後一張置中） */
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .about-hero {
        height: 280px;
        background-attachment: scroll; /* 手機靜止背景，JS 也會補這個 */
    }

    .brand-card {
        padding: 30px 20px;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .story-section {
        flex-direction: column;
        padding: 25px;
        gap: 25px;
    }

    .story-img-box {
        width: 100%;
        height: 220px;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    /* 手機版 team card 不套用漂浮視差（避免錯位） */
    .team-card {
        will-change: auto;
    }

    .stats-banner {
        flex-direction: column;
        gap: 30px;
        padding: 30px 20px;
    }

    .timeline::before {
        left: 20px;
    }

    /* 手機版覆蓋奇偶排版：提高選擇器特異性，避免使用 !important */
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
        /* 手機版統一從下方淡入 */
        transform: translateY(20px);
    }

    .timeline-item:nth-child(odd).is-visible,
    .timeline-item:nth-child(even).is-visible {
        transform: translateY(0);
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 11px;
        right: auto;
    }

    /* 手機版按鈕點擊區域 ≥ 44px */
    .brand-card .btn {
        min-height: 44px;
        padding: 10px 20px;
    }
}
