/* css/index.css */

/* --- 全域設定 --- */
body {
    background-color: #fff;
    color: #333;
    font-family: "Microsoft JhengHei", "Heiti TC", sans-serif;
}

/* --- 1. 全螢幕主視覺 (Hero Section) --- */
.hero-section {
    width: 100%;
    height: 95vh;
    padding: 0;    /* 移除原本的留白 */
    display: flex;
    justify-content: center;
    position: relative; /* 為了定位裡面的箭頭 */
    margin-bottom: 0;
}

.hero-section .hero-content {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 0;   /* 移除圓角，變成直角滿版 */
    overflow: hidden;
    box-shadow: none;   /* 滿版通常不需要陰影 */
}

/* 圖片設定：強制填滿 */
.hero-section .hero-content img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 讓圖片填滿整個畫面，不會變形 */
    object-position: center; /* 圖片置中 */
    display: block;
}

/* 遮罩 (稍微暗一點，讓箭頭明顯) */
.hero-section .hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2); /* 20% 黑色遮罩，可自行調整 */
    z-index: 1;
    pointer-events: none; /* 讓滑鼠可以直接點穿遮罩 */
}

/* --- 下滑箭頭動畫 --- */
.scroll-down {
    position: absolute;
    bottom: 40px;          /* 距離底部 40px */
    left: 50%;
    transform: translateX(-50%) rotate(90deg); /* 轉90度讓箭頭向下 */
    z-index: 10;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 3rem;       /* 箭頭大小 */
    font-weight: bold;
    animation: bounce 2s infinite; /* 呼叫彈跳動畫 */
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
}

/* 滑鼠移上去變亮 */
.scroll-down:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* 定義彈跳動畫 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) rotate(90deg) translateY(0);
    }
    40% {
        transform: translateX(-50%) rotate(90deg) translateY(-20px); /* 往上縮 */
    }
    60% {
        transform: translateX(-50%) rotate(90deg) translateY(-10px);
    }
}

/* 手機版調整：扣掉網址列高度，避免跑版 */
@media (max-width: 768px) {
    .hero-section {
        height: 100svh; /* 支援現代手機瀏覽器的動態高度 */
    }
    .scroll-down {
        bottom: 80px; /* 手機版按鈕稍微拿高一點 */
        font-size: 2.5rem;
    }
}

/* --- 下滑箭頭動畫 (修正版：移除旋轉) --- */
.scroll-down {
    position: absolute;
    bottom: 40px;
    left: 50%;
    /* 修改這裡：拿掉 rotate(90deg)，只保留置中 */
    transform: translateX(-50%); 
    z-index: 10;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
    /* 確保 SVG 顏色正確 */
    fill: rgba(255, 255, 255, 0.8); 
    animation: bounce 2s infinite;
}

/* 確保 SVG 大小適中 */
.scroll-down svg {
    width: 48px;
    height: 48px;
    fill: white; /* 強制白色 */
}

.scroll-down:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 定義彈跳動畫 (修正版：移除旋轉) */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        /* 這裡也拿掉 rotate(90deg) */
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-20px);
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* --- 2. 跑馬燈 (黃底紅字 - 稍微優化質感) --- */
.marquee-container {
    width: 100%;
    background-color: #FFFACD;
    overflow: hidden;
    white-space: nowrap;
    padding: 18px 0; /* 稍微加高一點點 */
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.marquee-text {
    display: inline-block;
    font-size: 1.5rem; /* 字體調整跟內文協調 */
    font-weight: bold;
    color: #FF0000;
    padding-left: 100%;
    animation: scroll-left 20s linear infinite;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- 共用容器設定 (對齊 About 頁面) --- */
.news-section, .activity-review {
    max-width: 1300px; /* 跟 about.css 一樣寬 */
    width: 90%;
    margin: 60px auto; /* 統一間距 */
    padding: 0 20px;
}

/* --- 3. 最新消息 (海報區) --- */
.news-section h2, .activity-review h2 {
    text-align: center;
    font-size: 2rem;
    color: #000;
    font-weight: 900;
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.poster-container {
    display: flex;
    justify-content: space-between;
    gap: 30px; /* 增加間距 */
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.poster {
    flex: 1;
    min-width: 300px;
}

.poster img {
    width: 100%;
    height: auto;
    /* !!! 統一風格：加上圓角與陰影 !!! */
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: transform 0.3s; /* 增加一點互動感 */
}

.poster img:hover {
    transform: translateY(-5px); /* 滑鼠移過去稍微浮起來 */
}

/* 按鈕樣式 (優化版) */
.cta-buttons {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 80px;
}

.cta-buttons button {
    flex: 1;
    background-color: #D9534F;
    color: white;
    border: none;
    padding: 12px 0; /* 加大點擊範圍 */
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px; /* 圓角 */
    font-weight: bold;
    transition: background-color 0.3s;
}

.cta-buttons button:hover {
    background-color: #c9302c;
}

/* --- 最新消息區 (新聞卡片排版) --- */
.news-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;        /* 卡片之間的間距 */
    margin-bottom: 50px;
}

/* 每一個新聞卡片 (包含圖和按鈕) */
.news-card {
    flex: 1;          /* 三個平均分配寬度 */
    display: flex;
    flex-direction: column; /* 讓圖在上面，按鈕在下面 */
    min-width: 0;     /* 防止內容撐開容器 */
}

/* 圖片樣式 */
.news-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    margin-bottom: 20px; /* 圖片跟按鈕之間的距離 */
    transition: transform 0.3s;
}

.news-card img:hover {
    transform: translateY(-5px); /* 滑鼠移過去浮起來 */
}

/* 按鈕樣式 (現在按鈕是在卡片裡面) */
.news-card button {
    width: 100%;      /* 按鈕寬度跟圖片一樣寬 */
    background-color: #D9534F;
    color: white;
    border: none;
    padding: 12px 0;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    transition: background-color 0.3s;
    margin-top: auto; /* 確保按鈕對齊底部 (如果有卡片高度不同的話) */
}

.news-card button:hover {
    background-color: #c9302c;
}

/* --- 4. 榮譽榜 (獎狀區 - 風格微調) --- */
.awards-container {
    display: flex;
    justify-content: center;
    margin-bottom: 80px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    max-width: 1300px;
}

.award-box {
    background-color: #ffffdd;
    border: 2px solid #4169E1;
    padding: 40px; /* 內距加大 */
    display: flex;
    align-items: center;
    gap: 60px; /* 間距加大 */
    width: 100%;
    border-radius: 10px; /* 圓角 */
    /* 加上陰影讓它更有質感 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.award-box img {
    width: 250px;
    border-radius: 4px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    background-color: #fff; /* 照片加白底邊框感 */
    padding: 5px;
}

.award-text h3 {
    color: #FF0000;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.award-text p {
    font-size: 1.6rem;
    color: #333;
    font-weight: bold;
    line-height: 1.5;
}

/* --- 5. 活動花絮 (改成跟 About 頁面一樣的左右排版) --- */
.activity-review {
    margin-bottom: 80px;
}

.gallery-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px; /* 統一間距 */
    margin-bottom: 80px;
    padding-bottom: 60px;
    border-bottom: 1px solid #eee; /* 改成實線比較現代 */
}

/* 文字區塊 (flex: 1) */
.gallery-text {
    flex: 1; 
    text-align: left; /* 改成靠左對齊，跟 About 頁面一致 */
}

.gallery-text h3 {
    color: #0000FF;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 15px;
}

/* 圖片區塊 (flex: 1.2 - 統一比例) */
.gallery-img {
    flex: 1.2;
}

.gallery-img img {
    width: 100%;
    height: auto;
    display: block;
    /* 統一風格 */
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* 偶數項反轉排版 (左圖右文 -> 右圖左文) 增加變化性 */
.gallery-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* --- 手機版適應 (更新) --- */
@media (max-width: 900px) {
    /* 讓新聞卡片變成直排 */
    .news-grid {
        flex-direction: column;
        gap: 40px; /* 手機上每個項目距離拉大一點 */
    }

    /* 手機上卡片寬度佔滿 */
    .news-card {
        width: 100%;
    }

    /* 原本的榮譽榜適應 (保持不變) */
    .award-box {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .award-box img {
        width: 100%;
        max-width: 250px;
    }

    /* 原本的活動花絮適應 (保持不變) */
    .gallery-item, .gallery-item:nth-child(even) {
        flex-direction: column-reverse;
        text-align: center;
    }
}

/* --- 卡片式網格設計 (模仿參考圖) --- */

.cards-grid {
    display: grid;
    /* 自動適應寬度：電腦顯示3欄，平板2欄，手機1欄 */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px; /* 卡片之間的間距 */
    margin-top: 30px;
}

/* 卡片本體 */
.activity-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px; /* 圓角 */
    overflow: hidden; /* 讓圖片不超出圓角 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* 滑鼠移過去的效果：浮起來 + 陰影 */
.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* 圖片區域 */
.card-thumb {
    width: 100%;
    height: 200px; /* 固定圖片高度，才不會參差不齊 */
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 讓圖片填滿框框不變形 */
    transition: transform 0.5s ease;
}

.activity-card:hover .card-thumb img {
    transform: scale(1.05); /* 滑鼠移過去圖片稍微放大 */
}

/* 內容區域 */
.card-content {
    padding: 20px;
    flex: 1; /* 確保內容區填滿剩餘空間 */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 靠左對齊 */
}

/* 藍色標籤 (模仿參考圖的 "協會公告" 樣式) */
.card-tag {
    background-color: #0000FF; /* 藍底 */
    color: #fff;              /* 白字 */
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 2px;
    margin-bottom: 12px;
    display: inline-block;
    font-weight: normal;
}

/* 標題 */
.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* 修改後的 .card-desc */
.card-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
    
    /* --- 改用高度限制法 (不會報錯，但沒有吊飾點點) --- */
    height: 4.8rem;      /* 1.6 (行高) * 3 (行數) = 4.8rem */
    overflow: hidden;    /* 超出的部分藏起來 */
}

/* --- 卡片內迷你輪播 (修正版) --- */

.mini-slider {
    position: relative;
    width: 100%;
    height: 200px;
    /* ⭐ 關鍵：這一行沒加，圖片就會衝出框框連成一條 */
    overflow: hidden; 
    border-radius: 8px 8px 0 0; /* 配合卡片圓角 */
}

.mini-track {
    display: flex;
    height: 100%;
    width: 100%;
    /* 加入 transition 讓滑動順暢 */
    transition: transform 0.4s ease-in-out;
}

.mini-track img {
    /* ⭐ 關鍵：強制每一張圖都保持 100% 寬度，不准被壓縮 */
    width: 100%;
    min-width: 100%; 
    flex-shrink: 0; 
    
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 按鈕樣式 (維持不變) */
.mini-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
    /* 確保按鈕內容居中 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.mini-prev { left: 10px; }
.mini-next { right: 10px; }
.mini-slider:hover .mini-btn { opacity: 1; }
.mini-btn:hover { background-color: rgba(0, 0, 0, 0.8); }