/* ===========================================
   NEWS 新知分享列表頁
   =========================================== */
.news {
  min-height: 100vh;
  padding-top: 64px;
  background: var(--bg-gradient);
  font-family: "Space Grotesk", "Noto Sans TC", sans-serif;
  color: var(--text-primary);
}

.news .news-section {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
}
.news .news-container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* 標題與說明：共用樣式見 common.css 的 .list-head / .list-title / .list-lead */


/* ── 卡片格：上二中三下三 ── */
/* ── 版面容器 ── */
.news .news-grid {
  display: block;
}

/* ── 頭條大橫幅（左文右大圖）── */
.news .news-hero {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 0;
  align-items: stretch;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid rgba(74, 26, 120, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(74, 26, 120, 0.08);
}
.news .news-hero-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.8rem, 3.5vw, 3rem);
  background: #ffffff;
}
.news .news-hero-title {
  margin: 0.6rem 0 0.9rem;
  font-family: "Noto Sans TC", sans-serif;
  font-size: clamp(1.6rem, 3.6vw, 2.7rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--brand-purple);
}
.news .news-hero-excerpt {
  max-width: 48ch;
  font-size: var(--body-size);
  line-height: 1.8;
  color: var(--text-secondary);
}
.news .news-hero-date {
  display: block;
  margin-top: 1.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: rgba(26, 10, 46, 0.45);
}
.news .news-hero-media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  text-decoration: none;
}
.news .news-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 精選文章小標列 */
.news .news-subhead {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  margin-bottom: clamp(1.2rem, 2.5vw, 1.8rem);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}
.news .news-subhead strong {
  font-weight: 700;
  color: var(--brand-purple);
}

/* ── 下方卡片：六張大小一致（疊字樣式）── */
.news .news-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 1.8rem);
}

/* 疊字大卡：外觀見 common.css 的 .overlay-card，此頁只加捲動進場 */
.news .overlay-card {
  animation: news-fade-up 0.5s var(--ease-out-expo) backwards;
}

/* ── 分類 / 產業標籤（卡片 / 頭條共用）── */
.news .news-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.news .news-tag {
  display: inline-block;
  padding: 0.3em 0.9em;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--brand-purple);
  background: rgba(74, 26, 120, 0.09);
  border: 1px solid rgba(74, 26, 120, 0.2);
  border-radius: 999px;
}
/* 產業標籤：實心底色，與文章分類標籤區隔 */
.news .news-tag-industry {
  color: #ffffff;
  background: var(--brand-purple);
  border-color: var(--brand-purple);
}
/* 頭條左側文字區為 flex column，標籤列靠左、不撐滿 */
.news .news-hero-text .news-tags-inline {
  align-self: flex-start;
  margin-bottom: 0.9rem;
}
/* 頭條：產業標籤也用淺色底（與文章分類標籤一致） */
.news .news-hero-text .news-tag-industry {
  color: var(--brand-purple);
  background: rgba(74, 26, 120, 0.09);
  border-color: rgba(74, 26, 120, 0.2);
}
/* 疊字卡在深色圖上：標籤置中並改白色樣式 */
.news .overlay-card .news-tags-inline {
  justify-content: center;
  margin-bottom: 0.55rem;
}
.news .overlay-card .news-tag {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}
.news .overlay-card .news-tag-industry {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.5);
}

/* 右側小卡 */
.news .news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: rgba(74, 26, 120, 0.04);
  border: 1px solid rgba(74, 26, 120, 0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: news-fade-up 0.5s var(--ease-out-expo) backwards;
}
@media(hover: hover) {
  .news .news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(74, 26, 120, 0.25);
  }
}
@keyframes news-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .news .news-card { animation: none; }
}

.news .news-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(74, 26, 120, 0.06);
}
.news .news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* 無圖時的品牌漸層縮圖 */
.news .news-poster {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 1.2em;
  text-align: center;
  color: #ffffff;
}
.news .news-poster .poster-en {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.news .news-poster .poster-zh {
  font-size: clamp(0.8rem, 1.5vw, 0.98rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.92;
}
.news .poster-1 { background: linear-gradient(150deg, #6B2BA8 0%, #4A1A78 100%); }
.news .poster-2 { background: linear-gradient(150deg, #4A1A78 0%, #2A1145 100%); }
.news .poster-3 { background: linear-gradient(150deg, #7A3DB8 0%, #46208a 100%); }
.news .poster-4 { background: linear-gradient(150deg, #8A4FC0 0%, #4A1A78 100%); }
.news .poster-5 { background: linear-gradient(150deg, #4A1A78 0%, #6B2BA8 55%, #F5B800 210%); }
.news .poster-6 { background: linear-gradient(150deg, #2A1145 0%, #6B2BA8 120%); }

/* 卡片內文 */
.news .news-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(0.85rem, 1.6vw, 1.2rem) clamp(0.9rem, 1.8vw, 1.3rem) clamp(1rem, 1.8vw, 1.3rem);
}
.news .news-card-title {
  margin-top: 0.4rem;
  font-size: var(--body-size);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.4;
}
.news .news-card-excerpt {
  margin-top: 0.5rem;
  font-size: var(--small-size);
  line-height: 1.7;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news .news-card-date {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(26, 10, 46, 0.45);
}

/* ── 頁碼分頁 ── */
.news .news-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: clamp(2.2rem, 5vw, 3.5rem);
}
.news .news-pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid rgba(74, 26, 120, 0.18);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.news .news-pagination .page-num.active {
  color: #ffffff;
  background: var(--brand-purple);
  border-color: var(--brand-purple);
}
@media(hover: hover) {
  .news .news-pagination button:not(.active):not(:disabled):hover {
    border-color: var(--brand-purple);
    color: var(--brand-purple);
  }
}
.news .news-pagination button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── 側邊聯絡我們按鈕 ── */
.side-contact {
  position: fixed;
  right: 0;
  top: 42%;
  z-index: 9989;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  padding: 1em 0.55em;
  color: #ffffff;
  text-decoration: none;
  background: var(--brand-purple);
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 4px 14px rgba(74, 26, 120, 0.25);
  transition: background 0.2s, padding-right 0.2s;
}
.side-contact .side-contact-text {
  writing-mode: vertical-rl;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 500;
}
.side-contact svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linejoin: round;
}
@media(hover: hover) {
  .side-contact:hover {
    background: var(--brand-purple-light);
    padding-right: 0.85em;
  }
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 900px) {
  .news .news-hero {
    grid-template-columns: 1fr;
    gap: clamp(1rem, 3vw, 1.8rem);
  }
  .news .news-hero-media { order: -1; }         /* 頭條圖移到文字上方 */
  .news .news-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .side-contact { padding: 0.8em 0.45em; }
  .side-contact .side-contact-text { font-size: 0.78rem; }
}
@media (max-width: 560px) {
  .news { padding-top: 56px; }
  .news .news-cards { grid-template-columns: 1fr; }

  /* 手機：卡片變單欄，頭條改成與下方卡片相同的疊字樣式（樣式對齊 common.css 的 .overlay-card）*/
  .news .news-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    aspect-ratio: 16 / 10;
    padding: 1.4rem;
    margin-bottom: clamp(1.2rem, 2.5vw, 1.8rem);   /* 與 .news-cards 的 gap 一致 */
    border: none;
    border-radius: 16px;
    box-shadow: none;
  }
  /* 圖片鋪滿整張卡當底圖，整塊仍可點擊 */
  .news .news-hero-media {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
  }
  /* 漸層與文字都不擋點擊，整張卡都能點進內頁（與下方卡片一致）*/
  .news .news-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(20, 8, 40, 0.86) 0%, rgba(20, 8, 40, 0.5) 38%, rgba(20, 8, 40, 0.05) 78%);
  }
  .news .news-hero-text {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0;
    pointer-events: none;
    background: transparent;
    text-align: center;
    color: #ffffff;
  }
  .news .news-hero-title a {
    pointer-events: auto;
  }
  .news .news-hero-title {
    margin: 0;
    font-family: inherit;
    font-size: clamp(1.15rem, 2.1vw, 1.55rem);
    line-height: 1.4;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .news .news-hero-excerpt {
    margin-top: 0.6rem;
    max-width: none;
    font-size: var(--small-size);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* 日期移到標題上方，對齊卡片的 .overlay-card-meta */
  .news .news-hero-date {
    order: -1;
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: inherit;
    opacity: 0.85;
  }
  /* 頭條變成深色疊字卡：標籤列置中、移到最上方並改白色樣式 */
  .news .news-hero-text .news-tags-inline {
    order: -2;
    align-self: center;
    justify-content: center;
    margin-bottom: 0.55rem;
  }
  .news .news-hero-text .news-tag {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
  }
  .news .news-hero-text .news-tag-industry {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.5);
  }
  .side-contact svg { display: none; }
}
