/* Trang /tin-tuc: lưới bài viết 2 cột + cột phải nội dung học mới nhất */
.nw-page {
  --nw-text: #0f172a;
  --nw-muted: #64748b;
  --nw-border: #e2e8f0;
  --nw-accent: #4f46e5;
  --nw-a: #1fb5d6;
  --nw-b: #5b3fa8;
  background: #f5f7fb;
  padding: 1.75rem 0 3rem;
  color: var(--nw-text);
}

.nw-head {
  margin-bottom: 1.5rem;
}

.nw-kicker {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--nw-accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nw-title {
  margin: .5rem 0 .25rem;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--nw-text);
}

.nw-sub {
  margin: 0;
  color: var(--nw-muted);
}

.nw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.75rem;
  align-items: start;
}

/* Lưới bài viết */
.nw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.nw-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--nw-border);
  color: inherit;
  text-decoration: none !important;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.nw-card:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
  box-shadow: 0 14px 30px rgba(79, 70, 229, .12);
}

.nw-card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--nw-a), var(--nw-b));
}

.nw-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}

.nw-card:hover .nw-card-img img {
  transform: scale(1.04);
}

.nw-card-date {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.nw-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: .5rem;
  padding: 1rem 1.1rem 1.1rem;
}

.nw-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--nw-text);
}

.nw-card:hover .nw-card-title {
  color: var(--nw-accent);
}

.nw-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--nw-muted);
}

.nw-card-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: .25rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--nw-accent);
}

/* Phân trang */
.nw-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 1.75rem;
}

.nw-pg {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--nw-border);
  color: var(--nw-text);
  font-weight: 700;
  text-decoration: none !important;
}

a.nw-pg:hover {
  border-color: #a5b4fc;
  color: var(--nw-accent);
}

.nw-pg.is-active {
  background: linear-gradient(135deg, var(--nw-a), var(--nw-b));
  border-color: transparent;
  color: #fff;
}

.nw-pg--gap {
  border: 0;
  background: transparent;
  min-width: 20px;
}

.nw-empty {
  padding: 3rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed var(--nw-border);
  text-align: center;
  color: var(--nw-muted);
}

/* Cột phải */
.nw-side {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.nw-widget {
  padding: 1rem 1rem .5rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--nw-border);
}

.nw-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: .5rem;
}

.nw-widget-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--nw-text);
}

.nw-widget-more {
  flex: 0 0 auto;
  font-size: .8rem;
  font-weight: 700;
  color: var(--nw-accent) !important;
  text-decoration: none !important;
}

.nw-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nw-mini-list li + li {
  border-top: 1px solid #f1f5f9;
}

.nw-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .55rem .25rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none !important;
}

.nw-mini:hover {
  background: #f8fafc;
}

.nw-mini-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: #eef2ff;
}

.nw-ic {
  display: grid;
  place-items: center;
  color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

.nw-ic--quiz {
  background-color: #8b5cf6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.nw-ic--fc {
  background-color: #f59e0b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='14' height='14' rx='2'/%3E%3Cpath d='M7 6V4h12a2 2 0 0 1 2 2v12h-2'/%3E%3C/svg%3E");
}

.nw-ic--vq {
  background-color: #1fb5d6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3 7l4.5 4L12 4l4.5 7L21 7l-2 12H5L3 7z'/%3E%3C/svg%3E");
}

.nw-mini-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.nw-mini-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--nw-text);
}

.nw-mini:hover .nw-mini-name {
  color: var(--nw-accent);
}

.nw-mini-meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .76rem;
  color: var(--nw-muted);
}

/* Tablet / mobile */
@media (max-width: 991.98px) {
  .nw-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .nw-page {
    padding: 1rem 0 2rem;
  }

  .nw-title {
    font-size: 1.5rem;
  }

  .nw-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}
