/* style.css */

/* --- 全域設定 --- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* 為了不被固定的 Footer 擋住內容，預留底部空間 (約等於 footer-bottom 的高度) */
    padding-bottom: 60px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #f8f9fa; /* 統一背景色 */
}

/* --- 首頁 (Index) 樣式 --- */
.hero-section {
    background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    padding: 80px 0;
}

.event-card {
    transition: transform 0.3s;
    border: none;
    overflow: hidden;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    background: #eee;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 活動內頁 (Event) 樣式 --- */
.artwork-card { 
    border-radius: 12px; 
    border: none; 
    transition: transform 0.2s; 
    background: #fff;
    /* 新增：確保卡片上方有足夠的空間，避免被 sticky header 遮住 */
    scroll-margin-top: 80px; 
}

.artwork-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}

.thumb-img { 
    cursor: zoom-in; 
    height: 220px; 
    object-fit: contain; 
    background-color: #f8f9fa; /* 圖片背景淺灰 */
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.description-box { 
    font-size: 0.95rem; 
    line-height: 1.6; 
}

.grid-item {
    margin-bottom: 1.5rem;
    scroll-margin-top: 80px; /* 雙重保險 */
}

/* --- Modal (燈箱) 樣式 --- */
.modal-body.img-container {
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-img {
    max-height: 85vh; /* 確保不超過視窗高度 */
    max-width: 100%;
    object-fit: contain;
}

/* --- Footer 樣式 (摺疊固定版) --- */
.site-footer {
    position: fixed;  /* 關鍵：固定在視窗底部 */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1050;    /* 確保在最上層 */
    background-color: #2c2c2c;
    color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2); /* 增加陰影 */
    transition: all 0.3s ease;
}

/* 隱藏的內容區塊 (預設收合) */
.footer-content {
    max-height: 0;    /* 高度為 0 */
    overflow: hidden; /* 隱藏超出範圍的內容 */
    opacity: 0;
    padding: 0;       /* 收合時移除 padding */
    transition: all 0.3s ease; /* 滑動動畫 */
    background-color: #333; /* 展開區塊稍微淺一點 */
}

/* 展開狀態 (透過 JS 加入 class) */
.site-footer.expanded .footer-content {
    max-height: 500px; /* 設定一個足夠大的高度 */
    opacity: 1;
    padding: 30px 0;   /* 展開時給予 padding */
    border-bottom: 1px solid #444;
}

/* 內容區塊容器 */
.footer-content .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.footer-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #ff8e8e;
}

.footer-info p { margin: 5px 0; }

.footer-info a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-info a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: transform 0.2s, opacity 0.2s;
    font-size: 0.9rem;
}
/* --- 手機版 Footer 社群連結：橫向捲動修正版 --- */
@media (max-width: 768px) {
    .footer-social {
        display: flex;
        flex-wrap: nowrap;            /* 不換行 */
        overflow-x: auto;             /* 開啟左右滑動 */
        
        /* ★★★ 關鍵修正 1：強制靠左 ★★★ */
        /* 之前如果設為 center，超出範圍時左邊會被切掉 */
        justify-content: flex-start !important; 
        
        align-items: center;
        width: 100%;
        padding: 10px 0;              /* 上下留點空間 */
        gap: 10px;                    /* 按鈕間距 */
        
        /* 讓滑動更順暢 */
        -webkit-overflow-scrolling: touch; 
    }

    /* ★★★ 關鍵修正 2：防止按鈕變形與文字換行 ★★★ */
    .footer-social .social-link {
        flex: 0 0 auto;               /* 固定大小，不準縮放 */
        white-space: nowrap;          /* 禁止文字換行 (解決 LINE 變直排的問題) */
    }

    /* 隱藏捲軸 (美觀) */
    .footer-social::-webkit-scrollbar { display: none; }
    .footer-social { -ms-overflow-style: none; scrollbar-width: none; }
}

.social-link i { margin-right: 8px; }
.social-link.fb { background-color: #3b5998; }
.social-link.ig { background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d); }

.social-link:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: white;
}

/* 底部版權列 (永遠顯示，可點擊) */
.footer-bottom {
    background-color: #2c2c2c;
    text-align: center;
    padding: 15px 0;
    font-size: 0.9rem;
    color: #bbb;
    cursor: pointer; /* 讓游標變成手指 */
    position: relative;
    user-select: none; /* 防止連點時選取到文字 */
    transition: background-color 0.2s;
}

.footer-bottom:hover {
    background-color: #1f1f1f;
    color: #fff;
}

/* 提示箭頭樣式 */
.toggle-icon {
    position: absolute;
    top: -15px; /* 讓箭頭浮在 bar 的上方中間 */
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff8e8e; /* 櫻桃色 */
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

/* 展開時箭頭旋轉 */
.site-footer.expanded .toggle-icon {
    transform: translateX(-50%) rotate(180deg);
    background-color: #444;
}

/* RWD 調整 */
@media (max-width: 768px) {
    .footer-content .container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .footer-social { justify-content: center; }
    
    /* 讓容器頂部多一點空間，避免第一排卡片被切掉 */
    .container.pb-5.flex-grow-1 {
        padding-top: 20px; 
    }
}

/* --- 音訊播放器樣式 (修正手機版跑版問題) --- */
.audio-wrapper {
    margin-top: 15px;      /* 與上方文字或圖片的距離 */
    padding: 10px;         /* 內距 */
    background-color: #f1f3f5; /* 淺灰背景，讓它看起來像一個獨立區塊 */
    border-radius: 30px;   /* 圓角 */
    width: 100%;           /* 確保寬度填滿 */
    box-sizing: border-box; /* 確保 padding 不會撐爆寬度 */
}

audio.audio-player {
    width: 100%;           /* 寬度佔滿容器 */
    height: 40px;          /* 固定高度 */
    display: block;        /* 區塊顯示 */
    outline: none;         /* 移除點擊邊框 */
}

/* 針對 iOS Safari 的預設播放器微調 */
audio::-webkit-media-controls-panel {
    background-color: #f1f3f5; /* 讓 iOS 原生控制列背景一致 */
}