/* ==========================================================================
   BAO GIAY — giao diện báo giấy đen trắng, toàn màn hình, chia cột
   Palette: chỉ mực (#111) trên giấy (#fff). Không màu.
   ========================================================================== */

:root {
  --ink: #111;
  --ink-soft: #3c3c3c;
  --ink-faint: #767676;
  --paper: #ffffff;
  --paper-shade: #f2f2f2;
  --rule: #111;
  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-body: "PT Serif", Georgia, "Times New Roman", serif;
  --font-label: "Oswald", "Arial Narrow", Arial, sans-serif;
  --gap-col: clamp(18px, 2.2vw, 34px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; height: auto; display: block; }

/* Ảnh đen trắng tuyệt đối — đúng chất báo in */
img, .post-figure img, .teaser__figure img, .lead-figure img {
  filter: grayscale(100%) contrast(1.05);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.12;
  margin: 0 0 .4em;
  color: var(--ink);
}

/* ---- Khổ báo: full màn hình ---- */
.paper {
  width: 100%;
  max-width: none;               /* không giới hạn — trải hết mép trang */
  padding: 0 clamp(14px, 1.8vw, 36px);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;            /* mobile: tính cả thanh địa chỉ động */
}

/* footer luôn dính đáy màn hình kể cả trang ít nội dung */
.content-area { flex: 1 0 auto; display: flex; flex-direction: column; }
.content-area > .frontpage { flex: 1 0 auto; display: flex; flex-direction: column; }
.content-area > .err404 { flex: 1 0 auto; }

/* ========================= MASTHEAD ========================= */
.masthead { padding-top: 14px; }

.dateline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 7px;
}
.dateline__right { display: inline-flex; gap: 14px; }
.dateline__right a { text-decoration: underline; text-underline-offset: 2px; }

.site-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  letter-spacing: .005em;
  margin: 10px 0 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-left: 0;
  padding: 2px 0 6px;
  position: relative;
  text-transform: uppercase;
}
.site-title a { color: var(--ink); }

.site-tagline {
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin: 4px 0 10px;
}

/* ---- Điều hướng ---- */
.nav-bar {
  border-top: 3px double var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 40px;
}
.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(14px, 2vw, 34px);
  margin: 0;
  padding: 8px 0;
  font-family: var(--font-label);
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.nav-list a { color: var(--ink); }
.nav-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.nav-cta a {
  border: 1.5px solid var(--ink);
  padding: 3px 10px;
}
.nav-cta a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.burger {
  display: none;
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1.5px solid var(--ink);
  padding: 3px 7px;
  cursor: pointer;
  line-height: 0;
}
.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 3px 0;
}
.burger span:nth-child(2) { transition: transform .2s; }
.nav-open .burger { background: var(--ink); }
.nav-open .burger span { background: var(--paper); }
.nav-open .burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ===================== TRANG NHẤT ===================== */
.frontpage { padding: 22px 0 0; }

.lead-grid { margin-bottom: 26px; flex: 1; }

.lead-grid {
  display: block;
}
/* ≥960px: flex — cột trái co giãn (flex:1) luôn đẩy cột Mục lục sát mép phải */
@media (min-width: 960px) {
  .lead-grid { display: flex; align-items: stretch; }
}

.lead-col { padding: 6px 0; }
@media (min-width: 960px) {
  .lead-col--left { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .lead-col--left .teaser { flex: 0 0 auto; }
  .lead-col--left .teaser--fill { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .lead-col--left .teaser--fill .lead-content { overflow: hidden; }
}
@media (min-width: 960px) {
  .lead-col { padding: 0 var(--gap-col); min-width: 0; }
  .lead-col--left  { flex: 1 1 0; padding-left: 0; border: 0; }
  .lead-col--main  { flex: 2 1 0; border: 0; display: flex; flex-direction: column; }
  .lead-col--main .lead-excerpt { flex: 1 1 auto; overflow: hidden; text-align: justify; hyphens: auto; }
  /* lead không có ảnh: content đổ đầy, cắt gọn đúng đáy bloc */
  .lead-col--main .lead-content { flex: 1 1 auto; overflow: hidden; font-size: 20px; line-height: 1.62; text-align: justify; hyphens: auto; }
  .lead-content p { margin: 0 0 .8em; }
/* trang nhất: thụt dòng từ đoạn nội dung thứ hai trở đi (đoạn 1 = sapo, đoạn 2 = drop-cap) */
.lead-content > p:nth-of-type(n+3) { text-indent: 1.6em; }
  .lead-content h2, .lead-content h3 { font-size: 22px; margin: 1em 0 .4em; }
  .lead-content .lead-sub { font-style: italic; color: var(--ink-soft); }
  .lead-content > p:nth-of-type(2)::first-letter {
    font-family: var(--font-display); font-weight: 900; font-size: 3em;
    line-height: .82; float: left; padding: 4px 8px 0 0;
  }
  /* các bài khác (teaser fill): không drop-cap → thay bằng indent mọi đoạn nội dung */
  .teaser--fill .lead-content > p:nth-of-type(2)::first-letter {
    font: inherit; font-weight: inherit; font-size: inherit;
    line-height: inherit; float: none; padding: 0;
  }
  .teaser--fill .lead-content > p:not(.lead-sub) { text-indent: 1.6em; }
  .lead-col--right { flex: 0 1 clamp(240px, 22vw, 360px); border: 0; padding-right: 0; }
}

.kicker {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  margin: 0 0 6px;
  color: var(--ink-soft);
}
.kicker a { text-decoration: underline; text-underline-offset: 2px; }
.kicker__sep { font-size: 8px; }

.lead-title {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 10px;
}

.lead-figure { display: block; border: 1px solid var(--rule); margin: 0 0 10px; }
.lead-figure img { width: 100%; }

.byline {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 5px 0;
  margin: 0 0 10px;
}
.byline--center { text-align: center; max-width: 760px; margin-left: auto; margin-right: auto; }
.byline__author { font-weight: 700; color: var(--ink); }
.byline__dot { margin: 0 6px; }

.lead-excerpt {
  font-size: 20px;
  line-height: 1.55;
  margin: 0;
}
.lead-excerpt::first-letter { font-weight: 700; }


/* --- Mục lục --- */
.col-head {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 5px;
  margin: 4px 0 12px;
}
.toc { list-style: none; counter-reset: toc; margin: 0; padding: 0; }
.toc li {
  display: grid;
  grid-template-columns: 1.6em 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dotted var(--ink-faint);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.toc__num::before {
  counter-increment: toc;
  content: counter(toc) ".";
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink-faint);
}
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 2px; }

.toc-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-label); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.toc-tags a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.toc-tags sup { color: var(--ink-faint); margin-left: 2px; }

/* =================== DÀN TRANG NHIỀU CỘT ===================
   Lõi "báo giấy": một vùng văn bản chia thành nhiều cột in,
   có vạch dọc (column-rule) ngăn giữa các cột.                */
.strip-head {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  background: var(--ink);
  color: var(--paper);
  display: inline-block;
  padding: 4px 12px;
  margin: 0;
}
/* Nhãn nằm trên lưới tin — tạo khoảng cách từ phần tử phía sau, giữ margin:0 cho strip-head */
.strip-head + .teaser-strip,
.strip-head + .topic-grid { margin-top: 16px; }

.teaser-strip {
  column-gap: var(--gap-col);
  column-rule: 0;
  column-count: 2;
}
@media (min-width: 1800px) { .teaser-strip { column-count: 3; } }

.teaser {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 22px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--rule);
}
.teaser__meta {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.teaser__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.22;
  margin: 0 0 5px;
}
.teaser--big .teaser__title { font-size: 22px; font-weight: 900; }
.teaser__date {
  font-family: var(--font-label);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-faint);
  margin: 0 0 7px;
}
.teaser__ex {
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}
.teaser__figure { display: block; border: 1px solid var(--rule); margin: 0 0 9px; }

/* --- bản danh sách (archive): cards có ảnh --- */
.teaser--card { border-bottom: 0; padding-bottom: 18px; }
.teaser--card .teaser__meta { display: none; }
.teaser-strip--cards { column-rule: 0; }
.teaser--card .teaser__title { font-size: 22px; }

/* ============ TIN VẮN — 3 CỘT THEO CHỦ ĐỀ ============ */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
}
/* (strip-head nằm ngoài topic-grid — xem .more-news) */
@media (min-width: 900px) {
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
  .topic-col + .topic-col { border-left: 0; }
}
.topic-col {
  padding: 0 0 10px;
}
@media (min-width: 900px) {
  .topic-col { padding: 0 var(--gap-col); }
  .topic-col:first-child { padding-left: 0; }
  .topic-col:last-child  { padding-right: 0; }
}
@media (max-width: 899px) {
  .topic-col { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 12px; }
}
.col-head--link a { color: var(--ink); text-decoration: none; }
.col-head--link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.topic-col .teaser { border-bottom: 1px dotted var(--ink-faint); margin-bottom: 14px; padding-bottom: 12px; }
.topic-col .teaser__title { font-size: 22px; }
.topic-col .teaser__ex { font-size: 20px; text-indent: 1.6em; text-align: justify; hyphens: auto; }

/* ===================== BÀI VIẾT =====================
   Toàn bộ bài (title, ảnh đại diện, nội dung) chảy trong dàn cột:
   3 cột ở màn Full HD (≥1800px), 2 cột ở màn nhỏ hơn, 1 cột mobile. */
.post { padding: 10px 0 30px; border-bottom: 3px double var(--rule); }

.post-flow {
  padding-top: 10px;
  column-gap: clamp(24px, 2.6vw, 48px);
  column-rule: 0;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.post-flow { column-count: 1; }
@media (min-width: 900px)  { .post-flow { column-count: 2; } }
@media (min-width: 1800px) { .post-flow { column-count: 3; } }

.post-head {
  text-align: left;
  margin: 0 0 12px;
  padding: 0;
  break-inside: avoid;
}
  .post-title {
  font-size: 24px;
  font-weight: 900;
  margin: 4px 0 8px;
}
.post-sub {
  font-style: italic;
  font-size: 20px;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.post-figure {
  margin: 0 0 14px;
  border: 1px solid var(--rule);
  padding: 4px;
  break-inside: avoid;
}
.post-figure figcaption {
  font-family: var(--font-label);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
  text-align: center;
  padding: 6px 0 2px;
}

/* --- Khối nội dung: không tự chia cột nữa — để .post-flow chia --- */
.post-body {
  font-size: 20px;
  line-height: 1.66;
}

/* Chữ_DROP cap ở đoạn đầu — chữ cái lớn kiểu báo in */
.post-body > p:first-child::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.4em;
  line-height: .82;
  float: left;
  padding: 4px 10px 0 0;
}

.post-body p { margin: 0 0 1em; }
/* báo giấy: thụt đầu dòng các đoạn, trừ khối đầu tiên (drop-cap) */
.post-body > p { text-indent: 1.6em; }
.post-body > p:first-child { text-indent: 0; }
.post-body h2, .post-body h3 {
  break-after: avoid;
  break-inside: avoid;
  margin-top: 1.4em;
}
.post-body h2 { font-size: 22px; }
.post-body h3 { font-size: 20px; font-weight: 700; }
.post-body a { text-decoration: underline; text-underline-offset: 2px; }

.post-body img { border: 1px solid var(--rule); margin: 0 0 1em; break-inside: avoid; }

/* Koenig: ảnh wide/full trải spanning hết các cột — như ảnh khổ lớn giữa trang */
.kg-width-wide, .kg-width-full {
  column-span: all;
  break-inside: avoid;
  margin: 1.2em 0;
}
.kg-width-wide img, .kg-width-full img { width: 100%; }
.post-body figure { margin: 0 0 1.2em; break-inside: avoid; }
.post-body figcaption {
  font-family: var(--font-label); font-size: 14px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-faint); padding-top: 4px;
}

.post-body blockquote {
  margin: 1.2em 0;
  padding: 6px 0 6px 18px;
  border-left: 0;
  font-style: italic;
  font-size: 1.12em;
  break-inside: avoid;
}

.post-body ul, .post-body ol { padding-left: 1.3em; margin: 0 0 1em; }
.post-body li { margin-bottom: .3em; }
.post-body hr { border: 0; border-top: 3px double var(--rule); margin: 1.6em 0; }

/* Code an toàn trong cột hẹp */
.post-body pre {
  background: var(--paper-shade);
  border: 1px solid var(--rule);
  padding: 12px;
  margin: 0 0 1.2em;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  break-inside: avoid;
  font-size: .86em;
  line-height: 1.5;
}
.post-body code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: var(--paper-shade); padding: 1px 4px; }
.post-body pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; break-inside: avoid; font-size: .95em; }
th, td { border: 1px solid var(--rule); padding: 7px 10px; text-align: left; }
th { background: var(--ink); color: var(--paper); font-family: var(--font-label); text-transform: uppercase; letter-spacing: .08em; font-size: .85em; }

/* --- kicker trang bài: tag trái, chia sẻ phải --- */
.kicker--post {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 18px;
  flex-wrap: wrap;
}
.kicker__share { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.kicker__share a { text-decoration: underline; text-underline-offset: 3px; }

.more-news { padding: 24px 0 0; }

/* ===================== ARCHIVE / TAG / AUTHOR ===================== */
.archive { padding: 14px 0 0; }
.archive-head {
  text-align: center;
  border-bottom: 1px solid var(--rule);
  padding: 18px 0 14px;
  margin: 0 0 26px;
}
.archive-title { font-size: 24px; margin: 2px 0 6px; }
.archive-desc { font-style: italic; color: var(--ink-soft); max-width: 60ch; margin: 0 auto 6px; }
.archive-count {
  font-family: var(--font-label); font-size: 14px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-faint); margin: 0;
}

/* pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 26px;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  padding-top: 14px;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.pagination a { border-bottom: 2px solid var(--ink); padding-bottom: 2px; }

/* ===================== 404 ===================== */
.err404 { text-align: center; padding: 30px 0 50px; }
.err404__code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(6rem, 18vw, 13rem);
  line-height: 1;
  margin: 0;
  -webkit-text-stroke: 2px var(--ink);
  color: var(--paper);
}
.err404__headline { font-size: 22px; }
.err404__text { color: var(--ink-soft); font-style: italic; }
.btn-print {
  display: inline-block;
  font-family: var(--font-label);
  font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em;
  border: 1.5px solid var(--ink);
  padding: 9px 18px;
  margin: 0 6px;
}
.btn-print:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn-print--ghost { border-style: double; border-width: 4px; }

/* ===================== FOOTER ===================== */
.site-footer { border-top: 3px double var(--rule); margin-top: 30px; padding-bottom: 20px; }
.footer-rule { display: none; }
.footer-grid { display: block; }
.footer-col { padding: 14px 0 0; }
.footer-headrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 5px;
  margin-bottom: 9px;
}
.footer-head {
  font-family: var(--font-label); font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .18em; margin: 0;
}
.footer-links a { display: inline-block; margin: 0 12px 6px 0; font-size: 20px; text-decoration: underline; text-underline-offset: 3px; }
.footer-sub { font-family: var(--font-label); text-transform: uppercase; letter-spacing: .1em; font-size: 14px; margin: 0; }
.footer-bar {
  border-top: 1px solid var(--rule);
  margin-top: 14px;
  padding-top: 12px;
  text-align: center;
  font-family: var(--font-label);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-faint);
}

/* ===================== RESPONSIVE / MENU ===================== */
@media (max-width: 959px) {
  .teaser-strip { column-count: 2; column-width: auto; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .teaser-strip, .post-flow { column-count: 1; column-rule: 0; }
  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: calc(-1 * clamp(14px, 1.8vw, 36px));
    right: calc(-1 * clamp(14px, 1.8vw, 36px));
    background: var(--paper);
    border-bottom: 3px double var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 0;
    z-index: 50;
  }
  .nav-open .nav-list { display: flex; }
  .nav-list li { border-top: 1px solid var(--rule); }
  .nav-list li a { display: block; padding: 12px 18px; }
  .nav-cta a { border: 0; padding: 12px 18px; }
  .nav-cta a:hover { color: var(--paper); }
  .burger { display: block; }
  .post-flow { text-align: left; }
}

/* Portal iframe mặc định */
iframe [id*="portal"] { color-scheme: light; }

/* ===================== IN ẤN ===================== */
@media print {
  .nav-bar, .burger, .site-footer, .more-news, .dateline__right, .kicker__share { display: none !important; }
  .post-flow { column-count: 2; }
  body { font-size: 12px; }
}
