/* ==========================================================================
   Không gian văn hóa Hồ Chí Minh — HFIC
   Chuyên trang thuộc hfic.vn
   Design tokens theo brief.
   Không dùng localStorage / sessionStorage.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Màu nền giấy ngà */
  --paper:        #F6EFDD;
  --paper-deep:   #EFE6CC;

  /* Mực */
  --ink:          #241B12;
  --ink-soft:     #574539;   /* 7,9:1 trên nền giấy */
  --ink-faint:    #6E5B49;   /* 5,6:1 — đã làm đậm hơn #8A7663 (chỉ 3,8:1) */

  /* Đỏ cờ */
  --red:          #A6192E;   /* 6,5:1 */
  --red-hover:    #7E1223;

  /* Vàng đồng — CHỈ dùng cho đường viền, gạch chân, chấm trang trí.
     KHÔNG dùng làm màu chữ: #B8892E trên nền giấy chỉ đạt 2,75:1,
     dưới chuẩn WCAG AA (4,5:1) và rất khó đọc ở cỡ chữ nhỏ viết hoa. */
  --gold:         #B8892E;
  --gold-light:   #D9BE86;

  /* Đồng đậm — dùng cho CHỮ khi cần giữ tông ấm.
     5,5:1 trên nền giấy, 5,1:1 trên nền giấy đậm — đủ dư cho cả hai nền. */
  --gold-text:    #7A5A1C;

  /* Xanh navy HFIC — dùng cho số chương, số mục lục (12,9:1) */
  --navy:         #16264D;

  /* Đường viền mảnh (hairline) */
  --hairline:      1px solid var(--gold-light);
  --hairline-firm: 1px solid var(--gold);

  /* Typography */
  --font-serif: "Literata", "Times New Roman", Georgia, serif;
  --font-sans:  "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;

  /* Nhịp bố cục */
  --toc-width:  268px;
  --gutter:     48px;
  --max-width:  1240px;
}

/* --------------------------------------------------------------------------
   2. Reset & nền chung
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background-color: var(--paper);
  /* Vân giấy rất nhẹ, không gây nhiễu chữ */
  background-image:
    radial-gradient(circle at 20% 12%, rgba(217,190,134,.16) 0, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(217,190,134,.12) 0, transparent 46%);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--red); text-decoration: none; }
a:hover, a:focus-visible { color: var(--red-hover); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Bỏ bo góc kiểu SaaS trên toàn trang */
button, input, select, textarea { border-radius: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.28;
  color: var(--ink);
  margin: 0;
}

p { margin: 0 0 1.05em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  font-size: 14px;
}
.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* --------------------------------------------------------------------------
   3. Thanh trạng thái thẩm định (toàn trang)
   -------------------------------------------------------------------------- */
.statusbar {
  background: var(--navy);
  color: #F2E8D4;
  font-size: 13px;
  letter-spacing: .015em;
  padding: 9px 0;
  border-bottom: 3px solid var(--gold);
}
.statusbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
}
.statusbar strong { color: var(--gold-light); font-weight: 600; }

/* --------------------------------------------------------------------------
   4. Thanh điều hướng site (liên kết về hfic.vn)
   -------------------------------------------------------------------------- */
.sitebar {
  background: var(--paper-deep);
  border-bottom: var(--hairline);
}
.sitebar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}
.breadcrumb { color: var(--ink-soft); }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }

/* --------------------------------------------------------------------------
   5. Hero — banner do HFIC cung cấp
      Hiệu ứng fade-in DUY NHẤT của cả trang, chỉ chạy 1 lần khi tải.
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

/* Mũi tên gợi ý cuộn xuống — nằm giữa mép dưới banner, nhún nhẹ */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(22, 38, 77, .78);
  border: 1.5px solid var(--gold-light);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  color: var(--gold-light);
  animation: heroScrollNudge 2.2s ease-in-out 1.4s infinite;
  transition: opacity .35s ease, visibility .35s ease, background-color .2s ease;
}
.hero__scroll svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.hero__scroll:hover { background: var(--navy); color: #fff; }
.hero__scroll:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hero__scroll.is-hidden { opacity: 0; visibility: hidden; }
.pagehead { scroll-margin-top: 8px; }

@keyframes heroScrollNudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(7px); }
}
.hero__figure {
  margin: 0;
  opacity: 0;
  animation: heroFadeIn 1100ms ease-out 120ms forwards;
}
.hero__figure img { width: 100%; height: auto; }

.hero__caption {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px 16px;
  font-size: 12.5px;
  color: rgba(242,232,212,.72);
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__figure { opacity: 1; animation: none; }
  .hero__scroll { animation: none; }
}

/* Đề mục trang, đặt dưới banner */
.pagehead {
  border-bottom: var(--hairline);
  background: var(--paper-deep);
}
.pagehead__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 26px 24px 24px;
}
.pagehead__eyebrow {
  font-size: 12.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 600;
  margin-bottom: 8px;
}
.pagehead h1 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -.01em;
}
.pagehead__lead {
  margin: 12px 0 0;
  text-align: justify;
  max-width: 74ch;
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* --------------------------------------------------------------------------
   5c. Dải con số — nhịp thị giác giữa các khối chữ
   -------------------------------------------------------------------------- */
.statband {
  display: grid;
  /* Ép đúng 4 cột: auto-fit hay rơi vào 3+1 khi cột nội dung hẹp, trông lệch. */
  grid-template-columns: repeat(3, 1fr);
  border-top: var(--hairline-firm);
  border-bottom: var(--hairline-firm);
  margin: 28px 0 34px;
}
.stat {
  padding: 20px 18px 18px;
  border-right: var(--hairline);
  text-align: center;
}
.stat:last-child { border-right: 0; }
.stat__figure {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--red);
  letter-spacing: -.015em;
}
.stat__unit {
  font-size: .46em;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--navy);
  margin-left: 3px;
}
.stat__label {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   5d. Trích dẫn nổi bật — CHỈ dùng cho câu đã xác minh nguồn
   -------------------------------------------------------------------------- */
.pullquote {
  margin: 26px 0;
  padding: 22px 26px 20px;
  background: rgba(22,38,77,.04);
  border-top: 2px solid var(--navy);
  border-bottom: 1px solid var(--gold-light);
  max-width: 72ch;
}
.pullquote blockquote {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 700;
  font-style: normal;
  line-height: 1.55;
  letter-spacing: -.005em;
  text-align: justify;
  color: var(--ink);
}
.pullquote__cite {
  display: block;
  margin-top: 14px;
  padding-top: 11px;
  border-top: var(--hairline);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-style: normal;
  color: var(--ink-faint);
  line-height: 1.55;
}
.pullquote__cite strong { color: var(--ink-soft); font-weight: 600; }

/* --------------------------------------------------------------------------
   5e. Hoa văn ngăn chương
   -------------------------------------------------------------------------- */
.ornament {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
  padding: 30px 0 6px;
  overflow: visible;
}
.ornament line { stroke: var(--gold-light); stroke-width: 1; }
.ornament path { fill: var(--gold); }
.ornament circle { fill: var(--gold-light); }

/* --------------------------------------------------------------------------
   6. Bố cục: mục lục sách (trái) + nội dung chương (phải)
   -------------------------------------------------------------------------- */
.layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 72px;
  display: grid;
  grid-template-columns: var(--toc-width) 1fr;
  gap: var(--gutter);
  align-items: start;
}

/* --- Mục lục dạng sách, sticky bên trái --- */
.toc {
  position: sticky;
  top: 28px;
  padding: 22px 22px 8px 0;
  border-right: var(--hairline);
}
.toc__title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: var(--hairline-firm);
}
.toc__list { list-style: none; margin: 0; padding: 0; }
.toc__list li { border-bottom: var(--hairline); }
.toc__list li:last-child { border-bottom: 0; }

.toc__link {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 11px 4px 11px 10px;
  margin-left: -12px;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
  border-left: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.toc__link:hover { color: var(--red); text-decoration: none; }
.toc__num {
  font-family: var(--font-serif);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--navy);
  font-weight: 600;
}
.toc__link:hover .toc__num { color: var(--red); }
.toc__link[aria-current="true"] {
  color: var(--red);
  font-weight: 600;
  border-left-color: var(--red);
  background: rgba(166,25,46,.045);
}
.toc__link[aria-current="true"] .toc__num { color: var(--red); }

.toc__foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: var(--hairline);
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* --- Cột nội dung --- */
.content { min-width: 0; padding-top: 22px; }

/* --------------------------------------------------------------------------
   7. Chương nội dung
   -------------------------------------------------------------------------- */
.chapter {
  padding: 0 0 56px;
  margin-bottom: 56px;
  border-bottom: var(--hairline);
}
.chapter:last-of-type { border-bottom: 0; margin-bottom: 0; }

.chapter__head { margin-bottom: 26px; }
.chapter__num {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: .03em;
  color: var(--navy);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.chapter__title {
  font-size: clamp(23px, 2.7vw, 30px);
  padding-bottom: 12px;
  border-bottom: var(--hairline-firm);
}
.chapter__intro {
  margin-top: 14px;
  text-align: justify;
  color: var(--ink-soft);
  max-width: 74ch;
}

.prose { max-width: 72ch; }
.prose p { text-align: justify; }
.prose h3 { font-size: 19px; margin: 30px 0 10px; }

/* --------------------------------------------------------------------------
   8. Nhãn trạng thái nội dung
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid currentColor;
  line-height: 1.3;
}
.badge::before {
  content: "";
  width: 7px; height: 7px;
  background: currentColor;
  flex: none;
}
.badge--review   { color: var(--red); }
.badge--building { color: var(--navy); }

.notice {
  border: var(--hairline-firm);
  border-left: 4px solid var(--red);
  background: rgba(184,137,46,.07);
  padding: 16px 20px;
  margin: 0 0 26px;
  font-size: 14.5px;
  color: var(--ink-soft);
  max-width: 72ch;
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--ink); }

/* --------------------------------------------------------------------------
   9. Khối "Đang xây dựng" (placeholder — KHÔNG dùng nội dung giả)
   -------------------------------------------------------------------------- */
.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
  margin: 24px 0 0;
}
.slot {
  border: 1px dashed var(--gold-light);
  background: rgba(255,255,255,.28);
  padding: 22px 18px;
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
.slot__kind {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 600;
}
.slot__label {
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: var(--ink-soft);
}
.slot__note { font-size: 12.5px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   9b. Tiểu mục trong chương (II.1, II.2, II.3…)
   -------------------------------------------------------------------------- */
.subsection {
  margin-top: 40px;
  padding-top: 28px;
  border-top: var(--hairline);
}
.subsection:first-of-type { margin-top: 32px; }

.subsection__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 10px;
}
.subsection__title {
  font-size: 20px;
  margin: 0;
}
.subsection__num {
  font-family: var(--font-serif);
  color: var(--navy);
  font-weight: 600;
  margin-right: 8px;
}
.subsection__lead {
  color: var(--ink-soft);
  max-width: 72ch;
  font-size: 15px;
  margin-bottom: 6px;
}

/* Liên kết "xem tại kho chính thống" đặt cuối tiểu mục */
.subsection__more {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: var(--hairline);
  font-size: 14.5px;
  max-width: 72ch;
}
.subsection__more a { font-weight: 500; }
.subsection__more .ext { font-size: 12px; color: var(--ink-faint); margin-left: 4px; }

/* --------------------------------------------------------------------------
   9c. Thư viện ảnh (Chương II.1)
       Ô trống có nét đứt = chỗ chờ tư liệu, KHÔNG phải ảnh mẫu.
   -------------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.gallery__slot {
  border: 1px dashed var(--gold-light);
  background: rgba(255,255,255,.28);
  aspect-ratio: 4 / 3;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}
.gallery__slot-period {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 600;
}
.gallery__slot-label {
  font-family: var(--font-serif);
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.gallery__slot-note { font-size: 12px; color: var(--ink-faint); }

/* Dùng khi đã có ảnh thật đã thẩm định */
.gallery__item { margin: 0; }
.gallery__link {
  display: block;
  border: var(--hairline);
  background: var(--paper-deep);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery__link img { width: 100%; height: 100%; object-fit: cover; }
.gallery__link:hover { border-color: var(--red); }
.gallery__item figcaption {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 7px;
  line-height: 1.5;
}

/* Khung xem ảnh phóng to */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(22,38,77,.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 14px;
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: min(1100px, 100%);
  max-height: 76vh;
  width: auto;
  object-fit: contain;
  border: 1px solid var(--gold);
}
.lightbox__caption {
  color: #E8DCC2;
  font-size: 14px;
  max-width: 74ch;
  text-align: center;
  margin: 0;
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: 1px solid var(--gold-light);
  color: #E8DCC2;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
}
.lightbox__close:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* --------------------------------------------------------------------------
   9d. Danh mục văn bản / phim (Chương II.2, II.3)
   -------------------------------------------------------------------------- */
.doclist {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  border-top: var(--hairline);
  max-width: 74ch;
}
.doclist > li { border-bottom: var(--hairline); }
.doclist a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 16px;
  padding: 14px 6px 14px 0;
  color: var(--ink);
}
.doclist a:hover {
  color: var(--red);
  text-decoration: none;
  background: rgba(166,25,46,.04);
}
.doclist__name { font-weight: 500; line-height: 1.5; }
.doclist__desc {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.55;
}
.doclist__src {
  font-size: 12.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9d-bis. Thẻ tư liệu dẫn tới nguồn chính thống (bộ ảnh, phim tư liệu)
       Là LIÊN KẾT tới nguồn gốc, không sao chép ảnh/phim về máy chủ HFIC.
   -------------------------------------------------------------------------- */
.medialist {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.mediacard { display: flex; }
.mediacard > a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 16px 16px 14px;
  border: var(--hairline);
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,.34);
  color: var(--ink);
  transition: border-color .18s ease, background .18s ease;
}
.mediacard > a:hover {
  text-decoration: none;
  border-color: var(--red);
  border-left-color: var(--red);
  background: rgba(166,25,46,.05);
  color: var(--red);
}

.mediacard__kind {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 600;
}
.mediacard__title {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.42;
  flex: 1 0 auto;
}
.mediacard__src {
  font-size: 12px;
  color: var(--ink-faint);
  padding-top: 7px;
  border-top: var(--hairline);
}
.mediacard > a:hover .mediacard__src { color: var(--red); }

/* --------------------------------------------------------------------------
   9e. Khối hướng dẫn / lưu ý trong tiểu mục
   -------------------------------------------------------------------------- */
.callout {
  margin-top: 24px;
  padding: 18px 20px;
  border: var(--hairline);
  border-left: 3px solid var(--navy);
  background: rgba(22,38,77,.045);
  max-width: 72ch;
}
.callout__title {
  font-family: var(--font-serif);
  font-size: 16.5px;
  margin: 0 0 8px;
}
.callout p { margin-bottom: .7em; font-size: 14.5px; color: var(--ink-soft); }
.callout p:last-child { margin-bottom: 0; }
.callout__note { font-size: 13px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   9f. Video (Chương V) — dùng khi đã có video được thẩm định
   -------------------------------------------------------------------------- */
.video { margin: 0 0 22px; }
.video video {
  width: 100%;
  height: auto;
  display: block;
  background: var(--navy);
  border: var(--hairline);
}
.video__caption {
  display: block;
  padding-top: 9px;
  border-bottom: var(--hairline);
  padding-bottom: 12px;
}
.video__title {
  display: block;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.video__meta {
  display: block;
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 3px;
}

/* --------------------------------------------------------------------------
   10. Dòng thời gian (Chương III)
   -------------------------------------------------------------------------- */
.timeline {
  list-style: none;
  margin: 26px 0 0;
  padding: 0 0 0 26px;
  border-left: var(--hairline-firm);
  max-width: 74ch;
}
.timeline__item { position: relative; padding: 0 0 30px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 11px;
  width: 9px;
  height: 9px;
  background: var(--paper);
  border: 2px solid var(--red);
}
.timeline__year {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--red);
  display: block;
  line-height: 1.4;
}
.timeline__text { margin: 2px 0 0; color: var(--ink-soft); }

/* --- Trưng bày mở rộng: mỗi mốc là một "gian" có tiêu đề, diễn giải và liên kết tư liệu --- */
.timeline--exhibit { padding-left: 30px; }
.timeline--exhibit .timeline__item { padding-bottom: 34px; }
.timeline--exhibit .timeline__item::before {
  left: -35px;
  top: 13px;
  width: 11px;
  height: 11px;
}

.exhibit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 6px;
}
.exhibit__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.exhibit__place {
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.exhibit__body { margin: 0 0 10px; color: var(--ink-soft); }

.exhibit__link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px 6px 0;
  border-top: var(--hairline);
  width: 100%;
}
.exhibit__link .ext { font-size: 11.5px; color: var(--ink-faint); font-weight: 400; }
.exhibit__link:hover .ext { color: var(--red); }

/* Lời dẫn mở và kết của không gian trưng bày */
.exhibit__intro,
.exhibit__outro {
  max-width: 72ch;
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 18px;
  margin: 22px 0;
  color: var(--ink-soft);
}
.exhibit__outro { border-left-color: var(--red); }

/* --------------------------------------------------------------------------
   11. Bốn giá trị đạo đức (Chương IV)
   -------------------------------------------------------------------------- */
.values {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  border-top: var(--hairline);
}
.value {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: var(--hairline);
}
.value__num {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
}
.value__title { font-size: 18.5px; margin-bottom: 5px; }
.value__desc { margin: 0; color: var(--ink-soft); font-size: 15px; }

.streams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 30px;
  border: var(--hairline);
}
.stream { padding: 20px 20px 22px; border-right: var(--hairline); }
.stream:last-child { border-right: 0; }
.stream h4 { font-size: 16px; margin-bottom: 6px; }
.stream p { font-size: 13.8px; color: var(--ink-soft); margin-bottom: 12px; }

/* --------------------------------------------------------------------------
   12. Liên kết tư liệu chính thống
   -------------------------------------------------------------------------- */
.linklist {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-top: var(--hairline);
  max-width: 72ch;
}
.linklist li { border-bottom: var(--hairline); }
.linklist a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 13px 4px;
  color: var(--ink);
}
.linklist a:hover {
  color: var(--red);
  text-decoration: none;
  background: rgba(166,25,46,.04);
}
.linklist__name { font-weight: 500; }
.linklist__url { font-size: 12.5px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   14. Chân trang
   -------------------------------------------------------------------------- */
.sitefoot {
  background-color: var(--navy);
  border-top: 3px solid var(--gold);
}
.sitefoot__lotus {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px 20px;
}
.sitefoot__emblem {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.sitefoot__emblem line { stroke: var(--gold); stroke-width: 1.2; }
.sitefoot__emblem line.thin { stroke: var(--gold-light); stroke-width: .7; opacity: .55; }
.sitefoot__emblem path { fill: var(--gold-light); }
.sitefoot__emblem circle { fill: var(--gold-light); }
.sitefoot__emblem circle.dim { opacity: .6; }

/* --------------------------------------------------------------------------
   15. Responsive — ưu tiên mobile
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root { --toc-width: 228px; --gutter: 34px; }
}

@media (max-width: 860px) {
  html { scroll-padding-top: 124px; }

  .layout { grid-template-columns: 1fr; gap: 0; padding-bottom: 56px; }

  /* Mục lục chuyển thành thanh cuộn ngang, dính phía trên nội dung */
  .toc {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0;
    margin: 0 -24px;
    /* Bắt buộc: ô lưới mặc định là min-width:auto nên sẽ nở rộng bằng toàn bộ
       mục lục (~990px) và làm cả trang cuộn ngang. Ép về 0 để overflow-x của
       .toc__list thực sự có hiệu lực. */
    min-width: 0;
    border-right: 0;
    border-bottom: var(--hairline-firm);
    background: var(--paper-deep);
    box-shadow: 0 2px 0 rgba(36,27,18,.05);
  }
  .toc__title, .toc__foot { display: none; }

  .toc__list {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .toc__list::-webkit-scrollbar { height: 3px; }
  .toc__list::-webkit-scrollbar-thumb { background: var(--gold-light); }

  .toc__list li {
    border-bottom: 0;
    border-right: var(--hairline);
    flex: none;
    scroll-snap-align: start;
  }

  .toc__link {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    padding: 13px 16px;
    margin-left: 0;
    border-left: 0;
    border-bottom: 3px solid transparent;
    font-size: 14px;
  }
  .toc__link[aria-current="true"] {
    border-left: 0;
    border-bottom-color: var(--red);
    background: rgba(166,25,46,.06);
  }

  .content { padding-top: 30px; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .layout, .pagehead__inner, .sitebar__inner,
  .statusbar__inner, .sitefoot__lotus, .hero__caption {
    padding-left: 18px;
    padding-right: 18px;
  }
  .toc { margin: 0 -18px; }

  .chapter { padding-bottom: 42px; margin-bottom: 42px; }
  .prose p, .pagehead__lead, .chapter__intro, .pullquote blockquote { text-align: left; }

  .value { grid-template-columns: 44px 1fr; gap: 14px; }
  .value__num { font-size: 18px; }

  .streams { grid-template-columns: 1fr; }
  .stream { border-right: 0; border-bottom: var(--hairline); }
  .stream:last-child { border-bottom: 0; }

  .placeholder-grid { grid-template-columns: 1fr; }

  /* Dải con số: 2 cột trên điện thoại, viền dưới thay viền phải */
  .stat { padding: 15px 6px 13px; }
  .stat__figure { font-size: 28px; }
  .stat__label { font-size: 11.5px; }

  .pullquote { padding: 18px 18px 16px; }
  .ornament { max-width: 190px; padding-top: 22px; }
  .hero__scroll { width: 36px; height: 36px; margin-left: -18px; bottom: 8px; }
  .hero__scroll svg { width: 19px; height: 19px; }

  /* Thư viện ảnh: 2 cột trên điện thoại để không quá dài */
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .gallery__slot { padding: 12px; }
  .gallery__slot-label { font-size: 13px; }
  .gallery__slot-note { display: none; }

  /* Danh mục văn bản: nguồn xuống dòng riêng cho dễ đọc */
  .doclist a { grid-template-columns: 1fr; }
  .doclist__src { white-space: normal; }

  .lightbox { padding: 20px 12px; }
  .lightbox__img { max-height: 68vh; }
}

/* --------------------------------------------------------------------------
   16. In ấn
   -------------------------------------------------------------------------- */
@media print {
  .toc, .statusbar, .sitebar { display: none; }
  .layout { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .hero__figure { opacity: 1; animation: none; }
}
