@charset "utf-8";
/* LƯỢC SỬ VIỆT — lớp áo thuỷ mặc: giấy dó, mực tàu, son triện. Nền do tools/ve-thuy-mac.py vẽ. */
:root {
  --paper: #ece7db; --ink: #23261f; --son: #9c3a28; --cham: #343c34; --white: #f6f3ea; --muted: #55564a;
  --line: rgba(35, 38, 31, 0.2); --but: "Charm", "Noto Serif", serif;
}
body { background: var(--paper) url("../assets/nen/giay.webp"); }
::selection { background: var(--ink); }
html { scrollbar-color: var(--cham) transparent; accent-color: var(--son); }

/* chữ bút lông cho tên web và tiêu đề lớn; tên mục nhỏ vẫn là chữ in để dễ đọc */
.brand, .hero h1, .ig-head h1, .ig-head h2, .terr-head h2, .gal h1, .cmp h1, .chieu h2, .mp-head h2 { font-family: var(--but); font-weight: 700; line-height: 1.25; letter-spacing: 0; }
.ig-head h1, .ig-head h2, .terr-head h2, .gal h1, .cmp h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.75rem); }
.top { background: var(--paper) url("../assets/nen/giay.webp"); align-items: center; border: 0; padding-block: 8px; }
.brand { font-size: 1.75rem; line-height: 1.4; }

/* ---------- mở đầu: bản đồ ---------- */
.hero.map-hero { position: relative; display: block; padding: 0; height: calc(100svh - 56px); min-height: 600px; max-height: 1080px; overflow: hidden; container-type: size; }
.mh-plane { position: absolute; left: 50%; top: 50%; aspect-ratio: 16 / 9; width: max(100cqw, 177.8cqh); transform: translate(-50%, -50%); }
.mh-plane > picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 90px; background: linear-gradient(transparent, var(--paper)); pointer-events: none; }
.map-hero .hero-text { position: absolute; z-index: 2; left: var(--m); top: 50%; transform: translateY(-54%); padding: 0; gap: 18px; width: min(38cqw, 560px); }
.map-hero h1 { font-size: clamp(3.5rem, 7.2cqw, 7rem); line-height: 1.08; white-space: nowrap; }
.map-hero h1 span { display: block; }
.map-hero .hero-text::before { content: ""; position: absolute; z-index: -1; left: 48%; top: -30%; width: 420px; height: 300px; background: url("../assets/nen/vay-muc.webp") 0 0 / contain no-repeat; transform: rotate(-24deg); opacity: 0.85; pointer-events: none; }
.map-hero .scope { font: 400 1.125rem/1.6 var(--sans); color: var(--ink); max-width: 34ch; }
.btn { position: relative; isolation: isolate; background: none; color: var(--white); padding: 14px 44px 14px 30px; min-height: 56px; }
.btn::before { content: ""; position: absolute; z-index: -1; inset: -4px -14px -4px -6px; background: var(--ink); -webkit-mask: url("../assets/nen/vet-co.webp") 0 0 / 100% 100%; mask: url("../assets/nen/vet-co.webp") 0 0 / 100% 100%; transition: background-color 160ms; }
.btn:hover { background: none; }
.btn:hover::before { background: var(--son); }
.mh-pt { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); display: flex; align-items: center; gap: 8px; min-height: 44px; transform: translate(-22px, -50%); padding: 0 8px 0 15px; text-decoration: none; white-space: nowrap; color: var(--ink); font: 700 clamp(1.0625rem, 1.5cqw, 1.5rem)/1.2 var(--but); }
.mh-pt::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 4px solid var(--son); background: var(--white); transition: background-color 160ms; }
.mh-pt.trai { flex-direction: row-reverse; text-align: right; transform: translate(calc(-100% + 22px), -50%); padding: 0 15px 0 8px; }
.mh-pt small { display: block; font: 400 0.875rem/1.3 var(--sans); color: #42443a; }
.mh-pt span, .mh-dao { text-shadow: 0 0 5px var(--paper), 0 0 5px var(--paper), 0 0 10px var(--paper); }
.mh-pt.cao span { transform: translateY(-16px); }
.mh-pt.thap span { transform: translateY(12px); }
.mh-pt:hover, .mh-pt:focus-visible { color: var(--son); }
.mh-pt:hover::before { background: var(--son); }
.mh-dao { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(-50%, -50%); font: 400 1.125rem/1.3 var(--but); color: var(--ink); text-align: center; white-space: nowrap; }
.mh-dao::before { content: ""; display: block; width: 34px; height: 16px; margin: 0 auto 2px; background: radial-gradient(circle at 4px 11px, currentColor 2px, transparent 3px), radial-gradient(circle at 14px 4px, currentColor 2.5px, transparent 3.5px), radial-gradient(circle at 22px 12px, currentColor 1.5px, transparent 2.5px), radial-gradient(circle at 31px 6px, currentColor 2px, transparent 3px); }
.mh-trien { position: absolute; z-index: 2; right: calc(var(--m) + 8px); top: 40px; display: grid; place-items: center; width: 92px; height: 112px; background: var(--son); color: var(--white); font: 700 1.625rem/1.2 var(--but); text-align: center; border-radius: 7px 5px 8px 4px; box-shadow: inset 0 0 0 4px var(--son), inset 0 0 0 6px rgba(246, 243, 234, 0.75); transform: rotate(-2deg); padding: 0 14px; }

/* ---------- cuốn tranh: video và ảnh các thời ---------- */
.chieu { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 28px var(--m); align-items: center; padding: clamp(40px, 5vw, 72px) var(--m) clamp(150px, 15vw, 230px); }
.chieu::after { content: ""; position: absolute; z-index: -1; inset: auto 0 0; height: clamp(150px, 17.5vw, 300px); background: url("../assets/nen/nui.webp") 50% 100% / max(1100px, 100%) auto no-repeat; opacity: 0.75; }
.chieu h2 { font-size: clamp(2.25rem, 1.5rem + 2.2vw, 3.5rem); }
.chieu > div > p { margin-top: 10px; color: var(--muted); max-width: 34ch; }
.slide { text-decoration: none; }
.slide-cap { border: 0; background: none; isolation: isolate; color: var(--white); padding: 10px 56px 12px 24px; margin-top: 6px; font: 700 clamp(1.25rem, 1.1rem + 0.5vw, 1.625rem)/1.4 var(--but); }
.slide-cap::before { content: ""; position: absolute; z-index: -1; inset: 0; background: var(--ink); -webkit-mask: url("../assets/nen/vet-co.webp") 0 0 / 100% 100%; mask: url("../assets/nen/vet-co.webp") 0 0 / 100% 100%; transition: background-color 160ms; }
.slide-cap .roman { color: #dfb765; }
.slide:hover .slide-cap { color: var(--white); }
.slide:hover .slide-cap::before { background: var(--son); }
.slides .slide-bar { margin-top: -54px; }
.slides .slide-nav, .slides .slide-play { border: 0; background: rgba(35, 38, 31, 0.09); min-width: 44px; min-height: 44px; height: 44px; }

/* ---------- dòng thời gian ---------- */
.ig.ig-home { border: 0; padding-top: 24px; }
.ig-more { border: 0; }
.terr-entry { border: 0; padding-top: 0; }
.ig-year { background: none; isolation: isolate; position: relative; height: 30px; margin-bottom: 2px; padding: 0 10px; font-size: 0.875rem; overflow: visible; max-width: none; }
.ig-year::before { content: ""; position: absolute; z-index: -1; inset: 0 -18px 0 -9px; background: var(--ink); -webkit-mask: url("../assets/nen/vet-co.webp") 0 0 / 100% 100%; mask: url("../assets/nen/vet-co.webp") 0 0 / 100% 100%; }
.ig-stop.has .ig-year { background: none; }
.ig-stop.has .ig-year::before { background: var(--son); }
.ig-name { font-size: 1rem; }
.ig-type, .ig-count, .ig-g-name, .ig-mchip, .terr-go, .lf-head span, .lf-legend, .lf-caps, .lf-note, .lf-story li, .mp-k, .terr-gs a, .terr-entry h4 small, .ig-gantt summary small, .slide-n, .ig-mchip span { font-size: 0.875rem; }
.ig-ribbon { background: var(--ink); padding-inline: calc(var(--m) - 12px); }
.ig-ribbon .roman { font: 700 1.5rem/1.2 var(--but); color: #dfb765; }
.ig-ribbon small { color: rgba(246, 243, 234, 0.82); }
.ig-ribbon a { border: 0; }
.ig-ribbon { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.terr-list { padding-bottom: 24px; }
.foot .brand { font: 700 1.75rem/1.4 var(--but); }
.ig-detail > p { max-width: 70ch; }
.ig-flag .roman { background: none; isolation: isolate; box-shadow: none; font: 700 1.375rem/1 var(--but); color: var(--white); }
.ig-flag .roman::before { content: ""; position: absolute; z-index: -1; inset: -3px; border-radius: 47% 53% 50% 50% / 52% 47% 53% 48%; background: var(--ink); box-shadow: 0 0 0 5px var(--paper); }
.ig-row.active .ig-flag .roman { background: none; }
.ig-row.active .ig-flag .roman::before { background: var(--son); }
.ig-gbtn { border-radius: 3px; border-color: var(--ink); background: var(--ink); min-height: 44px; }
.ig-detail { background: var(--white); }
.ig-thumbs img, .ig-mchip img { background: var(--white); box-shadow: none; border-color: rgba(35, 38, 31, 0.18); }
.ig-d-head h3 { font: 700 clamp(1.75rem, 1.4rem + 1vw, 2.25rem)/1.3 var(--but); }

/* ---------- lãnh thổ ---------- */
.terr-yr { font-family: var(--but); font-weight: 700; }
.terr-card, .lf-story li { border-left: 0; border-radius: 2px; }
.terr-card { background: rgba(35, 38, 31, 0.055); }
.lf-story b { font-size: 0.875rem; }
.lf-story li + li::before { display: none; }
.terr-step { border-radius: 2px; }
.terr-more > summary, .terr-ctl button, .mp-ctl > button, .mp-x { border-radius: 3px; min-height: 44px; }

/* ---------- bộ sưu tập: trang phục hoà vào nền giấy ---------- */
.card .media, .ig-d-cards .media, .terr-gs img { background: rgba(255, 255, 255, 0.42); border-top: 0; }
.card .media > img, .ig-d-cards .media > img, .terr-gs img { mix-blend-mode: multiply; }
.card-cap { border: 0; }
.card-cap b { font: 700 1.375rem/1.3 var(--but); }

/* ---------- chân trang ---------- */
.foot { position: relative; background: var(--ink); margin-top: clamp(150px, 16vw, 260px); }
.foot::before { content: ""; position: absolute; inset: auto 0 100%; height: clamp(140px, 16vw, 260px); background: url("../assets/nen/nui.webp") 50% 100% / max(1100px, 100%) auto no-repeat; transform: scaleX(-1); pointer-events: none; }
.foot-note { border: 0; padding-top: 0; }

@media (max-width: 759px) {
  .hero.map-hero { min-height: 620px; max-height: 820px; }
  .mh-plane { aspect-ratio: 10 / 17; width: max(100cqw, 58.83cqh); }
  .mh-pt, .mh-dao { left: calc(var(--mx) * 1%); top: calc(var(--my) * 1%); }
  .mh-pt { font-size: 1.0625rem; }
  .mh-pt small { display: none; }
  .mh-trien { width: 62px; height: 76px; font-size: 1.125rem; right: 16px; top: 14px; padding: 0 8px; }
  .map-hero .hero-text { left: var(--m); top: 8px; transform: none; gap: 0; width: auto; }
  .map-hero .scope { display: none; }
  .map-hero h1 { font-size: 2.75rem; }
  .map-hero .hero-text::before { display: none; }
  .map-hero .btn { position: absolute; top: calc(100cqh - 84px); left: 0; white-space: nowrap; }
  .ig-ribbon { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; padding-inline: 4px; }
  .ig-ribbon > * { grid-column: auto !important; min-width: 0; text-align: left; }
  .ig-stop.has-map > button:not(.ig-mchip) { padding-right: 88px; }
  .ig-track.has-maps .ig-mchip { width: auto; margin: 0; }
  .ig-year { margin-bottom: 8px; margin-left: 4px; }
  .chieu { grid-template-columns: 1fr; }
  .slides .slide-bar { margin-top: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  /* một màn mở đầu: mực loang ra giấy */
  .mh-plane > picture img { animation: loang 1200ms cubic-bezier(0.16, 1, 0.3, 1) both; }
  @keyframes loang { from { opacity: 0; transform: scale(1.03); } }
}

/* màn vừa (máy tính bảng dọc): dùng bản đồ dọc để không cắt mất Hoàng Sa, Trường Sa */
@media (min-width: 760px) and (max-aspect-ratio: 11/10) {
  .hero.map-hero { height: min(calc(100svh - 56px), 112vw); }
  .mh-plane { left: auto; right: 0; transform: translateY(-50%); aspect-ratio: 10 / 17; width: 58.83cqh; min-width: 76cqw; }
  .mh-plane > picture img { -webkit-mask: linear-gradient(90deg, transparent, #000 38%); mask: linear-gradient(90deg, transparent, #000 38%); }
  .mh-pt, .mh-dao { left: calc(var(--mx) * 1%); top: calc(var(--my) * 1%); }
  .map-hero .hero-text { top: 24px; transform: none; }
  .map-hero h1 { font-size: 4rem; }
  .map-hero .scope { max-width: 22ch; }
  .mh-trien { top: auto; bottom: 120px; right: auto; left: var(--m); }
}

/* trang từng bộ */
.g-side > h1 { font: 700 clamp(2rem, 1.4rem + 2.2vw, 3.25rem)/1.25 var(--but); }
.notes-h { font: 700 clamp(1.75rem, 1.4rem + 1vw, 2.25rem)/1.3 var(--but); }
.stage { border-top: 0 !important; background: #fff !important; }

/* bản đồ lãnh thổ thuỷ mặc: màu vẽ sẵn trong ảnh, lớp vùng trong suốt chỉ để bấm và làm nổi */
.vk.tm .rg { fill-opacity: 0; stroke: none; opacity: 1; }
.vk.tm .rg:hover { filter: none; fill: #fff; fill-opacity: 0.16; }
.vk.tm .rg.lit { stroke: #9c3a28; stroke-width: 5; stroke-linejoin: round; }
.vk.tm .rg.dim { opacity: 1; fill: #ece7db; fill-opacity: 0.62; }
.vk.tm text { font-family: var(--but); font-weight: 700; fill: #23261f; letter-spacing: 0; paint-order: stroke; stroke: rgba(240, 236, 226, 0.92); stroke-width: 7px; stroke-linejoin: round; }
.vk.tm .cn { font-size: 30px; } .vk.tm .nbt { opacity: 0.75; }
.vk.tm .cap circle { fill: #f0ece2; stroke: #23261f; stroke-width: 4; }
.vk-l:has(.tm)::after { content: none; }
.lf-year { font: 700 clamp(26px, 3.4vw, 46px)/1 var(--but); color: #9c3a28; text-shadow: none; }
.ig-map.lf-vd .lf-map { background-color: #cdd5d0 !important; }
.vk.tm .sm { font-size: 36px; } .vk.tm .cn { font-size: 32px; }
.lf-vd .lf-year { right: auto; left: 18px; } .lf-vd .lf-tools { right: auto; left: 10px; }
@media (max-width: 480px) { .su-dau:has(.su-nv a:nth-child(3)) .su-nv { grid-template-columns: repeat(3, 1fr); } .su-dau:has(.su-nv a:nth-child(3)) .su-nv img { height: 130px; } }
