/* =========================================
   Home Page Specific Styles
   ========================================= */

/* ------------------------------------------------
   通用設定
   ------------------------------------------------ */
.section-container {
  padding: 80px 0;
  background-color: transparent;
  background-image: none;
  overflow: hidden;
}

/* 確保區塊無背景 */
.ip-zone,
.news-section,
.store-map-section,
.video-carousel-section {
  background-color: transparent;
  background-image: none;
}

/* ==========================================================
   Home Page Styles
   ========================================================== */

/* ------------------------------------------------
   1. Banner (Carousel) - Navbar 避讓與 RWD 設定
   ------------------------------------------------ */

.home-banner {
  width: 100%;
  position: relative;

  /* ✅ 核心修正：利用 margin-top 避開 Navbar 的高度
     預設為手機版 (Mobile < 768px) 
  */
  margin-top: var(--nav-height-mobile, 45px);
}

/* Tablet (768px ~ 1023px) */
@media (min-width: 768px) {
  .home-banner {
    margin-top: var(--nav-height-tablet, 55px);
  }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
  .home-banner {
    margin-top: var(--nav-height-desktop, 79px);
  }
}

/* --- Banner 內部圖片結構 (維持你的自動縮放邏輯) --- */
.home-banner .carousel-item {
  /* ✅ 高度自動，讓圖片撐開容器 */
  height: auto;
  min-height: auto;
  width: 100%;
}

.home-banner .carousel-inner img {
  /* ✅ 寬度 100%，高度自動維持比例 */
  width: 100%;
  height: auto;

  /* 消除圖片下方微小空隙 */
  display: block;
  object-fit: contain;
}

/* --- 指示器 (圓點) --- */
.home-banner .carousel-indicators {
  margin-bottom: -3%; /* 維持你的設定 */
  gap: 10px;
}

.home-banner .carousel-indicators [data-bs-target] {
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--primary-color, #0d6efd); /* 建議加上 fallback 顏色 */
  background-color: #fff;
  opacity: 1;
  margin: 0;
  transition: all 0.3s ease;
}

.home-banner .carousel-indicators .active {
  background-color: var(--primary-color, #0d6efd);
  transform: scale(1.1);
}

/* --- 左右箭頭 --- */
.home-banner .carousel-control-prev-icon,
.home-banner .carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  /* 這裡保留你的 SVG background-image 設定，在此省略以節省篇幅 */
}

.home-banner .carousel-control-prev:hover,
.home-banner .carousel-control-next:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1024px) {
  .ui-carousel-nav {
    bottom: -60px;
  }
}

/* --- RWD 微調 (手機版箭頭縮小) --- */
@media (max-width: 768px) {
  .home-banner .carousel-control-prev-icon,
  .home-banner .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
  }

  .ui-carousel-nav {
    bottom: -50px;
  }
}

/* ------------------------------------------------
   2. IP Zone (About)
   ------------------------------------------------ */
.ip-zone {
  padding-top: 100px;
  padding-bottom: 80px;
  position: relative;
  width: 100%;
}

.ip-content {
  /* ✅ 使用流體寬度變數 */
  width: var(--container-fluid-width);
  margin: 0 auto;

  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.ip-text {
  flex: 0 0 45%;
  text-align: left;
}

.ip-text h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: 1.4;
  color: #2c3e50;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.ip-text p {
  font-size: var(--fs-body-focus);
  font-weight: var(--fw-regular);
  line-height: 1.8;
  color: #555;
  margin-bottom: 2rem;
  text-align: justify;
}

.ip-characters-container {
  flex: 0 0 50%;
  display: flex;
  justify-content: flex-end;
}

.ip-characters-container img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
}

/* --- RWD: 平板與手機調整 (<= 1024px) --- */
/* 直接寫在這裡，方便管理 */
@media (max-width: 1024px) {
  .ip-content {
    flex-direction: column; /* 改為垂直排列 */
    gap: 2rem;
    align-items: center;
  }

  .ip-text {
    flex: 0 0 100%;
    width: 100%;
    text-align: left !important; /* 強制文字靠左 */
    padding: 0 10px; /* 避免貼邊 */
  }

  .ip-text h2,
  .ip-text p {
    text-align: left !important;
  }

  .ip-characters-container {
    flex: 0 0 100%;
    width: 100%;
    justify-content: center; /* 圖片維持置中 */
  }
}

/* ------------------------------------------------
   3. News Section (活動新訊)
   ------------------------------------------------ */
.news-section {
  padding-bottom: 60px;
  position: relative;
  overflow: hidden;
}

.news-owl-carousel {
  /* ✅ 使用流體寬度變數 */
  width: var(--container-fluid-width) !important;
  margin: 0 auto !important;

  position: relative;
  z-index: 5;
  overflow: hidden;
  padding: 20px 0;
}

.news-owl-carousel .owl-stage {
  display: flex;
  align-items: center;
}

.news-image {
  display: block;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 15px;
  margin: 0 auto;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-owl-carousel .owl-item .news-image {
  transform: scale(0.8);
  opacity: 0.6;
  filter: grayscale(40%) brightness(0.8);
  box-shadow: none;
}

.news-owl-carousel .owl-item {
  z-index: 1;
  transition: z-index 0.3s;
}

.news-owl-carousel .owl-item.active.center {
  z-index: 20;
}

.news-owl-carousel .owl-item.active.center .news-image {
  transform: scale(1);
  opacity: 1;
  filter: grayscale(0%) brightness(1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 4px solid #fff;
}

.news-owl-carousel .owl-dots {
  margin-top: 20px !important;
  text-align: center;
  position: relative;
  z-index: 30;
}

.news-owl-carousel .owl-dot span {
  width: 12px !important;
  height: 12px !important;
  background: transparent !important;
  border: 2px solid #4fa8d8 !important;
  margin: 5px 6px !important;
  opacity: 0.6;
  transition: all 0.3s;
}

.news-owl-carousel .owl-dot.active span {
  background: #4fa8d8 !important;
  opacity: 1;
  transform: scale(1.2);
}

/* ------------------------------------------------
   4. Map Section
   ------------------------------------------------ */
.store-map-wrapper {
  /* ✅ 使用流體寬度變數 */
  width: var(--container-fluid-width);
  margin: 0 auto;

  display: flex;
  gap: 20px;
  height: 600px;
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.store-map {
  flex: 2;
  border-radius: 12px;
  background-color: #eee;
  overflow: hidden;
}

.store-list-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 300px;
}

.store-list-ul {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  border: 1px solid #eee;
  border-radius: 8px;
}

.store-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-item:hover {
  background-color: #f8f9fa;
}

.store-item .badge {
  background: #333;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* ------------------------------------------------
   Bottom & Modal
   ------------------------------------------------ */
.bottom-decoration {
  height: 200px;
  background-position: bottom center;
  background-size: cover;
}

.store-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.store-modal-content {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 650px;
  height: 70vh;
  border-radius: 10px;
  background-color: #fff;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.store-modal-top {
  flex: 1;
  background-color: #ccc;
  position: relative;
  overflow: hidden;
}

.store-modal-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-modal-bottom {
  background-color: #fff;
  padding: 1rem 1.5rem;
}

.store-modal-bottom h4 {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.store-modal-bottom p {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.store-modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  z-index: 1;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.store-button-group {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 1rem;
}

.store-button-group button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.store-intro-btn,
.store-route-btn {
  background-color: #fff;
  color: #333;
  border: 2px solid #333;
}

.store-intro-btn:hover,
.store-route-btn:hover {
  background-color: #e0e0e0;
}

.store-gps-btn {
  background-color: #333;
  color: white;
  border: none;
}

.store-gps-btn:hover {
  background-color: #000;
}

/* ==================== 影音專區 (Video Section) ==================== */

#video-carousel {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  display: block;
}

/* ==================== 卡片 Flex 排版 ==================== */
.video-card {
  display: flex; /* 關鍵：左右排列 */
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin: 10px;
  min-height: 380px;
}

/* 左側圖片區 (60%) */
.video-card-thumb {
  width: 60%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.video-card-thumb:hover img {
  transform: scale(1.05);
}

/* 播放按鈕 */
.play-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(204, 51, 51, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.play-icon-overlay::after {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 5px;
}

.video-card-thumb:hover .play-icon-overlay {
  transform: scale(1.1);
}

/* 右側文字區 (40%) */
.video-card-content {
  width: 40%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.video-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
}

.video-card-desc {
  font-size: 1rem;
  color: #666;
  line-height: 1.7;
  margin-bottom: 2rem;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-date {
  font-size: 0.9rem;
  color: #999;
  text-align: right;
  margin-top: auto;
}

/* ==================== 影片彈窗 (Modal) 樣式 ==================== */

/* 1. 遮罩層 (Overlay) - 全螢幕半透明背景 */
.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75); /* 深色半透明背景 */
  z-index: 9999; /* 確保在最上層 */
  display: flex;
  justify-content: center;
  align-items: center; /* 上下左右置中 */
  padding: 20px; /* 避免手機版邊緣貼死 */
  backdrop-filter: blur(4px); /* 背景模糊效果 (現代瀏覽器支援) */
  /* opacity: 0; */ /* 配合 jQuery fadeIn 的初始狀態 */
  display: none;
}

/* 2. 彈窗本體 (Container) - 白色卡片 */
.video-modal-container {
  background-color: #fff;
  width: 70%; /* 電腦版預設 70% */
  max-width: 1000px; /* 限制最大寬度，避免在超大螢幕太寬 */
  border-radius: 12px; /* 圓角 */
  overflow: hidden; /* 確保內容不超出圓角 */
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  animation: slideUpFade 0.4s ease-out; /* 彈出動畫 */
}

/* 3. 關閉按鈕 (X) */
.video-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: none;
  color: #fff; /* 在影片上方顯示白色 */
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 10; /* 確保在影片之上 */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 增加陰影確保在淺色影片背景也能看見 */
  transition: transform 0.2s;
}

.video-modal-close:hover {
  transform: scale(1.1); /* Hover 放大效果 */
}

/* 4. 影片容器 (Video Wrapper) - 保持 16:9 比例 */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background-color: #000;
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 5. 資訊文字區 (Info) */
.video-modal-info {
  padding: 25px 30px;
  text-align: left;
}

/* 標題樣式 */
.video-modal-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee; /* 標題下方的分隔線 */
}

/* 日期樣式 (對應 Figma 右下角顯示) */
.video-modal-info p#modal-video-date {
  font-size: 0.9rem;
  color: #999;
  text-align: right; /* 靠右對齊 */
  margin-top: 15px;
  margin-bottom: 0;
}

/* 如果未來有描述文字 (Description) 的樣式預留 */
/* 修改前 (或新增) */
.video-modal-info .modal-desc {
  font-size: var(--fs-body-base);
  color: var(--color-header);
  line-height: 1.6;
  text-align: justify;

  /* 🔥 新增以下 4 行來達成「最多顯示 3 行」的效果 */
  display: -webkit-box; /* 必須設定為 box 才能使用 line-clamp */
  -webkit-line-clamp: 3; /* 限制顯示 3 行 */
  -webkit-box-orient: vertical; /* 設定排列方向為垂直 */
  overflow: hidden; /* 隱藏超出範圍的文字 */
  text-overflow: ellipsis; /* (選填) 標準屬性，輔助截斷效果 */
}

/* ==================== RWD 響應式設定 ==================== */

/* 平板 (Tablet): 寬度 80% */
@media (max-width: 1024px) {
  .video-modal-container {
    width: 80%;
  }
}

/* 手機 (Mobile): 寬度 90% ~ 95% */
@media (max-width: 768px) {
  .video-modal-container {
    width: 95%; /* 手機版讓它寬一點，視覺比較舒適 */
  }

  .video-modal-info {
    padding: 20px;
  }

  .video-modal-info h3 {
    font-size: 1.25rem;
  }
}

/* ==================== 動畫效果 ==================== */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== 導航樣式 (箭頭與圓點) ==================== */
#video-carousel .owl-dots {
  margin-top: 25px !important;
  text-align: center;
}

#video-carousel .owl-dot span {
  width: 10px;
  height: 10px;
  background: #ccc;
  transition: 0.3s;
}
#video-carousel .owl-dot.active span {
  background: #39b3d7;
  width: 25px;
}

/* 箭頭位置設定 */
#video-carousel .owl-nav {
  position: absolute;
  bottom: -8px;
  width: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  gap: 100px; /* 箭頭之間的距離 */
}

#video-carousel .owl-nav button.owl-prev,
#video-carousel .owl-nav button.owl-next {
  pointer-events: auto;
  background: none !important;
  color: #39b3d7 !important;
  font-size: 30px !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== RWD 手機版 ==================== */
@media (max-width: 767px) {
  .video-card {
    flex-direction: column; /* 垂直排列 */
    min-height: auto;
  }
  .video-card-thumb {
    width: 100%;
    height: 220px;
  }
  .video-card-content {
    width: 100%;
    padding: 25px;
  }
  #video-carousel .owl-nav {
    display: none; /* 手機版隱藏箭頭 */
  }
}

/*--------------------------------------*/
.module-hidden {
    display: none !important;
}
