/* ===================================================
   檔案路徑：public/css/news.css
   風格定義：Modern Editorial Grid（活力智庫卡片流）
   =================================================== */

/* ---------------------------------------------------
   1. 頁面橫幅 (Page Banner)
   --------------------------------------------------- */
.page-banner {
  background: radial-gradient(circle at 80% 20%, #1f533e 0%, #133a2b 50%, #061911 100%);
  color: #ffffff;
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.banner-aura {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(82, 183, 136, 0.28) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.banner-inner {
  position: relative;
  z-index: 1;
}

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #a7f3d0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

.badge-dot {
  width: 6px;
  height: 6px;
  background-color: #52b788;
  border-radius: 50%;
  box-shadow: 0 0 8px #52b788;
  animation: dotPulse 2s infinite ease-in-out;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
}

.banner-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.banner-desc {
  max-width: 660px;
  margin: 0 auto;
  font-size: 1.02rem;
  color: #cbd5e1;
  line-height: 1.65;
}

/* ---------------------------------------------------
   2. 工具列 (Filter Tabs & Search)
   --------------------------------------------------- */
.news-main-section {
  padding: 48px 0 80px;
  background-color: #fbfdfc; /* 極淺護眼清爽底色 */
}

.news-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tab-btn:hover {
  border-color: #52b788;
  color: #1b4332;
  transform: translateY(-2px);
}

.tab-btn.active {
  background: #1b4332;
  color: #ffffff;
  border-color: #1b4332;
  box-shadow: 0 4px 14px rgba(27, 67, 50, 0.18);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.search-box input {
  padding: 10px 18px 10px 40px;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  font-size: 0.9rem;
  outline: none;
  width: 260px;
  background: #ffffff;
  transition: all 0.22s ease;
}

.search-box input:focus {
  border-color: #52b788;
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.18);
  width: 290px;
}

/* ---------------------------------------------------
   3. 卡片式網格容器 (News Grid Layout)
   --------------------------------------------------- */
.news-flow-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.news-item {
  position: relative;
  background: #ffffff;
  border: 1px solid #edf2f0;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* 懸浮效果：立體浮起與邊框微光 */
.news-item:hover {
  transform: translateY(-5px);
  border-color: #a7f3d0;
  box-shadow: 0 16px 32px rgba(27, 67, 50, 0.08);
}

/* 首篇精選卡片：在寬螢幕下跨 2 欄展示 */
.news-item.is-featured {
  grid-column: span 2;
  background: linear-gradient(135deg, #f3faf6 0%, #ffffff 100%);
  border-color: #bbf7d0;
}

/* 卡片頂部：日期與標籤並排 */
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

/* 精緻扁平日期徽章 */
.date-badge {
  background: #f1f7f4;
  border: 1px solid #e3ede7;
  border-radius: 8px;
  padding: 6px 12px;
  text-align: center;
  line-height: 1.1;
  transition: all 0.22s ease;
}

.news-item:hover .date-badge {
  background: #1b4332;
  border-color: #1b4332;
}

.db-day {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1b4332;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: color 0.22s ease;
}

.db-my {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 2px;
  transition: color 0.22s ease;
}

.news-item:hover .db-day { color: #52b788; }
.news-item:hover .db-my { color: #cbd5e1; }

/* 分類標籤區 */
.item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.category-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.chip-green { background-color: #d1fae5; color: #065f46; }
.chip-blue { background-color: #e0f2fe; color: #0369a1; }
.chip-purple { background-color: #f3e8ff; color: #7e22ce; }

.sparkle-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: #b91c1c;
  background-color: #fee2e2;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

/* 內容主要欄位 */
.item-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 10px;
}

.news-item.is-featured .item-title {
  font-size: 1.32rem;
}

.item-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-item:hover .item-title a {
  color: #2d6a4f;
}

.item-desc {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 底部互動按鈕 */
.item-action {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px dashed #edf2f0;
}

.arrow-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.news-item:hover .arrow-btn {
  background: #1b4332;
  border-color: #1b4332;
  color: #ffffff;
  transform: rotate(45deg);
}

/* ---------------------------------------------------
   4. 分頁控制項 (Pagination)
   --------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.page-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled) {
  border-color: #52b788;
  color: #1b4332;
  transform: translateY(-1px);
}

.page-btn.active {
  background: #1b4332;
  border-color: #1b4332;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.15);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------------------------------------------------
   5. 響應式斷點 (Responsive)
   --------------------------------------------------- */
@media (max-width: 900px) {
  .news-flow-container {
    grid-template-columns: 1fr;
  }

  .news-item.is-featured {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .news-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box input,
  .search-box input:focus {
    width: 100%;
  }

  .banner-title {
    font-size: 1.85rem;
  }
}