/* Trang danh sách tin (chuyên mục CMS) + thẻ bài viết, sidebar dùng chung cho chi tiết tin và trang chính sách.
   Port từ khối <style> trong ui-template-v2/tin-tuc.html */

.news-section { padding: 48px 0 92px; }

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}

.hero-subpage .hero-meta {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--text-muted);
}


/* Thẻ bài nổi bật */
.featured-article-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
  transition: all var(--transition-normal);
}
.featured-article-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.featured-article-body { padding: 32px; }
.featured-article-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; line-height: 1.35; }
.featured-article-title a { color: var(--text-heading); }
.featured-article-title a:hover { color: var(--cz-blue-primary); }
.featured-article-excerpt { font-size: .9375rem; color: var(--text-body); line-height: 1.7; margin-bottom: 20px; }
.featured-read { color: var(--cz-blue-primary); font-weight: 600; }
.featured-read:hover { color: var(--cz-blue-hover); }
.featured-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--cz-blue-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}

/* Lưới thẻ bài viết */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.article-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(0, 161, 255, .3); }

.article-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  overflow: hidden;
  position: relative;
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.article-card:hover .article-thumb img,
.featured-article-card:hover .article-thumb img { transform: scale(1.05); }

/* Ảnh giữ chỗ khi bài không có ảnh trên CMS */
.article-thumb-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--cz-blue-soft), var(--cz-mint-soft));
  color: var(--cz-blue-primary);
}
.article-thumb-empty svg { width: 40px; height: 40px; opacity: .7; }

.article-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.article-category {
  display: inline-block;
  font-size: .75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cz-blue-primary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.article-title { font-size: 1.125rem; font-weight: 700; color: var(--text-heading); line-height: 1.45; margin-bottom: 10px; }
.article-title a { color: inherit; }
.article-title a:hover { color: var(--cz-blue-primary); }
.article-excerpt {
  font-size: .875rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  border-top: 1px solid var(--bg-card-border);
  padding-top: 12px;
}

/* Trạng thái rỗng */
.news-empty {
  border: 1px dashed var(--bg-card-border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 64px 24px;
  text-align: center;
}
.news-empty strong { display: block; color: var(--text-heading); font-size: 1rem; margin-bottom: 4px; }
.news-empty p { color: var(--text-muted); font-size: .875rem; }

/* Phân trang */
.news-pagination { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.news-pagination a,
.news-pagination span {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-heading);
  font-size: .875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}
.news-pagination a:hover { border-color: var(--cz-blue-primary); color: var(--cz-blue-primary); }
.news-pagination span[aria-current] { background: var(--cz-blue-primary); border-color: var(--cz-blue-primary); color: #fff; }

/* Sidebar */
.news-sidebar { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.sidebar-widget-cta { background: var(--bg-surface); }
.sidebar-widget-cta .eyebrow { margin-bottom: 14px; }
.sidebar-widget-cta h4 { font-size: 1.125rem; color: var(--text-heading); margin-bottom: 12px; line-height: 1.4; }
.sidebar-widget-cta p { font-size: .875rem; color: var(--text-body); line-height: 1.6; margin-bottom: 20px; }
.sidebar-widget-cta .btn { width: 100%; justify-content: center; text-align: center; white-space: normal; }
.sidebar-widget-cta .btn + .btn { margin-top: 10px; }

.widget-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 22px;
  position: relative;
}
.widget-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--cz-blue-primary);
}
.widget-category-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.widget-category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--text-body);
  font-size: .875rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.widget-category-list a:hover { color: var(--cz-blue-primary); background: var(--cz-blue-soft); }
.widget-category-list a.active { color: var(--cz-blue-primary); background: var(--cz-blue-soft); font-weight: 600; }

.widget-popular-item { display: flex; gap: 12px; margin-bottom: 16px; }
.widget-popular-item:last-child { margin-bottom: 0; }
.widget-popular-thumb {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--cz-blue-soft), var(--cz-mint-soft));
}
.widget-popular-title {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.widget-popular-title:hover { color: var(--cz-blue-primary); }
.widget-popular-date { font-size: .7rem; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 1024px) {
  .news-layout { grid-template-columns: minmax(0, 1fr); }
  .article-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .news-section { padding: 40px 0 64px; }
  .article-grid,
  .article-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .featured-article-body { padding: 22px; }
  .sidebar-widget { padding: 20px; }
}
