/* ==========================================================================
   NLICT Review — main.css
   Bảng màu: mực chàm (ink) + vàng nghệ (brand) + đỏ giá (hot)
   Chữ:  Bitter (tiêu đề) / Be Vietnam Pro (nội dung) / JetBrains Mono (số liệu)
   ========================================================================== */

:root {
  --ink:        #16233d;
  --ink-2:      #2c3e63;
  --ink-soft:   #55617a;
  --muted:      #7b869b;
  --paper:      #ffffff;
  --surface:    #f4f6f9;
  --surface-2:  #eef1f6;
  --line:       #dfe4ec;
  --brand:      #f2b705;
  --brand-deep: #c99400;
  --hot:        #e03131;
  --good:       #12805c;

  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 1px 2px rgba(22,35,61,.06), 0 8px 24px -12px rgba(22,35,61,.18);
  --shadow-lg:  0 2px 4px rgba(22,35,61,.06), 0 18px 40px -18px rgba(22,35,61,.28);

  --font-display: "Bitter", Georgia, serif;
  --font-body:    "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --wrap:       1180px;
  --gap:        28px;
  --col-side:   320px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
  color: var(--ink);
}

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.nl-skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 0 0 8px 0;
}
.nl-skip:focus { left: 0; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---------- Layout ---------- */
.nl-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.nl-main { padding: 28px 0 56px; }

.nl-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--col-side);
  gap: var(--gap);
  align-items: start;
}

.nl-side { position: sticky; top: 88px; display: grid; gap: 18px; }

/* ---------- Topbar ---------- */
.nl-topbar {
  background: var(--ink);
  color: #e9edf5;
  font-size: 13.5px;
}
.nl-topbar__in {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 38px; text-align: center; flex-wrap: wrap;
}
.nl-topbar__tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  background: var(--brand); color: var(--ink);
  padding: 3px 8px; border-radius: 4px;
}
.nl-topbar a { color: var(--brand); font-weight: 600; }
.nl-topbar a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.nl-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.nl-header__in {
  display: flex; align-items: center; gap: 20px;
  min-height: 68px;
}

.nl-logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.nl-logo__mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ink); color: var(--brand);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 15px;
}
.nl-logo__text { display: grid; line-height: 1.1; }
.nl-logo__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.nl-logo__sub {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}

.nl-search { flex: 1; max-width: 460px; position: relative; }
.nl-search input[type="search"] {
  width: 100%; height: 42px; padding: 0 44px 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: 14.5px;
}
.nl-search input::placeholder { color: var(--muted); }
.nl-search input:focus { background: #fff; border-color: var(--ink-2); }
.nl-search button {
  position: absolute; right: 4px; top: 4px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--ink); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}

.nl-header__nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nl-header__nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nl-header__nav a { font-size: 14.5px; font-weight: 500; color: var(--ink-soft); }
.nl-header__nav a:hover { color: var(--ink); }

.nl-burger {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  background: var(--paper); border-radius: var(--radius); cursor: pointer;
}
.nl-burger span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px auto; }

/* ---------- Chip nav ---------- */
.nl-chipnav { background: var(--paper); border-bottom: 1px solid var(--line); }
.nl-chipnav__in {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
  scrollbar-width: none;
}
.nl-chipnav__in::-webkit-scrollbar { display: none; }
.nl-chip {
  flex: none; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  white-space: nowrap;
}
.nl-chip:hover, .nl-chip--on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Section header (signature: thước timeline) ---------- */
.nl-sechead { display: flex; align-items: flex-end; gap: 16px; margin: 0 0 18px; }
.nl-sechead__txt { flex: none; }
.nl-eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--brand-deep);
  display: block; margin-bottom: 2px;
}
.nl-sechead h2 { font-size: 22px; margin: 0; }
.nl-sechead__rule {
  flex: 1; height: 14px; align-self: center; margin-bottom: 2px;
  background-image:
    linear-gradient(var(--line), var(--line)),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px);
  background-size: 100% 1px, 100% 7px;
  background-position: 0 100%, 0 100%;
  background-repeat: no-repeat, repeat-x;
}
.nl-sechead__link { flex: none; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.nl-sechead__link:hover { color: var(--brand-deep); }

/* ---------- Hero (front page) ---------- */
.nl-hero {
  background: var(--ink);
  color: #fff;
  padding: 54px 0 46px;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 1px, transparent 1px 42px);
}
.nl-hero h1 {
  color: #fff; font-size: clamp(28px, 4.4vw, 46px); max-width: 17ch; margin: 0 0 14px;
}
.nl-hero h1 em { font-style: normal; color: var(--brand); }
.nl-hero p { color: #c3cddf; font-size: 16.5px; max-width: 56ch; margin: 0 0 24px; }
.nl-hero__bar { display: flex; gap: 10px; flex-wrap: wrap; max-width: 620px; }
.nl-hero__bar input {
  flex: 1; min-width: 220px; height: 50px; padding: 0 18px;
  border-radius: var(--radius); border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #fff; font-family: var(--font-body); font-size: 15px;
}
.nl-hero__bar input::placeholder { color: #8fa0bd; }
.nl-hero__tags { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nl-hero__tags span {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: #8fa0bd; margin-right: 4px;
}
.nl-hero__tags a {
  font-size: 13px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22); color: #dbe3f0;
}
.nl-hero__tags a:hover { background: var(--brand); border-color: var(--brand); color: var(--ink); }

/* ---------- Buttons ---------- */
.nl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 24px; border: 0; border-radius: var(--radius);
  background: var(--brand); color: var(--ink);
  font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nl-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(242,183,5,.9); }
.nl-btn--ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
}
.nl-btn--ghost:hover { background: var(--paper); box-shadow: var(--shadow); }
.nl-btn--block { width: 100%; }
.nl-btn--sm { height: 38px; padding: 0 16px; font-size: 13.5px; }

.nl-more { display: flex; justify-content: center; margin: 28px 0 8px; }

/* ---------- Panel ---------- */
.nl-panel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
}
.nl-panel--flat { padding: 0; overflow: hidden; }

/* ---------- Card: bài nổi bật ---------- */
.nl-feat { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.nl-feat__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.nl-feat__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.nl-feat:hover .nl-feat__media img { transform: scale(1.03); }
.nl-feat__body { padding: 18px 22px 22px; }
.nl-feat__body h3 { font-size: 24px; margin: 0 0 8px; }
.nl-feat:hover .nl-feat__body h3 { color: var(--ink-2); }
.nl-feat__excerpt { color: var(--ink-soft); font-size: 15px; margin: 0 0 12px; }

/* ---------- Card: list ngang ---------- */
.nl-list { display: grid; }
.nl-item {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 18px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.nl-item:last-child { border-bottom: 0; }
.nl-item__media {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
}
.nl-item__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.nl-item:hover .nl-item__media img { transform: scale(1.04); }
.nl-item__body { display: flex; flex-direction: column; justify-content: center; }
.nl-item__body h3 { font-size: 17.5px; line-height: 1.35; margin: 0 0 6px; }
.nl-item:hover .nl-item__body h3 { color: var(--ink-2); }
.nl-item__excerpt {
  color: var(--ink-soft); font-size: 14.5px; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Meta ---------- */
.nl-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase;
}
.nl-meta__cat { color: var(--brand-deep); font-weight: 700; }
.nl-meta__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* Điểm review — chip mono trên ảnh (signature) */
.nl-score {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: baseline; gap: 3px;
  font-family: var(--font-mono); font-weight: 700;
  background: rgba(22,35,61,.92); color: #fff;
  padding: 5px 10px; border-radius: 6px;
  border-left: 3px solid var(--brand);
}
.nl-score b { font-size: 15px; line-height: 1; }
.nl-score i { font-style: normal; font-size: 10px; opacity: .65; }

.nl-badge {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  background: var(--brand); color: var(--ink);
  padding: 4px 8px; border-radius: 4px;
}

/* ---------- Lối vào chuyên mục (front page) ---------- */
.nl-lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.nl-lane {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; display: grid; gap: 8px; align-content: start;
  transition: border-color .2s ease, transform .2s ease;
}
.nl-lane:hover { border-color: var(--ink); transform: translateY(-2px); }
.nl-lane__no {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; color: var(--brand-deep);
}
.nl-lane h3 { font-size: 19px; margin: 0; }
.nl-lane p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.nl-lane__go { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }

/* ---------- Tiles chủ đề ---------- */
.nl-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.nl-tile {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 16 / 10; background: var(--ink-2); color: #fff;
  display: flex; align-items: flex-end; padding: 16px;
}
.nl-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.nl-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,35,61,0) 30%, rgba(22,35,61,.92) 100%);
}
.nl-tile__txt { position: relative; z-index: 2; }
.nl-tile__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.nl-tile__count { font-family: var(--font-mono); font-size: 11px; color: #c3cddf; }
.nl-tile:hover img { opacity: .72; }

/* ---------- Sidebar ---------- */
.nl-side__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.nl-side__head h3 { font-size: 15px; margin: 0; }
.nl-side__head .nl-eyebrow { margin: 0; }
.nl-side__body { padding: 16px 18px; }

.nl-rank { list-style: none; margin: 0; padding: 0; display: grid; }
.nl-rank li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.nl-rank li:last-child { border-bottom: 0; }
.nl-rank__no { font-family: var(--font-mono); font-weight: 700; color: var(--brand-deep); font-size: 14px; }
.nl-rank a { font-size: 14.5px; font-weight: 500; line-height: 1.4; }
.nl-rank a:hover { color: var(--ink-2); }

.nl-note {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 14px 16px; background: var(--surface); color: var(--ink-soft); font-size: 13.5px;
}
.nl-note code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }

/* ---------- Thẻ sản phẩm affiliate (markup do plugin nlict-aff-core xuất) ---------- */
.nl-prods {
  display: grid; grid-auto-flow: column; grid-auto-columns: 208px;
  gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 12px; scrollbar-width: thin;
}
.nl-prods > * { scroll-snap-align: start; }
.nl-prods--side { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }

.nl-prod {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; gap: 8px;
}
.nl-prod:hover { border-color: var(--ink-2); box-shadow: var(--shadow); }
.nl-prod__media { aspect-ratio: 1 / 1; background: var(--surface); border-radius: 6px; overflow: hidden; }
.nl-prod__media img { width: 100%; height: 100%; object-fit: contain; }
.nl-prod__flag {
  position: absolute; left: 8px; top: 8px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--hot); color: #fff; padding: 3px 7px; border-radius: 4px;
}
.nl-prod__name {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nl-prod__spec { font-size: 12px; color: var(--muted); line-height: 1.5; }
.nl-prod__price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.nl-prod__now { font-family: var(--font-mono); font-weight: 700; font-size: 15.5px; color: var(--hot); }
.nl-prod__was { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.nl-prod__off {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--hot); background: #fdecec; padding: 1px 5px; border-radius: 4px;
}
.nl-prod__tag { font-size: 11.5px; color: var(--good); font-weight: 600; }

/* ---------- Footer ---------- */
.nl-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 40px 0 0; }
.nl-footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-bottom: 32px; }
.nl-footer h4 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
}
.nl-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.nl-footer a { font-size: 14.5px; color: var(--ink-soft); }
.nl-footer a:hover { color: var(--ink); }
.nl-footer__about { font-size: 14.5px; color: var(--ink-soft); max-width: 38ch; }
.nl-footer__bar {
  border-top: 1px solid var(--line); padding: 16px 0 28px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.nl-disclosure {
  background: var(--surface); border-radius: var(--radius); padding: 12px 16px;
  font-size: 13px; color: var(--ink-soft); margin-bottom: 24px;
}
.nl-disclosure b { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  :root { --col-side: 280px; }
  .nl-item { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .nl-cols { grid-template-columns: minmax(0, 1fr); }
  .nl-side { position: static; }
  .nl-lanes { grid-template-columns: 1fr; }
  .nl-tiles { grid-template-columns: repeat(2, 1fr); }
  .nl-footer__cols { grid-template-columns: 1fr 1fr; }
  .nl-header__nav ul { display: none; }
  .nl-burger { display: block; }
  .nl-header__nav.is-open ul {
    display: grid; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 12px 20px; gap: 4px; box-shadow: var(--shadow);
  }
  .nl-header__nav.is-open ul a { display: block; padding: 8px 0; }
}

@media (max-width: 640px) {
  .nl-header__in { flex-wrap: wrap; min-height: 0; padding: 12px 0; gap: 12px; }
  .nl-search { order: 3; flex-basis: 100%; max-width: none; }
  .nl-item { grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
  .nl-item__body h3 { font-size: 15.5px; }
  .nl-item__excerpt { display: none; }
  .nl-feat__body h3 { font-size: 20px; }
  .nl-tiles { grid-template-columns: 1fr; }
  .nl-footer__cols { grid-template-columns: 1fr; }
  .nl-hero { padding: 36px 0 32px; }
}

/* ==========================================================================
   Trang bài viết đơn
   ========================================================================== */

/* Thanh tiến độ đọc — mảnh, chạy dọc mép trên header */
.nl-progress {
  position: fixed; left: 0; top: 0; height: 3px; width: 0;
  background: var(--brand); z-index: 60; transition: width .1s linear;
}

.nl-article {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px 34px 30px;
}

/* Breadcrumb */
.nl-crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  color: var(--muted); margin-bottom: 16px;
}
.nl-crumbs a { color: var(--ink-soft); }
.nl-crumbs a:hover { color: var(--brand-deep); }
.nl-crumbs__now {
  max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Đầu bài */
.nl-article__head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 22px; }
.nl-article__head h1 {
  font-size: clamp(26px, 3.4vw, 36px); margin: 6px 0 12px; letter-spacing: -.02em;
}
a.nl-eyebrow:hover { color: var(--ink); }
.nl-article__lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 18px; max-width: 62ch; }

.nl-article__by { display: flex; align-items: center; gap: 12px; }
.nl-article__by img { border-radius: 50%; flex: none; }
.nl-article__author { font-weight: 600; font-size: 14.5px; display: block; }

.nl-article__score {
  margin-left: auto; text-align: center; flex: none;
  border-left: 3px solid var(--brand); background: var(--surface);
  border-radius: 8px; padding: 8px 14px;
  font-family: var(--font-mono);
}
.nl-article__score b { font-size: 22px; line-height: 1; }
.nl-article__score i { font-style: normal; font-size: 11px; color: var(--muted); }
.nl-article__score span {
  display: block; font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin-top: 2px;
}

/* Ảnh bìa */
.nl-article__cover { margin: 0 0 24px; }
.nl-article__cover img { width: 100%; border-radius: var(--radius); }
.nl-article__cover figcaption {
  font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center;
}

/* Mục lục */
.nl-toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 28px;
}
.nl-toc__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.nl-toc__toggle {
  border: 0; background: none; cursor: pointer; color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; padding: 2px 4px;
}
.nl-toc__toggle:hover { color: var(--brand-deep); }
.nl-toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nl-toc__list[hidden] { display: none; }
.nl-toc__item a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 5px 0; font-size: 14.5px; color: var(--ink-soft); line-height: 1.45;
}
.nl-toc__item a:hover { color: var(--ink); }
.nl-toc__item--h3 { padding-left: 26px; }
.nl-toc__item--h3 a { font-size: 13.5px; color: var(--muted); }
.nl-toc__no {
  font-family: var(--font-mono); font-weight: 700; font-size: 12px;
  color: var(--brand-deep); min-width: 16px; flex: none;
}
.nl-toc__item.is-current > a { color: var(--ink); font-weight: 600; }

/* Nội dung bài */
.nl-prose { font-size: 16.5px; line-height: 1.75; color: #23324d; counter-reset: nl-h2; }
.nl-prose > * { max-width: 68ch; }
.nl-prose > .nl-affblock,
.nl-prose > .nl-affbox,
.nl-prose > .nl-afftable-wrap,
.nl-prose > figure,
.nl-prose > .wp-block-image,
.nl-prose > table { max-width: none; }

.nl-prose p { margin: 0 0 1.15em; }
.nl-prose h2 {
  font-size: 24px; margin: 1.8em 0 .6em; scroll-margin-top: 90px;
  display: flex; align-items: baseline; gap: 12px;
}
.nl-prose h3 { font-size: 19px; margin: 1.5em 0 .5em; scroll-margin-top: 90px; }
.nl-prose h4 { font-size: 17px; margin: 1.3em 0 .4em; }

/* Số thứ tự H2 vẽ bằng bộ đếm CSS: hiện trên màn hình nhưng không
   nằm trong chữ, nên Google đọc đúng tiêu đề và trình đọc màn hình không đọc số. */
.nl-prose h2::before {
  counter-increment: nl-h2;
  content: counter(nl-h2);
  flex: none; font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--ink); background: var(--brand);
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-grid; place-items: center; line-height: 1;
  transform: translateY(-2px);
}

.nl-prose a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brand); }
.nl-prose a:hover { color: var(--brand-deep); }
.nl-prose ul, .nl-prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.nl-prose li { margin-bottom: .4em; }
.nl-prose img, .nl-prose figure img { border-radius: var(--radius); }
.nl-prose figure { margin: 1.6em 0; }
.nl-prose figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }

.nl-prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand);
  font-family: var(--font-display); font-size: 18px; color: var(--ink);
}
.nl-prose blockquote p:last-child { margin-bottom: 0; }

.nl-prose code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface); padding: 2px 6px; border-radius: 4px;
}
.nl-prose pre {
  background: var(--ink); color: #e9edf5; padding: 18px 20px;
  border-radius: var(--radius); overflow-x: auto; font-size: 13.5px;
}
.nl-prose pre code { background: none; padding: 0; color: inherit; }

.nl-prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 15px; }
.nl-prose th, .nl-prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.nl-prose th { background: var(--surface); font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.nl-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Cuối bài */
.nl-article__foot {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.nl-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.nl-tags a {
  font-size: 12.5px; padding: 4px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
.nl-tags a:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.nl-share { display: flex; align-items: center; gap: 8px; }
.nl-share .nl-eyebrow { margin: 0 4px 0 0; }
.nl-share__btn {
  font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer;
}
.nl-share__btn:hover { border-color: var(--ink); color: var(--ink); }
.nl-share__btn.is-done { background: var(--good); border-color: var(--good); color: #fff; }

/* Hộp tác giả */
.nl-author {
  display: flex; gap: 16px; margin-top: 24px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.nl-author img { border-radius: 50%; flex: none; }
.nl-author h3 { font-size: 17px; margin: 2px 0 6px; }
.nl-author p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* Bài liên quan */
.nl-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 10px; }
.nl-rel__media {
  display: block; position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; background: var(--surface-2); margin-bottom: 10px;
}
.nl-rel__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.nl-rel:hover .nl-rel__media img { transform: scale(1.04); }
.nl-rel h3 { font-size: 15.5px; line-height: 1.4; margin: 0 0 6px; }
.nl-rel:hover h3 { color: var(--ink-2); }

/* Bình luận */
.nl-comments { margin-top: 34px; }
.nl-commentlist { list-style: none; margin: 0 0 24px; padding: 0; }
.nl-commentlist .children { list-style: none; padding-left: 28px; }
.nl-commentlist .comment-body {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
}
.nl-comments__title { font-size: 18px; margin: 22px 0 10px; }
.nl-comments .comment-form-comment textarea,
.nl-comments input[type="text"], .nl-comments input[type="email"], .nl-comments input[type="url"] {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; font-family: var(--font-body); font-size: 15px; background: var(--paper);
}
.nl-comments .form-submit input { cursor: pointer; }

/* 404 */
.nl-404 { text-align: center; padding: 56px 24px; }
.nl-404 h1 { font-size: 28px; margin: 6px 0 10px; }
.nl-404 p { color: var(--ink-soft); }
.nl-404 .nl-search { margin: 18px auto; }

/* Phân trang */
.nl-pagination, .pagination { margin: 28px 0 0; }
.nl-pagination .nav-links, .pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.nl-pagination .page-numbers, .pagination .page-numbers {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
}
.nl-pagination .page-numbers.current, .pagination .page-numbers.current {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.nl-pagination a.page-numbers:hover, .pagination a.page-numbers:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 900px) {
  .nl-related { grid-template-columns: 1fr 1fr; }
  .nl-related > :last-child { display: none; }
}

@media (max-width: 640px) {
  .nl-article { padding: 20px 18px 24px; border-radius: var(--radius); }
  .nl-prose { font-size: 16px; }
  .nl-prose h2 { font-size: 21px; gap: 10px; }
  .nl-prose h2::before { width: 26px; height: 26px; font-size: 13px; }
  .nl-related { grid-template-columns: 1fr; }
  .nl-related > :last-child { display: block; }
  .nl-article__by { flex-wrap: wrap; }
  .nl-article__score { margin-left: 0; }
  .nl-article__foot { flex-direction: column; align-items: flex-start; }
}
