.bai-viet-lien-quan {
  margin: 24px 0;
}

.bai-viet-lien-quan h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

.bai-viet-lien-quan ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.bai-viet-lien-quan li {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bai-viet-lien-quan li:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.bai-viet-lien-quan li:hover .box-image img {
  transform: scale(1.05);
}

.tieu-de-bai-viet {
  padding: 13px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #333;
  transition: color 0.3s ease;
}

.bai-viet-lien-quan li a:hover .tieu-de-bai-viet {
  color: #0066cc;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
  .bai-viet-lien-quan ul {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .box-image {
    height: 180px;
  }

  .tieu-de-bai-viet {
    font-size: 15px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .bai-viet-lien-quan ul {
    grid-template-columns: 1fr;
  }

  .box-image {
    height: 220px;
  }
}
.entry-content .bai-viet-lien-quan ul,
.single-post .entry-content .bai-viet-lien-quan ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.entry-content .bai-viet-lien-quan li,
.single-post .entry-content .bai-viet-lien-quan li {
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
}
.entry-content .bai-viet-lien-quan li::before,
.single-post .entry-content .bai-viet-lien-quan li::before {
  content: none !important;
}

/* (Tùy chọn) Bật lưới cho đẹp */
.entry-content .bai-viet-lien-quan ul {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
}
@media (max-width: 1024px) {
  .entry-content .bai-viet-lien-quan ul {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 600px) {
  .entry-content .bai-viet-lien-quan ul {
    grid-template-columns: 1fr !important;
  }
}

.entry-content .bai-viet-lien-quan > h2 {
  margin: 0 0 12px !important;
}
.bai-viet-lien-quan .box-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

.bai-viet-lien-quan .box-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.bai-viet-lien-quan .box-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* sidebar */
/* Chỉ áp dụng cho sidebar trong trang blog/bài viết */
.blog .widget-area,
.single-post .widget-area,
.archive .widget-area {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Widget bài viết mới nhất */
.widget-area .widget.flatsome_recent_posts {
  margin-bottom: 0;
}

/* Tiêu đề widget */
.widget-area .widget-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
  display: block;
}

/* Đường phân cách */
.widget-area .is-divider {
  height: 2px;
  background: #e0e0e0;
  margin: 15px 0;
}

/* Danh sách bài viết */
.widget-area .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-area .recent-blog-posts-li {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.3s ease;
}

.widget-area .recent-blog-posts-li:last-child {
  border-bottom: none;
}

.widget-area .recent-blog-posts-li:hover {
  background: #f9f9f9;
  border-radius: 4px;
}

/* Layout flex */
.widget-area .flex-row.recent-blog-posts {
  display: flex;
  align-items: flex-start;
  padding: 12px 8px;
}

/* Thumbnail */
.widget-area .badge.post-date {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.widget-area .badge-inner.bg-fill {
  width: 100%;
  height: 100%;
  background-size: cover !important;
  background-position: center !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
}

/* Ngày tháng trong badge */
.widget-area .post-date-day {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.widget-area .post-date-month {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
}

/* Nội dung bài viết */
.widget-area .flex-col.flex-grow {
  flex: 1;
  min-width: 0;
}

.widget-area .flex-col.flex-grow a {
  color: #333;
  text-decoration: none;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
  transition: color 0.3s ease;
}

.widget-area .flex-col.flex-grow a:hover {
  color: #007bff;
}

/* Comment count */
.widget-area .post_comments {
  font-size: 12px;
  color: #999;
}

.widget-area .post_comments a {
  color: #999;
  text-decoration: none;
  font-size: 12px !important;
}

.widget-area .post_comments a:hover {
  color: #007bff;
}

/* Responsive */
@media (max-width: 768px) {
  .blog .widget-area,
  .single-post .widget-area,
  .archive .widget-area {
    position: relative;
    top: 0;
    max-height: none;
    margin-top: 30px;
  }
}

/* Scrollbar tùy chỉnh */
.widget-area::-webkit-scrollbar {
  width: 6px;
}

.widget-area::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.widget-area::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.widget-area::-webkit-scrollbar-thumb:hover {
  background: #999;
}
