.banner {
  width: 100%;
  position: relative;
}

.banner img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

.banner a {
  right: 0;
  bottom: 0;
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0.2em 0.5em;
  background: #222222e0;
}

.banner a span {
  color: #FFF;
  font-size: 1.6em;
  letter-spacing: 3px;
}

.banner a:hover span {
  text-decoration: underline;
}

.banner a svg {
  height: 2em;
}

.banner a path {
  fill: #FFF;
}

.classifyList a {
	margin-right: 1em;
	transition: color 0.3s;
	white-space: nowrap;
}

.classifyList .isPage , .classifyList a:hover {
	color: var(--sColor);
}

/* projects */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2em 0;
}

.project {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px B2px rgba(0,0,0,0.1);
}

/* --- 圖片效果的關鍵 CSS --- */

/* 1. 圖片容器 (.project-image-container) */
.project-image-container {
  position: relative; /* 讓偽元素可以絕對定位 */
  width: 100%;
  aspect-ratio: 16 / 9; /* 維持固定的長寬比 */
  background-color: #333; /* 圖片載入前的深色背景 */
  overflow: hidden; /* 隱藏模糊背景超出範圍的部分 */
}

/* 2. 模糊背景層 (使用 ::before 偽元素) */
.project-image-container::before {
  content: ''; /* 偽元素必須要有 content */
  position: absolute;
  inset: 0; /* 等同於 top: 0; right: 0; bottom: 0; left: 0; */
  z-index: 1; /* 確保在圖片下方 */
  
  /* 從父層讀取 CSS 變數來設定背景圖片 */
  background-image: var(--bg-image); 
  background-size: cover;
  background-position: center;

  /* 核心效果：高斯模糊 + 降低亮度 */
  filter: blur(20px) brightness(0.8);

  /* 技巧：稍微放大，避免模糊後邊緣出現半透明，讓效果更飽滿 */
  transform: scale(1.1);
}

/* 3. 清晰的前景圖 (原本的 <img>) */
.project-image-container img {
  position: relative; /* 需要 position 才能設定 z-index */
  z-index: 2; /* 確保在模糊背景的上方 */
  width: 100%;
  height: 100%;

  /* 關鍵：讓圖片完整顯示不裁切 */
  object-fit: contain; 

  /* 建議：加上陰影讓圖片更有立體感，從背景中突顯出來 */
  filter: drop-shadow(0 0 15px rgba(0,0,0,0.5));
}


/* --- 文字內容樣式 --- */
.project h3 {
  margin: 1rem 1rem 0.5rem;
  font-size: 1.25rem;
}

.project .description {
  margin: 0 1rem 1rem;
  flex-grow: 1;
  color: #555;
}

@media screen and (max-width: 500px) {
  .projects {
    grid-template-columns: repeat(auto-fill,minmax(350px,1fr));
  }
  .banner a span {
    font-size: 1.2em;
  }
  .banner a svg {
    height: 1.2em;
    width: 1.2em;
  }
}

@media screen and (max-width: 500px) {
  .projects {
    grid-template-columns: 1fr;
  }
}