/* 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; }
/* align-items: stretch để cột phải cao bằng bài viết — nhờ vậy menu gim đi theo suốt trang. */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: stretch; }
.col-side { display: grid; align-content: start; gap: 16px; min-width: 0; }
.side-sticky { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 94px); }
.side-ads { flex: 0 0 auto; 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-click { cursor: pointer; }
.ad-slot.ad-click:hover { border-color: var(--primary); }
.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; }

/* Danh sách chương dùng chung cho menu bên phải và menu dưới bài */
.chap-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chap-items a { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.chap-items a:hover { background: #eff3fb; text-decoration: none; }
.chap-n { flex: none; min-width: 22px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.chap-t { min-width: 0; }
.chap-items.plain a { padding-left: 12px; }
.chap-items li.cur > a { background: #e9f1fe; color: var(--primary-dark); font-weight: 750; }
.chap-items li.cur .chap-n { color: var(--primary); }

/* Menu chương gim bên phải (máy tính) */
.side-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; overflow: hidden; }
.side-toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.side-toc-head span { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--ink-2); }
.side-toc-head b { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.side-toc-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px 8px 10px; }

/* Menu chương đặt ngay dưới nội dung mỗi chương (điện thoại) */
.chap-jump { margin: 20px 0 0; }
.chap-list { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fbfcfe; }
.chap-list summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.chap-list summary::-webkit-details-marker { display: none; }
.chap-list summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.chap-list[open] summary::before { transform: rotate(90deg); }
.chap-list-body { margin-top: 8px; max-height: 340px; overflow: auto; }
.chap-list .chap-items { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.chap-nav { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin: 14px 0 0; }
.chap-nav .btn { justify-content: center; max-width: 100%; }
.chap-nav .chap-prev, .chap-nav .chap-done { flex: 1 1 200px; }
.chap-nav .chap-next { flex: 1 1 260px; font-size: 16px; padding: 12px 18px; }
.chap-gap { flex: 1 1 200px; }
.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); }
  .side-sticky { position: static; max-height: none; }
  .side-toc { display: none; }
  .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}

/* Video YouTube nhúng trong bài — bấm mới nạp trình phát */
.video-embed{margin:20px 0;position:relative;aspect-ratio:16/9;border-radius:12px;overflow:hidden;background:#0f172a}
.video-embed img,.video-embed iframe{width:100%;height:100%;display:block;border:0;object-fit:cover}
.video-play{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:none;cursor:pointer}
.video-btn{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:68px;height:48px;border-radius:12px;
  background:rgba(15,23,42,.78);transition:background .15s}
.video-btn::after{content:"";position:absolute;left:50%;top:50%;transform:translate(-40%,-50%);border-style:solid;
  border-width:10px 0 10px 17px;border-color:transparent transparent transparent #fff}
.video-play:hover .video-btn{background:#e11d48}
.video-embed noscript a{position:absolute;left:12px;bottom:12px;color:#fff;font-size:13px}

/* Trang chương: giữ khoảng cách đều giữa các khối dù chương 2 trở đi không có ảnh bìa và lời dẫn */
.post-intro { color: var(--ink-2); }
.post > .ad-slot:first-of-type { margin-top: 16px; }
@media (max-width: 720px) {
  .chap-nav { flex-direction: column; }
  .chap-nav .btn { flex: none; width: 100%; }
  .chap-gap { display: none; }
  .chap-list .chap-items { grid-template-columns: 1fr; }
}

/* Trang tĩnh (About, Contact, Privacy Policy…) + biểu mẫu liên hệ */
.static-page .page-body h2 { margin: 28px 0 10px; font-size: 20px; }
.static-page .page-body ul, .static-page .page-body ol { padding-left: 22px; }
.static-page .page-body li { margin-bottom: 6px; }
.static-page .page-body .muted { color: var(--muted); font-size: 14.5px; }
.contact-form { display: grid; gap: 12px; margin: 16px 0 4px; background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.contact-form label { display: grid; gap: 5px; font-weight: 600; font-size: 14.5px; }
.contact-form input, .contact-form textarea { font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.contact-form .cf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.contact-form .cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form button { justify-self: start; }
.note { border-radius: 12px; padding: 12px 16px; margin: 16px 0; border: 1px solid var(--line); }
.note.ok { background: #eefbf3; border-color: #bfe8d0; }
.note.bad { background: #fdf0f0; border-color: #f3c9c9; }
.note p { margin: 4px 0 0; }
