@charset "utf-8";
/* NẾP VIỆT — cuốn sách khổ lớn về phục trang: giấy ngà, mực đen, son trầm, chàm. */
:root {
  --paper: #F5F1E8;
  --ink: #24221F;
  --son: #A43B30;
  --cham: #253C49;
  --white: #fff;
  --muted: #575147;
  --line: rgba(36, 34, 31, 0.2);
  --tint: var(--cham);          /* sắc vải của bộ đang xem, đặt từ dữ liệu */
  --serif: "Noto Serif", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  --m: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button, select { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: var(--cham); color: var(--paper); }
:focus-visible { outline: 2px solid var(--son); outline-offset: 3px; }
main:focus { outline: none; }
.vh, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.roman { font-family: var(--serif); font-variant-numeric: lining-nums; }

/* ---------- đầu trang ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 16px var(--m) 12px; border-bottom: 1px solid var(--line); }
.brand { font: 500 1.5rem/1 var(--serif); text-decoration: none; letter-spacing: 0.01em; }
.top nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.top nav a { text-decoration: none; font-size: 1rem; padding: 8px 0; border-bottom: 2px solid transparent; transition: color 160ms, border-color 160ms; }
.top nav a:hover { border-bottom-color: var(--line); }
.top nav a[aria-current] { border-bottom-color: var(--son); color: var(--son); }

/* ---------- ảnh ---------- */
.media { position: relative; background: var(--white); }
.media > img, .media > svg { width: 100%; height: 100%; object-fit: contain; }
.crop { position: relative; overflow: hidden; background: var(--white); width: 100%; }
.crop-in { position: absolute; }
.crop-in .media { width: 100%; }
.crop-own img { width: 100%; height: auto; }

.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 500; font-size: 0.9375rem; transition: background-color 160ms; }
.btn:hover { background: var(--son); }
.btn:active { transform: translateY(1px); }

.closeup { display: block; text-decoration: none; border: 1px solid var(--line); background: var(--white); transition: border-color 160ms; }
.closeup span { display: block; padding: 10px 12px; font-size: 0.9375rem; line-height: 1.35; background: var(--paper); border-top: 1px solid var(--line); }
.closeup:hover { border-color: var(--son); }
.closeup:hover span { color: var(--son); }

/* ---------- TRANG CHỦ ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--m); padding: clamp(24px, 4vw, 56px) var(--m) clamp(40px, 6vw, 88px); align-items: stretch; }
.hero-text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; padding-bottom: 8vh; }
.hero h1 { font-size: clamp(2.5rem, 1rem + 4.2vw, 5rem); line-height: 1.1; letter-spacing: -0.015em; }
.scope { font: italic 400 clamp(1.125rem, 1rem + 0.5vw, 1.375rem)/1.4 var(--serif); color: var(--muted); }
.hero-show { display: grid; grid-template-columns: minmax(0, 1fr) clamp(140px, 15vw, 210px); gap: clamp(12px, 2vw, 28px); align-items: end; }
.hero-frame { display: flex; justify-content: center; background: var(--white); padding: clamp(24px, 4.5vw, 72px) clamp(16px, 3vw, 48px); border-top: 3px solid var(--tint); }
.hero-frame .media { height: min(68svh, 780px); max-width: 100%; }
.hero-side { display: grid; gap: 14px; }
.hero-cap { font-size: 0.875rem; color: var(--muted); line-height: 1.4; }
.hero-cap b { display: block; font: 400 1.0625rem/1.3 var(--serif); color: var(--ink); }

.toc-sec, .near-sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px var(--m); padding: clamp(56px, 8vw, 128px) var(--m); }
.toc-sec { border-top: 1px solid var(--line); }
.sec-head h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); }
.path-lead { color: var(--muted); margin-top: 12px; max-width: 30ch; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.toc a { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; gap: 8px 16px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding-left 300ms var(--ease); }
.toc .roman { color: var(--muted); font-size: 1.125rem; }
.toc-t { font: 400 clamp(1.125rem, 1rem + 0.6vw, 1.5rem)/1.3 var(--serif); }
.toc-r { font-size: 0.875rem; color: var(--muted); text-align: right; }
.toc a:hover { padding-left: 10px; }
.toc a:hover .toc-t, .toc a:hover .roman { color: var(--son); }
.near-sec { background: var(--cham); color: var(--paper); }
.near-sec .path-lead { color: rgba(245, 241, 232, 0.78); }
.near-sec :focus-visible { outline-color: var(--paper); }
.near { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 36px); align-items: end; }
.near-sec .closeup { border: 0; background: none; }
.near-sec .closeup span { background: none; border: 0; padding: 14px 0 0; color: var(--paper); font: 400 clamp(1rem, 0.9rem + 0.5vw, 1.25rem)/1.3 var(--serif); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.25em; transition: text-decoration-color 200ms; }
.near-sec .closeup:hover span { color: var(--paper); text-decoration-color: currentColor; }

/* ---------- DÒNG THỜI GIAN ---------- */
.tl { padding: clamp(28px, 4vw, 56px) var(--m) 0; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(24px, 3vw, 40px); }
.tl h1, .gal h1, .cmp h1 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); }
.legend { font-size: 0.875rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); flex: none; }
.dot.on { background: var(--son); border-color: var(--son); }
.legend .dot:nth-of-type(2) { margin-left: 12px; }

.ch { border-top: 1px solid var(--ink); }
.ch-h { font: inherit; }
.ch-btn { display: grid; grid-template-columns: 3.25rem auto minmax(0, 1fr) auto; align-items: baseline; gap: 0 12px; width: 100%; padding: 18px 0; background: none; border: 0; text-align: left; cursor: pointer; }
.ch-btn .roman { font-size: 1.125rem; color: var(--muted); }
.thread { align-self: center; height: 2px; width: 0; background: var(--son); }
.ch-t { font: 400 clamp(1.25rem, 1rem + 1vw, 1.75rem)/1.25 var(--serif); }
.ch-r { font-size: 0.875rem; color: var(--muted); text-align: right; }
.ch-btn:hover .ch-t { color: var(--son); }
.ch.open .roman { color: var(--son); }
.ch.open .thread { width: clamp(20px, 5vw, 72px); margin-right: 4px; animation: thread 220ms linear both; }
@keyframes thread { from { width: 0; } }
.ch-body { display: grid; grid-template-columns: clamp(140px, 16vw, 220px) minmax(0, 1fr); gap: 16px clamp(20px, 3vw, 48px); padding: 8px 0 40px 3.25rem; }
.ch-body[hidden] { display: none; }
.ch-cover { grid-row: span 2; align-self: start; text-decoration: none; border-top: 3px solid var(--tint); background: var(--white); }
.ch-cover span { display: block; padding: 8px 10px; font-size: 0.875rem; background: var(--paper); }
.ch-cover:hover span { color: var(--son); }
.ch.open .ch-cover { animation: fade 360ms 220ms ease-out both; }
@keyframes fade { from { opacity: 0; } }
.rows { grid-column: 2; min-width: 0; }
.ch-body > .rows:first-child { grid-column: 1 / -1; }
.axis { display: flex; justify-content: space-between; margin-left: min(300px, 42%); padding: 0 0 6px 16px; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: lining-nums; border-bottom: 1px solid var(--line); }
.lane { font: 500 0.875rem/1.4 var(--sans); color: var(--cham); padding: 18px 0 4px; }
.row { display: grid; grid-template-columns: min(300px, 42%) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.row-info { padding: 10px 16px 10px 0; }
.row-btn { display: flex; align-items: baseline; gap: 10px; background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; font: 400 1.0625rem/1.35 var(--serif); min-height: 32px; }
.row-btn:hover { color: var(--son); }
.row-meta { font-size: 0.875rem; color: var(--muted); padding-left: 19px; line-height: 1.45; }
.track { position: relative; min-height: 44px; border-left: 1px solid var(--line); }
.bar { position: absolute; top: 50%; height: 7px; margin-top: -3.5px; background: var(--cham); min-width: 3px; }
.row.has .bar { background: var(--son); }
.bar.cont::after { content: ""; position: absolute; right: -9px; top: -3.5px; border: 7px solid transparent; border-left: 9px solid var(--cham); border-right: 0; }
.bar.pre::before { content: ""; position: absolute; left: -9px; top: -3.5px; border: 7px solid transparent; border-right: 9px solid var(--cham); border-left: 0; }
.pt { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--cham); }
.pt.turning { background: var(--son); border-radius: 0; transform: rotate(45deg); width: 11px; height: 11px; }
.row-note { grid-column: 1 / -1; padding: 4px 0 18px 19px; font-size: 0.9375rem; color: var(--muted); max-width: 70ch; }
.row-note[hidden] { display: none; }
.row-note p + p { margin-top: 6px; }
.row.open .row-btn { color: var(--son); }
.row-thumbs { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.row-thumbs a { width: 96px; text-decoration: none; font-size: 0.875rem; color: var(--ink); }
.row-thumbs a:hover { color: var(--son); }
.row-thumbs .media { border: 1px solid var(--line); margin-bottom: 4px; }
.cmp-link { display: inline-block; margin-top: 20px; font-size: 0.9375rem; }
.ch-body .cmp-link { grid-column: 2; }
.cmp-link:hover { color: var(--son); }

.end { margin: clamp(40px, 6vw, 80px) calc(-1 * var(--m)) 0; padding: clamp(36px, 5vw, 64px) var(--m); background: var(--cham); color: var(--paper); display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 32px; }
.end p { font: 400 clamp(1.25rem, 1rem + 1vw, 1.75rem)/1.3 var(--serif); margin-right: auto; }
.end a { padding: 8px 0; }
.end :focus-visible { outline-color: var(--paper); }

/* ---------- BỘ SƯU TẬP ---------- */
.gal { padding: clamp(28px, 4vw, 56px) var(--m) 0; }
.gal-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; }
.tabs { display: flex; gap: clamp(16px, 3vw, 32px); }
.tab { font: 400 clamp(1.125rem, 1rem + 0.5vw, 1.375rem)/1.3 var(--serif); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.tab:hover { border-bottom-color: var(--line); }
.tab[aria-current] { color: var(--son); border-bottom-color: var(--son); }
.filters { margin: 24px 0 clamp(36px, 5vw, 64px); border-top: 1px solid var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 0 26px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.chip { flex: none; white-space: nowrap; text-decoration: none; font-size: 0.9375rem; padding: 10px 0 8px; border-bottom: 2px solid transparent; min-height: 44px; transition: color 160ms, border-color 160ms; display: inline-flex; align-items: center; gap: 6px; }
.chip .roman { color: var(--muted); }
.chip:hover { color: var(--son); }
.chip[aria-current] { color: var(--son); border-bottom-color: var(--son); }
.chip[aria-current] .roman { color: inherit; }
.chips.sub .chip { color: var(--muted); }
.chips.sub .chip[aria-current] { color: var(--son); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: clamp(36px, 5vw, 72px) clamp(20px, 3vw, 48px); }
.card { text-decoration: none; display: block; }
.card .media { padding: 0; border-top: 3px solid var(--tint); transition: transform 300ms var(--ease); }
.card:hover .media { transform: translateY(-4px); }
.card-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0 0; border-top: 1px solid var(--line); margin-top: 10px; }
.card-cap b { font: 400 1.0625rem/1.3 var(--serif); }
.card-cap span { font-size: 0.875rem; color: var(--muted); text-align: right; }
.card:hover b { color: var(--son); }
.empty, .gal-note { color: var(--muted); max-width: 60ch; }
.gal-note { margin-top: clamp(32px, 5vw, 64px); font-size: 0.9375rem; padding-bottom: 56px; }
.gal .cmp-link { margin-top: 36px; }
.gal > :last-child:not(.end) { margin-bottom: clamp(48px, 7vw, 96px); }

/* ---------- TRANG XEM BỘ ĐỒ ---------- */
.g { padding: 16px var(--m) 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.875rem; color: var(--muted); text-decoration: none; }
.back::before { content: "\2190 "; margin-right: 8px; }
.back:hover { color: var(--son); }
.g-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: clamp(20px, 3.5vw, 56px); align-items: stretch; }
.stage { min-width: 0; }
.frame { position: relative; background: var(--white); width: 100%; max-height: calc(100svh - 132px); min-height: 320px; border-top: 3px solid var(--tint); overflow: hidden; }
.g.single .frame { max-height: none; }
.layer { position: absolute; inset: 0; padding: 5%; display: flex; justify-content: center; align-items: center; }
.layer .media { height: 100%; max-width: 100%; background: none; }
.g-side { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: clamp(0px, 2vw, 28px) 0 8px; }
.g h1 { font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.5rem); line-height: 1.1; }
.g-sub { font: italic 400 1.1875rem/1.4 var(--serif); color: var(--muted); margin-top: -10px; }
.diem { display: block; width: 100%; height: 12px; background-image: var(--motif); background-repeat: repeat-x; border-top: 1px solid var(--tint); border-bottom: 1px solid var(--tint); opacity: 0.9; }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg-i { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; background: none; border: 0; cursor: pointer; text-decoration: none; font-size: 0.9375rem; white-space: nowrap; }
.seg-i + .seg-i { border-left: 1px solid var(--ink); }
.seg-i:hover { background: rgba(36, 34, 31, 0.07); }
.seg-i[aria-pressed="true"], .seg-i[aria-current] { background: var(--son); color: var(--paper); }
.g-h2 { font: 500 0.9375rem/1.4 var(--sans); margin-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; align-items: start; }
.tile { display: block; padding: 0; background: var(--white); border: 1px solid var(--line); cursor: zoom-in; text-align: left; transition: border-color 160ms; }
.tile span { display: block; padding: 10px 12px; font-size: 0.9375rem; line-height: 1.35; background: var(--paper); border-top: 1px solid var(--line); }
.tile:hover, .tile.on { border-color: var(--son); }
.tile:hover span, .tile.on span { color: var(--son); }

.detail { position: absolute; inset: 0; z-index: 3; background: var(--paper); display: flex; flex-direction: column; gap: 12px; }
.detail[hidden] { display: none; }
.detail-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.detail-bar h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
.x, .detail-foot button { background: none; border: 1px solid var(--ink); min-height: 44px; padding: 8px 16px; cursor: pointer; font-size: 0.875rem; }
.x:hover, .detail-foot button:hover { background: var(--son); border-color: var(--son); color: var(--paper); }
.detail-img { flex: 1; min-height: 0; display: flex; align-items: center; background: var(--white); border: 1px solid var(--line); padding: 4%; }
.detail-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.875rem; color: var(--muted); }
.detail-foot .diem { flex: 1 1 100%; }
.detail-foot button:last-child { margin-left: 0; }
.scrim { display: none; }

.notes { margin-top: clamp(32px, 5vw, 64px); padding-top: 20px; border-top: 1px solid var(--ink); max-width: 72ch; }
.desc { font: 400 1.0625rem/1.7 var(--serif); margin-top: 10px; }
.src { margin: 12px 0 0; padding-left: 1.1em; font-size: 0.9375rem; color: var(--muted); }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: clamp(36px, 5vw, 72px) 0 clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); }
.pn a { text-decoration: none; padding: 14px 0; font: 400 1.0625rem/1.35 var(--serif); }
.pn small { display: block; font: 400 0.875rem/1.4 var(--sans); color: var(--muted); }
.pn-next { text-align: right; }
.pn a:hover { color: var(--son); }
.g .end { margin-top: 0; }

/* ---------- ĐỐI CHIẾU ---------- */
.cmp { padding: 16px var(--m) clamp(48px, 7vw, 96px); }
.cmp-ctl { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 20px 0 24px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2.5vw, 40px); align-items: start; }
.cmp-col { display: grid; gap: 10px; min-width: 0; }
.cmp-pick select { width: 100%; min-height: 44px; padding: 8px 10px; background: var(--paper); border: 1px solid var(--ink); border-radius: 0; }
.cmp-frame { max-height: none; min-height: 0; padding: 4%; display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; }
.cmp-frame > .media { height: 100%; max-width: 100%; }
.cmp-open { font-size: 0.875rem; }
.cmp-open:hover { color: var(--son); }

/* ---------- chuyển tiếp ảnh bìa → ảnh trưng bày ---------- */
::view-transition-group(garment) { animation-duration: 420ms; animation-timing-function: var(--ease); }
::view-transition-old(garment), ::view-transition-new(garment) { height: 100%; object-fit: contain; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }

/* ---------- xuất hiện so le, soi nhẹ khi rê chuột ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.hero-text > *, .hero-frame, .hero-side, .card, .near .closeup, .tile, .g-side > h1, .g-side > .g-sub, .g-side > .diem, .g-side > .seg, .tl-head, .gal-head, .ch.open .row, .ch.open .lane { animation: rise 460ms var(--ease) both; }
.hero-text > :nth-child(2), .g-side > .g-sub { animation-delay: 70ms; }
.hero-text > :nth-child(3), .g-side > .diem { animation-delay: 140ms; }
.hero-frame { animation-delay: 60ms; }
.hero-side { animation-delay: 260ms; }
.g-side > .seg { animation-delay: 200ms; }
.card:nth-child(2), .near .closeup:nth-child(2), .tile:nth-child(2) { animation-delay: 70ms; }
.card:nth-child(3), .near .closeup:nth-child(3), .tile:nth-child(3) { animation-delay: 140ms; }
.card:nth-child(4), .tile:nth-child(4) { animation-delay: 210ms; }
.card:nth-child(n+5) { animation-delay: 280ms; }
.tile { animation-delay: 260ms; }
.tile:nth-child(2) { animation-delay: 330ms; }
.tile:nth-child(3) { animation-delay: 400ms; }
.ch.open .row, .ch.open .lane { animation-duration: 320ms; animation-delay: 220ms; }
.ch.open .row:nth-child(n+4) { animation-delay: 280ms; }
.ch.open .row:nth-child(n+7) { animation-delay: 340ms; }
.ch.open .bar { transform-origin: 0 50%; animation: draw 520ms 320ms var(--ease) both; }
@keyframes draw { from { transform: scaleX(0); } }
.crop-in { transition: transform 600ms var(--ease); }
.tile:hover .crop-in, .closeup:hover .crop-in { transform: scale(1.06); }

/* ---------- máy tính bảng, điện thoại ---------- */
@media (max-width: 859px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 0; }
  .hero-frame .media { height: auto; width: min(100%, 420px); }
  .toc-sec, .near-sec { grid-template-columns: 1fr; }
  .path-lead { max-width: 46ch; }
  .g-grid { grid-template-columns: 1fr; }
  .frame { max-height: none; }
  .g-side { position: static; }
  .detail { position: fixed; inset: auto 0 0 0; z-index: 30; max-height: 86svh; overflow-y: auto; padding: 16px var(--m) calc(16px + env(safe-area-inset-bottom)); border-top: 3px solid var(--tint); box-shadow: 0 -18px 40px -18px rgba(36, 34, 31, 0.5); }
  .detail-img { flex: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(36, 34, 31, 0.5); }
  .scrim[hidden] { display: none; }
  body.detail-open { overflow: hidden; }
  .ch-body { grid-template-columns: 1fr; padding-left: 0; }
  .ch-cover { grid-row: auto; width: 140px; }
  .rows, .ch-body .cmp-link { grid-column: 1; }
}
@media (max-width: 599px) {
  .hero-show { grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; }
  .hero-frame { padding: 16px 6px; }
  .closeup span { padding: 8px; font-size: 0.875rem; }
  .toc a { grid-template-columns: 2.5rem minmax(0, 1fr); padding: 14px 0; }
  .near { grid-template-columns: 1fr 1fr; }
  .near .closeup:first-child { grid-column: 1 / -1; }
  .toc-r { grid-column: 2; text-align: left; }
  .ch-btn { grid-template-columns: 2.25rem auto minmax(0, 1fr); }
  .ch-r { grid-column: 3; text-align: left; }
  .ch.open .ch-r { grid-column: 3; }
  .row { grid-template-columns: 1fr; }
  .track { min-height: 16px; border-left: 0; margin: 0 0 10px 19px; background: linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
  .axis { margin-left: 19px; padding-left: 0; }
  .card-cap { flex-direction: column; gap: 0; }
  .card-cap span { text-align: left; }
  .grid { grid-template-columns: 1fr 1fr; }
  .seg-i { padding: 8px 14px; }
  .pn { grid-template-columns: 1fr; gap: 0; }
  .pn-next { text-align: left; border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- mô tả theo tư liệu ---------- */
.notes { max-width: 78ch; }
.notes-h { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin-bottom: 14px; }
.notes .lead { font: italic 400 1.1875rem/1.55 var(--serif); color: var(--ink); margin-bottom: 8px; }
.parts { margin: 0; }
.parts > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 4px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.parts dt { font: 500 0.9375rem/1.5 var(--sans); color: var(--tint); }
.parts dd { margin: 0; font: 400 1.0625rem/1.7 var(--serif); }
.notes .ai { margin-top: 8px; padding: 14px 16px; background: rgba(36, 34, 31, 0.05); font-size: 0.9375rem; line-height: 1.6; color: var(--muted); }
.notes .ai b { color: var(--ink); font-weight: 600; }
@media (max-width: 599px) { .parts > div { grid-template-columns: 1fr; } }

/* ---------- slide ảnh trang chủ ---------- */
.slides { position: relative; min-width: 0; align-self: center; }
.slide-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cham); }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 900ms ease, visibility 0s linear 900ms; }
.slide.on { opacity: 1; visibility: visible; transition: opacity 900ms ease; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.0); }
.slide.on img { animation: slow-zoom 7s ease-out both; }
.paused .slide.on img { animation-play-state: paused; }
@keyframes slow-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.slide-cap { position: absolute; left: 0; bottom: 0; display: flex; align-items: baseline; gap: 12px; padding: 12px 20px 12px 18px; background: var(--paper); color: var(--ink); font: 400 clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem)/1.3 var(--serif); border-top: 3px solid var(--son); }
.slide-cap .roman { color: var(--son); font-size: 0.9em; }
.slide:hover .slide-cap { color: var(--son); }
.slide:focus-visible { outline-offset: -4px; outline-color: var(--paper); }
.slide-bar { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.slide-nav, .slide-play { background: none; border: 1px solid var(--line); min-width: 44px; min-height: 44px; cursor: pointer; font-size: 1rem; transition: border-color 160ms, color 160ms; }
.slide-play { margin-left: auto; padding: 0 14px; font-size: 0.875rem; }
.slide-nav:hover, .slide-play:hover { border-color: var(--son); color: var(--son); }
.slide-dots { display: flex; }
.dot-btn { width: 36px; height: 44px; background: none; border: 0; cursor: pointer; display: grid; place-items: center; padding: 0; }
.dot-btn span { display: block; width: 22px; height: 2px; background: var(--line); transition: background-color 200ms, height 200ms; }
.dot-btn:hover span { background: var(--ink); }
.dot-btn[aria-current] span { background: var(--son); height: 4px; }
@media (max-width: 599px) { .slide-cap { padding: 8px 12px; } }

/* ---------- tầng lớp ---------- */
.g-class { display: inline-block; margin-top: -6px; padding: 3px 10px; border: 1px solid var(--tint); color: var(--ink); font-size: 0.8125rem; letter-spacing: 0.01em; }
.card-class { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--son); }

/* ---------- chân trang ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 48px; padding: clamp(32px, 4vw, 48px) var(--m) clamp(28px, 3vw, 40px); background: var(--ink); color: rgba(245, 241, 232, 0.72); font-size: 0.9375rem; }
.foot .brand { color: var(--paper); font: 400 1.375rem/1.2 var(--serif); }
.foot-brand p { margin-top: 6px; max-width: 46ch; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.foot nav a { color: var(--paper); padding: 8px 0; }
.foot :focus-visible { outline-color: var(--paper); }
/* infographic trên trang chủ */
.ig.ig-home { border-top: 1px solid var(--line); padding-bottom: clamp(40px, 6vw, 80px); }
.ig-more { display: flex; flex-wrap: wrap; gap: 8px 32px; margin-top: clamp(28px, 4vw, 48px); padding-top: 20px; border-top: 1px solid var(--line); }
.ig-more a { padding: 8px 0; }

/* ---------- tối ưu bố cục mọi khổ màn hình (28/11/2026) ---------- */
/* chấm slide tự co cho vừa hàng, không tràn ngang dù có nhiều slide */
.slide-dots { flex: 1 1 auto; min-width: 0; }
.dot-btn { flex: 1 1 0; min-width: 6px; max-width: 36px; width: auto; }
.dot-btn span { width: 100%; max-width: 22px; }
/* lưới thẻ dày hơn trên màn hình vừa */
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: clamp(28px, 4vw, 56px) clamp(16px, 2.4vw, 36px); }
@media (max-width: 859px) {
  /* bộ lọc thành một hàng vuốt ngang */
  .chips { flex-wrap: nowrap; overflow-x: auto; gap: 0 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .tabs { gap: 18px; }
  .tab { font-size: 1.0625rem; }
  .filters { margin: 16px 0 28px; }
  .gal-head { align-items: flex-end; }
}
@media (min-width: 600px) and (max-width: 859px) {
  /* máy tính bảng: trang chi tiết vẫn 2 cột */
  .g-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .frame { max-height: calc(100svh - 120px); }
  .g h1 { font-size: clamp(1.75rem, 1rem + 2.4vw, 2.25rem); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding-bottom: 32px; }
}
@media (max-width: 599px) {
  .frame { max-height: 68svh; }
  .g h1 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .gal-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .tabs { gap: 16px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; white-space: nowrap; font-size: 1rem; }
  .card-cap b { font-size: 1rem; }
  .top { padding: 12px var(--m) 8px; }
  .top nav { gap: 14px; }
  .top nav a { font-size: 0.9375rem; }
  .hero { gap: 20px; padding-bottom: 28px; }
  .hero h1 { font-size: 2.25rem; }
  .slide-play { padding: 0 10px; }
  .foot { gap: 12px; }
}

/* thẻ bộ sưu tập: mọi khung ảnh cùng tỉ lệ để chữ dưới thẻ thẳng hàng (ảnh vẫn giữ nguyên, căn giữa trong khung) */
.grid .card .media { aspect-ratio: 5 / 8 !important; }
.grid .card .media > img { position: absolute; inset: 0; }

/* slide video mở đầu */
.slide video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.slide-snd { background: none; border: 1px solid var(--line); min-height: 44px; padding: 0 14px; cursor: pointer; font-size: 0.875rem; transition: border-color 160ms, color 160ms; margin-left: auto; }
.slide-snd:hover, .slide-snd[aria-pressed="true"] { border-color: var(--son); color: var(--son); }
.slide-snd:not([hidden]) + .slide-play { margin-left: 0; }

/* chú thích slide nằm dưới ảnh, không che hình: các slide xếp chồng trong một ô lưới, cao = ảnh 16:9 + dòng chữ */
.slide-stage { aspect-ratio: auto; display: grid; background: none; }
.slide { position: relative; inset: auto; grid-area: 1 / 1; display: flex; flex-direction: column; }
.slide img, .slide video { height: auto; aspect-ratio: 16 / 9; background: var(--cham); }
.slide-cap { position: relative; z-index: 1; left: auto; bottom: auto; align-self: flex-start; }

/* ghi chú chân trang */
.foot-note { flex-basis: 100%; margin: 4px 0 0; padding-top: 16px; border-top: 1px solid rgba(245, 241, 232, 0.16); font-size: 0.875rem; line-height: 1.6; max-width: 90ch; }
.foot-note a { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }

/* điều khiển trong video: bật tiếng, tua, thời gian (phủ đáy khung 16:9) */
.vid-ctl { position: absolute; z-index: 3; left: 0; right: 0; top: 0; aspect-ratio: 16 / 9; display: flex; align-items: flex-end; gap: 10px; padding: 0 12px 10px; pointer-events: none; background: linear-gradient(transparent 72%, rgba(0,0,0,.55)); }
.vid-ctl[hidden] { display: none; }
.vid-ctl > * { pointer-events: auto; }
.vc-snd { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(20,18,16,.6) center / 18px no-repeat; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z' fill='%23fff'/%3E%3Cpath d='m22 9-6 6M16 9l6 6'/%3E%3C/svg%3E"); }
.vc-snd[aria-pressed="true"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z' fill='%23fff'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E"); }
.vc-snd:hover, .vc-snd:focus-visible { background-color: var(--son); }
.vc-seek { flex: 1; min-width: 0; height: 34px; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; --p: 0%; }
.vc-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--son) var(--p), rgba(255,255,255,.45) var(--p)); }
.vc-seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.45); }
.vc-seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--son); }
.vc-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(164,59,48,.6); }
.vc-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.vc-t { flex: none; color: #fff; font: 500 0.78rem/1 var(--sans); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.6); padding-bottom: 1px; align-self: center; margin-top: auto; height: 34px; display: grid; place-items: center; }

/* thanh điều hướng slide gọn: nằm cùng hàng với chú thích, bên phải */
.slides .slide-bar { width: fit-content; margin: -44px 0 0 auto; position: relative; z-index: 2; gap: 4px; min-height: 44px; }
.slides .slide-dots { display: none; }
.slides .slide-nav, .slides .slide-play { min-width: 32px; min-height: 32px; height: 32px; font-size: 0.875rem; padding: 0 8px; }
.slides .slide-play { margin-left: 4px; padding: 0 10px; font-size: 0.8125rem; }
.slide-n { min-width: 52px; text-align: center; font: 500 0.8125rem/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .slides .slide-bar { margin: 8px 0 0 auto; } }

/* hạn chế lưu ảnh: không kéo thả, không hiện menu "Lưu ảnh" khi nhấn giữ trên điện thoại */
img, video, svg { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
.media, .slide-stage, .crop, .ig-mchip, .terr-gs, .ig-d-cards { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
