/* blog.css */
.blog-section {
  padding: 4rem 2rem;
  background-color: #f9f9f9;
}

.blog-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #333;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.blog-image {
  height: 220px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f0f0f0; /* placeholder จนกว่ารูปจะโหลด */
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.blog-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-date {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.5rem;
  display: block;
}

.blog-title {
  font-size: 1.25rem;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.blog-title a {
  color: #333;
  text-decoration: none;
}

.blog-title a:hover {
  color: #007bff; /* สีหลักแบรนด์ สามารถเปลี่ยนได้ */
}

.blog-excerpt {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* ลบ margin ของ p tag ที่มาจาก WordPress */
.blog-excerpt p {
  margin: 0;
}

.read-more {
  display: inline-block;
  font-weight: 600;
  color: #007bff;
  text-decoration: none;
  margin-top: auto;
}

.read-more:hover {
  text-decoration: underline;
}

.error-msg {
  text-align: center;
  color: #d9534f;
  grid-column: 1 / -1;
  padding: 2rem;
  background: #ffecec;
  border-radius: 8px;
}

.blog-cat {
  display: inline-block;
  background: rgba(245, 166, 35, 0.15);
  color: #b07600;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
