/* ==========================================================
   Trang Tin tức / Chính sách – danh sách & chi tiết
   Bố cục theo greensm.com/vn-vi/news, dùng token của base.css.
   Mobile-first; ≥768px lưới 2 cột; ≥1024px bố cục desktop.
   ========================================================== */

.nw-page {
  padding-bottom: 64px;
}

.nw-h2 {
  margin-bottom: 16px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: var(--chu-tieu-de);
}

/* ---------- Nhãn ---------- */
.nw-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 10px;
  border: 1px solid var(--duong-ke);
  border-radius: 20px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--chu-noi-dung);
}
.nw-pill--new {
  height: 24px;
  padding: 0 10px;
  background: var(--nen-xam-nhat);
}

/* ---------- Banner ---------- */
.nw-banner {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 16px;
  background: #e3f8f8;
}
.nw-banner__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px;
}
.nw-banner__icon {
  width: auto;
  height: 46px;
  margin-bottom: 12px;
  object-fit: contain;
  object-position: left center;
}
.nw-banner__title {
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  color: #3c7475;
}
.nw-banner__media {
  height: 145px;
}
.nw-banner__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}

/* ---------- Đường dẫn ---------- */
.nw-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  font-size: 14px;
  line-height: 20px;
  color: #4b5563;
}
.nw-crumb a {
  color: #4b5563;
  transition: color .15s;
}
.nw-crumb a:hover,
.nw-crumb__current {
  color: var(--xanh-thuong-hieu);
}
.nw-crumb__home {
  display: inline-flex;
}
.nw-crumb__sep {
  color: #d1d5db;
}

/* ---------- Tin nổi bật ---------- */
.nw-featured {
  margin-top: 64px;
}
.nw-featured__viewport {
  overflow: hidden;
  border: 1px solid var(--duong-ke);
  border-radius: 16px;
}
.nw-featured__track {
  display: flex;
  transition: transform .4s ease;
}
.nw-feat {
  display: flex;
  flex-direction: column;
  flex: 0 0 100%;
  min-width: 0;
}
.nw-feat__media {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.nw-feat__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nw-feat__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
  background: var(--nen-xam-nhat);
}
.nw-feat__body .nw-pill {
  margin-bottom: 8px;
}
.nw-feat__title {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
  font-size: 20px;
  line-height: 30px;
  font-weight: 700;
  color: var(--chu-tieu-de);
}
.nw-feat:hover .nw-feat__title {
  color: var(--xanh-chu);
}
.nw-feat__desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  line-height: 24px;
  color: #4b5563;
}
.nw-featured__nav {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
.nw-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--duong-ke);
  border-radius: 50%;
  background: var(--nen-trang);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.nw-arrow:hover {
  border-color: var(--vien-o-nhap);
  background: var(--nen-xam-nhat);
}

/* ---------- Tab danh mục + sắp xếp ---------- */
.nw-list {
  margin-top: 64px;
}
.nw-list--top {
  margin-top: 48px;
}
.nw-toolbar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nw-tabs {
  display: flex;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nw-tabs::-webkit-scrollbar {
  display: none;
}
.nw-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.nw-tab:hover {
  background: var(--nen-xam-nhat);
  color: var(--chu-tieu-de);
}
.nw-tab.is-active {
  background: #f3f4f6;
  color: var(--chu-tieu-de);
}
.nw-sort {
  position: relative;
  display: block;
  flex-shrink: 0;
}
.nw-sort select {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--vien-o-nhap);
  border-radius: 10px;
  background: var(--nen-trang);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  color: var(--chu-tieu-de);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.nw-sort select:focus {
  outline: none;
  border-color: var(--xanh-thuong-hieu);
}
.nw-sort img {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ---------- Thẻ bài ---------- */
.nw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 32px;
  margin-top: 32px;
}
.nw-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nw-card__media {
  display: block;
  aspect-ratio: 358 / 200;
  overflow: hidden;
  border-radius: 16px;
}
.nw-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.nw-card:hover .nw-card__media img {
  transform: scale(1.03);
}
.nw-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nw-card .nw-meta {
  margin-top: 20px;
}
.nw-meta__date {
  font-size: 14px;
  line-height: 20px;
  color: #4b5563;
}
.nw-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 12px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  color: var(--chu-tieu-de);
  transition: color .15s;
}
.nw-card:hover .nw-card__title {
  color: var(--xanh-chu);
}
.nw-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  font-size: 16px;
  line-height: 24px;
  color: #4b5563;
}
.nw-empty {
  margin-top: 32px;
  color: var(--chu-phu);
}

/* ---------- Phân trang ---------- */
.nw-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
}
.nw-pages .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: rgba(0, 0, 0, .85);
  transition: background-color .15s;
}
.nw-pages a.page-numbers:hover {
  background: var(--nen-xam-nhat);
}
.nw-pages .page-numbers.current {
  background: #f3f4f6;
  color: #1f2937;
}
.nw-pages .page-numbers.dots {
  border-radius: 0;
}

/* ---------- Chi tiết bài ---------- */
.nw-single {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 64px;
  margin-top: 72px;
}
.nw-article--page {
  max-width: 789px;
  margin-top: 72px;
}
.nw-article__title {
  margin: 12px 0 24px;
  font-size: 26px;
  line-height: 40px;
  font-weight: 700;
  color: var(--chu-tieu-de);
}
.nw-article--page .nw-article__title {
  margin-top: 0;
}
.nw-content {
  font-size: 16px;
  line-height: 28px;
  color: #333;
  overflow-wrap: anywhere;
}
.nw-content > * + * {
  margin-top: 10px;
}
.nw-content h2 {
  margin-top: 24px;
  font-size: 20px;
  line-height: 32px;
  font-weight: 700;
  color: var(--chu-tieu-de);
}
.nw-content h3,
.nw-content h4 {
  margin-top: 20px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 700;
  color: var(--chu-tieu-de);
}
.nw-content strong,
.nw-content b {
  font-weight: 700;
}
.nw-content a {
  color: var(--xanh-thuong-hieu);
}
.nw-content a:hover {
  text-decoration: underline;
}
.nw-content ul,
.nw-content ol {
  padding-left: 22px;
}
.nw-content ul {
  list-style: disc;
}
.nw-content ol {
  list-style: decimal;
}
.nw-content li + li {
  margin-top: 6px;
}
.nw-content img {
  height: auto;
}
.nw-content figure,
.nw-content .wp-caption {
  max-width: 100%;
}
.nw-content figcaption,
.nw-content .wp-caption-text {
  margin-top: 6px;
  font-size: 14px;
  line-height: 20px;
  color: var(--chu-phu);
  text-align: center;
}
.nw-content table {
  width: 100%;
  border-collapse: collapse;
}
.nw-content th,
.nw-content td {
  padding: 8px 12px;
  border: 1px solid var(--duong-ke);
  text-align: left;
}
.nw-content td.is-hl {
  background: var(--xanh-ngoc-nhat);
  font-weight: 600;
}
.nw-table-scroll {
  overflow-x: auto;
}
.nw-table-scroll th,
.nw-table-scroll td {
  white-space: nowrap;
}
.nw-content blockquote {
  padding-left: 16px;
  border-left: 4px solid var(--xanh-thuong-hieu);
  color: var(--chu-noi-dung);
}
.nw-content .aligncenter {
  margin-inline: auto;
}
.nw-content__cover img {
  width: 100%;
}
.nw-share {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--duong-ke);
}
.nw-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--duong-ke);
  border-radius: 50%;
  background: var(--nen-trang);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.nw-share__btn:hover,
.nw-share__btn.is-copied {
  border-color: var(--xanh-thuong-hieu);
  background: var(--xanh-ngoc-nhat);
}
.nw-recent .nw-h2 {
  margin-bottom: 32px;
}
.nw-recent__list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.nw-404 .btn {
  margin-top: 32px;
}

/* ---------- ≥768px ---------- */
@media (min-width: 768px) {
  .nw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 64px;
  }
  .nw-feat {
    flex-direction: row;
  }
  .nw-feat__media {
    flex: 0 0 50%;
    aspect-ratio: auto;
    height: 400px;
  }
  .nw-feat__body {
    padding: 32px;
  }
  .nw-feat__title {
    font-size: 30px;
    line-height: 38px;
  }
  .nw-feat__desc {
    -webkit-line-clamp: 5;
  }
  .nw-card .nw-meta {
    margin-top: 32px;
  }
  .nw-card__title {
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
  }
  .nw-card__media {
    aspect-ratio: 384 / 214;
  }
}

/* ---------- ≥1024px ---------- */
@media (min-width: 1024px) {
  .nw-page {
    padding-bottom: 96px;
  }
  .nw-h2 {
    margin-bottom: 32px;
  }
  .nw-banner {
    flex-direction: row;
    justify-content: space-between;
    height: 240px;
    margin-top: 32px;
  }
  .nw-banner__text {
    padding: 0 40px;
  }
  .nw-banner__icon {
    height: 62px;
  }
  .nw-banner__title {
    font-size: 48px;
    line-height: 60px;
  }
  .nw-banner__media {
    width: 592px;
    max-width: 50%;
    height: 100%;
  }
  .nw-banner__media img {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
    mask-image: linear-gradient(90deg, transparent, #000 45%);
  }
  .nw-featured {
    margin-top: 128px;
  }
  .nw-feat__media {
    flex-basis: 58.4%;
  }
  .nw-featured__nav {
    margin-top: 32px;
  }
  .nw-list {
    margin-top: 96px;
  }
  .nw-list--top {
    margin-top: 64px;
  }
  .nw-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 64px;
  }
  .nw-sort {
    width: 451px;
    max-width: 40%;
  }
  .nw-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .nw-pages {
    margin-top: 64px;
  }
  .nw-single {
    grid-template-columns: minmax(0, 1fr) 363px;
    margin-top: 88px;
  }
  .nw-article--page {
    margin-top: 88px;
  }
  .nw-article__title {
    font-size: 32px;
    line-height: 40px;
  }
}
