#blog-cards {
  padding: 2rem 1rem;
  background-color: #f9f9f9;
}

#blog-cards .cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

#blog-cards .blog-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  height: 350px;
  min-height: 350px; /* お好みの高さに調整 */
  flex-direction: column;
}

#blog-cards .blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

#blog-cards .blog-card img {
  height: 170px;
  width: 100%;
  object-fit: cover;
}

#blog-cards .blog-card h3 {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.2rem;
  font-weight: 550;
  line-height: 1.4;
  height: 2.4rem;             /* 文字1行 + 上下paddingを確保 */
  padding: 0.4rem 1rem;       /* 上下に余裕を出し、左右も見栄えを良く */
  margin: 0;                  /* 外側の余白はなしで調整 */
  color: #333;
  box-sizing: border-box;     /* padding込みでheightを計算 */
}

#blog-cards .blog-card h3 a {
  display: inline-block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: inherit;
  text-decoration: none;
  color: inherit;
}

/* 日付とカテゴリーを横並びにまとめる */
#blog-cards .date-and-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  flex-wrap: wrap;
  margin: 0 1rem 0.5rem;
}

#blog-cards .date-and-category time {
  color: #888;
  margin: 0;
  display: inline-block;
}

/* カテゴリーリスト */
#blog-cards .date-and-category .post-categories {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* カテゴリーバッジ風リンク */
#blog-cards .date-and-category .post-categories a {
  background-color: #f2f2f2;
  padding: 0.1rem 0.3rem; /* ここを半分に */
  border-radius: 9999px;
  font-size: 0.8rem;
  color: #337ab7;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}


#blog-cards .date-and-category .post-categories a:hover {
  background-color: #337ab7;
  color: #fff;
  text-decoration: none;
}

#blog-cards .blog-card p {
  font-size: 1rem;
  color: #555;
  margin: 0 1rem 1rem;
  line-height: 1.4;
  overflow: hidden;      /* はみ出したテキストを隠す */
  text-overflow: ellipsis; /* 省略記号「...」を表示 */
  display: -webkit-box;
  -webkit-line-clamp: 3;  /* 表示する行数を3行に限定（webkit専用） */
  -webkit-box-orient: vertical;
}

#blog-cards .post-summary {
  padding-left: 1rem;
  padding-right: 1rem;
  font-size: 1rem;
  color: #555;
  line-height: 1.4;
  height: 4.2em; /* 1.4em * 3行程度 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* 最大3行 */
  -webkit-box-orient: vertical;
}

/* 既存のカテゴリーリスト（もし使うなら） */
#blog-cards .blog-category-inline {
  margin-bottom: 1rem;
}

#blog-cards .blog-category-inline .category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
  margin: 0;
}

#blog-cards .blog-category-inline .category-list li {
  background-color: #f2f2f2;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

#blog-cards .blog-category-inline .category-list li.active {
  background-color: #333;
  color: #fff;
}

#blog-cards .blog-category-inline .category-list li a {
  color: inherit;
  text-decoration: none;
}
