@charset "UTF-8";

/* ==========================================================
   1. 共用設定 (Banner & Breadcrumb & Layout)
   ========================================================== */

/* Page Banner */
.page-banner {
  width: 100%;
  position: relative;
  margin-top: var(--nav-height-mobile, 45px);
  display: block;
}
@media (min-width: 768px) {
  .page-banner {
    margin-top: var(--nav-height-tablet, 55px);
  }
}
@media (min-width: 1024px) {
  .page-banner {
    margin-top: var(--nav-height-desktop, 79px);
  }
}

.page-banner img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Container */
.x720-container {
  width: var(--container-fluid-width, 90%);
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* Section Spacing */
.section-discount {
  padding-top: 1rem;
  padding-bottom: 5rem;
}

.line-decor {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background-color: #ccc;
  z-index: 1;
}

/* Breadcrumb */
.x720-breadcrumb {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 8px;
  height: 28px;
  margin-bottom: 2rem;
}
.breadcrumb-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-header, #333);
  font-size: var(--fs-body-base, 1rem);
  font-weight: 400;
  padding-bottom: 1px;
  transition: all 0.3s ease;
}
.breadcrumb-link span {
  border-bottom: 1px solid #666;
}
.breadcrumb-link:hover {
  color: #000;
}
.breadcrumb-link img {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
}
.breadcrumb-sep {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.breadcrumb-current {
  color: var(--primary-color, #4fa8d8);
  font-size: var(--fs-body-base, 1rem);
  letter-spacing: 0.5px;
}

/* ==========================================================
   2. 新聞卡片樣式 (News Card)
   ========================================================== */

.news-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid #eee;

  /* ❌ 移除 height: 100% (讓卡片隨內容長短變化) */
  height: auto;
  display: flex;
  flex-direction: column;

  /* ✅ 新增：因為瀑布流是垂直堆疊，卡片之間需要距離 */
  margin-bottom: 24px;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 卡片圖片 */
.news-img-wrapper {
  width: 100%;
  overflow: hidden;
  background-color: #f5f5f5;
  position: relative;
}

.news-img-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.news-card:hover .news-img-wrapper img {
  transform: scale(1.05);
}

/* 卡片內容區 */
.news-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* 標籤與日期列 */
.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  flex-direction: row;
  gap: 10px;
}

.meta-left {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  flex-direction: row;
}

/* --- 標籤樣式 (Tag Styles) --- */
.tag-badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: var(--fs-body-sm, 0.85rem); /* 預設字體大小 */
  font-weight: var(--fw-semilight, 400);
  color: var(--color-white, #fff);
  white-space: nowrap;
}

/* 顏色變體 (對應 JS 中的 type) */
.tag-dark {
  background-color: var(--color-border, #2f3e46); /* 深灰 */
}

.tag-green {
  background-color: var(--color-green, #3b813d); /* 綠色 */
}

.tag-orange {
  background-color: var(--color-red, #ad2d24); /* 橘紅 */
}

.tag-light {
  background-color: var(--color-light, #666666); /* 淺灰 (已結束) */
}

/* RWD: 1024px 以下字體縮小 */
@media (max-width: 1024px) {
  .tag-badge {
    font-size: var(--fs-body-xs);
    padding: 3px 10px;
  }

  /* 標籤與日期列 */
  .news-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-direction: column-reverse;
    gap: 10px;
  }
}

/* --- 其他文字 --- */
.news-date {
  font-size: var(--fs-body-xs);
  color: vaf;
  font-family: monospace;
}

.news-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--color-header);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-desc {
  font-size: var(--fs-body-base);
  font-weight: var(--fw-semilight);
  color: var(--color-border);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 詳細內容按鈕 */
.btn-read-more {
  display: block;
  width: 100%;
  background-color: var(--secondary-color-1);
  color: var(--color-white);
  text-align: center;
  padding: 10px 0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color 0.3s;
  margin-top: auto;
}

.btn-read-more:hover {
  background-color: var(--color-white);
  color: var(--secondary-color-1);
  border: 1px solid var(--secondary-color-1); /* 極細邊框 */
}

/* ==========================================================
   3. 分頁器樣式 (Pagination)
   ========================================================== */
.pagination {
  gap: 6px;
}

.page-item .page-link {
  border: none;
  color: #666;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  background-color: transparent;
  transition: all 0.2s;
}

.page-item.active .page-link {
  background-color: var(--primary-color, #4fa8d8);
  color: #fff;
  box-shadow: 0 2px 5px rgba(79, 168, 216, 0.4);
}

.page-item .page-link:hover {
  background-color: #f0f0f0;
  color: var(--primary-color, #4fa8d8);
}

.page-item.active .page-link:hover {
  background-color: var(--primary-color, #4fa8d8);
  color: #fff;
}

.page-item.disabled .page-link {
  background-color: transparent;
  color: #ccc;
  cursor: default;
}

/* ==========================================================
   4. 活動詳情彈窗 (Modal)
   ========================================================== */

/* --- 核心：寬度控制 (依照 variables.css) --- */
#discountModal .modal-dialog {
  /* 強制覆蓋 Bootstrap 預設寬度 */
  max-width: var(--container-fluid-width) !important;
  width: 100%;
  margin: 1.75rem auto; /* 保持垂直置中時的上下邊距 */
}

/* 手機版邊距微調 */
@media (max-width: 576px) {
  #discountModal .modal-dialog {
    margin: 1rem auto;
  }
}

/* --- 彈窗外觀 --- */
#discountModal .modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden; /* 確保圖片圓角不溢出 */
  position: relative;
}

/* 自訂關閉按鈕 (右上角紅色 X) */
.btn-close-custom {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  border: none;
  color: #333; /* 紅色 */
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  background-color: rgba(255, 255, 255, 0.8); /* 避免在深色圖片上看不見 */
}

.btn-close-custom:hover {
  background-color: #333;
  color: #fff;
  transform: rotate(90deg);
}

/* --- 圖片區域 --- */
.modal-img-wrapper {
  width: 100%;
  /* 這裡可以選擇是否限制高度，依設計稿看似乎是完整顯示圖片 */
  height: auto;
  background-color: #f5f5f5;
}

.modal-img-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- 文字內容區域 --- */
.modal-text-content {
  padding: 2rem;
  background-color: #fff;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  line-height: 1.4;
}

.modal-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: #555;
  white-space: pre-line; /* 保留換行格式 */
  text-align: justify;
}

/* 手機版內距縮小 */
@media (max-width: 1024px) {
  .news-title {
    font-size: var(--fs-h4);
  }

  .news-desc {
    font-size: var(--fs-body-sm);
  }
}

/* 手機版內距縮小 */
@media (max-width: 576px) {
  .modal-text-content {
    padding: 1.5rem;
  }
  .modal-title {
    font-size: 1.25rem;
  }
}

/* ==========================================================
   5. 活動已結束狀態遮罩 (Status Overlay)
   ========================================================== */

/* 確保遮罩層能相對圖片容器進行絕對定位 */
.news-img-wrapper {
  position: relative;
}

/* 半透明背景遮罩，讓底圖微暗化以凸顯文字 */
.ended-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* 仿圖二的深色膠囊狀標籤 */
.ended-badge {
  background-color: rgba(36, 30, 28, 0.95); /* 深色系膠囊底 */
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.ended-badge i {
  font-size: 1.4rem;
}

/* (優化選項) 如果活動已結束，滑過卡片時圖片就不要再有放大動畫，避免突兀 */
.news-card:has(.ended-overlay):hover .news-img-wrapper img {
  transform: scale(1);
}
