/* ==========================================================================
   pages.css — 各頁面專屬樣式
   ========================================================================== */

/* ==================================================== 首頁 Hero ======== */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(1100px 720px at 62% 44%, #121a24 0%, var(--bg) 66%);
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 13, 0.62) 0%, transparent 28%),
    linear-gradient(0deg, var(--bg) 2%, rgba(10, 11, 13, 0.1) 40%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  text-align: center;
  padding: var(--nav-h) 24px 120px;
}

/* 寬螢幕：文字靠左成一欄，右側留給地球與衛星動畫 */
@media (min-width: 960px) {
  .hero { place-items: center start; }
  .hero__inner { text-align: left; padding-bottom: 96px; }
  .hero__inner > * { max-width: 560px; }
  /* 這兩條要贏過檔案後面的置中設定，所以刻意加上 .hero 提高特異性 */
  .hero .hero__rule { margin-left: 0; margin-right: 0; }
  .hero .hero__sub  { margin-left: 0; margin-right: 0; }
}

.hero__kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--accent-2);
  margin: 0 0 22px;
  opacity: 0;
  animation: heroIn 0.9s var(--ease) 0.2s forwards;
}

.hero__title {
  font-family: var(--font-latin);
  font-size: clamp(1.85rem, 4.6vw, 3.4rem);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
  background: linear-gradient(100deg, #ffffff 0%, #cde3ff 40%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  animation: heroIn 1s var(--ease) 0.38s forwards;
}

.hero__rule {
  width: 0;
  height: 1px;
  margin: 0 auto 26px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: heroRule 1.1s var(--ease) 0.9s forwards;
}

.hero__sub {
  color: var(--txt-dim);
  font-size: clamp(0.95rem, 1.5vw, 1.06rem);
  max-width: 34rem;
  margin: 0 auto;
  opacity: 0;
  animation: heroIn 1s var(--ease) 0.62s forwards;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes heroRule {
  to { width: min(320px, 60%); }
}

/* 往下捲動提示 */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--txt-mute);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  opacity: 0;
  animation: heroIn 1s var(--ease) 1.2s forwards;
}

.hero__scroll i {
  display: block;
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, var(--accent), transparent);
  animation: scrollPulse 2.4s var(--ease) infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.6); transform-origin: top; }
  50%      { opacity: 1;    transform: scaleY(1);   transform-origin: top; }
}

/* 窄螢幕：改成上下排列。文字貼齊導覽列下方，不再置中，
   否則上方會留下一大塊空白；動畫則留在畫面下半部。 */
@media (max-width: 959px) {
  .hero { place-items: start center; }
  .hero__inner {
    padding-top: calc(var(--nav-h) + 36px);
    padding-bottom: 0;
    width: 90%;
  }
  /* 疊層排列時捲動提示一定會壓到地球，直接不顯示 */
  .hero__scroll { display: none; }
}

/* ================================================== 首頁 簡介段 ======= */

.intro {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

.intro__grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 56px;
  align-items: start;
}

.intro__headline {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.5;
  margin: 0;
  color: #eaf1f8;
}

.intro__headline em {
  font-style: normal;
  color: var(--accent-2);
}

.intro__body p { color: var(--txt-dim); line-height: 1.95; }
.intro__body > :last-child { margin-bottom: 0; }

@media (max-width: 880px) {
  .intro__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* =================================================== 首頁 消息區 ====== */

.news-home__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.news-home__head .sec-head { margin-bottom: 0; }

/* ====================================================== 一般頁面 ===== */

.page-body > p:first-child { margin-top: 0; }

.stack { display: grid; gap: 22px; }
.stack--lg { gap: 40px; }

.subsec { margin-top: 56px; }
.subsec:first-child { margin-top: 0; }

.subsec__title {
  font-size: 1.2rem;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.subsec__title .mono { font-size: 0.75rem; }

/* ====================================================== 活動列表 ===== */

.activity-list { display: grid; gap: 16px; }

.activity {
  display: grid;
  grid-template-columns: 172px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--txt);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
              transform 0.25s var(--ease);
}

.activity:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateX(4px);
  color: var(--txt);
}

.activity__date {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--accent-2);
  letter-spacing: 0.05em;
}

.activity__title { font-size: 1.06rem; margin: 0 0 5px; }
.activity__place { font-size: 0.86rem; color: var(--txt-mute); margin: 0; }

.activity__go {
  width: 18px;
  height: 18px;
  color: var(--txt-mute);
  flex-shrink: 0;
}
.activity:hover .activity__go { color: var(--accent-2); }

@media (max-width: 720px) {
  .activity { grid-template-columns: 1fr; gap: 10px; padding: 22px; }
  .activity__go { display: none; }
}

/* ================================================== 活動內頁 ========= */

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 34px;
  padding: 20px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
}

.activity-meta__item { display: flex; flex-direction: column; gap: 3px; }
.activity-meta__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--txt-mute);
}
.activity-meta__value { font-size: 0.97rem; color: var(--txt); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;        /* 讓不裁切的照片保有各自的高度 */
}

.gallery figure { margin: 0; }

/* 預設：裁成 4:3 橫式 */
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-3);
}

/* fit: "portrait" — 直式框（3:4），仍會輕微裁切上下 */
.gallery figure[data-fit="portrait"] img { aspect-ratio: 3 / 4; }

/* fit: "whole" — 完全不裁切，依照片原始比例顯示 */
.gallery figure[data-fit="whole"] img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.gallery figcaption {
  font-size: 0.82rem;
  color: var(--txt-mute);
  margin-top: 8px;
}

/* ===================================================== 聯絡我們 ====== */

.contact-card {
  display: grid;
  gap: 26px;
  padding: 44px 40px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  max-width: 640px;
}

.contact-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: baseline;
  gap: 8px 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.contact-row:last-of-type { border-bottom: 0; padding-bottom: 0; }

.contact-row__label { margin: 0; }

.contact-row__value {
  margin: 0;
  font-size: 1.08rem;
  color: var(--txt);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  color: var(--accent-2);
  word-break: break-all;
}

.contact-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--accent-2);
  word-break: break-all;
}

.contact-mail svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (max-width: 560px) {
  .contact-card { padding: 30px 24px; }
  .contact-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ===================================================== 研究成果 ====== */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.topic {
  padding: 22px 22px 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-top: 2px solid var(--accent);
}

.topic__idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--txt-mute);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 10px;
}

.topic h3 { font-size: 1rem; margin: 0; line-height: 1.5; }

/* ===================================================== 加入我們 ====== */

.member-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.member-type {
  padding: 30px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* 中文會員類別是重點，所以直接當標題；英文縮小放在下方 */
.member-type__name {
  font-size: 1.45rem;
  margin: 0 0 4px;
  color: #f2f7fc;
}

.member-type__en {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.member-type p:last-child { color: var(--txt-dim); font-size: 0.93rem; margin: 0; }

.benefit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.benefit-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 0.93rem;
  color: var(--txt-dim);
}

.benefit-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}