/*
 * Phần dùng chung (menu, KV, footer...) và trang tin (category / post),
 * dựng theo bộ block của landing home mới (public/landing/assets/home/index.html
 * - xuất từ psdcut). Riêng trang chủ có thêm home.css.
 *
 * Đơn vị --u giống hệt landing: 1u = 1px của bản thiết kế, desktop thiết kế
 * 1920 ngang, mobile 750 ngang. Khác landing ở chỗ phần thân là flow layout
 * (grid/flex) chứ không định vị tuyệt đối: bài viết dài ngắn tuỳ nội dung.
 * File này nằm ngoài thư mục home/ để xuất lại landing không ghi đè mất.
 */
@font-face { font-family: 'Myriad Pro'; src: url('../home/fonts/MyriadPro-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'i Ciel Bree Serif'; src: url('../home/fonts/iCielBreeSerif-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

body { margin: 0; background: #f6efe8; }
.np-page { container-type: inline-size; width: 100%; display: block; }

.np {
  --u: calc(100cqw / 750);
  --np-red: #a41703;
  --np-dark: #6e0000;
  position: relative;
  width: 100%;
  overflow: hidden;
  overflow: clip; /* clip chứ không hidden: hidden tạo scroll container, menu sticky sẽ không dính */
  background: #f6efe8;
  font-family: 'Lexend Deca', sans-serif;
  color: #3b2a22;
}
@media (min-width: 768px) {
  .np { --u: calc(100cqw / 1920); }
}

.np .only-d { display: none !important; }
@media (min-width: 768px) {
  .np .only-m { display: none !important; }
  .np .only-d { display: block !important; }
}

/* lớp định vị tuyệt đối theo toạ độ PSD (inline style left/top/width/height) */
.np .a { position: absolute; display: block; box-sizing: border-box; }
.np img.a, .np .a > img { display: block; }
.np .a > img { width: 100%; height: 100%; }
.np .deco { pointer-events: none; }

/* ---- hiệu ứng (lấy từ landing) ---- */
.np .fx { transition: filter .25s ease, scale .25s ease; }
.np a.fx { color: inherit; }
.np .fx-inner { position: relative; width: 100%; height: 100%; }
.np .fx-hover-bright:hover { filter: brightness(1.2); }
.np .fx .fx-hl { opacity: 0; transition: opacity .25s ease; }
.np .fx:hover .fx-hl { opacity: 1; }
.np .fx-hover-scale:hover { scale: 1.06; }
@media (prefers-reduced-motion: reduce) {
  .np .fx, .np .fx * { transition: none !important; }
}

/* ---- menu ---- */
.offcanvas-content > .icon::after { background-image: none; }
.np-sticky { position: sticky; top: 0; height: 0; z-index: 50; }
.np-nav { left: 0; top: 0; width: calc(1920 * var(--u)); height: calc(103 * var(--u)); }
.np-nav .nav-item { transition: filter .2s ease; }
.np-nav .nav-item:hover, .np-nav .nav-item.is-active { filter: brightness(1.25) drop-shadow(0 0 calc(6 * var(--u)) rgba(255, 210, 120, .8)); }

/* Màn hình hẹp không đủ lề cho thanh tải game nổi bên phải. */
@media (max-width: 1023px) {
  .block-float { display: none; }
}

/* Chừa chỗ cho nút đóng trailer cả khi màn hình nằm ngang. */
.wmodal-content.youtube { width: min(90vw, calc((100dvh - 56px) * 16 / 9)); }

/* ---- KV ---- */
.np-kv { position: relative; height: calc(1025 * var(--u)); }
@media (min-width: 768px) {
  .np-kv { height: calc(814 * var(--u)); }
}
.np-kv .np-play { padding: 0; border: 0; background: none; cursor: pointer; transition: scale .2s; }
.np-kv .np-play:hover { scale: 1.08; }
.np-kv .np-play > img { animation: np-pulse 2.4s ease-in-out infinite; }

/* KV: fade-in khi tải trang */
.np-intro > div { animation: np-fade 1.2s ease both; }
/* tiêu đề: vệt sáng vàng lướt qua định kỳ, mask theo chính ảnh chữ (--mask) */
.np-shine { overflow: hidden; -webkit-mask: var(--mask) center / 100% 100% no-repeat; mask: var(--mask) center / 100% 100% no-repeat; }
.np-shine > img { filter: drop-shadow(0 0 calc(6 * var(--u)) rgba(255, 90, 40, .45)); }
.np-shine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; translate: -120% 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 236, 170, .85) 50%, transparent 65%);
  animation: np-shine 4.5s ease-in-out 1.2s infinite;
}
/* parallax KV desktop (web.js đặt --px / --py) */
.np-par { translate: var(--px, 0) var(--py, 0); transition: translate .6s cubic-bezier(.2, .7, .2, 1); will-change: translate; }
/* hạt sáng */
.np-particles { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

@keyframes np-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes np-shine { 0% { translate: -120% 0; } 45%, 100% { translate: 120% 0; } }
@keyframes np-pulse { 50% { scale: 1.06; filter: drop-shadow(0 0 calc(18 * var(--u)) rgba(255, 120, 60, .8)); } }

@media (prefers-reduced-motion: reduce) {
  .np-intro > div, .np-shine::after, .np-kv .np-play > img { animation: none !important; }
  .np-par { translate: none; }
  .np-particles { display: none; }
}

/* ---- thân trang ---- */
.np-main {
  position: relative;
  z-index: 2;
  width: calc(682 * var(--u));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.np-side, .np-body { display: contents; }
.np-b03 { order: 1; }
.np-sup { order: 2; margin-top: calc(6 * var(--u)); }
.np-panel { order: 3; margin-top: calc(6 * var(--u)); }
.np-events { order: 4; margin-top: calc(10 * var(--u)); }

@media (min-width: 768px) {
  .np-main {
    width: calc(1173 * var(--u));
    display: grid;
    grid-template-columns: calc(272 * var(--u)) calc(886 * var(--u));
    column-gap: calc(15 * var(--u));
    align-items: start;
  }
  .np-side, .np-body { display: flex; flex-direction: column; }
  .np-side { margin-top: calc(6 * var(--u)); gap: calc(16 * var(--u)); position: sticky; top: calc(110 * var(--u)); }
  .np-body { gap: calc(9 * var(--u)); }
  .np-sup, .np-panel { margin-top: 0; }
}

/* khối tải game (desktop, cột trái) */
.np-dl { position: relative; width: calc(272 * var(--u)); height: calc(542 * var(--u)); }
.np-dl .txt { position: absolute; white-space: pre; color: #fff; }

/* hàng nút Giftcode / Cộng Đồng / Nạp Thẻ / Chơi Ngay */
.np-b03 { display: grid; grid-template-columns: repeat(2, 1fr); align-items: end; width: calc(678 * var(--u)); }
.np-b03 a { display: block; }
.np-b03 img { display: block; width: 100%; height: auto; }
@media (min-width: 768px) {
  .np-b03 { grid-template-columns: repeat(4, 1fr); width: 100%; height: calc(94 * var(--u)); }
}

/* 4 ô hỗ trợ: mobile 1 hàng 4 ô, desktop 2x2 dưới khối tải game */
.np-sup { display: grid; grid-template-columns: repeat(4, 1fr); }
.np-sup a { display: block; }
.np-sup img { display: block; width: 100%; height: auto; }
@media (min-width: 768px) {
  .np-sup { grid-template-columns: repeat(2, 1fr); }
}

/* 3 thẻ sự kiện (mobile) - sprite 3 ô như landing */
.np-events { display: grid; grid-template-columns: repeat(3, 1fr); width: calc(678 * var(--u)); aspect-ratio: 678 / 452; }
.np-events a { display: block; background: url('../home/assets/btn-event.png') no-repeat; background-size: 300% 100%; transition: filter .36s ease; }
.np-events a:hover { filter: brightness(110%); }
.np-events a:nth-child(1) { background-position: 0 0; }
.np-events a:nth-child(2) { background-position: 50% 0; }
.np-events a:nth-child(3) { background-position: 100% 0; }

/* ---- khung nội dung (khung trắng "Tin Tức Đặc Sắc" của landing) ---- */
.np-panel {
  position: relative;
  background: #fff;
  min-height: calc(900 * var(--u));
  padding: calc(64 * var(--u)) calc(30 * var(--u)) calc(40 * var(--u));
  box-sizing: border-box;
  font-size: max(14px, calc(26 * var(--u)));
  line-height: 1.6;
}
@media (min-width: 768px) {
  .np-panel {
    min-height: calc(724 * var(--u));
    padding: calc(64 * var(--u)) calc(48 * var(--u)) calc(48 * var(--u));
    font-size: max(14px, calc(17 * var(--u)));
  }
}
.np-tab {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  height: calc(46 * var(--u));
  line-height: calc(46 * var(--u));
  padding: 0 calc(48 * var(--u)) 0 calc(16 * var(--u));
  background: #000;
  clip-path: polygon(0 0, 100% 0, calc(100% - 18 * var(--u)) 100%, 0 100%);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: max(13px, calc(24 * var(--u)));
  letter-spacing: .025em;
  color: #fff;
  white-space: nowrap;
  max-width: 85%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 768px) {
  .np-tab {
    height: calc(38 * var(--u));
    line-height: calc(38 * var(--u));
    padding: 0 calc(40 * var(--u)) 0 calc(12 * var(--u));
    font-size: max(12px, calc(17 * var(--u)));
  }
}

.np-crumb { font-size: .85em; color: #8a7466; margin: 0 0 .9em; }
.np-crumb a { color: inherit; text-decoration: none; }
.np-crumb a:hover { color: var(--np-red); }
.np-crumb span { margin: 0 .4em; opacity: .6; }

.np-title {
  margin: 0;
  font-family: 'i Ciel Bree Serif', serif;
  font-weight: 400;
  font-size: 1.75em;
  line-height: 1.25;
  color: var(--np-red);
}
.np-date { margin: .5em 0 0; font-size: .85em; color: #8a7466; }
.np-sep {
  height: calc(4 * var(--u));
  margin: 1em 0 1.25em;
  background: url('../home/assets/shape-2-2.png') no-repeat left center / auto 100%;
}

/* nội dung bài viết từ CMS (CKEditor) */
/* break-word chứ không anywhere: anywhere bẻ cả chữ trong ô bảng ("Ngà|y") */
.np-article { overflow-wrap: break-word; }
.np-article img, .np-article video, .np-article iframe { max-width: 100%; height: auto; }
.np-article iframe { aspect-ratio: 16 / 9; width: 100%; }
.np-article table { max-width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.np-article td, .np-article th { border: 1px solid #e3d6c8; padding: .35em .6em; }
.np-article a { color: var(--np-red); }
.np-article h1, .np-article h2, .np-article h3, .np-article h4 { color: var(--np-dark); line-height: 1.3; }

/* danh sách bài viết */
.np-list { list-style: none; margin: 0; padding: 0; }
.np-list li { border-bottom: 1px dashed #e3d6c8; }
.np-list li:last-child { border-bottom: 0; }
.np-item { display: flex; gap: 1em; align-items: center; padding: .9em 0; color: inherit; text-decoration: none; }
.np-item:hover .np-item-title { color: var(--np-red); }
.np-thumb {
  flex: none;
  width: calc(200 * var(--u));
  aspect-ratio: 16 / 9;
  background: #f3e9dd;
  overflow: hidden;
}
@media (min-width: 768px) {
  .np-thumb { width: calc(168 * var(--u)); }
}
.np-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale .3s ease; }
.np-item:hover .np-thumb img { scale: 1.06; }
.np-thumb img.is-fallback { object-fit: contain; padding: 4%; box-sizing: border-box; }
.np-item-body { min-width: 0; flex: 1; }
.np-item-title {
  margin: 0;
  font-weight: 400;
  font-size: 1.05em;
  color: var(--np-dark);
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np-item-excerpt {
  margin: .25em 0 0;
  font-size: .85em;
  color: #6b5a50;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np-item-date { flex: none; font-size: .8em; color: #8a7466; white-space: nowrap; }
.np-item-body .np-item-date { display: block; margin-top: .3em; }
.np-empty { padding: 2em 0; text-align: center; color: #8a7466; }
.np-empty a { color: var(--np-red); }

/* tin liên quan (trang bài viết) */
.np-related { margin-top: 2em; }
.np-related h3 {
  margin: 0 0 .4em;
  font-family: 'i Ciel Bree Serif', serif;
  font-weight: 400;
  font-size: 1.3em;
  color: var(--np-red);
}
.np-related .np-item { padding: .55em 0; }

/* phân trang */
.np-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: .4em; margin-top: 1.5em; }
.np-pager a, .np-pager span {
  min-width: 2.2em;
  height: 2.2em;
  line-height: 2.2em;
  padding: 0 .5em;
  box-sizing: border-box;
  text-align: center;
  font-size: .9em;
  text-decoration: none;
  color: var(--np-dark);
  border: 1px solid #e3d6c8;
}
.np-pager a:hover { border-color: var(--np-red); color: var(--np-red); }
.np-pager .is-on { background: var(--np-red); border-color: var(--np-red); color: #fff; }
.np-pager .is-off { opacity: .4; }

/* ---- footer ---- */
.np-foot { position: relative; margin-top: calc(80 * var(--u)); }
@media (min-width: 768px) {
  .np-foot { margin-top: calc(120 * var(--u)); }
}
