/* ==========================================
   專案詳細介紹頁樣式 (project-detail.css)
   ========================================== */

/* 頂部滿版主視覺 */
.project-detail-hero {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 400px;
  overflow: hidden;
  margin-top: 0; 
}

.project-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 60px 20px 30px;
  background: linear-gradient(to top, rgba(55, 70, 76, 0.9), transparent);
  color: white;
  text-align: center;
}

.hero-overlay h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-overlay p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* 內容區塊排版 */
.project-detail-content {
  padding-top: 60px;
  padding-bottom: 60px;
}

/* 介紹與資訊網格 (左右排版) */
.info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-bottom: 80px;
  background-color: rgba(255, 255, 255, 0.6);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--c4-winter-mist);
}

/* 讓右側的 meta-info 區塊內容垂直置中 */
.info-grid .meta-info {
  display: flex;
  flex-direction: column;
  justify-content: center; /* 🌟 垂直置中的關鍵魔法 */
  height: 100%; /* 確保它撐滿整個右邊的高度，才能在中間對齊 */
}

.info-grid .meta-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-grid .meta-info li {
  padding: 12px 0;
  border-bottom: 1px solid var(--c4-winter-mist);
  font-size: 0.95rem;
}

.info-grid .meta-info li:last-child {
  border-bottom: none;
}

.info-grid .meta-info strong {
  color: var(--accent-color);
  margin-right: 8px;
}

/* 技術亮點區塊 (圖文交錯排列) */
.tech-showcase {
  margin-bottom: 60px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 60px;
}

.feature-item.reverse {
  flex-direction: row-reverse;
}

.feature-text {
  flex: 1;
}

.feature-text h3 {
  color: var(--accent-color);
  font-size: 1.4rem;
  margin-bottom: 15px;
}

.feature-image {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(104, 170, 198, 0.2);
}

.feature-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* 返回按鈕 */
.back-link {
  text-align: center;
  margin-top: 40px;
}

.btn-back {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--c3-cold-smoke);
  color: white;
  border-radius: 30px;
  transition: all 0.3s ease;
}

.btn-back:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(104, 170, 198, 0.4);
}

/* 手機版 RWD 適應 */
@media screen and (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr; 
    gap: 20px;
  }
  .feature-item, .feature-item.reverse {
    flex-direction: column; 
    gap: 20px;
  }
  
  /* 🌟 關鍵修復：強制讓圖片/輪播圖區塊在手機上佔滿 100% 寬度，避免坍塌隱形 */
  .feature-image {
    width: 100%;
  }
}

/* ==========================================
   外部連結按鈕 (例如得獎紀錄、試玩連結)
   ========================================== */
.btn-action {
  display: inline-block;
  padding: 10px 25px;
  background-color: transparent;
  color: var(--accent-color);              /* 文字使用冰晶水藍色 */
  border: 2px solid var(--accent-color);    /* 加上水藍色外框 */
  border-radius: 30px;                      /* 圓角藥丸形狀 */
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

/* 滑鼠移過去的特效 */
.btn-action:hover {
  background-color: var(--accent-color);    /* 背景填滿水藍色 */
  color: #fff;                              /* 文字變成白色 */
  transform: translateY(-3px);              /* 微微往上浮起 */
  box-shadow: 0 6px 15px rgba(104, 170, 198, 0.3); /* 帶有水藍色的光暈陰影 */
}

/* ==========================================
   自動輪播圖 (Auto Crossfade Slider)
   ========================================== */
.auto-slider {
  position: relative;
  /* 強制鎖定比例，避免圖片還沒載入時高度塌陷 (可依你的照片比例微調 16/9 或 4/3) */
  aspect-ratio: 16 / 10; 
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(104, 170, 198, 0.2);
}

/* 把所有圖片疊在一起，並先隱藏 */
.auto-slider .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out; /* 1秒的極致絲滑淡入淡出 */
  z-index: 1;
}

/* 只有帶有 active 的圖片才會浮現 */
.auto-slider .slide.active {
  opacity: 1;
  z-index: 2;
}

/* 輪播圓點指示器 */
.slider-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 停留在哪一張，那個圓點就會變白放大 */
.slider-dots .dot.active {
  background-color: #fff;
  transform: scale(1.4);
}

/* ==========================================
   GIF 微型展示網格 (2x2)
   ========================================== */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 15px;
  background-color: transparent;
  box-shadow: none; 
  place-items: center;
}

/* 確保裡面的 GIF 和 WebM 都能保有自己的圓角，且乖乖待在格子裡 */
.gif-grid img,
.gif-grid video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(104, 170, 198, 0.15); /* 給小圖獨立的陰影 */
}

/* ==========================================
   多比例 GIF 彈性展示區 (支援 img 與 video)
   ========================================== */
.gif-showcase {
  display: flex;
  flex-wrap: wrap; /* 如果塞不下會自動換行 */
  gap: 20px;
  justify-content: center; /* 讓所有角色在正中間集中 */
  
  /* 🌟 排版心機：讓圖片對齊「底部」。
     這樣不同比例的角色腳底都會貼齊同一條隱形的地平線，看起來最自然！ */
  align-items: flex-end; 
  
  background-color: transparent;
  box-shadow: none; 
}

/* 將 img 與 video 一起設定 */
.gif-showcase img,
.gif-showcase video {
  height: 200px; /* 你可以根據喜好微調這個高度，200px 通常很剛好 */
  width: auto;   /* 寬度設定 auto，它就會根據原本的比例自己縮放，絕不變形 */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(104, 170, 198, 0.15);
  transition: transform 0.3s ease;
}


@media screen and (max-width: 768px) {
  .gif-showcase img,
  .gif-showcase video {
    height: 150px; 
    max-width: 100%; 
    object-fit: contain;
  }
}

/* ==========================================
   單獨調整「主角動畫區塊」的高度
   ========================================== */
.hero-showcase video {
  height: 130px !important; /* 👈 這裡填入你想要的高度，加上 !important 確保覆蓋原本的設定 */
}

/* 記得也幫手機版設定一個專屬的縮小高度，避免螢幕塞不下 */
@media screen and (max-width: 640px) {
  .hero-showcase video {
    height: 130px !important; 
  }
}