/* ===================== */
/* ---- BODY & GRID ---- */
/* ===================== */
body {
  background: #fafafa;
  
}

.article-container {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  
}

/* ===================== */
/* ---- ARTICLE CARD ---- */
/* ===================== */
article.article {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #fff;
  transition: 0.25s;
}

article.article:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

article img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

/* ===================== */
/* ---- ARTICLE CONTENT ---- */
/* ===================== */
.article-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.article-content h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-content .excerpt {
  color: #555;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================== */
/* ---- RATING & FOOTER ---- */
/* ===================== */
.article-rating-summary {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #f8f8f8;
  text-align: center;
  font-size: 0.85rem;
  color: #555;
}

.published {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #888;
}

.published button {
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* ===================== */
/* ---- SKELETON & ANIMATION ---- */
/* ===================== */
.skeleton {
  height: 300px;
  border-radius: 12px;
  background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.fade-in {
  animation: fadein 0.6s ease-in;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ===================== */
/* ---- NEWS DETAIL ---- */
/* ===================== */
.news-detail .content {
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

.news-detail .content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px auto;
  border-radius: 6px;
}

/* ===================== */
/* ---- RESPONSIVE ---- */
/* ===================== */
@media (max-width: 768px) {
  .news-detail .content {
    padding-left: 5px;
    padding-right: 5px;
  }

  .news-detail .content img {
    width: calc(100% - 20px);
  }
}
/* ===================== */
/* ---- LINKS INSIDE ARTICLE ---- */
/* ===================== */
.article-content a {
  text-decoration: none;  /* bỏ gạch chân */
  color: inherit;          /* giữ màu theo thẻ cha */
  transition: color 0.2s;
}

.article-content a:hover {
  text-decoration: underline; /* underline khi hover (tuỳ chọn) */
  color: #007bff;             /* đổi màu khi hover */
}

/* ===================== */
/* ---- MOBILE GRID 2 CỘT ---- */
/* ===================== */
@media (max-width: 768px) {
  .article-container {
    grid-template-columns: repeat(2, 1fr); /* 2 cột trên mobile */
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .article-container {
    grid-template-columns: 1fr; /* 1 cột trên điện thoại nhỏ */
  }
}
