/* ======================================
   AITerm 文章 — blog.css
   接在 style.css 後面，只加文章頁需要的東西。
   ====================================== */

/* ── 列表 ── */
.post-list { padding-top: 132px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
}
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); opacity: 1; }

.post-card-date {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.post-card h2 { font-size: 1.2rem; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.post-card p { color: var(--muted); font-size: 0.95rem; line-height: 1.7; }
.post-card-more { margin-top: 18px; color: var(--accent); font-size: 0.9rem; font-weight: 600; }

/* ── 內文 ──
   量測欄寬用 ch 而不是 px：文章是中英雙語，同一個像素寬度下中文一行塞進的
   字數比英文多得多，用字元寬度定義才會兩邊都落在好讀的行長。 */
.post { padding: 132px 0 80px; }
.post-inner { max-width: 44rem; margin: 0 auto; padding: 0 24px; }

.post-back { font-size: 0.9rem; color: var(--muted); }
.post-back:hover { color: var(--accent); }

.post-title {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 20px 0 12px;
}

.post-meta {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  color: var(--muted);
}

.post-sub {
  margin-top: 14px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #94a3b8;
  font-style: italic;
}

.post-body { margin-top: 40px; font-size: 1.08rem; line-height: 1.95; }
.post-body p { margin-bottom: 1.5rem; color: #cbd5e1; }
.post-body strong { color: var(--text); font-weight: 700; }

.post-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 3rem 0 1.2rem;
  letter-spacing: -0.01em;
}
.post-body h3 { font-size: 1.2rem; font-weight: 700; margin: 2.2rem 0 0.9rem; }

.post-body ul, .post-body ol { margin: 0 0 1.5rem 1.3rem; color: #cbd5e1; }
.post-body li { margin-bottom: 0.6rem; }

.post-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.post-body figure { margin: 2.2rem 0; }
.post-body img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.post-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-body pre code { background: none; padding: 0; font-size: 0.88rem; line-height: 1.7; }

@media (max-width: 640px) {
  .post { padding-top: 108px; }
  .post-list { padding-top: 108px; }
  .post-body { font-size: 1.02rem; }
}

/* 指回 Medium 原文。沒有網址時整個元素不會輸出，不是隱藏起來——
   不會有指向空白的連結。 */
.post-medium {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
