/* ============================================
   news.css — Styles riêng cho trang Tin tức
   Không sửa main.css — chỉ thêm class mới
   ============================================ */

/* ---- PAGE BANNER ---- */
.news-page-banner {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #42a5f5 100%);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 30px;
  color: #ffffff;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

/* Vòng tròn trang trí nền */
.news-page-banner::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.news-page-banner::after {
  content: '';
  position: absolute;
  right: 80px;
  bottom: -80px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.news-banner-icon {
  font-size: 44px;
  opacity: 0.9;
  flex-shrink: 0;
  line-height: 1;
}

.news-banner-text {
  flex: 1;
}

.news-banner-text h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: 0.3px;
}

.news-banner-text p {
  font-size: 14px;
  opacity: 0.85;
  margin: 0;
}

.news-banner-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
}

.news-banner-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 18px;
  min-width: 68px;
  backdrop-filter: blur(4px);
}

.nbs-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.nbs-label {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- CATEGORY FILTER BAR ---- */
.news-filter-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  background-color: #ffffff;
  border-bottom: 2px solid var(--container-border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  margin-bottom: 20px;
}

.news-filter-bar::-webkit-scrollbar {
  display: none;
}

.news-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid transparent;
  border-radius: 50px;
  background-color: #eef6fd;
  color: #555;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.news-filter-btn:hover {
  background-color: #d1eaf9;
  color: var(--primary-blue);
}

.news-filter-btn.active {
  background-color: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 3px 10px rgba(25, 118, 210, 0.35);
}

/* ---- SECTION WRAPPER (dùng thêm cho news) ---- */
.news-section {
  background-color: #ffffff;
  margin-bottom: 20px;
}

/* ---- FEATURED ARTICLE ---- */
.news-featured-wrapper {
  display: flex;
  gap: 20px;
  min-height: 280px;
  padding: 20px;
  background-color: #ffffff;
}

.news-featured-img {
  width: 42%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  color: rgba(255, 255, 255, 0.75);
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.news-featured-label {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.news-featured-content {
  flex: 1;
  padding: 8px 8px 8px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.news-featured-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.45;
  margin: 0;
}

.news-featured-excerpt {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-featured-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #888;
}

.news-featured-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.news-read-btn {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.news-read-btn:hover {
  background-color: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
}

.news-read-btn i {
  transition: transform 0.2s ease;
}

.news-read-btn:hover i {
  transform: translateX(4px);
}

/* ---- BADGES ---- */
.news-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  width: fit-content;
}

.badge-thong-bao {
  background-color: #e3f2fd;
  color: #1565c0;
}

.badge-bao-tri {
  background-color: #fff3e0;
  color: #e65100;
}

.badge-su-kien {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.badge-thiet-bi-moi {
  background-color: #e8f5e9;
  color: #2e7d32;
}

/* ---- NEWS GRID ---- */
.news-grid-wrapper {
  padding: 24px 24px 20px;
  background-color: var(--equipment-container-bg);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 10px;
}

/* ---- NEWS CARD ---- */
.news-card {
  background-color: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.news-card-img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

.news-card-body {
  flex: 1;
  padding: 16px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-excerpt {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
  padding-top: 4px;
}

.news-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.news-card-footer {
  padding: 10px 16px 14px;
  border-top: 1px solid #f0f0f0;
}

.news-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--primary-blue);
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0;
  transition: gap 0.2s ease, color 0.2s ease;
}

.news-card-btn:hover {
  color: #1565c0;
  gap: 10px;
}

/* ---- EMPTY STATE ---- */
.news-empty {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.news-empty i {
  font-size: 48px;
  color: #cbd5e1;
}

.news-empty p {
  font-size: 15px;
  font-weight: 500;
}

/* ---- GRADIENT PRESETS ---- */
.gradient-thong-bao {
  background: linear-gradient(135deg, #1565c0, #42a5f5);
}

.gradient-bao-tri {
  background: linear-gradient(135deg, #bf360c, #ff7043);
}

.gradient-su-kien {
  background: linear-gradient(135deg, #4a148c, #ab47bc);
}

.gradient-thiet-bi-moi {
  background: linear-gradient(135deg, #1b5e20, #66bb6a);
}

.gradient-bao-tri-2 {
  background: linear-gradient(135deg, #6a1b9a, #ce93d8);
}

.gradient-su-kien-2 {
  background: linear-gradient(135deg, #b71c1c, #ef5350);
}

.gradient-khoa-hoc {
  background: linear-gradient(135deg, #004d40, #4db6ac);
}

.gradient-qr {
  background: linear-gradient(135deg, #e65100, #ffb74d);
}

.gradient-laptop {
  background: linear-gradient(135deg, #283593, #7986cb);
}

.gradient-dao-tao {
  background: linear-gradient(135deg, #006064, #4dd0e1);
}

/* ---- FILTER ANIMATION ---- */
.news-card {
  animation: fadeInCard 0.3s ease both;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================
   RESPONSIVE — news.css
   ================================================ */

/* Tablet (≤ 900px): 2 cột */
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ≤ 768px */
@media (max-width: 768px) {

  /* Page Banner */
  .news-page-banner {
    padding: 18px 16px;
    gap: 14px;
  }

  .news-banner-icon {
    font-size: 32px;
  }

  .news-banner-text h2 {
    font-size: 17px;
  }

  .news-banner-text p {
    font-size: 13px;
  }

  .news-banner-stats {
    gap: 10px;
  }

  .news-banner-stat {
    padding: 8px 12px;
    min-width: 54px;
  }

  .nbs-value {
    font-size: 18px;
  }

  .nbs-label {
    font-size: 10px;
  }

  /* Filter */
  .news-filter-bar {
    padding: 10px 12px;
    gap: 6px;
  }

  .news-filter-btn {
    font-size: 13px;
    padding: 7px 14px;
  }

  /* Featured: stack dọc */
  .news-featured-wrapper {
    flex-direction: column;
    min-height: unset;
  }

  .news-featured-img {
    width: 100%;
    height: 180px;
    font-size: 56px;
  }

  .news-featured-content {
    padding: 20px 16px 18px;
    gap: 12px;
  }

  .news-featured-title {
    font-size: 17px;
  }

  .news-featured-excerpt {
    -webkit-line-clamp: 3;
  }

  /* Grid */
  .news-grid-wrapper {
    padding: 16px 12px;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .news-card-img {
    height: 110px;
    font-size: 38px;
  }

  .news-card-title {
    font-size: 13px;
  }
}

/* ≤ 480px: 1 cột */
@media (max-width: 480px) {
  .news-page-banner {
    flex-wrap: wrap;
    padding: 14px 12px;
    gap: 10px;
  }

  .news-banner-stats {
    width: 100%;
    justify-content: space-around;
  }

  .news-banner-stat {
    flex: 1;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Card nằm ngang trên mobile nhỏ */
  .news-card {
    flex-direction: row;
    border-radius: 8px;
  }

  .news-card-img {
    width: 90px;
    height: auto;
    font-size: 30px;
    flex-shrink: 0;
    border-radius: 0;
    min-height: 100px;
  }

  .news-card-body {
    padding: 12px 12px 6px;
    gap: 6px;
  }

  .news-card-excerpt {
    display: none;
    /* ẩn tóm tắt, tiết kiệm không gian */
  }

  .news-card-title {
    -webkit-line-clamp: 3;
  }

  .news-card-footer {
    display: none;
    /* nút đọc thêm ẩn trên mobile nhỏ — tap vào card */
  }

  .news-featured-img {
    height: 150px;
    font-size: 44px;
  }

  .news-featured-title {
    font-size: 15px;
  }

  .news-featured-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .news-featured-meta {
    gap: 10px;
    font-size: 12px;
  }

  .news-read-btn {
    font-size: 13px;
    padding: 8px 18px;
  }

  .news-filter-bar {
    padding: 8px 10px;
  }

  .news-filter-btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}