/* ==========================================================
   1. Page Banner (通用於內頁頂部形象圖)
   ========================================================== */

.page-banner {
  width: 100%;
  position: relative;
  /* Navbar 避讓邏輯 */
  margin-top: var(--nav-height-mobile, 45px);
  display: block;
}

/* Tablet */
@media (min-width: 768px) {
  .page-banner {
    margin-top: var(--nav-height-tablet, 55px);
  }
}

/* Desktop */
@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;
}

/* ==========================================================
   2. 全域容器 (RWD Width Control)
   依據 variables.css 定義的寬度
   ========================================================== */
.x720-container {
  /* 核心：讀取 CSS 變數 */
  width: var(--container-fluid-width, 90%);

  /* 置中 */
  margin-left: auto;
  margin-right: auto;

  /* 避免貼邊 */
  padding-left: 15px;
  padding-right: 15px;
}

.section-result {
  padding-top: 1rem;
  padding-bottom: 4rem;
}

/* ==========================================================
   1. 卡片列表：RWD Grid 佈局
   ========================================================== */
.activity-result-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 1rem;
}

@media (max-width: 1024px) {
  .activity-result-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .activity-result-list {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ==========================================================
   2. 單一卡片（玻璃感設計 Glassmorphism）
   ========================================================== */
.activity-result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 12px 16px;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.activity-result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 主圖片區 */
.activity-result-cover {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2f7;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
}

.activity-result-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.activity-result-card:hover .activity-result-cover img {
  transform: scale(1.05);
}

/* 標籤與日期 */
.activity-result-tag,
.activity-result-date {
  position: absolute;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  z-index: 2;
}

.activity-result-tag {
  left: 10px;
  top: 10px;
  background: var(--secondary-color-1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.activity-result-date {
  right: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--secondary-color-1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 文字內容區 */
.activity-result-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 6px;
}

.activity-result-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-header, #222);
  line-height: 1.4;
}

.activity-result-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #64748b;
  /* 限制最多兩行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   3. 活動成果 Modal (還原圖二的高質感排版)
   ========================================================== */
.activity-modal {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.activity-modal.is-open {
  display: flex;
  opacity: 1;
}

.activity-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
}

.activity-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 92vw);
  max-height: 90vh;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.activity-modal.is-open .activity-modal-dialog {
  transform: translateY(0);
}

/* 關閉按鈕 */
.activity-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.activity-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* 內部容器 (製造全白背景與留白) */
.activity-modal-content-wrap {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 主照片區 */
.activity-modal-photo {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 16 / 9; /* 保持完美比例 */
  width: 100%;
}

.activity-modal-photo img,
.activity-modal-photo video {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 讓長條或寬版圖片都能完整顯示不被裁切 */
  background: #e2e8f0; /* 空白處補灰色 */
  display: block;
}

/* 左右切換箭頭 (圖二樣式：黑底白箭頭，位於圖片邊緣) */
.activity-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 5;
}

.activity-modal-nav:hover {
  background: rgba(0, 0, 0, 0.9);
}

.activity-modal-prev {
  left: 10px;
}
.activity-modal-next {
  right: 10px;
}

/* 縮圖列 */
.activity-modal-thumbs {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.activity-modal-thumbs::-webkit-scrollbar {
  height: 0px;
} /* 隱藏滾動條求美觀 */

.activity-modal-thumb {
  flex: 0 0 70px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #e2e8f0;
  cursor: pointer;
  padding: 0;
  opacity: 0.6;
  transition: all 0.2s;
}

.activity-modal-thumb:hover {
  opacity: 0.9;
}

.activity-modal-thumb img,
.activity-modal-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.activity-modal-thumb.is-active {
  border-color: var(--primary-color, #333);
  opacity: 1;
  transform: scale(1.05);
}

/* 下半部：文字內容 */
.activity-modal-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.activity-modal-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

.activity-modal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}

.activity-modal-date {
  font-size: 0.9rem;
  color: #64748b;
  white-space: nowrap;
}

.activity-modal-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: #475569;
}

/* RWD Modal 調整 */
@media (max-width: 768px) {
  .activity-modal-dialog {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    height: 100vh;
  }

  .activity-modal-content-wrap {
    padding: 15px;
  }

  .activity-modal-title-row {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

/* ==========================================================
   4. 活動成果 Modal 外部連結按鈕 (滿版樣式)
   ========================================================== */
.activity-detail-btn {
  display: block;
  width: 100%;
  background-color: var(--secondary-color-1); /* 使用您指定的副色 */
  color: var(--color-white, #ffffff); /* 使用您指定的白色 */
  text-align: center;
  padding: 12px 20px;
  border-radius: 8px; /* 對應圖中的微圓角設計 */
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  transition:
    opacity 0.3s ease,
    background-color 0.3s ease;
}

.activity-detail-btn:hover {
  /* 懸停時稍微改變透明度，或可替換為 var(--primary-color) */
  background-color: var(--secondary-color-1);
  color: var(--color-white, #ffffff);
  opacity: 0.85;
}
