/* ================= 全域設定 ================= */
html, body {
    height: 100%;                     /* 讓 footer 能貼底 */
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;  /* 全站字型 */
    line-height: 1.6;                /* 行距 */
    background-color: #f5f5f5;       /* 背景顏色 */
    color: #333;                     /* 字體顏色 */
    display: flex;
    flex-direction: column;         /* 排列 header / main / footer */
}

/* ================= 導覽列 ================= */
nav {
    background: #333;
    padding: 10px;
    text-align: center;
}
nav a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
}

/* ================= 英雄區塊（首頁大圖） ================= */
.hero {
    background-image: url('../images/IMG_0029.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 250px 20px;
    text-align: center;
}

/* ================= 通用容器 ================= */
main {
    flex: 1;                         /* 撐開空間，推 footer 到底 */
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================= 標題樣式 ================= */
.about-header {
    text-align: center;
}

/* ================= 頭像區塊 ================= */
.avatar {
    margin: 20px auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #333;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ================= 作品列表 ================= */
.projects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.project {
    width: 250px;
    margin: 15px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
}
.project img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ================= 作品標籤 ================= */
.tag {
    color: #5e717e;
    font-weight: bold;
}

/* ================= 下拉選單 ================= */
.dropdown {
    display: inline-block;
    position: relative;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #444;
    min-width: 160px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1;
}
.dropdown-content a {
    color: white;
    padding: 10px 15px;
    display: block;
    text-align: left;
    text-decoration: none;
}
.dropdown:hover .dropdown-content {
    display: block;
}
.dropdown-content a:hover {
    background-color: #666;
}

/* ================= 橫幅圖片區（子頁大圖） ================= */
.banner {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    position: relative;
}
.banner img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center center; /* 水平 + 垂直 置中 */
    display: block;
}
/* 可選：圖片中央顯示文字（如建設中） */
.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
    text-align: center;
}

/* ================= 頁腳區塊 ================= */
footer {
    background: white;
    text-align: center;
    padding: 10px;
}

/* ================= 超連結樣式 ================= */
a {
    color: #a15d5d;
}

/* ================= 圖片網格排版（響應式） ================= */
.gallery {
    display: grid;                                        /* 使用 Grid 布局 */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 自動調整欄數 */
    gap: 20px;                                             /* 圖片間距 */
    padding: 10px;
}
.page-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  background: white;                 /* 可選：讓圖片+說明區塊有底色 */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(0,0,0,0.1); /* 可選：讓整塊更有層次 */
}


.image-caption {
  width: 100%;                         /* 與圖片同寬 */
  font-size: 0.85rem;
  color: #313131;
  font-style: italic;
  text-align: center;
  padding: 6px 10px;
  background-color: white;           /* 淺色底讓字與圖分明 */
}



/* ================= 捲動淡入動畫 ================= */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}


/* ================= 響應式設計 ================= */
@media (max-width: 768px) {
    .project {
        width: 90%; /* 行動裝置單欄排 */
    }

    .banner {
        max-height: 180px;
    }

    .banner-text {
        font-size: 1.2rem;
        padding: 0 10px;
    }

    nav a {
        display: inline-block;
        margin: 8px;
    }

    .gallery {
        grid-template-columns: repeat(1, 1fr); /* 手機一行一張 */
    }
}

@media (min-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr); /* 電腦一行五張 */
    }
}
