/* ==========================================================================
   components.css — 可重複使用的元件
   ========================================================================== */

/* ============================================================ 按鈕 ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent-2);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}

.btn:hover {
  background: var(--accent);
  color: #06101f;
  box-shadow: 0 0 22px rgba(74, 158, 255, 0.3);
}

.btn--solid {
  background: var(--accent);
  color: #06101f;
  font-weight: 600;
}
.btn--solid:hover { background: var(--accent-2); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--txt-dim);
}
.btn--ghost:hover { background: rgba(74, 158, 255, 0.12); color: #fff; box-shadow: none; }

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ============================================================ 標籤 ===== */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.tag--org      { color: var(--tag-org); }
.tag--imagery  { color: var(--tag-imagery); }
.tag--member   { color: var(--tag-member); }
.tag--workshop { color: var(--tag-workshop); }
.tag--training { color: var(--tag-training); }
.tag--intl     { color: var(--tag-intl); }

/* 標籤篩選列 */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.tag-filter__btn {
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--txt-mute);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.tag-filter__btn:hover { color: var(--txt); border-color: var(--txt-mute); }
.tag-filter__btn.is-active {
  color: #06101f;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ====================================================== 最新消息卡 ==== */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-left: 2px solid var(--accent);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
              background 0.25s var(--ease);
}

.news-card:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  border-left-color: var(--accent-2);
  transform: translateY(-3px);
}

.news-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.news-card__date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--txt-mute);
  letter-spacing: 0.05em;
}

.news-card__title {
  font-size: 1.08rem;
  margin: 0;
  line-height: 1.5;
}

.news-card__body {
  color: var(--txt-dim);
  font-size: 0.92rem;
  line-height: 1.8;
  margin: 0;
}

/* 消息列表（最新消息整頁） */
.news-list { display: flex; flex-direction: column; gap: 0; }

.news-row {
  display: grid;
  grid-template-columns: 172px 1fr;
  gap: 8px 26px;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease);
}
.news-row:first-child { border-top: 1px solid var(--line); }
.news-row:hover { background: rgba(74, 158, 255, 0.04); }

.news-row__meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.news-row__meta .tag { font-size: 0.72rem; }
.news-row__title { font-size: 1.1rem; margin: 0 0 8px; }
.news-row__body { color: var(--txt-dim); font-size: 0.93rem; margin: 0; }

@media (max-width: 680px) {
  .news-row { grid-template-columns: 1fr; }
  .news-row__meta { flex-direction: row; align-items: center; gap: 14px; }
}

/* 載入與空狀態 */
.state {
  padding: 48px 24px;
  text-align: center;
  color: var(--txt-mute);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.state strong { display: block; color: var(--txt-dim); margin-bottom: 6px; font-weight: 500; }
.state code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-2);
}

/* ======================================================== 核心價值 ==== */

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.value {
  background: var(--bg-2);
  padding: 34px 30px 36px;
  transition: background 0.3s var(--ease);
}
.value:hover { background: var(--surface); }

.value__icon {
  display: block;          /* span 預設是 inline，寬高會失效 */
  width: 38px;
  height: 38px;
  color: var(--accent);
  margin-bottom: 20px;
}
.value__icon svg { width: 100%; height: 100%; }

.value h3 { font-size: 1.12rem; margin-bottom: 12px; }
.value p { color: var(--txt-dim); font-size: 0.93rem; margin: 0; }

/* ======================================================== 大事紀 ====== */

.timeline {
  position: relative;
  padding-left: 34px;
  margin: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg,
    rgba(74, 158, 255, 0.1),
    var(--accent) 12%,
    var(--accent) 88%,
    rgba(74, 158, 255, 0.1));
}

.timeline__item {
  position: relative;
  padding-bottom: 42px;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 4px var(--bg), 0 0 14px var(--accent-glow);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-2);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.timeline__title { font-size: 1.12rem; margin-bottom: 8px; }
.timeline__body { color: var(--txt-dim); font-size: 0.95rem; margin: 0; }

/* ====================================================== 下載檔案 ====== */

.downloads { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }

.download {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--txt);
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.download:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  color: #fff;
}

.download__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
}

.download__name { flex: 1; font-size: 0.95rem; }
.download__hint { font-size: 0.78rem; color: var(--txt-mute); font-family: var(--font-mono); }

.download__arrow { width: 16px; height: 16px; color: var(--txt-mute); flex-shrink: 0; }
.download:hover .download__arrow { color: var(--accent-2); }

/* ======================================================== 資料表格 ==== */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: 0.93rem;
}

table.data th,
table.data td {
  padding: 15px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

table.data th {
  background: var(--bg-3);
  color: var(--txt-dim);
  font-weight: 500;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(74, 158, 255, 0.05); }

/* ======================================================= 人員名片 ===== */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
}

/* 工作委員會：固定一列三人，分配較平均 */
.people--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 860px) {
  .people--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .people--3 { grid-template-columns: 1fr; }
}

.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.25s var(--ease);
}
.person:hover { border-color: var(--line-strong); }

.person__photo {
  width: 92px;
  height: 92px;
  margin: 0 auto 16px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
}

.person__name { font-size: 1.02rem; margin: 0 0 4px; }
.person__org { font-size: 0.85rem; color: var(--txt-mute); margin: 0 0 16px; }

/* 個人網站：原本是細小的文字連結，容易被忽略，改成有外框的按鈕 */
.person__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--txt-dim);
  transition: border-color 0.22s var(--ease), color 0.22s var(--ease),
              background 0.22s var(--ease);
}

.person__link svg { width: 13px; height: 13px; }

.person__link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
}

/* ======================================================= 圖片佔位 ===== */

.figure-slot {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(135deg,
      rgba(140, 170, 200, 0.03) 0 12px,
      transparent 12px 24px),
    var(--bg-2);
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--txt-mute);
}
.figure-slot img { border-radius: var(--radius); }
.figure-slot__hint { font-family: var(--font-mono); font-size: 0.8rem; }

/* ===================================================== 條列式流程 ===== */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 56px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--txt-dim);
  font-size: 0.95rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ===================================================== 一般內容框 ===== */

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
}

.panel--accent { border-left: 2px solid var(--accent); }

.panel h3 { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

/* 巢狀目標清單（關於我們） */
.goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }

.goal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}

.goal > h3 {
  font-size: 1.08rem;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.goal ul { margin: 0; padding-left: 1.15em; color: var(--txt-dim); font-size: 0.94rem; }
.goal li { margin-bottom: 8px; }
.goal li::marker { color: var(--accent); }

/* ===================================================== 連結行列 ====== */

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.22s var(--ease);
}
.link-row:hover { border-color: var(--accent); }
.link-row__name { font-size: 0.98rem; color: var(--txt); }

/* ====================================================== 標籤說明 ===== */

.tag-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 18px 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 30px;
}
