.posts-section {
  padding-left: 20px;
  padding-right: 20px;
}

/* ===== HERO ===== */
.blog-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 64px 20px 56px;
  text-align: center;
  color: white;
}

.blog-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.blog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.blog-hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.blog-hero p {
  font-size: 1.05rem;
  opacity: 0.92;
  margin: 0;
}

/* ===== Filter Section ===== */
.filter-section {
  padding: 24px 20px;
  border-bottom: 1px solid #eef0f4;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  background: white;
  border-radius: 50px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
  color: #444;
}

.filter-btn:hover {
  border-color: var(--cat-color, #667eea);
  color: var(--cat-color, #667eea);
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.filter-count {
  background: rgba(0,0,0,0.06);
  border-radius: 50px;
  padding: 1px 8px;
  font-size: 11px;
}

.filter-btn.active .filter-count {
  background: rgba(255,255,255,0.25);
}

/* Search Box */
.search-box { width: 100%; }

.search-box input {
  border-radius: 50px;
  border: 2px solid #e0e0e0;
  padding: 10px 20px;
  transition: all 0.25s ease;
  width: 100%;
}

.search-box input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  outline: none;
}

/* ===== Post Card ===== */
article {
  transition: all 0.25s ease;
  border: 2px solid #f0f0f0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

article:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
  border-color: #667eea;
}

.post-thumbnail img,
.thumbnail-fallback {
  transition: transform 0.3s ease;
}

article:hover .post-thumbnail img,
article:hover .thumbnail-fallback {
  transform: scale(1.04);
}

.thumbnail-fallback {
  width: 150px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--cat-color, #667eea) 12%, white);
}

.thumbnail-fallback i {
  font-size: 2.4rem;
  color: var(--cat-color, #667eea);
  opacity: 0.85;
}

.post-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cat-color, #667eea);
  background: color-mix(in srgb, var(--cat-color, #667eea) 12%, white);
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 10px;
}

.post-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.post-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s;
}

.post-title a:hover {
  color: #667eea;
}

.post-summary {
  line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* khoảng cách ảnh – chữ (không phụ thuộc Bootstrap gap-*) */
.post-item article {
  gap: 24px;
}

.post-thumbnail {
  flex: 0 0 160px;          /* khóa chiều rộng ảnh, không bị co lại */
  width: 160px;
}

.post-thumbnail img,
.thumbnail-fallback {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.thumbnail-fallback {
  display: flex;            /* ghi đè display: block ở trên cho icon căn giữa */
}

.post-content {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;         /* thay cho text-align: center của <main> */
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;                /* khoảng cách giữa "phút đọc" và ngày */
}

/* Animation */
.post-item {
  animation: fadeInUp 0.5s ease-out backwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .blog-hero { padding: 48px 20px 40px; }
  .blog-hero h1 { font-size: 1.7rem; }

  article {
    flex-direction: column !important;
  }

  .post-thumbnail img,
  .thumbnail-fallback {
    width: 100% !important;
    height: 180px !important;
  }

  .filter-tabs {
    width: 100%;
    justify-content: center;
  }

  .search-box { width: 100%; }
  .search-box input { width: 100%; }
}

.alert {
    display: none;
}