/*
Theme Name: TopChiaSe Nhật Báo
Theme URI: https://topchiase.com
Author: TopChiaSe
Description: Theme cổng tin tức kiến thức riêng của TopChiaSe: tông navy + ngọc lục, chữ Lora/Inter, bố cục cột chính + cột phải, thanh chuyên mục.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: tcs-nhatbao
*/

:root {
  --navy: #142437;
  --navy-dk: #0b1522;
  --ink: #1b2430;
  --text: #2b3240;
  --soft: #6a7483;
  --line: #e1e6ec;
  --wash: #f2f5f8;
  --white: #fff;
  --teal: #0f7a6e;
  --teal-dk: #0b5c53;
  --f-head: 'Lora', Georgia, 'Times New Roman', serif;
  --f-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --wrap: 1200px;
  --gut: 16px;
  --side: 320px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--text); font: 400 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, video, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 700; line-height: 1.3; margin: 0; color: var(--ink); }
p { margin: 0 0 .9em; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--teal); color: #fff; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: var(--teal); color: #fff; padding: 10px 16px; }
.nb-wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; }
.nb-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Masthead ---------- */
.nb-strip { background: var(--navy); color: #c7d2dd; font-size: 12.5px; }
.nb-strip .nb-wrap { display: flex; justify-content: space-between; align-items: center; min-height: 34px; gap: 12px; }
.nb-strip ul { display: flex; gap: 16px; }
.nb-strip a { display: inline-flex; align-items: center; min-height: 34px; color: #c7d2dd; }
.nb-strip a:hover { color: #fff; }

.nb-masthead { padding: 16px 0; border-bottom: 1px solid var(--line); }
.nb-masthead .nb-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nb-logo { display: inline-flex; flex-direction: column; line-height: 1; }
.nb-logo__name { font: 700 clamp(1.7rem, 4vw, 2.3rem)/1 var(--f-head); letter-spacing: -.01em; color: var(--ink); }
.nb-logo__name em { font-style: normal; color: var(--teal); }
.nb-logo__tag { margin-top: 6px; font: 500 11px var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.nb-search { display: flex; width: min(100%, 360px); }
.nb-search input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-right: 0; background: var(--wash); font: inherit; font-size: 14px; color: var(--ink); border-radius: 20px 0 0 20px; }
.nb-search input:focus { outline: none; border-color: var(--teal); background: #fff; }
.nb-search button { display: grid; place-items: center; width: 46px; height: 40px; border: 0; background: var(--teal); color: #fff; cursor: pointer; border-radius: 0 20px 20px 0; }
.nb-search button:hover { background: var(--teal-dk); }

/* ---------- Nav ---------- */
.nb-nav { position: sticky; top: 0; z-index: 50; background: var(--navy); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.nb-nav .nb-wrap { overflow-x: auto; scrollbar-width: none; }
.nb-nav .nb-wrap::-webkit-scrollbar { display: none; }
.nb-nav ul { display: flex; white-space: nowrap; }
.nb-nav li { position: relative; }
.nb-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font: 600 13px var(--f-body); text-transform: uppercase; letter-spacing: .03em; color: #cfd9e2; }
.nb-nav a:hover, .nb-nav .current-cat > a, .nb-nav .current-menu-item > a { color: #fff; background: var(--teal); }
.nb-nav .nb-home a { padding: 0 14px; }
.nb-nav ul ul { display: none; }

/* ---------- Layout ---------- */
.nb-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 28px; padding: 22px 0 8px; align-items: start; }
.nb-main { min-width: 0; }
.nb-side { min-width: 0; }
.nb-block { margin-bottom: 26px; }
.nb-block__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--navy); flex-wrap: wrap; }
.nb-block__head h2, .nb-block__head h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .02em; padding-left: 10px; border-left: 4px solid var(--teal); line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.nb-block__head a { font-size: 12.5px; color: var(--soft); white-space: nowrap; }
.nb-block__head a:hover { color: var(--teal); }

/* ---------- Pieces ---------- */
.nb-thumb { position: relative; display: block; overflow: hidden; background: var(--wash); aspect-ratio: 3 / 2; border-radius: 6px; }
.nb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nb-ph { width: 100%; height: 100%; display: grid; place-items: center; font: 700 36px var(--f-head); color: #c3cdd6; background: var(--wash); }
.nb-cat { font: 700 11.5px/1 var(--f-body); text-transform: uppercase; letter-spacing: .05em; color: var(--teal); }
.nb-cat:hover { color: var(--teal-dk); }
.nb-meta { font-size: 12.5px; color: var(--soft); }
.nb-meta span + span::before { content: '—'; margin: 0 6px; }
.nb-ttl a:hover { color: var(--teal); }

/* Lead block */
.nb-top { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.nb-lead .nb-thumb { aspect-ratio: 16 / 10; }
.nb-lead__title { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin: 12px 0 6px; }
.nb-lead__sapo { color: var(--soft); font-size: 14.5px; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nb-stack { display: flex; flex-direction: column; }
.nb-item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.nb-stack .nb-item:first-child { padding-top: 0; }
.nb-stack .nb-item:last-child { border-bottom: 0; padding-bottom: 0; }
.nb-item__title { font-size: 14.5px; line-height: 1.4; margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nb-item .nb-thumb { align-self: start; }

/* 4-up cards */
.nb-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 18px 0 4px; }
.nb-card__title { font-size: 14.5px; line-height: 1.4; margin: 10px 0 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Category block */
.nb-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.nb-dual .nb-lead__title { font-size: 1.15rem; margin: 10px 0 4px; }
.nb-dual .nb-lead .nb-thumb { aspect-ratio: 3 / 2; }
.nb-dual .nb-stack .nb-item { grid-template-columns: 1fr 88px; }
.nb-dual .nb-stack .nb-item .nb-thumb { order: 2; }
.nb-dual .nb-stack .nb-item:first-child { padding-top: 0; }

/* List rows */
.nb-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.nb-row:first-child { padding-top: 0; }
.nb-row__title { font-size: 1.1rem; margin: 5px 0 5px; }
.nb-row__sapo { margin: 0 0 6px; color: var(--soft); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sidebar */
.nb-rank li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); counter-increment: nbr; }
.nb-rank { counter-reset: nbr; }
.nb-rank li::before { content: counter(nbr); font: 700 22px/1 var(--f-head); color: #c3cdd6; }
.nb-rank li:nth-child(-n+3)::before { color: var(--teal); }
.nb-rank li:last-child { border-bottom: 0; }
.nb-rank a { font: 600 14px/1.4 var(--f-body); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nb-rank a:hover { color: var(--teal); }
.nb-rank .nb-meta { display: block; margin-top: 2px; }
.nb-mini .nb-item { grid-template-columns: 88px 1fr; gap: 10px; padding: 10px 0; }
.nb-mini .nb-item__title { font-size: 14px; margin: 0 0 3px; -webkit-line-clamp: 3; }
.nb-mini .nb-item:first-child { padding-top: 0; }
.nb-cats li { border-bottom: 1px solid var(--line); }
.nb-cats li:last-child { border-bottom: 0; }
.nb-cats a { display: flex; justify-content: space-between; align-items: center; min-height: 40px; font: 600 14px var(--f-body); color: var(--ink); }
.nb-cats a:hover { color: var(--teal); }
.nb-cats small { color: var(--soft); font: 500 12px var(--f-body); }
.nb-cats ul { padding-left: 14px; }
.nb-sticky { position: sticky; top: 62px; }

/* Pagination / page head */
.nb-pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 0; }
.nb-pager .page-numbers { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); font: 600 14px var(--f-body); border-radius: 20px; }
.nb-pager a.page-numbers:hover { border-color: var(--teal); color: var(--teal); }
.nb-pager .current { background: var(--teal); border-color: var(--teal); color: #fff; }
.nb-pagehead { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--navy); }
.nb-pagehead h1 { font-size: 1.5rem; padding-left: 12px; border-left: 5px solid var(--teal); }
.nb-pagehead p { margin: 8px 0 0; color: var(--soft); }
.nb-empty { padding: 44px 0; text-align: center; }
.nb-empty .nb-big { font: 700 5rem/1 var(--f-head); color: var(--teal); }
.nb-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 24px; background: var(--teal); color: #fff; font: 700 14px var(--f-body); border-radius: 20px; border: 0; cursor: pointer; }
.nb-btn:hover { background: var(--teal-dk); color: #fff; }

/* ---------- Article ---------- */
.nb-crumbs { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12.5px; color: var(--soft); margin-bottom: 12px; }
.nb-crumbs a:hover { color: var(--teal); }
.nb-art__title { font-size: clamp(1.5rem, 3.4vw, 2.15rem); line-height: 1.26; margin-bottom: 12px; }
.nb-art__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 0; margin-bottom: 16px; border-block: 1px solid var(--line); font-size: 13px; color: var(--soft); }
.nb-art__cover { margin: 0 0 18px; }
.nb-art__cover img { width: 100%; border-radius: 6px; }
.nb-body { font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; color: #232a35; }
.nb-body > * { margin-top: 0; margin-bottom: 1em; }
.nb-body h2 { font-size: 1.45rem; margin: 1.5em 0 .6em; padding-left: 10px; border-left: 4px solid var(--teal); line-height: 1.3; scroll-margin-top: 64px; }
.nb-body h3 { font-size: 1.2rem; margin: 1.3em 0 .5em; scroll-margin-top: 64px; }
.nb-body a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.nb-body a:hover { color: var(--teal-dk); }
.nb-body img { margin: 1em auto; height: auto; max-width: 100%; }
.nb-body .wp-caption, .nb-body figure, .nb-body div, .nb-body p, .nb-body table { max-width: 100% !important; }
.nb-body .wp-caption, .nb-body figure { width: auto !important; margin: 1em 0; }
.nb-body .wp-caption img { width: 100%; }
.nb-body figcaption, .nb-body .wp-caption-text { font-size: 13px; color: var(--soft); text-align: center; margin-top: 4px; font-style: italic; }
.nb-body blockquote { margin: 1.2em 0; padding: 10px 16px; background: var(--wash); border-left: 4px solid var(--teal); }
.nb-body blockquote p:last-child { margin: 0; }
.nb-body ul { list-style: disc; padding-left: 1.4em; }
.nb-body ol { padding-left: 1.4em; }
.nb-body li { margin-bottom: .35em; }
.nb-body li::marker { color: var(--teal); }
.nb-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.nb-body th, .nb-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.nb-body th { background: var(--wash); }
.nb-body code, .nb-body pre { background: var(--wash); font: .88em ui-monospace, Menlo, monospace; }
.nb-body code { padding: 1px 5px; }
.nb-body pre { padding: 12px; overflow-x: auto; }
.nb-body iframe { width: 100%; }
.nb-toc { margin: 0 0 20px; border: 1px solid var(--line); border-left: 4px solid var(--teal); background: var(--wash); font-family: var(--f-body); border-radius: 6px; }
.nb-toc summary { cursor: pointer; padding: 10px 14px; min-height: 44px; font-weight: 700; font-size: 14px; text-transform: uppercase; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.nb-toc summary::-webkit-details-marker { display: none; }
.nb-toc summary::after { content: '+'; font-size: 18px; color: var(--teal); }
.nb-toc[open] summary::after { content: '–'; }
.nb-toc ol { margin: 0; padding: 0 14px 12px 14px; font-size: 14.5px; line-height: 1.45; list-style: none; counter-reset: nbt; }
.nb-toc li { padding: 3px 0; }
.nb-toc li:not(.sub) { counter-increment: nbt; }
.nb-toc li:not(.sub)::before { content: counter(nbt) '. '; color: var(--teal); font-weight: 700; }
.nb-toc li.sub { margin-left: 18px; list-style: none; padding-left: 4px; }
.nb-toc li.sub::before { content: '– '; color: var(--teal); }
.nb-toc a { color: var(--ink); font-weight: 500; text-decoration: none; }
.nb-toc a:hover { color: var(--teal); }
.nb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.nb-tags a { padding: 4px 12px; border: 1px solid var(--line); font-size: 13px; border-radius: 20px; }
.nb-tags a:hover { border-color: var(--teal); color: var(--teal); }
.nb-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--teal); z-index: 100; }

/* Comments */
.nb-comments { margin-top: 30px; }
.nb-comments h2, .comment-reply-title { font-size: 1.1rem; margin-bottom: 14px; text-transform: uppercase; font-family: var(--f-head); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 20px; }
.comment-body { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment-author .avatar { float: left; margin-right: 10px; border-radius: 50%; }
.comment-metadata { font-size: 12px; color: var(--soft); }
.comment-form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: var(--wash); font: inherit; border-radius: 6px; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--teal); background: #fff; }
.comment-form .submit { min-height: 42px; padding: 0 24px; background: var(--teal); color: #fff; border: 0; border-radius: 20px; font: 700 14px var(--f-body); cursor: pointer; }
.comment-form .submit:hover { background: var(--teal-dk); }

/* ---------- Footer ---------- */
.nb-foot { margin-top: 30px; background: var(--navy-dk); color: #aab6c2; font-size: 14px; }
.nb-foot__top { padding: 30px 0 10px; }
.nb-foot__top .nb-logo__name { color: #fff; font-size: 1.7rem; }
.nb-foot__top .nb-logo__tag { color: #7e8c9a; }
.nb-foot__top p { margin: 14px 0 0; max-width: 46ch; color: #96a3b0; }
.nb-foot__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 0 20px; border-top: 1px solid #22314400; }
.nb-foot h3 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; font-family: var(--f-body); }
.nb-foot li a { display: inline-flex; align-items: center; min-height: 32px; color: #96a3b0; }
.nb-foot li a:hover { color: #fff; }
.nb-foot__copy { border-top: 1px solid #223144; padding: 14px 0 18px; font-size: 12.5px; color: #71808f; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .nb-layout { grid-template-columns: minmax(0, 1fr); }
  .nb-sticky { position: static; }
  .nb-cards { grid-template-columns: repeat(2, 1fr); }
  .nb-foot__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .nb-strip ul { display: none; }
  .nb-masthead .nb-wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .nb-search { width: 100%; }
  .nb-top, .nb-dual { grid-template-columns: 1fr; }
  .nb-top .nb-stack { padding-top: 8px; }
  .nb-item { grid-template-columns: 104px 1fr; }
  .nb-row { grid-template-columns: 112px 1fr; gap: 12px; }
  .nb-row__title { font-size: 1rem; margin: 3px 0; }
  .nb-row__sapo { display: none; }
  .nb-dual .nb-stack .nb-item { grid-template-columns: 1fr 88px; }
  .nb-body { font-size: 16.5px; }
  .nb-foot__cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.nb-block__head { flex-wrap: wrap; }
