/* LNT Portal — giao diện trang đọc: sáng, sạch, đọc tốt trên điện thoại. */
:root {
  --ink: #14181f; --ink-2: #3d4657; --muted: #6b7488; --line: #e6e9f0; --bg: #f6f7fb; --surface: #fff;
  --primary: #1f6feb; --primary-dark: #1657bd; --ok: #128a4b; --warn: #b2650a; --radius: 14px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 750; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #cfd6e4; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }

/* Header */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.head-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text small { color: var(--muted); font-size: 12px; }
.site-nav { display: flex; gap: 4px; flex: 1; overflow: auto; }
.site-nav a { padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
.site-nav a:hover { background: #f0f3f9; text-decoration: none; }
.site-search { display: flex; gap: 4px; }
.site-search input { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px; width: 190px; background: var(--bg); }
.site-search button { border: 0; background: none; cursor: pointer; font-size: 16px; }
.menu-btn { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; font-size: 18px; padding: 4px 10px; cursor: pointer; }

/* Bố cục */
main.wrap { padding-top: 22px; padding-bottom: 40px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.col-side { position: sticky; top: 80px; display: grid; gap: 16px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card-img { display: block; aspect-ratio: 16/9; background: #eef1f7; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .noimg { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; font-weight: 800; color: #c3cbdb; }
.card-img.img-failed { background: linear-gradient(135deg, #eef2fa, #e3e9f6); }
figure.img-failed { display: none; }
.card-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.card-body h3 a { color: var(--ink); }
.card-body p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.chip { align-self: start; background: #eaf1ff; color: var(--primary-dark); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; }
.hero { margin-bottom: 26px; }
.hero .card-big { flex-direction: row; }
.hero .card-big .card-img { flex: 1 1 55%; aspect-ratio: auto; min-height: 280px; }
.hero .card-big .card-body { flex: 1 1 45%; align-content: center; padding: 26px; }
.hero .card-big h3 { font-size: 26px; }
.grid-ad { grid-column: 1 / -1; }
.page-head { margin-bottom: 18px; display: grid; gap: 6px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }
.empty.big h1 { font-size: 54px; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 26px 0; color: var(--muted); }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.top-list { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.top-list a { color: var(--ink); font-weight: 600; }
.top-list small { display: block; color: var(--muted); font-size: 12.5px; }

/* Bài viết */
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px 30px; box-shadow: var(--shadow); }
.crumbs { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.post h1 { margin-bottom: 10px; }
.post-parent { color: var(--ink-2); margin: 0 0 8px; }
.post-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.post-cover { margin: 0 0 18px; }
.post-cover img { width: 100%; border-radius: 12px; }
.post-intro { color: var(--ink-2); font-style: italic; border-left: 3px solid var(--primary); padding-left: 14px; margin-bottom: 18px; }
.post-body { font-size: 18px; }
.post-body h2 { margin: 26px 0 10px; }
.post-body h3 { margin: 22px 0 8px; font-size: 19px; }
.post-body img { border-radius: 10px; }
.post-body blockquote { margin: 18px 0; padding: 4px 18px; border-left: 3px solid var(--line); color: var(--ink-2); }

/* Nút “Xem thêm” + quảng cáo hiện khi bấm */
.reveal-zone { position: relative; }
.reveal-fade { height: 110px; margin-top: -110px; position: relative; z-index: 1; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 85%); pointer-events: none; }
/* Quảng cáo trong phần mồi phải nổi lên trên lớp mờ (không bị làm nhạt → vẫn tính là hiển thị hợp lệ) */
#postBody .ad-slot { position: relative; z-index: 2; background: var(--card, #fff); }
.reveal-box { text-align: center; padding: 6px 0 26px; display: grid; gap: 10px; justify-items: center; }
.reveal-note { margin: 0; color: var(--muted); font-size: 14.5px; }
.reveal-btn { font: inherit; font-weight: 800; font-size: 17px; color: #fff; background: var(--primary); border: 0; border-radius: 12px;
  padding: 14px 34px; cursor: pointer; box-shadow: 0 6px 18px rgba(31,111,235,.28); display: inline-flex; gap: 10px; align-items: center; }
.reveal-btn:hover { background: var(--primary-dark); }
.reveal-btn span { transition: transform .2s; }
.reveal-btn:hover span { transform: translateY(2px); }
.reveal-btn.loading { opacity: .7; cursor: progress; }
.reveal-ad:not(:empty) { margin: 8px 0 18px; }

/* Khối quảng cáo */
.ad-slot { margin: 22px 0; text-align: center; background: #fbfcfe; border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }
.ad-slot .ad-label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9aa3b5; margin-bottom: 6px; }
.ad-slot .ad-body { min-height: 1px; }
.ad-slot.ad-sidebar { margin: 0; }
.sticky-ad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding: 6px 10px; }
.sticky-ad .ad-slot { margin: 0; border: 0; padding: 0; background: none; }
.sticky-x { position: absolute; top: -14px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
body.content-opened .sticky-ad { box-shadow: 0 -4px 14px rgba(16,24,40,.08); }
@media (min-width: 861px) { .ad-only-mobile { display: none; } }
@media (max-width: 860px) { .ad-only-desktop { display: none; } }

/* Điều hướng chương */
.post-after { margin-top: 26px; }
.chap-nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.chap-list { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #fbfcfe; }
.chap-list summary { cursor: pointer; font-weight: 700; }
.chap-list ol { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.chap-list li.cur > a { font-weight: 800; color: var(--ink); }
.related { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px; }
.related h2 { margin-bottom: 14px; }

/* Chân trang */
.site-foot { background: var(--surface); border-top: 1px solid var(--line); padding: 26px 0 40px; margin-top: 30px; }
.foot-in { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.foot-links { display: flex; gap: 16px; }
.copy { color: var(--muted); font-size: 13.5px; margin-top: 18px; }

@media (max-width: 980px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; }
  .hero .card-big { flex-direction: column; }
  .hero .card-big .card-img { min-height: 200px; aspect-ratio: 16/9; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1 { font-size: 25px; }
  .post { padding: 18px 16px 24px; border-radius: 12px; }
  .post-body { font-size: 17px; }
  .menu-btn { display: block; }
  .site-nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 8px; }
  .site-nav.open { display: flex; }
  .site-search input { width: 130px; }
  .sticky-ad { padding-bottom: 8px; }
  body { padding-bottom: 70px; }
}

/* Quảng cáo hiện sẵn trước khi bấm “Xem thêm” */
#postBody > .ad-slot:last-child { margin-bottom: 0; }
.ad-article_after_first{margin:18px 0}
.ad-before_more{margin:0 0 14px}
.reveal-zone .ad-slot{margin-left:auto;margin-right:auto}
