/* ===== News page (news.html) – loaded after style.css + home.css ===== */

/* Shorter hero: logo only, no CTA panel */
.news-hero { height: 47vw; }
/* logo-big.webp has wide transparent margins (art is ~70% of its width), so the box is wider than the screen and pulled down */
.news-hero .hero__content { bottom: -15vw; width: 108vw; } /* art ~76vw, scales with the screen */
.news-hero .hero__logo { width: 100%; } /* div shrinks to the image otherwise, capping it at its 1559px file width on wide screens */
.news-hero .hero__logo img { top: 0; margin-bottom: 0; } /* drop the landing nudges so bottom places the art directly */

/* Purple band with page title + breadcrumb */
.page-head {
  position: relative;
  z-index: 5;
  aspect-ratio: 1920 / 200;
  display: flex;
  align-items: center;
  background: url("../images/news/heading-bg.webp") center / cover no-repeat;
  color: #fff;
}
.page-head__inner { width: 100%; padding-left: 20%; }
.page-head h1, .page-head__title { font-size: clamp(28px, 3.4vw, 64px); line-height: 1.1; font-weight: 700; }
.page-head__crumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin-top: .4vw; font-size: clamp(12px, 1.1vw, 20px); }
.page-head__crumb img { width: clamp(18px, 1.8vw, 34px); }
.page-head__crumb a:hover { color: #ffd98a; }
.page-head__crumb a, .page-head__crumb span { white-space: nowrap; }

/* White column on the lavender page background */
.news-main { padding-top: 0; }
.news-page {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 24px 5% 50px;
  background: rgba(255, 255, 255, .92);
}
.news-page .news__tabs { margin: 0 0 18px; }

/* News card: thumbnail left, date + title + XEM THÊM right */
.posts { display: flex; flex-direction: column; gap: 14px; max-width: 1000px; margin: 0 auto; }
.post {
  display: flex;
  gap: 2%;
  padding: 1% 1.2% 1.4%;
  background: url("../images/news/card-bg.png") center / 100% 100% no-repeat;
}
.post__thumb { flex: 0 0 34%; aspect-ratio: 479 / 278; overflow: hidden; border-radius: 6px; }
.post__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post__thumb:hover img { transform: scale(1.05); }
.post__body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding-top: 1.4%; }
.post time { color: #777; font-size: 15px; }
.post h3 { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #1a1a1a; font-size: 15px; font-weight: 500; }
.post h3 img { width: 34px; }
.post__more { width: min(260px, 40%); margin-top: auto; transition: filter .2s; }
.post__more:hover { filter: brightness(1.2); }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pager a {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid #c9a7f5;
  border-radius: 6px;
  background: #fff;
  color: #4a1a8a;
  font-weight: 700;
  transition: background .2s, color .2s;
}
.pager a:hover, .pager a.is-active { background: linear-gradient(#6a2fd0, #3b0f8f); border-color: #3b0f8f; color: #fff; }

@media (max-width: 768px) {
  .news-hero { height: calc(100vw * 852 / 393 * .62); }
  .news-hero .hero__content { width: 140vw; bottom: -18vw; } /* art fills ~98vw */
  .page-head { aspect-ratio: auto; padding: 5vw 0; }
  .page-head__inner { padding-left: 5vw; }
  .page-head h1, .page-head__title { font-size: 8vw; }
  .page-head__crumb { font-size: 3.2vw; }
  .page-head__crumb img { width: 5vw; }
  .news-page { margin-bottom: 14vw; padding: 4vw 3vw 8vw; }
  .posts { gap: 3vw; }
  .post { gap: 3vw; padding: 2vw; }
  .post__thumb { flex-basis: 40%; }
  .post time { font-size: 3vw; }
  .post h3 { font-size: 3.2vw; align-items: flex-start; }
  .post h3 img { width: 7vw; margin-top: .5vw; }
  .post__more { width: 70%; }
  .pager a { min-width: 9vw; height: 9vw; }
}

/* Câu trạng thái khi gọi API (đang tải / chưa có bài / lỗi) — thay chỗ danh sách, không để khung trống */
.posts__state { padding: 48px 16px; color: #6b5a78; font-size: 18px; text-align: center; }
.posts__state--error { color: #b3001b; font-weight: 700; }
.pager a.is-disabled { opacity: .4; pointer-events: none; }
.pager[hidden] { display: none; } /* display:flex above would override [hidden] */
