/* 引入 Google Fonts 的字體 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@700&family=Open+Sans:wght@400;700&display=swap');

/* --- 基本樣式重設 --- */
body, h1, h2, p, ul {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    line-height: 1.6;
    background-color: #f9f7f7;
    color: #333;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 頁首 Header --- */
header {
    background-color: #a73c3c;
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    border-bottom: 3px solid #8e2d2d;
}

header h1 {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

header .main-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.5rem;
    font-weight: 700;
}

/* --- 導覽列 Nav --- */
nav {
    background-color: #5c3d2e;
    padding: 0.75rem 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    transition: background-color 0.3s, color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    background-color: #fff;
    color: #5c3d2e;
    border-radius: 5px;
}

/* --- 主要內容 Main --- */
main {
    padding: 2rem 0;
}

/* 其他內容頁面的通用樣式 */
.welcome-section,
.content-section {
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.welcome-section h2,
.content-section h2 {
    font-family: 'Noto Serif TC', serif;
    margin-bottom: 1.5rem;
    color: #a73c3c;
    font-size: 2rem;
    text-align: center;
}

.content-section ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.content-section ul li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* --- 連結頁面的列表樣式 --- */
.link-list {
    list-style: none;
    padding: 0;
}
.link-list li {
    background-color: #f9f9f9;
    border-left: 4px solid #a73c3c;
    padding: 1rem;
    margin-bottom: 1rem;
}
.link-list li p {
    font-weight: bold;
    margin-bottom: 0.25rem;
}
.link-list li a {
    color: #5c3d2e;
    text-decoration: none;
    word-break: break-all;
}
.link-list li a:hover {
    text-decoration: underline;
}

/* --- 聯絡我們頁面的樣式 --- */
.contact-info {
    text-align: center;
    font-size: 1.1rem;
}
.contact-info p {
    margin-bottom: 0.8rem;
}

/* --- 通用表格樣式 (適用於網站所有表格) --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

table th, table td {
    border: 1px solid #333;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.activities-table td ul {
    padding-left: 20px;
    margin-top: 5px;
}
.activities-table td ul li {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* --- 相簿頁面樣式 (點擊開啟大圖版) --- */
.photo-album {
    margin-bottom: 3rem; 
}

.photo-album h3 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.8rem;
    margin-bottom: 1.5rem;
}

.photo-grid {
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; /* 縮圖之間的間距 */
}

/* 針對包住圖片的 <a> 連結做設定 */
.photo-grid a {
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* 隱藏圖片超出圓角的部分 */
    flex: 1 1 180px; /* 調整縮圖基礎寬度為 180px，讓它們變得更小 */
}

.photo-grid a:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2); /* 滑鼠移過時，陰影更明顯 */
}

/* 針對 <a> 裡面的 <img> 圖片做設定 */
.photo-grid img {
    width: 100%; /* 讓圖片寬度永遠填滿 <a> 容器 */
    height: 140px; /* 給定一個固定的高度，讓所有縮圖等高 */
    object-fit: cover; /* 保持圖片比例，自動裁剪多餘部分 */
    display: block;
}

/* --- 頁尾 Footer --- */
footer {
    background-color: #5c3d2e;
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* --- 響應式設計 --- */
@media (max-width: 768px) {
    header .main-title {
        font-size: 2rem;
    }
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    main {
        padding: 1.5rem 0;
    }
    .welcome-section, .content-section {
        padding: 1.5rem;
    }
}

/* --- 讓內容區的圖片自動縮放以適應邊界 --- */
.welcome-section img,
.content-section img:not(.photo-grid img) { /* 排除相簿縮圖，避免樣式衝突 */
    max-width: 100%;
    height: auto;
    display: block;
}