/* ==========================================================================
   eMAGAZINE MÙA THU MIỀN NHỚ - DESIGN SYSTEM & SCROLLYTELLING STYLES
   Tác giả: Cao Xuân Thu Ngọc
   Color Palette: Midnight Blue | Lacquer Red (Đỏ sơn mài) | Moonlight Gold (Vàng hoàng kim) | Neon Lantern Glow
   ========================================================================== */

:root {
  /* Core Colors */
  --bg-midnight-deep: #050814;
  --bg-midnight-rich: #091024;
  --bg-midnight-card: #0e1836;
  --bg-midnight-glass: rgba(10, 17, 38, 0.78);
  
  --lacquer-deep: #590f10;
  --lacquer-primary: #8e1c1d;
  --lacquer-bright: #be282a;
  --lacquer-neon: #ff334b;
  
  --gold-imperial: #d4af37;
  --gold-moonlight: #ffd56b;
  --gold-warm: #f6c043;
  --gold-pale: #fff2cc;
  --gold-shadow: rgba(244, 180, 54, 0.28);
  
  --neon-lantern-orange: #ff7700;
  --neon-lantern-red: #ff2255;
  --neon-lantern-gold: #ffbe0b;
  --neon-cyan-glow: #00f2fe;

  --text-primary: #edf2f9;
  --text-secondary: #b5c3da;
  --text-muted: #8294b2;
  --text-gold: #ffd978;

  /* Typography */
  --font-serif-title: 'Playfair Display', 'Cinzel', Georgia, serif;
  --font-serif-body: 'Lora', 'Merriweather', 'Times New Roman', serif;
  --font-sans-ui: 'Be Vietnam Pro', 'Inter', -apple-system, sans-serif;

  /* Dynamic Article Font Scaling */
  --story-font-size: 1.18rem;
  --story-line-height: 2.05;

  /* Spacing & Layout */
  --max-content-width: 820px;
  --max-display-width: 1140px;
  --header-height: 64px;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;

  /* Transitions */
  --trans-smooth: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  --trans-fast: all 0.25s ease;
}

/* Light / Dark Mode & Neon Adjustments */
body.glow-active {
  --neon-glow-intensity: 1;
}

body:not(.glow-active) {
  --neon-glow-intensity: 0.15;
}

/* --------------------------------------------------------------------------
   RESET & GLOBAL SETUP
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-midnight-deep);
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-serif-body);
  background: radial-gradient(circle at 50% 0%, #101c3d 0%, var(--bg-midnight-rich) 45%, var(--bg-midnight-deep) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Canvas for Falling Petals and Fireflies */
#ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   STICKY HEADER & READING CONTROLS
   -------------------------------------------------------------------------- */
.emag-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--bg-midnight-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  z-index: 100;
  transition: var(--trans-fast);
}

.header-inner {
  max-width: var(--max-display-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-emag {
  font-family: var(--font-sans-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--lacquer-bright), var(--lacquer-deep));
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 213, 107, 0.4);
  box-shadow: 0 0 10px rgba(190, 40, 42, 0.5);
}

.magazine-title {
  font-family: var(--font-serif-title);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--gold-pale), var(--gold-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.quick-nav {
  display: none;
  gap: 8px;
}

@media (min-width: 1024px) {
  .quick-nav {
    display: flex;
    align-items: center;
  }
}

.nav-pill {
  font-family: var(--font-sans-ui);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: var(--trans-fast);
  white-space: nowrap;
}

.nav-pill:hover, .nav-pill.active {
  color: var(--gold-moonlight);
  border-color: rgba(246, 192, 67, 0.5);
  background: rgba(142, 28, 29, 0.35);
  box-shadow: 0 0 12px rgba(255, 213, 107, 0.2);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--text-primary);
  font-family: var(--font-sans-ui);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--trans-fast);
}

.tool-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-imperial);
  color: var(--gold-pale);
}

.tool-btn.active {
  background: linear-gradient(135deg, rgba(142, 28, 29, 0.6), rgba(90, 15, 16, 0.7));
  border-color: var(--gold-warm);
  color: var(--gold-moonlight);
  box-shadow: 0 0 14px rgba(255, 190, 11, 0.3);
}

.tool-btn.playing {
  animation: pulse-audio-btn 2s infinite ease-in-out;
}

@keyframes pulse-audio-btn {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 119, 0, 0.4); }
  50% { box-shadow: 0 0 20px rgba(255, 213, 107, 0.7); }
}

.font-scale-group {
  display: flex;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.sub-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans-ui);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--trans-fast);
}

.sub-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-moonlight);
}

/* Reading Progress Bar */
.reading-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.reading-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--lacquer-bright), var(--gold-warm), var(--neon-cyan-glow));
  box-shadow: 0 0 10px rgba(255, 213, 107, 0.7);
  transition: width 0.1s linear;
}

.progress-moon-thumb {
  position: absolute;
  top: -9px;
  left: 0%;
  transform: translateX(-50%);
  font-size: 13px;
  pointer-events: none;
  transition: left 0.1s linear;
  filter: drop-shadow(0 0 8px #ffd56b);
}

/* Side Floating Progress Indicator */
.side-indicator {
  position: fixed;
  right: 28px;
  bottom: 36px;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: var(--trans-smooth);
}

@media (min-width: 1200px) {
  .side-indicator {
    display: flex;
  }
}

.side-lantern-box {
  background: rgba(9, 16, 36, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 8px 12px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 190, 11, 0.2);
}

.mini-lantern {
  width: 10px;
  height: 10px;
  background: var(--gold-warm);
  border-radius: 50%;
  box-shadow: 0 0 8px #ffd56b, 0 0 16px #ff7700;
  animation: flicker-lantern 2s infinite ease-in-out alternate;
}

@keyframes flicker-lantern {
  0% { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 14px #ffd56b, 0 0 25px #ff2255; }
}

.percent-label {
  font-family: var(--font-sans-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-moonlight);
}

/* --------------------------------------------------------------------------
   HERO BANNER & CELESTIAL SCROLLYTELLING
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 40px) 24px 60px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, #050813 0%, #0d1633 60%, var(--bg-midnight-deep) 100%);
}

.sky-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.deep-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 120px 80px, #ffd56b, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 240px 180px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 380px 70px, #ffb703, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 500px 220px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 700px 140px, #ffd56b, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 850px 90px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 980px 240px, #ffdf79, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 1000px 300px;
  opacity: 0.65;
}

/* Glowing Realistic Moon with Parallax */
.celestial-moon {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  pointer-events: none;
  z-index: 2;
}

@media (min-width: 768px) {
  .celestial-moon {
    width: 290px;
    height: 290px;
    top: 7%;
  }
}

.moon-halo {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 107, 0.35) 0%, rgba(246, 192, 67, 0.12) 45%, rgba(0,0,0,0) 70%);
  filter: blur(28px);
  animation: halo-pulse 6s ease-in-out infinite alternate;
}

@keyframes halo-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.08); opacity: 1; }
}

.moon-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffdf4 0%, #fee49f 40%, #e2ab39 80%, #aa7519 100%);
  box-shadow: 
    inset -10px -10px 30px rgba(110, 68, 10, 0.6),
    0 0 50px rgba(255, 222, 120, 0.8),
    0 0 100px rgba(246, 192, 67, 0.35);
  overflow: hidden;
}

.moon-crater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 110, 30, 0.28) 0%, rgba(130, 80, 15, 0.1) 70%, transparent 100%);
}

.moon-crater.c1 { width: 45px; height: 35px; top: 25%; left: 30%; }
.moon-crater.c2 { width: 65px; height: 50px; top: 48%; left: 52%; }
.moon-crater.c3 { width: 35px; height: 30px; top: 60%; left: 22%; }

/* Parallax Drifting Clouds */
.cloud-layer {
  position: absolute;
  height: 80px;
  background: radial-gradient(ellipse at center, rgba(18, 30, 65, 0.85) 0%, rgba(10, 18, 40, 0.5) 60%, transparent 100%);
  filter: blur(14px);
  border-radius: 50%;
  pointer-events: none;
}

.cloud-1 {
  width: 320px;
  top: 40%;
  left: -80px;
  animation: cloud-float 22s linear infinite alternate;
}

.cloud-2 {
  width: 420px;
  top: 60%;
  right: -100px;
  animation: cloud-float-rev 28s linear infinite alternate;
}

@keyframes cloud-float {
  0% { transform: translateX(0); opacity: 0.7; }
  100% { transform: translateX(90px); opacity: 0.9; }
}

@keyframes cloud-float-rev {
  0% { transform: translateX(0); opacity: 0.6; }
  100% { transform: translateX(-110px); opacity: 0.85; }
}

.mist-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(180deg, transparent 0%, var(--bg-midnight-deep) 100%);
  z-index: 3;
}

/* Floating Traditional Lanterns */
.floating-lantern {
  position: absolute;
  width: 34px;
  height: 52px;
  background: linear-gradient(180deg, #be282a 0%, #751415 100%);
  border-radius: 17px / 26px;
  border: 1px solid var(--gold-warm);
  z-index: 4;
  box-shadow: 0 0 25px rgba(255, 34, 85, 0.6), 0 0 45px rgba(255, 190, 11, 0.4);
  animation: lantern-sway 5s ease-in-out infinite alternate;
  pointer-events: none;
  opacity: 0.85;
}

.floating-lantern::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 8px;
  background: var(--gold-imperial);
  border-radius: 3px 3px 0 0;
}

.floating-lantern::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 14px;
  background: var(--gold-moonlight);
  box-shadow: 0 4px 6px #ffbe0b;
}

.floating-lantern.l-1 { top: 22%; left: 8%; animation-delay: 0s; transform: scale(0.9); }
.floating-lantern.l-2 { top: 38%; right: 9%; animation-delay: 1.5s; transform: scale(1.1); }
.floating-lantern.l-3 { top: 65%; left: 14%; animation-delay: 2.8s; transform: scale(0.75); }

@keyframes lantern-sway {
  0% { transform: translateY(0) rotate(-4deg); }
  100% { transform: translateY(-24px) rotate(4deg); }
}

/* Hero Content Block */
.hero-container {
  position: relative;
  z-index: 5;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 110px;
}

@media (min-width: 768px) {
  .hero-container {
    padding-top: 140px;
  }
}

.editorial-stamp {
  display: inline-block;
  margin-bottom: 20px;
}

.stamp-border {
  font-family: var(--font-sans-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--gold-warm);
  padding: 8px 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
  position: relative;
}

.stamp-border::before, .stamp-border::after {
  content: '✦';
  font-size: 0.65rem;
  color: var(--lacquer-neon);
  margin: 0 8px;
}

.main-title {
  font-family: var(--font-serif-title);
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.title-sub-glow {
  display: block;
  font-size: 0.48em;
  font-weight: 600;
  letter-spacing: 8px;
  color: #ffde8a;
  text-shadow: 0 0 20px rgba(255, 213, 107, 0.7), 0 0 40px rgba(255, 119, 0, 0.5);
  margin-bottom: 6px;
}

.title-main-gradient {
  display: block;
  background: linear-gradient(135deg, #ffffff 0%, #fff2b2 30%, #f4b436 70%, #d48b16 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.8));
  position: relative;
}

body.glow-active .title-main-gradient {
  filter: drop-shadow(0 0 25px rgba(255, 190, 11, 0.55)) drop-shadow(0 0 50px rgba(190, 40, 42, 0.45));
}

.author-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 30px;
}

.seal-line {
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-warm), transparent);
}

.author-name {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: var(--gold-pale);
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-lead-quote {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.8;
  color: #dce5f2;
  max-width: 680px;
  margin: 0 auto 36px;
  padding: 0 16px;
  border-left: 2px solid var(--lacquer-bright);
  border-right: 2px solid var(--lacquer-bright);
}

.hero-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-family: var(--font-sans-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item .dot {
  width: 5px;
  height: 5px;
  background: var(--gold-imperial);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--gold-imperial);
}

/* Scroll Prompt Indicator */
.scroll-prompt {
  margin-top: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  opacity: 0.85;
  transition: var(--trans-fast);
}

.scroll-prompt:hover {
  opacity: 1;
  transform: translateY(4px);
}

.prompt-text {
  font-family: var(--font-sans-ui);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-warm);
}

.mouse-indicator {
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255, 213, 107, 0.5);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.mouse-wheel {
  width: 4px;
  height: 8px;
  background: var(--gold-moonlight);
  border-radius: 2px;
  animation: mouse-scroll 1.6s infinite ease-in-out;
}

@keyframes mouse-scroll {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

.prompt-arrow {
  color: var(--gold-moonlight);
  font-size: 1.1rem;
  animation: bounce-arrow 1.8s infinite;
}

@keyframes bounce-arrow {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

/* --------------------------------------------------------------------------
   STORYTELLING MAIN LAYOUT & EDITORIAL STYLES
   -------------------------------------------------------------------------- */
.emag-main-wrapper {
  position: relative;
  z-index: 10;
  max-width: var(--max-display-width);
  margin: 0 auto;
  padding: 40px 20px 100px;
}

/* Masterpiece Prologue Figure */
.masterpiece-showcase {
  max-width: 980px;
  margin: -30px auto 70px;
}

@media (min-width: 900px) {
  .masterpiece-showcase {
    margin-top: -60px;
  }
}

/* Lacquer Framed Media Container */
.featured-figure {
  margin: 0;
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: var(--bg-midnight-card);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 175, 55, 0.25);
  transition: var(--trans-smooth);
}

.frame-lacquer {
  border: 1px solid rgba(212, 175, 55, 0.35);
  position: relative;
}

.frame-lacquer::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 213, 107, 0.15);
  border-radius: calc(var(--border-radius-md) - 4px);
  pointer-events: none;
  z-index: 3;
}

.img-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #040711;
  cursor: pointer;
}

.masterpiece-showcase .img-wrapper {
  aspect-ratio: 16 / 11;
}

@media (min-width: 768px) {
  .masterpiece-showcase .img-wrapper {
    aspect-ratio: 16 / 9.5;
  }
}

.story-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
}

.featured-figure:hover .story-img {
  transform: scale(1.035);
}

/* Neon ambient glow overlays on images */
.lantern-glow-ambient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 30%, rgba(255, 60, 110, 0.18) 0%, rgba(255, 170, 50, 0.12) 40%, transparent 70%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.lantern-glow-pulse {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 213, 107, 0.22) 0%, rgba(255, 60, 110, 0.12) 50%, transparent 80%);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: pulse-lantern-overlay 4s infinite alternate ease-in-out;
}

@keyframes pulse-lantern-overlay {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.warm-tea-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 65%, rgba(255, 170, 50, 0.18) 0%, rgba(212, 175, 55, 0.12) 45%, transparent 75%);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Figcaptions with editorial distinction */
.fig-caption {
  padding: 16px 22px;
  background: linear-gradient(180deg, rgba(14, 24, 54, 0.95), rgba(7, 12, 28, 0.98));
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cap-decor {
  color: var(--gold-warm);
  font-size: 0.9rem;
  line-height: 1;
}

.cap-text {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   CHAPTER SECTIONS & TYPOGRAPHY
   -------------------------------------------------------------------------- */
.chapter-block {
  margin-bottom: 95px;
  position: relative;
}

.chapter-tag {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--max-content-width);
  margin: 0 auto 34px;
}

.tag-number {
  font-family: var(--font-sans-ui);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-warm);
  background: rgba(142, 28, 29, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 5px 14px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(190, 40, 42, 0.35);
}

.tag-line {
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.5), rgba(212, 175, 55, 0.05));
}

.tag-title {
  font-family: var(--font-serif-title);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--gold-pale);
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .tag-title {
    display: none;
  }
}

/* Text Column */
.text-column {
  max-width: var(--max-content-width);
  margin: 0 auto;
}

/* Faithful Paragraph Presentation */
.story-p {
  font-family: var(--font-serif-body);
  font-size: var(--story-font-size);
  line-height: var(--story-line-height);
  color: var(--text-primary);
  margin-bottom: 30px;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  position: relative;
  letter-spacing: 0.01em;
}

/* Beautiful Vietnamese Drop Cap for Chapter 1 */
.has-dropcap::first-letter {
  font-family: var(--font-serif-title);
  float: left;
  font-size: 4.4rem;
  line-height: 0.85;
  padding: 8px 14px 4px 6px;
  margin-right: 12px;
  margin-bottom: 2px;
  font-weight: 900;
  color: #fff2b2;
  background: linear-gradient(145deg, var(--lacquer-deep), var(--lacquer-bright));
  border: 2px solid var(--gold-warm);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 190, 11, 0.4);
}

/* Highlighted Reminiscence Paragraph */
.highlight-reminiscence {
  background: rgba(14, 24, 54, 0.45);
  border-left: 3px solid var(--gold-warm);
  padding: 20px 24px;
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Closing Paragraph */
.story-closing-p {
  font-size: calc(var(--story-font-size) * 1.05);
  line-height: 2.15;
  color: #f7f9fd;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   PULL QUOTES & EDITORIAL CALLOUTS
   -------------------------------------------------------------------------- */
.pullquote-lacquer {
  position: relative;
  margin: 45px 0 50px;
  padding: 30px 40px;
  background: radial-gradient(ellipse at center, rgba(142, 28, 29, 0.22) 0%, rgba(10, 17, 38, 0.65) 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.pullquote-lacquer .quote-symbol {
  font-family: var(--font-serif-title);
  font-size: 3.8rem;
  line-height: 1;
  color: var(--lacquer-bright);
  opacity: 0.55;
  margin-bottom: -15px;
}

.pullquote-lacquer .quote-content {
  font-family: var(--font-serif-title);
  font-size: clamp(1.22rem, 2.5vw, 1.65rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--gold-pale);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  margin-bottom: 12px;
}

.pullquote-lacquer .quote-sign {
  font-family: var(--font-sans-ui);
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Pullquote Neon Variant */
.pullquote-neon {
  margin: 45px 0 50px;
  padding: 28px 32px;
  background: rgba(14, 24, 54, 0.7);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 213, 107, 0.3);
  position: relative;
  text-align: center;
  box-shadow: 0 0 25px rgba(255, 34, 85, 0.15);
}

body.glow-active .pullquote-neon {
  border-color: rgba(255, 119, 0, 0.6);
  box-shadow: 0 0 35px rgba(255, 119, 0, 0.25), inset 0 0 15px rgba(255, 34, 85, 0.15);
}

.neon-lantern-mark {
  font-size: 2rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px #ffbe0b);
}

.pullquote-neon .quote-content {
  font-family: var(--font-serif-title);
  font-size: clamp(1.18rem, 2.3vw, 1.55rem);
  font-weight: 600;
  line-height: 1.6;
  color: #fff5d6;
  margin-bottom: 12px;
}

.pullquote-neon .quote-sign {
  font-family: var(--font-sans-ui);
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  color: var(--gold-warm);
}

/* Scrolly Card Callout */
.scrolly-card-quote {
  max-width: var(--max-content-width);
  margin: 40px auto 50px;
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(142, 28, 29, 0.35) 0%, rgba(9, 16, 36, 0.85) 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
}

.card-inner {
  padding: 30px 36px;
  position: relative;
  z-index: 2;
}

.card-quote-text {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.85;
  color: #fff9e6;
  text-align: center;
}

/* Final Climax Callout Box */
.final-callout-box {
  margin: 50px 0 20px;
  padding: 36px;
  border-radius: var(--border-radius-lg);
  background: radial-gradient(circle at 50% 0%, rgba(246, 192, 67, 0.15) 0%, rgba(14, 24, 54, 0.85) 100%);
  border: 1px solid var(--gold-warm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 0 35px rgba(255, 213, 107, 0.25);
}

.callout-symbol {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px #ffd56b);
}

.callout-highlight {
  font-family: var(--font-serif-title);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.6;
  color: #fff2cc;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  margin-bottom: 8px;
}

.callout-sub {
  font-family: var(--font-sans-ui);
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 520px;
}

/* --------------------------------------------------------------------------
   MEDIA PRESENTATIONS IN STORY
   -------------------------------------------------------------------------- */
.story-media-full {
  max-width: 960px;
  margin: 45px auto 55px;
}

.story-media-split {
  max-width: 860px;
  margin: 45px auto 55px;
}

.story-media-inline {
  max-width: var(--max-content-width);
  margin: 40px auto 45px;
}

/* --------------------------------------------------------------------------
   SCROLLYTELLING ANIMATION REVEALS
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   FOOTER & CREDITS
   -------------------------------------------------------------------------- */
.emag-footer {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, var(--bg-midnight-deep) 0%, #03050c 100%);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding: 80px 24px 60px;
  overflow: hidden;
}

.footer-container {
  max-width: 940px;
  margin: 0 auto;
  text-align: center;
}

.footer-seal-mark {
  margin-bottom: 50px;
}

.seal-gold-border {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--gold-warm);
  background: var(--lacquer-deep);
  box-shadow: 0 0 20px rgba(190, 40, 42, 0.6);
  margin-bottom: 18px;
}

.seal-char {
  font-family: var(--font-serif-title);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-pale);
}

.footer-heading {
  font-family: var(--font-serif-title);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-pale);
  margin-bottom: 6px;
}

.footer-sub {
  font-family: var(--font-sans-ui);
  font-size: 0.82rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 30px;
  margin-bottom: 60px;
  padding: 30px;
  background: rgba(14, 24, 54, 0.4);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 768px) {
  .credits-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.credit-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.credit-role {
  font-family: var(--font-sans-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold-warm);
  text-transform: uppercase;
}

.credit-val {
  font-family: var(--font-serif-body);
  font-size: 0.95rem;
  color: #dee5f2;
}

.author-credit {
  font-weight: 600;
  color: #ffffff;
}

.footer-bottom-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 30px;
}

@media (min-width: 768px) {
  .footer-bottom-line {
    flex-direction: row;
    justify-content: space-between;
  }
}

.copyright-text {
  font-family: var(--font-sans-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 600px;
  text-align: center;
}

@media (min-width: 768px) {
  .copyright-text {
    text-align: left;
  }
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(142, 28, 29, 0.3);
  border: 1px solid var(--gold-warm);
  color: var(--gold-pale);
  font-family: var(--font-sans-ui);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--trans-fast);
}

.back-to-top:hover {
  background: var(--lacquer-primary);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 213, 107, 0.4);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}

.lightbox-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 16, 0.92);
  backdrop-filter: blur(12px);
}

.lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--gold-warm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 190, 11, 0.25);
  object-fit: contain;
}

.lightbox-caption {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold-pale);
  margin-top: 14px;
  text-align: center;
  max-width: 800px;
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--trans-fast);
}

.lightbox-close:hover {
  color: var(--gold-warm);
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   MOBILE & RESPONSIVE REFINEMENTS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --header-height: 58px;
    --story-font-size: 1.08rem;
    --story-line-height: 1.95;
  }

  .header-inner {
    padding: 0 14px;
  }

  .magazine-title {
    display: none;
  }

  .tool-btn .btn-text {
    display: none;
  }

  .tool-btn {
    padding: 6px 8px;
  }

  .emag-main-wrapper {
    padding: 24px 16px 70px;
  }

  .story-p {
    text-align: left;
    margin-bottom: 24px;
  }

  .has-dropcap::first-letter {
    font-size: 3.4rem;
    padding: 4px 10px 2px 4px;
    margin-right: 8px;
  }

  .pullquote-lacquer, .pullquote-neon {
    padding: 22px 18px;
    margin: 32px 0 36px;
  }

  .chapter-block {
    margin-bottom: 65px;
  }
}
