/* ==================== 知識專欄區塊樣式 ==================== */

/* 部落格容器 - 左右留白 */
.blog-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem;
}

/* 區塊標題 */
.blog-container h2 {
  margin-left: 30px;
}

/* 文章卡片網格 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 固定一行 3 個 */
  gap: 2rem;
  margin-bottom: 1.5rem;
}

/* 文章卡片 */
.post-card {
  background: #fff;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* 文章圖片 */
.post-image {
  position: relative;
  width: 100%;
  padding-bottom: 66.57%; /* 237 ÷ 356 × 100% = 66.57% */
  height: 0;
  overflow: hidden;
  background: #f5f5f5;
}

.post-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
  transform: scale(1.05);
}

/* 文章內容 */
.post-content {
  padding: 1.5rem 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Meta 資訊 */
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.post-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #f0f0f0;
  color: #666;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.post-category:hover {
  background: #8b7355;
  color: #fff;
}

.post-date {
  color: #999;
  font-size: 0.8rem;
}

/* 文章標題 */
.post-title {
  margin: 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

.post-title a {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-title a:hover {
  color: #8b7355;
}

/* 文章摘要 */
.post-excerpt {
  color: #666;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* 閱讀更多 */
.read-more {
  display: inline-flex;
  align-items: center;
  color: #8b7355;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.read-more:hover {
  color: #6d5940;
  transform: translateX(4px);
}

/* 查看更多按鈕 */
.view-more-container {
  text-align: center;
  margin-top: 2rem;
}

.view-more-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: transparent;
  color: #8b7355;
  border: 2px solid #8b7355;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.view-more-btn:hover {
  background: #8b7355;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

/* 分類區塊 */
.blog-section {
  margin-bottom: 3rem;
}

.blog-section:last-child hr {
  display: none; /* 最後一個區塊不顯示分隔線 */
}

/* 分隔線樣式 */
.blog-section hr {
  width: 98%; /* 控制長度 */
  margin: 2rem auto 0; /* 置中並調整間距 */
  border: none;
  border-top: 1px solid #333;
}

/* 響應式 */
@media (max-width: 1200px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr); /* 平板:一行 2 個 */
  }
}

@media (max-width: 768px) {
  .blog-container {
    padding: 1.5rem 1rem;
  }

  .blog-container h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .posts-grid {
    grid-template-columns: 1fr; /* 手機:一行 1 個 */
  }

  .post-image {
    height: 200px;
  }

  .blog-section {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
  }
}
