/* =========================================
   全局基礎設定

   font-awesome(5.15.4)  https://fontawesome.com/v5/search?p=2&ic=free-collection
   ========================================= */
body {
   /* 使用思源宋體，並加入 Mac/iOS (Songti TC) 與 Windows (PMingLiU) 的原生明體作為備用防呆 */
    font-family: 'Noto Serif TC', 'Songti TC', 'PMingLiU', 'MingLiU', serif;
    background-color: #534539; /* 深褐色紀念背景#2b211c */
    color: #e0d8c3;
    line-height: 1.6;
}

.text-color {
  background: linear-gradient(90deg, #ff8fc7 0%, #ffe680 45%, #ffffff 75%, #5c93e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}/*彩色漸層，粉紅、黃、白、天藍*/


/* =========================================
   頂部導覽列 (Header)
   ========================================= */
/*.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.site-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 1px;
}
.site-title:hover {
    color: #f3c258;
    text-decoration: none;
}*/

/* =========================================
   頂部導覽列 (Header) - 精緻靠右版
   ========================================= */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 25px 0;
    z-index: 100;
    /* 質感漸層與毛玻璃效果，讓後方背景微糊化，凸顯文字 */
    background: background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgb(233 226 226 / 18%));
    backdrop-filter: blur(3px); 
    border-bottom: 1px solid rgb(255 255 245 / 53%); /* 極細微的下邊框增加立體感 */
}

/* 使用 Flexbox 進行排版 */
.header-nav {
    display: flex;
    justify-content: flex-end; /* 強制將內部元素靠右對齊 */
    align-items: center;
}

/* 網站標題文字設計 */
.site-title {
    color: #f8f9fa;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 2px; /* 增加字距，提升視覺優雅度 */
    text-decoration: none;
    position: relative;
    padding: 5px 0;
    transition: color 0.4s ease;
}

/* 移除預設的底線，改用精緻的自訂動態底線 */
.site-title:hover, 
.site-title:focus {
    color: #f3c258; /* 滑過時轉為典雅的金色 */
    text-decoration: none;
}

/* 隱藏的自訂動態底線 (利用偽元素製作) */
.site-title::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    right: 0; /* 動畫起始點設為右側 */
    background-color: #f3c258;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* 平滑的緩動函數 */
}

/* 當滑鼠經過時，底線從右向左展開 */
.site-title:hover::after {
    width: 100%;
    left: 0;
    right: auto;
}


/* =========================================
   純 CSS 無 JS 主視覺與輪播 (Hero Slider)
   ========================================= */
.hero-wrapper {
    position: relative;
    width: 100%;
    height: 65vh;       /* 佔螢幕高度 85% */
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* 輪播背景圖設定 */
.css-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0; /* 預設隱藏 */
    animation: fadeSlider 15s infinite; /* 15秒循環動畫 */
    z-index: 1;
}

/* 圖片路徑與延遲時間 (如需換圖請改此處) */
.slide-1 { background-image: url('../img/hero/h1.jpg'); animation-delay: 0s; }
.slide-2 { background-image: url('../img/hero/h2.jpg'); animation-delay: 5s; }
.slide-3 { background-image: url('../img/hero/h3.jpg'); animation-delay: 10s; }

/* 透明度與放大動畫 (Ken Burns Effect) */
@keyframes fadeSlider {
    0%   { opacity: 0; transform: scale(1); }
    10%  { opacity: 1; }
    33%  { opacity: 1; transform: scale(1.05); }
    43%  { opacity: 0; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1); }
}

/* 黑色漸層遮罩，保護文字可讀性 */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 2;
}

/* 漂浮於圖片上方的文字設定 */
.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 0 15px;
}

.hero-text h2 {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-btn {
    border: 2px solid #fff;
    padding: 12px 25px;
    font-size: 1.1rem;
    transition: all 0.3s;
}
.hero-btn:hover {
    background-color: #f3c258;
    border-color: #f3c258;
    color: #2b211c;
}

/* 手機版主標題字體縮小 */
@media (max-width: 768px) {
    .hero-text h2 { font-size: 1.8rem; }
    .hero-wrapper { height: 70vh; }
}


/* =========================================
   官方追悼文 (Eulogy Box) 專屬精緻排版
   ========================================= */
.eulogy-box {
    background: rgba(255, 255, 255, 0.03); /* 極淡的透明背景，區分層次但不搶戲 */
    border: 1px solid rgba(243, 194, 88, 0.2); /* 柔和的細緻金邊 */
    border-radius: 6px;
    padding: 25px; /* 寬裕的內距讓文字有呼吸空間 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* 標題設計 */
.eulogy-title {
    color: #f3c258;
    font-family: 'Noto Serif TC', serif;
    font-size: 1.25rem;
    letter-spacing: 2px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(243, 194, 88, 0.15); /* 標題下方的典雅分隔線 */
    padding-bottom: 12px;
}

/* 中文段落文字設計 */
.eulogy-box p {
    font-size: 0.95rem; /* 字體微調稍小，顯得精緻 */
    line-height: 2;  /* 拉大行高，提升閱讀舒適度 */
    color: #dfd8cf;     /* 柔和的米灰色，不刺眼 */
    text-align: justify;/* 左右對齊，讓段落邊緣像書本一樣整齊 */
    margin-bottom: 1.2rem;
}

/* 英文段落專屬微調 */
.eulogy-en p {
    font-family: 'sans-serif', Josefin Sans;
    font-size: 1rem; /* 英文字母視覺上較大，稍微縮小 0.05rem 取得中英平衡 */
    color: #b5a898;    /* 英文顏色稍微壓暗，做出主副層次 */
    line-height: 1.2;
}

/* 手機版 (Mobile) 適配調整 */
@media (max-width: 768px) {
    .eulogy-box {
        padding: 30px 25px; /* 手機版縮小內距 */
    }
    
    .eulogy-en {
        margin-top: 10px; /* 手機版時英文會掉到下方，增加上方間距 */
        border-top: 1px dashed rgba(243, 194, 88, 0.2); /* 加上虛線分隔中英文 */
        padding-top: 10px;
    }
}


/* =========================================
   留言板區塊 (Message Board)
   ========================================= */
.spad {
    padding-top: 50px;
    padding-bottom: 50px;
}

/* 說明文字框 */
.intro-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(243, 194, 88, 0.3);
    padding: 10px;
    border-radius: 8px;
}
.intro-box p {
    color: #bfae9e;
    margin-bottom: 0.5rem;
}

/* 個別留言卡片設計 */
.message-card {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #f3c258; /* 左側金色高光邊框 */
    padding: 20px;
    height: 100%;
    transition: transform 0.3s ease, background 0.3s ease;
}

.message-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.message-header h4 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 15px;
    line-height: 1.5;
}

.message-header small {
    color: #a39587;
    font-size: 0.9rem;
}

.message-body p {
    color: #cfc5b6;
    font-size: 0.9rem;
    text-align: justify;
    margin-bottom: 0;
}

/* =========================================
   留言相簿 (Message Gallery) 樣式
   ========================================= */
.message-gallery {
    border-top: 1px solid rgba(243, 194, 88, 0.2); /* 加一條細線隔開文字與照片 */
    padding-top: 5px;
}

/* 縮圖外框設定 */
.thumb-link {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    background-color: #000;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 縮圖圖片設定 */
.thumb-link img {
    width: 100%;
    height: 150px;       /* 固定高度讓網格整齊 */
    object-fit: cover;   /* 圖片裁切填滿，不變形 */
    opacity: 0.8;        /* 預設稍微變暗 */
    transition: all 0.3s ease;
}

/* 滑鼠經過效果 */
.thumb-link:hover {
    border-color: #f3c258; /* 框線變金黃色 */
    transform: scale(1.02);
}

.thumb-link:hover img {
    opacity: 1;          /* 圖片恢復亮度 */
}

/* 手機版適配：縮圖高度調小 */
@media (max-width: 576px) {
    .thumb-link img {
        height: 100px;
    }
}


/* =========================================
   照片集區塊 (Pictorial Legacy)
   ========================================= */
.photos-section {
    background-color: #241b17; /* 稍深於主背景，增加層次感 */
}

.photo-section-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.2rem;
    color: #f3c258;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.photo-section-subtitle {
    font-family: 'Noto Serif TC', serif;
    font-style: italic;
    color: #a39587;
    font-size: 0.95rem;
}

/* 自定義響應式網格系統 */
.photo-custom-grid {
    display: grid;
    gap: 12px; /* 照片間距 */
    /* 預設：電腦版每列 8 張 */
    grid-template-columns: repeat(8, 1fr);
}

/* 縮圖外框 */
.photo-thumb {
    aspect-ratio: 1 / 1; /* 強制照片成正方形，整齊美觀 */
    overflow: hidden;
    background-color: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 確保不同比例的照片都不會變形 */
    opacity: 0.7;
    transition: all 0.5s ease;
    filter: grayscale(30%); /* 略微去色，增加歷史感 */
}

/* 滑鼠經過效果 */
.photo-thumb:hover {
    border-color: #f3c258;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.photo-thumb:hover img {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1); /* 輕微放大 */
}

/* =========================================
   響應式斷點設定 (8 -> 6 -> 3 -> 2)
   ========================================= */

/* 中大型螢幕 (平板電腦橫向) - 每列 6 張 */
@media (max-width: 1400px) {
    .photo-custom-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 平板直向 - 每列 3 張 */
@media (max-width: 992px) {
    .photo-custom-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .photo-section-title { font-size: 1.8rem; }
}

/* 手機版 - 每列 2 張 */
@media (max-width: 576px) {
    .photo-custom-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}