/* SOLUNA XII — hộp thoại hướng dẫn bảo tàng (museum.js).
 * Nền Đất Nung #C75A28; chữ nhỏ chỉ đặt trên giấy ngà #F7F1E6 (thẻ giấy, passe-partout, hàng số);
 * chữ trực tiếp trên nền đất nung đều ≥ 24px, màu #2B1A10. Đất nung làm chữ chỉ ở cỡ ≥ 24px (số La Mã). */
.sm-root {
  --sm-ink: #2B1A10;
  --sm-deep: #9E3A16;
  --sm-terra: #C75A28;
  --sm-hover: #E07A47;
  --sm-ivory: #F7F1E6;
  --sm-ivory2: #EDE3D1;
  --sm-ash: #4B4436;
  --sm-soft: #6B4A2F;
  --sm-line: rgba(75, 68, 54, .3);
  --sm-ease: cubic-bezier(.65, 0, .35, 1);
  --sm-out: cubic-bezier(.22, .61, .36, 1);
  --sm-pad: clamp(20px, 5vw, 88px);
  --sm-top: clamp(76px, 13vh, 124px);    /* đầu trang: tên + bộ đếm */
  --sm-bot: 74px;                         /* hàng số, nút × ở khấc dưới, mũi tên */
  --sm-gap: clamp(28px, 4.4vw, 76px);    /* khoảng giữa ảnh và thẻ chữ */
  --sm-mat: 14px;                         /* passe-partout */
  --sm-cap: 48px;                         /* dòng chú thích dưới ảnh */
  --sm-thb: 54px;                         /* ảnh nhỏ */
  --sm-thh: calc(var(--sm-thb) + 16px);
  --sm-cw: clamp(340px, 40cqw, 540px);    /* bề ngang thẻ chữ */
  position: fixed;
  inset: var(--frame, 0px);
  z-index: var(--sm-z, 60);
  overflow: hidden;
  color: var(--sm-ink);
  outline: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-clip-path: circle(0px at var(--ox, 50%) var(--oy, 50%));
  clip-path: circle(0px at var(--ox, 50%) var(--oy, 50%));
  transition: clip-path .76s var(--sm-ease), -webkit-clip-path .76s var(--sm-ease);
  contain: layout paint;
}
.sm-root.is-open {
  -webkit-clip-path: circle(var(--or, 150vmax) at var(--ox, 50%) var(--oy, 50%));
  clip-path: circle(var(--or, 150vmax) at var(--ox, 50%) var(--oy, 50%));
  transition-duration: .95s;
}
html.sm-lock, html.sm-lock body { overscroll-behavior: none; }
.sm-root *, .sm-root *::before, .sm-root *::after { box-sizing: border-box; }
.sm-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- nền */
.sm-bg { position: absolute; inset: 0; background: var(--sm-terra); }
.sm-bg::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(120% 95% at 62% 48%, rgba(224, 122, 71, .16) 0%, rgba(199, 90, 40, 0) 42%, rgba(158, 58, 22, .55) 100%),
    linear-gradient(180deg, rgba(158, 58, 22, .18), rgba(158, 58, 22, 0) 30%, rgba(158, 58, 22, 0) 70%, rgba(158, 58, 22, .26));
}
.sm-bg::after {
  content: ''; position: absolute; inset: 0; opacity: .22; mix-blend-mode: multiply; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42 0 0 0 0 .2 0 0 0 0 .08 0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}
@media (hover: hover) and (pointer: fine) { .sm-bg { cursor: grab; } }
.sm-root.is-dragging, .sm-root.is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }

/* ---------------------------------------------------------------- tiêu đề chạy */
.sm-marquee {
  position: absolute; left: calc(-1 * var(--sm-pad)); right: calc(-1 * var(--sm-pad)); top: 50%;
  height: 40vh; margin-top: -20vh;
  overflow: hidden; pointer-events: none;
  opacity: 0; transform: translateY(6vh);
  transition: opacity .9s var(--sm-out) .25s, transform 1.2s var(--sm-out) .25s;
}
.sm-root.is-in .sm-marquee { opacity: 1; transform: none; }
.sm-mq-line {
  position: absolute; inset: 0; display: flex; align-items: center;
  transition: transform .9s var(--sm-ease), opacity .9s var(--sm-ease);
}
.sm-mq-line.is-enter-up { transform: translateY(72%); opacity: 0; transition: none; }
.sm-mq-line.is-enter-down { transform: translateY(-72%); opacity: 0; transition: none; }
.sm-mq-line.is-leave { transform: translateY(-72%); opacity: 0; }
.sm-mq-line.is-leave-down { transform: translateY(72%); opacity: 0; }
.sm-mq-track { display: flex; flex: none; white-space: nowrap; will-change: transform; animation: sm-mq 48s linear infinite; }
.sm-mq-chunk { flex: none; display: flex; align-items: center; }
.sm-mq-word {
  flex: none;
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-weight: 500; font-size: 34vh; line-height: 1.12; letter-spacing: -.012em;
  color: var(--sm-deep);
  text-shadow: 0 1px 0 rgba(247, 241, 230, .06);
}
.sm-mq-sep {
  flex: none; display: inline-block; margin: 0 .5em;
  font-family: 'Playfair Display', Georgia, serif; font-size: 7vh; line-height: 1;
  color: var(--sm-deep); opacity: .85; transform: translateY(-.1em);
}
@keyframes sm-mq { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- đầu trang */
.sm-head {
  position: absolute; left: var(--sm-pad); top: clamp(22px, 6.5vh, 70px);
  display: flex; align-items: baseline; gap: 18px; margin: 0; z-index: 2;
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s var(--sm-out) .45s, transform .9s var(--sm-out) .45s;
}
.sm-root.is-in .sm-head { opacity: 1; transform: none; }
.sm-head p { margin: 0; }
.sm-kicker { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 400; font-size: 26px; line-height: 1; color: var(--sm-ink); }
.sm-count { font-family: 'Playfair Display', Georgia, serif; font-size: 24px; line-height: 1; color: var(--sm-ink); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .04em; }
.sm-count b { font-weight: 600; }

/* ---------------------------------------------------------------- sân khấu và các trang */
.sm-stage {
  position: absolute; top: var(--sm-top); bottom: var(--sm-bot); left: var(--sm-pad); right: var(--sm-pad);
  container-type: size;
}
.sm-track {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--sm-out) .3s, transform 1.2s var(--sm-out) .3s;
}
.sm-root.is-in .sm-track { opacity: 1; transform: none; }
.sm-slide {
  position: absolute; inset: 0; margin: 0;
  visibility: hidden; pointer-events: none;
  transition: transform .5s var(--sm-out);
}
.sm-root.is-dragging .sm-slide { transition: none; }
.sm-slide.is-cur, .sm-slide.is-out { visibility: visible; }
.sm-slide.is-cur { pointer-events: auto; }
.sm-body {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: var(--sm-gap);
  overflow: hidden; touch-action: pan-y;
}
/* đổi trang: ảnh và thẻ chữ trượt từ phía trước vào, so le 80 ms; trang cũ trượt ra phía sau */
.sm-figwrap, .sm-paper {
  opacity: 0; transform: translate3d(calc(var(--d, 1) * 64px), 0, 0);
  transition: opacity .45s cubic-bezier(.42, 0, 1, 1), transform .5s cubic-bezier(.42, 0, 1, 1);
}
.sm-slide.is-out .sm-figwrap, .sm-slide.is-out .sm-paper { opacity: 0; transform: translate3d(calc(var(--d, 1) * -64px), 0, 0); }
.sm-slide.is-cur .sm-figwrap, .sm-slide.is-cur .sm-paper {
  opacity: 1; transform: none;
  transition: opacity .75s var(--sm-out) .12s, transform 1s var(--sm-out) .12s;
}
.sm-slide.is-cur .sm-paper { transition-delay: .2s; }
.sm-slide.is-pre .sm-figwrap, .sm-slide.is-pre .sm-paper { transition: none !important; }

/* ---------------------------------------------------------------- ảnh lồng passe-partout */
.sm-figwrap { flex: none; display: flex; flex-direction: column; align-items: center; }
.sm-fig {
  --ph: min(calc(100vh - 2 * var(--frame, 0px) - var(--sm-top) - var(--sm-bot) - var(--sm-cap) - var(--sm-thh) - 2 * var(--sm-mat)), 40vw, 600px);
  --ph: min(calc(100cqh - var(--sm-cap) - var(--sm-thh) - 2 * var(--sm-mat)), calc(100cqw - var(--sm-cw) - var(--sm-gap) - 2 * var(--sm-mat)), 600px);
  margin: 0; position: relative;
  padding: var(--sm-mat) var(--sm-mat) 0;
  background: var(--sm-ivory);
  box-shadow:
    0 0 0 1px rgba(75, 68, 54, .55),
    0 40px 70px -24px rgba(43, 26, 16, .6),
    0 14px 26px -14px rgba(43, 26, 16, .4);
}
.sm-photo {
  position: relative; width: var(--ph); aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--sm-ivory2);
  box-shadow: 0 0 0 1px rgba(75, 68, 54, .32);
}
.sm-ph {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transform: scale(1.03);
  transition: opacity .7s var(--sm-out), transform 1.4s var(--sm-out);
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
.sm-ph.is-cur.is-loaded { opacity: 1; transform: none; }
.sm-cap {
  height: var(--sm-cap); display: flex; align-items: center; justify-content: center;
  width: var(--ph); margin: 0 auto; padding: 2px 6px;
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 17px; line-height: 1.22; color: var(--sm-ash); text-align: center; text-wrap: balance;
  overflow: hidden;
  transition: opacity .22s var(--sm-out);
}
.sm-cap.is-swap { opacity: 0; }
.sm-thumbs { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.sm-thumb {
  appearance: none; border: 0; padding: 0; margin: 0; cursor: pointer; position: relative;
  width: var(--sm-thb); height: var(--sm-thb); background: var(--sm-ivory2);
  box-shadow: 0 0 0 3px var(--sm-ivory), 0 0 0 4px rgba(75, 68, 54, .45), 0 10px 18px -10px rgba(43, 26, 16, .6);
  opacity: .78; transform: translateY(0);
  transition: opacity .35s var(--sm-out), transform .45s var(--sm-out), box-shadow .35s var(--sm-out);
}
.sm-th { width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none; }
.sm-thumb:hover { opacity: 1; transform: translateY(-3px); }
.sm-thumb[aria-pressed="true"] {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--sm-ivory), 0 0 0 5px var(--sm-deep), 0 10px 18px -10px rgba(43, 26, 16, .6);
}
.sm-s-intro .sm-photo { aspect-ratio: var(--ar, 1); }
.sm-s-intro .sm-fig {
  --ph: min(calc((100vh - 2 * var(--frame, 0px) - var(--sm-top) - var(--sm-bot) - var(--sm-cap) - 2 * var(--sm-mat)) * var(--ar, 1)), 40vw, 560px);
  --ph: min(calc((100cqh - var(--sm-cap) - 2 * var(--sm-mat)) * var(--ar, 1)), calc(100cqw - var(--sm-cwi) - var(--sm-gap) - 2 * var(--sm-mat)), 560px);
}

/* ---------------------------------------------------------------- thẻ giấy viền kép */
.sm-paper {
  flex: none; position: relative; display: flex; flex-direction: column;
  width: var(--sm-cw); max-height: 100%;
  /* giấy ngà có thớ: lớp ngà mỏng phủ lên thớ giấy để nền sáng, chữ dễ đọc */
  background: linear-gradient(rgba(247, 241, 230, .55), rgba(247, 241, 230, .55)), url('assets/paper.webp') 0 0 / 220px, var(--sm-ivory);
  background-blend-mode: normal, multiply, normal;
  color: var(--sm-ash);
  box-shadow: 0 0 0 1px rgba(75, 68, 54, .35), 0 34px 64px -30px rgba(43, 26, 16, .65), 0 12px 24px -16px rgba(43, 26, 16, .35);
}
.sm-rule { position: absolute; inset: 10px; border: 1px solid var(--sm-line); pointer-events: none; z-index: 1; }
.sm-rule::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(75, 68, 54, .18); }
.sm-pin {
  /* ruột cuộn nằm trong viền kép (margin 14px), chữ cuộn tới đâu cũng bị cắt gọn ở đường viền */
  position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y;   /* vuốt ngang trong thẻ vẫn đổi trang, không bị trình duyệt nuốt */
  margin: 14px;
  padding: clamp(14px, 2.6vh, 32px) clamp(14px, 1.8vw, 32px) clamp(14px, 2.4vh, 28px);
  scrollbar-width: thin; scrollbar-color: rgba(158, 58, 22, .45) transparent;
  outline: none;
}
.sm-pin::-webkit-scrollbar { width: 4px; }
.sm-pin::-webkit-scrollbar-thumb { background: rgba(158, 58, 22, .45); border-radius: 3px; }
/* còn chữ phía dưới: mép dưới mờ dần (museum.js bật/tắt .has-more theo vị trí cuộn) */
.sm-pin.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), rgba(0, 0, 0, .1));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), rgba(0, 0, 0, .1));
}
.sm-pin > :first-child { margin-top: 0; }
.sm-pin > :last-child { margin-bottom: 0; }

.sm-eb-k {
  margin: 0 0 12px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 500;
  font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--sm-deep);
}
.sm-h {
  margin: 0 0 16px;
  font-family: 'Playfair Display', Georgia, serif; font-weight: 500;
  font-size: clamp(25px, 3.4vh, 33px); line-height: 1.16; letter-spacing: .002em; color: var(--sm-deep);
  text-wrap: balance;
}
.sm-tmain { display: block; }
.sm-tsub {
  display: block; margin-top: .22em;
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-style: italic; font-weight: 500;
  font-size: .8em; line-height: 1.2; color: var(--sm-soft);
}
.sm-p {
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif; font-size: clamp(16px, 2vh, 18px); line-height: 1.55;
  color: var(--sm-ash); text-wrap: pretty;
}
.sm-rh {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 12px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 500;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--sm-deep);
}
.sm-rh::before {
  content: ''; flex: none; width: 7px; height: 7px; transform: rotate(45deg);
  border: 1px solid var(--sm-terra);
}
.sm-rh::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--sm-line); }

/* điểm nhấn của phòng */
.sm-hl { list-style: none; margin: 0; padding: 0; }
.sm-hl li {
  position: relative; padding: 0 0 0 20px; margin: 0 0 7px;
  font-family: 'EB Garamond', Georgia, serif; font-size: clamp(15.5px, 1.85vh, 16.5px); line-height: 1.38; color: var(--sm-ash);
}
.sm-hl li:last-child { margin-bottom: 0; }
.sm-hl li::before {
  content: ''; position: absolute; left: 3px; top: .58em; width: 5px; height: 5px;
  background: var(--sm-terra); transform: rotate(45deg);
}

/* số La Mã + giai đoạn */
.sm-eyebrow { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; }
.sm-numeral {
  flex: none; padding-right: 16px; border-right: 1px solid var(--sm-line);
  font-family: 'Playfair Display', Georgia, serif; font-weight: 500;
  font-size: clamp(38px, 5.4vh, 50px); line-height: .95; color: var(--sm-terra);
  font-variant-numeric: lining-nums;
}
.sm-ebt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sm-roomlbl {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 500;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--sm-deep);
}
.sm-period {
  text-wrap: balance;
  font-family: 'EB Garamond', Georgia, serif; font-variant-caps: all-small-caps;
  font-size: 18px; line-height: 1.2; letter-spacing: .07em; color: var(--sm-soft);
}

/* trang Bộ sưu tập */
.sm-s-intro { --sm-cwi: clamp(380px, 54cqw, 680px); }
.sm-s-intro .sm-paper { width: var(--sm-cwi); }
/* hai cột cố định: 01–06 bên trái, 07–11 bên phải (lưới theo cột, không để trình duyệt tự cân cột) */
.sm-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, auto); grid-auto-flow: column; column-gap: 28px; }
.sm-index li {
  display: flex; gap: 10px; align-items: baseline; min-width: 0;
  padding: 6px 0 7px; border-top: 1px solid rgba(75, 68, 54, .16);
}
.sm-ix-n {
  flex: none; width: 22px;
  font-family: 'Playfair Display', Georgia, serif; font-size: 14px; color: var(--sm-deep);
  font-variant-numeric: lining-nums tabular-nums;
}
.sm-ix-t { font-family: 'EB Garamond', Georgia, serif; font-size: clamp(15px, 1.8vh, 16px); line-height: 1.3; color: var(--sm-ash); }
.sm-note {
  margin: 18px 0 0;
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 18px; line-height: 1.35; color: var(--sm-soft);
}

/* trang cuối */
.sm-s-end .sm-paper { width: min(600px, 100%); text-align: center; }
.sm-s-end .sm-pin { padding-top: clamp(26px, 4vh, 40px); }
.sm-seal { position: relative; width: 104px; height: 104px; margin: 0 auto 16px; color: var(--sm-terra); }
.sm-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: sm-spin 30s linear infinite; }
.sm-ring text { fill: var(--sm-deep); font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-size: 14px; font-weight: 500; }
.sm-seal-mid { position: absolute; inset: 0; display: grid; place-items: center; }
.sm-seal-mid svg { width: 30px; height: 30px; }
@keyframes sm-spin { to { transform: rotate(360deg); } }
.sm-visit { font-style: italic; font-weight: 400; font-size: clamp(24px, 3.2vh, 30px); margin-bottom: 10px; }
.sm-tagline {
  margin: 0;
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif; font-style: italic; font-weight: 500;
  font-size: 19px; letter-spacing: .02em; color: var(--sm-soft);
}
.sm-acts { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 24px 0 22px; }
.sm-btn {
  appearance: none; margin: 0; cursor: pointer; border-radius: 999px;
  padding: 14px 30px; min-height: 46px;
  border: 1px solid var(--sm-deep); background: var(--sm-deep); color: var(--sm-ivory);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 500;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  transition: background-color .35s var(--sm-out), color .35s var(--sm-out), transform .45s var(--sm-out);
}
.sm-btn:hover { background: transparent; color: var(--sm-deep); }
.sm-btn:active { transform: scale(.97); }
.sm-link {
  appearance: none; border: 0; background: none; padding: 8px 0 4px; margin: 0; cursor: pointer;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 500;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--sm-deep);
  border-bottom: 1px solid rgba(158, 58, 22, .4);
  transition: border-color .3s var(--sm-out);
}
.sm-link:hover { border-bottom-color: var(--sm-deep); }
.sm-credit {
  margin: 0; padding-top: 16px; border-top: 1px solid rgba(75, 68, 54, .18);
  font-family: 'EB Garamond', Georgia, serif; font-style: italic; font-size: 14.5px; line-height: 1.45; color: var(--sm-soft);
}

/* ---------------------------------------------------------------- hàng số + mũi tên + nút đóng */
.sm-rail {
  position: absolute; left: var(--sm-pad); bottom: 11px; z-index: 2;
  display: flex; align-items: center; gap: 1px; padding: 4px;
  background: var(--sm-ivory); border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(75, 68, 54, .3), 0 10px 22px -12px rgba(43, 26, 16, .6);
  opacity: 0; transform: translateY(12px);
  transition: opacity .7s var(--sm-out) .6s, transform .9s var(--sm-out) .6s;
}
.sm-root.is-in .sm-rail { opacity: 1; transform: none; }
.sm-num {
  appearance: none; border: 0; margin: 0; padding: 0 7px; cursor: pointer;
  min-width: 34px; height: 28px; border-radius: 999px; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif; font-size: 13.5px; line-height: 1; color: var(--sm-deep);
  font-variant-numeric: lining-nums;
  transition: background-color .35s var(--sm-out), color .35s var(--sm-out);
}
.sm-num:hover { background: rgba(158, 58, 22, .1); }
.sm-num[aria-current="true"] { background: var(--sm-deep); color: var(--sm-ivory); }
.sm-num svg { display: block; }

.sm-nav {
  position: absolute; right: var(--sm-pad); bottom: 7px; z-index: 2;
  display: flex; align-items: center; gap: 12px; pointer-events: none;
  opacity: 0; transform: translateY(12px);
  transition: opacity .7s var(--sm-out) .65s, transform .9s var(--sm-out) .65s;
}
.sm-nav button { pointer-events: auto; }
.sm-root.is-in .sm-nav { opacity: 1; transform: none; }
.sm-arrow, .sm-close {
  appearance: none; border: 0; margin: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--sm-ivory); color: var(--sm-deep);
  box-shadow: 0 8px 20px -10px rgba(43, 26, 16, .6);
  transition: background-color .35s var(--sm-out), color .35s var(--sm-out), border-color .35s var(--sm-out), transform .45s var(--sm-out);
}
/* mũi tên: vòng chỉ mảnh màu ngà trên nền đất nung (3.8:1, đạt 3:1 cho thành phần giao diện) */
.sm-arrow {
  width: 44px; height: 44px;
  background: transparent; color: var(--sm-ivory);
  border: 1px solid rgba(247, 241, 230, .7); box-shadow: none;
}
.sm-arrow:hover { background: var(--sm-ivory); color: var(--sm-deep); border-color: var(--sm-ivory); }
.sm-close:hover { background: var(--sm-deep); color: var(--sm-ivory); }
.sm-prev:hover { transform: translateX(-3px); }
.sm-next:hover { transform: translateX(3px); }
.sm-arrow:active, .sm-close:active { transform: scale(.94); }
.sm-close {
  /* .sm-root đã lùi vào trong khung, nên bottom: 6px nằm trong khấc dưới của khung */
  position: absolute; left: 50%; bottom: 6px;
  width: 46px; height: 46px; margin-left: -23px; z-index: 3;
  opacity: 0; transform: translateY(10px) scale(.9);
  transition: opacity .5s var(--sm-out) .7s, transform .7s var(--sm-out) .7s, background-color .35s, color .35s;
}
.sm-root.is-in .sm-close { opacity: 1; transform: none; }
.sm-root.is-in .sm-close:active { transform: scale(.94); }
.sm-root :focus-visible { outline: 2px solid var(--sm-ivory); outline-offset: 3px; }
.sm-paper :focus-visible, .sm-rail :focus-visible, .sm-fig :focus-visible { outline: 2px solid var(--sm-deep); outline-offset: 3px; }
.sm-thumb:focus-visible { outline: 2px solid var(--sm-ivory); outline-offset: 6px; }
.sm-root:focus-visible { outline: none; }

/* đóng: rút nội dung trước, vòng tròn thu lại sau */
.sm-root.is-closing .sm-marquee, .sm-root.is-closing .sm-head, .sm-root.is-closing .sm-track,
.sm-root.is-closing .sm-rail, .sm-root.is-closing .sm-nav, .sm-root.is-closing .sm-close {
  transition-delay: 0s; transition-duration: .35s;
}

/* ---------------------------------------------------------------- laptop nhỏ, tablet ngang */
@media (orientation: landscape) and (max-width: 1100px) {
  .sm-root { --sm-pad: clamp(20px, 4vw, 48px); --sm-gap: clamp(22px, 3.4vw, 40px); --sm-cw: clamp(320px, 44cqw, 480px); }
  .sm-s-intro { --sm-cwi: clamp(380px, 58cqw, 620px); }
}
@media (orientation: landscape) and (max-height: 800px) {
  .sm-root { --sm-top: clamp(64px, 11vh, 84px); --sm-thb: 48px; --sm-cap: 44px; }
  .sm-head { top: clamp(18px, 4.4vh, 34px); }
  .sm-index li { padding: 4px 0 5px; }
  .sm-ix-n { font-size: 13px; }
  .sm-ix-t { font-size: 14.5px; line-height: 1.25; }
  .sm-s-intro .sm-h { font-size: 25px; margin-bottom: 12px; }
  .sm-s-intro .sm-p { font-size: 15.5px; line-height: 1.48; }
  .sm-rh { margin: 16px 0 10px; }
  .sm-note { margin-top: 12px; font-size: 17px; }
}

/* ---------------------------------------------------------------- điện thoại ngang */
@media (orientation: landscape) and (max-height: 520px) {
  .sm-root {
    --sm-pad: 22px; --sm-top: 58px; --sm-bot: 54px; --sm-gap: 22px;
    --sm-mat: 8px; --sm-cap: 40px; --sm-thb: 40px; --sm-thh: 0px;
    --sm-cw: clamp(280px, 48cqw, 440px);
  }
  .sm-head { top: calc(12px + env(safe-area-inset-top, 0px)); right: var(--sm-pad); justify-content: space-between; }
  .sm-kicker { font-size: 24px; }
  .sm-marquee { height: 34vh; margin-top: -17vh; }
  .sm-mq-word { font-size: 30vh; }
  .sm-mq-sep { font-size: 6vh; }
  /* ảnh nhỏ thành một cột cạnh ảnh chính để ảnh chính giữ trọn chiều cao */
  .sm-figwrap { flex-direction: row; gap: 14px; }
  .sm-thumbs { flex-direction: column; margin: 0 0 var(--sm-cap); gap: 10px; }
  .sm-fig { --ph: min(calc(100cqh - var(--sm-cap) - 2 * var(--sm-mat)), calc(100cqw - var(--sm-cw) - var(--sm-gap) - 64px - 2 * var(--sm-mat))); }
  .sm-cap { font-size: 14px; line-height: 1.18; padding: 2px 2px; }
  .sm-pin { margin: 10px; padding: 10px 14px 10px; }
  .sm-rule { inset: 7px; }
  .sm-h { font-size: 22px; margin-bottom: 12px; }
  .sm-p { font-size: 15.5px; line-height: 1.5; }
  .sm-numeral { font-size: 34px; padding-right: 12px; }
  .sm-eyebrow { gap: 12px; margin-bottom: 12px; }
  .sm-period { font-size: 16px; }
  .sm-hl li { font-size: 15px; }
  .sm-rh { margin: 16px 0 10px; }
  .sm-index { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .sm-s-intro { --sm-cwi: clamp(300px, 52cqw, 480px); }
  .sm-s-intro .sm-fig { --ph: min(calc((100cqh - var(--sm-cap) - 2 * var(--sm-mat)) * var(--ar, 1)), calc(100cqw - var(--sm-cwi) - var(--sm-gap) - 2 * var(--sm-mat))); }
  /* trang cuối phải thấy trọn nút Đặt bàn mà không cần cuộn: bỏ con dấu, hai nút nằm một hàng */
  .sm-seal { display: none; }
  .sm-s-end .sm-paper { width: min(640px, 100%); }
  .sm-visit { font-size: 21px; margin-bottom: 6px; }
  .sm-tagline { font-size: 16px; }
  .sm-acts { flex-direction: row; justify-content: center; gap: 22px; margin: 14px 0 12px; }
  .sm-btn { padding: 11px 24px; min-height: 42px; }
  .sm-credit { font-size: 13px; padding-top: 10px; }
  .sm-rail { bottom: 8px; padding: 3px; }
  .sm-num { min-width: 28px; height: 26px; padding: 0 5px; font-size: 12.5px; }
  .sm-nav { bottom: 6px; gap: 10px; }
  .sm-arrow { width: 40px; height: 40px; }
}

/* ---------------------------------------------------------------- dọc: điện thoại, tablet dọc
   Cột flex: đầu trang / hàng số / sân khấu (thân trang cuộn dọc bên trong) / hàng nút ở đáy. */
@media (orientation: portrait) and (max-width: 900px) {
  .sm-root {
    --sm-pad: 16px; --sm-mat: 8px; --sm-cap: auto; --sm-thb: 50px;
    display: flex; flex-direction: column;
    padding: calc(52px + env(safe-area-inset-top, 0px)) 0 64px;
  }
  .sm-head { position: relative; left: auto; top: auto; flex: none; gap: 12px; margin: 0 18px 12px; justify-content: space-between; }
  .sm-kicker { font-size: 24px; }
  .sm-rail { position: relative; left: auto; bottom: auto; flex: none; align-self: center; margin: 0 0 12px; }
  .sm-num { min-width: 30px; padding: 0 5px; }
  .sm-stage { position: relative; top: auto; bottom: auto; left: auto; right: auto; flex: 1 1 0; min-height: 0; }
  .sm-marquee { left: 0; right: 0; top: 23%; height: 26vh; margin-top: -13vh; }
  .sm-mq-word { font-size: min(22vh, 40vw); }
  .sm-mq-sep { font-size: min(5vh, 9vw); }
  .sm-body {
    display: block; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; touch-action: pan-y;
    padding: 4px 16px 28px; scrollbar-width: none;
    /* mép dưới mờ dần trước hàng số, nội dung không bị cắt cụt */
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  }
  .sm-body::-webkit-scrollbar { display: none; }
  .sm-figwrap { width: 100%; }
  .sm-fig { --ph: min(calc(100vw - 32px - 2 * var(--sm-mat)), 42vh); }
  .sm-s-intro .sm-fig { --ph: calc(100vw - 32px - 2 * var(--sm-mat)); }
  .sm-cap { height: auto; min-height: 40px; font-size: 16px; padding: 8px 4px 9px; }
  .sm-thumbs { margin-top: 14px; }
  .sm-paper { width: 100%; max-height: none; margin: 22px auto 0; }
  .sm-s-intro .sm-paper { width: 100%; }
  .sm-pin { overflow: visible; padding: 14px 12px 14px; }
  .sm-pin.has-more { -webkit-mask-image: none; mask-image: none; }
  .sm-h { font-size: 25px; }
  .sm-p { font-size: 17px; }
  .sm-hl li { font-size: 16px; }
  .sm-index { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
  .sm-ix-t { font-size: 16px; }
  .sm-body-end { display: flex; flex-direction: column; justify-content: center; }
  .sm-s-end .sm-paper { margin-top: 0; }
  .sm-nav { left: 14px; right: 14px; bottom: 6px; justify-content: space-between; gap: 0; }
  .sm-arrow { width: 46px; height: 46px; }
}
@media (orientation: portrait) and (max-width: 900px) and (min-width: 600px) {
  .sm-root { --sm-mat: 12px; --sm-thb: 58px; }
  .sm-head { margin: 0 28px 16px; }
  .sm-rail { margin-bottom: 18px; }
  .sm-num { min-width: 40px; height: 32px; font-size: 15px; }
  .sm-body { padding: 4px 28px 32px; }
  .sm-fig { --ph: min(calc(100vw - 56px - 2 * var(--sm-mat)), 44vh); }
  .sm-s-intro .sm-fig { --ph: min(calc(100vw - 56px - 2 * var(--sm-mat)), 620px); }
  .sm-paper, .sm-s-intro .sm-paper { width: min(620px, 100%); }
  .sm-pin { padding: 22px 26px; }
  .sm-index { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(6, auto); grid-auto-flow: column; }
  .sm-nav { left: max(24px, calc(50% - 300px)); right: max(24px, calc(50% - 300px)); bottom: 8px; }
}

/* ---------------------------------------------------------------- giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  .sm-root, .sm-root.is-open { transition: opacity .2s linear; -webkit-clip-path: none; clip-path: none; opacity: 0; }
  .sm-root.is-open { opacity: 1; }
  .sm-mq-track, .sm-ring { animation: none; }
  .sm-marquee, .sm-head, .sm-track, .sm-rail, .sm-nav, .sm-close, .sm-mq-line, .sm-ph, .sm-cap, .sm-slide,
  .sm-figwrap, .sm-paper, .sm-slide.is-cur .sm-figwrap, .sm-slide.is-cur .sm-paper, .sm-thumb {
    transition-duration: .01s !important; transition-delay: 0s !important;
  }
  .sm-figwrap, .sm-paper, .sm-slide.is-out .sm-figwrap, .sm-slide.is-out .sm-paper { transform: none; }
}
