/* Bảng màu: giấy ngà, mực nâu đen, đỏ sơn mài, vàng nhũ */
.mgz-root {
  --mgz-paper: #f5efe4;
  --mgz-ink: #1e1a16;
  --mgz-lacquer: #6e221d;
  --mgz-deep: #1f1311;
  --mgz-gold: #b48a43;
  --mgz-gold-soft: #d4b67a;
  --mgz-muted: #4f463d;
  background: var(--mgz-paper);
  color: var(--mgz-ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.125rem;
  line-height: 1.8;
}

.mgz-root p { margin: 0 0 1.35em; }
.mgz-root h2 { margin: 0; }
.mgz-root figure { margin: 0; }
.mgz-root picture { display: block; }
.mgz-root img { display: block; max-width: 100%; height: auto; }
.mgz-root a:focus-visible { outline: 3px solid #b48a43; outline-offset: 3px; }

.mgz-root .mgz-col { box-sizing: content-box; max-width: 44rem; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }

/* Thanh tiến độ đọc, chỉ có khi JS chạy */
.mgz-progress { position: sticky; top: 0; height: 0; z-index: 20; }
.mgz-root.mgz-js .mgz-progress-bar { position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #6e221d, #c9a35a); transform-origin: 0 50%; transform: scaleX(0); }

/* Mở đầu: ảnh bìa trọn khung, chữ xếp dưới ảnh trên điện thoại */
.mgz-hero { background: var(--mgz-deep); color: #f2e8d5; padding: 0 0 56px; }
.mgz-hero-media { border-bottom: 3px solid #b48a43; }
.mgz-hero-media img { width: 100%; height: auto; }
.mgz-hero-head { max-width: 62rem; margin: 0 auto; padding: 36px 20px 8px; box-sizing: border-box; text-align: center; }
.mgz-root .mgz-title { margin: 0; }
.mgz-kicker { display: block; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: .22em; font-size: .78rem; line-height: 1.6; color: var(--mgz-gold-soft); margin-bottom: 18px; }
.mgz-title-main { display: block; font-size: clamp(1.85rem, 4.6vw, 3.5rem); line-height: 1.16; font-weight: 400; letter-spacing: -.005em; color: #f6ecd8; }
.mgz-root .mgz-byline { margin: 26px 0 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .32em; font-size: .78rem; color: var(--mgz-gold-soft); display: flex; align-items: center; justify-content: center; gap: 14px; }
.mgz-byline::before, .mgz-byline::after { content: ""; width: 40px; height: 1px; background: currentColor; opacity: .6; }
.mgz-root .mgz-sapo { font-size: 1.2rem; font-style: italic; line-height: 1.7; color: #e6d9bf; text-align: center; margin: 30px 0 0; }

@media (min-width: 768px) {
  .mgz-hero { padding: 48px 0 80px; }
  .mgz-root .mgz-hero-media { max-width: 82rem; margin: 0 auto; padding: 0 32px; box-sizing: border-box; border-bottom: 0; }
  .mgz-hero-media img { outline: 1px solid rgba(212, 182, 122, .55); outline-offset: 12px; }
  .mgz-hero-head { position: relative; margin-top: -72px; background: var(--mgz-deep); padding: 48px 56px 8px; }
  .mgz-root .mgz-sapo { font-size: 1.3rem; }
}

/* Thân bài */
.mgz-body { padding: 72px 0 104px; }
.mgz-lead::first-letter { float: left; font-size: 4.2em; line-height: .82; padding: 8px 12px 0 0; color: #6e221d; }
.mgz-root .mgz-intro { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.75; color: var(--mgz-muted); border-top: 1px solid #c9ad74; border-bottom: 1px solid #c9ad74; padding: 22px 0; margin: 40px 0 0; }

/* Mở chương: dải sơn mài với số chương vàng nhũ */
.mgz-chapter-head { background: radial-gradient(120% 140% at 85% 0%, #4a1d18 0%, #1f1311 62%); color: #f2e8d5; padding: 88px 0 72px; margin: 88px 0 64px; }
.mgz-num { display: block; font-size: 4.5rem; line-height: 1; font-style: italic; color: #c9a35a; margin-bottom: 18px; }
.mgz-root .mgz-chapter-head h2 { font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.22; color: #f6ecd8; }
.mgz-rule { display: block; width: 96px; height: 2px; background: #c9a35a; margin-top: 28px; transform-origin: 0 50%; }

/* Hỏi – đáp */
.mgz-root .mgz-q { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 1.02rem; line-height: 1.72; color: #6e221d; border-left: 3px solid #b48a43; padding: 4px 0 4px 18px; margin: 2.2em 0 1.4em; }
.mgz-q strong { color: #b48a43; }
.mgz-who { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #6e221d; margin-right: 6px; }

/* Lời nhân vật được nâng lên */
.mgz-root .mgz-voice { position: relative; font-size: 1.42rem; line-height: 1.6; color: #2a1d17; margin: 2.4em 0; padding-top: 56px; border-top: 1px solid #c9ad74; }
.mgz-voice::before { content: "\201C"; position: absolute; top: 6px; left: 0; font-size: 4.4rem; line-height: 1; color: #b48a43; }
.mgz-voice--r::before { left: auto; right: 0; }
.mgz-voice .mgz-who { display: block; margin-bottom: 10px; }

/* Thẻ nhân vật */
.mgz-root .mgz-person { max-width: 68rem; margin: 64px auto; padding: 0 20px; box-sizing: border-box; display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center; }
.mgz-person img { width: 100%; box-sizing: border-box; padding: 8px; background: #fffaf1; border: 1px solid #c9ad74; }
.mgz-person figcaption { font-size: 1.35rem; line-height: 1.5; font-style: italic; color: #2a1d17; border-left: 2px solid #b48a43; padding-left: 24px; }

/* Ảnh rộng, ảnh vừa, cặp ảnh */
.mgz-root .mgz-wide { max-width: 78rem; margin: 64px auto; padding: 0 20px; box-sizing: border-box; }
.mgz-root .mgz-mid { max-width: 52rem; margin: 56px auto; padding: 0 20px; box-sizing: border-box; }
.mgz-mid img { width: 100%; box-sizing: border-box; padding: 12px; background: #fffaf1; box-shadow: 0 18px 40px -24px rgba(31, 19, 17, .45); }
.mgz-root .mgz-pair { max-width: 74rem; margin: 64px auto; padding: 0 20px; box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.mgz-pair img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* Bộ ảnh chương 3 */
.mgz-root .mgz-gallery { max-width: 80rem; margin: 64px auto; padding: 0 20px; box-sizing: border-box; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mgz-gallery figure { overflow: hidden; background: #1f1311; }
.mgz-gallery picture { height: 100%; }
.mgz-gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.mgz-gallery figure:hover img { transform: scale(1.04); }
.mgz-gallery-lead { grid-column: span 2; grid-row: span 2; }
.mgz-gallery-lead img { height: 100%; aspect-ratio: auto; }

/* Kết bài */
.mgz-root .mgz-end { text-align: center; font-style: italic; color: #6e221d; margin-top: 2.6em; }
.mgz-end::after { content: "\2756"; display: block; font-style: normal; color: #b48a43; margin-top: 18px; }

/* Hiện dần khi cuộn tới, chỉ khi có JS */
.mgz-root.mgz-js [data-mgz-animate] { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.mgz-root.mgz-js [data-mgz-animate].mgz-visible { opacity: 1; transform: none; }
.mgz-root.mgz-js .mgz-chapter-head .mgz-rule { transform: scaleX(0); transition: transform 1.2s ease .35s; }
.mgz-root.mgz-js .mgz-chapter-head.mgz-visible .mgz-rule { transform: scaleX(1); }

@media (max-width: 760px) {
  .mgz-root { font-size: 1.0625rem; }
  .mgz-body { padding: 48px 0 72px; }
  .mgz-chapter-head { padding: 60px 0 48px; margin: 64px 0 44px; }
  .mgz-num { font-size: 3.2rem; }
  .mgz-root .mgz-voice { font-size: 1.22rem; padding-top: 50px; }
  .mgz-root .mgz-person { grid-template-columns: 1fr; gap: 20px; margin: 48px auto; }
  .mgz-person figcaption { font-size: 1.15rem; padding-left: 18px; }
  .mgz-root .mgz-wide { padding: 0; margin: 48px auto; }
  .mgz-root .mgz-mid { margin: 44px auto; }
  .mgz-root .mgz-pair { grid-template-columns: 1fr; gap: 14px; margin: 48px auto; }
  .mgz-root .mgz-gallery { grid-template-columns: 1fr 1fr; gap: 10px; margin: 48px auto; }
  .mgz-gallery-lead { grid-column: span 2; grid-row: auto; }
  .mgz-gallery-lead img { height: auto; aspect-ratio: 3 / 2; }
  .mgz-gallery figure:last-child { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  .mgz-root.mgz-js [data-mgz-animate] { opacity: 1; transform: none; transition: none; }
  .mgz-root.mgz-js .mgz-chapter-head .mgz-rule { transform: none; transition: none; }
  .mgz-gallery img { transition: none; }
  .mgz-gallery figure:hover img { transform: none; }
}

@media print {
  .mgz-root { background: #ffffff; color: #000000; font-size: 11pt; }
  .mgz-hero, .mgz-chapter-head { background: #ffffff; color: #000000; }
  .mgz-title-main, .mgz-root .mgz-sapo, .mgz-root .mgz-chapter-head h2 { color: #000000; }
}