/* ================================================================
   PÂTISSERIE PLAIN (patisserie-plain) — hero-cake.css
   Editorial Scroll Showcase — Vibrant First Load & Luxurious Transitions
   ================================================================ */

/* ── Outer Multi-Viewport Scroll Track (400vh for natural, responsive transitions) ── */
.hero-scrub-track {
  position: relative;
  width: 100%;
  height: 400vh;
  background-color: var(--bg-cream);
}

/* ── Sticky Pinned Viewport Stage (100vh) ── */
.hero-scrub-stage {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-cream);
  z-index: 10;
}

/* ── Floating haoqi-Style Top Status Bar (HUD) ── */
.hero-hud-top {
  position: absolute;
  top: calc(var(--nav-height) + 1.25rem);
  left: 0;
  width: 100%;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
  pointer-events: none;
}

.hero-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  background: rgba(253, 251, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-ink);
  box-shadow: 0 4px 20px rgba(61, 30, 22, 0.08);
  pointer-events: auto;
}

.hero-hud-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  animation: hudPulse 2s infinite ease-in-out;
}

@keyframes hudPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-hud-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-full);
  background: rgba(253, 251, 247, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-ink);
  box-shadow: 0 4px 20px rgba(61, 30, 22, 0.08);
  pointer-events: auto;
}

.hero-scrub-bar-mini {
  width: 48px;
  height: 4px;
  background: rgba(194, 142, 0, 0.18);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.hero-scrub-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 25%;
  background: var(--gold-accent);
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Pinned Chapters Container ── */
.hero-chapters-stack {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ── Individual Chapter Frame with Luxurious Transitions ── */
.chapter-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
  will-change: opacity, transform;
}

/* Chapter active state */
.chapter-frame.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  z-index: 20;
}

.chapter-frame.exiting {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  z-index: 15;
}

/* ── Vibrant Photo Canvas with Rich Contrast ── */
.chapter-photo-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: saturate(1.05) contrast(1.03) brightness(1.01);
  transform: scale(1);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  will-change: transform, opacity;
}

.chapter-photo--1 {
  background-image: url('../images/home-page/1.jpg'), url('../assets/images/hero/1.jpg');
}

.chapter-photo--2 {
  background-image: url('../images/home-page/2.jpg'), url('../assets/images/hero/2.jpg');
}

.chapter-photo--3 {
  background-image: url('../images/home-page/3.jpg'), url('../assets/images/hero/3.jpg');
}

/* ── Content Panel Half ── */
.chapter-content-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 6vw, 6rem);
  position: relative;
  z-index: 25;
}

.chapter-content-panel--cream {
  background-color: var(--bg-cream); /* #FDFBF7 */
}

.chapter-content-panel--parchment {
  background-color: #F7F2E8; /* Soft Antique Linen */
}

.chapter-content-panel--blush {
  background-color: #FBF4F0; /* Soft Warm Rose-Blush */
}

/* Crisp Text Panel Body */
.chapter-panel-body {
  max-width: 520px;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-frame:not(.active) .chapter-panel-body {
  opacity: 0.15;
  transform: translateY(16px);
}

.chapter-frame.active .chapter-panel-body {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ── Chapter Headings & Typography ── */
.chapter-badge {
  margin-bottom: 1.25rem;
  display: inline-flex;
}

.chapter-title {
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  line-height: 1.15;
  color: #1C1917;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  font-family: var(--font-serif);
  font-weight: 700;
}

.chapter-title em {
  font-style: italic;
  color: #B45309;
  font-weight: 600;
}

.chapter-desc {
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.75;
  color: #44403C;
  margin-bottom: 1.75rem;
}

.chapter-pill-cluster {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.chapter-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(194, 142, 0, 0.1);
  border: 1.5px solid var(--border-gold);
  color: #1C1917;
}

.chapter-scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92rem;
  color: #B45309;
  margin-top: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

.chapter-scroll-hint:hover {
  color: var(--text-ink);
  transform: translateY(2px);
}

/* ── CHAPTER 4: FULL-VIEWPORT OVERLAY ON 4.JPG ── */
.chapter-frame--full-overlay {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background-image: url('../images/home-page/4.jpg'), url('../assets/images/hero/4.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  padding: clamp(2rem, 5vw, 4.5rem);
  filter: saturate(1.05) contrast(1.03);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
}

.chapter-overlay-card {
  max-width: 520px;
  width: 100%;
  margin-right: clamp(1rem, 4vw, 4rem);
  padding: clamp(2.5rem, 5vw, 3.5rem);
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse at center, rgba(253, 251, 247, 0.97) 0%, rgba(253, 251, 247, 0.92) 80%, rgba(253, 251, 247, 0.85) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 24px 60px rgba(61, 30, 22, 0.16), 0 0 35px var(--gold-glow);
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
}

.chapter-cta-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ── Floating Bottom Navigation Dock ── */
.hero-hud-bottom {
  position: absolute;
  bottom: 1.75rem;
  left: 0;
  width: 100%;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
  pointer-events: none;
}

.hero-chapter-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  padding: 0.4rem;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(61, 30, 22, 0.08);
  pointer-events: auto;
}

.hero-tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-tab-btn.active {
  background: var(--text-ink);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(61, 30, 22, 0.25);
}

.hero-tab-btn:hover:not(.active) {
  color: var(--text-ink);
  background: rgba(194, 142, 0, 0.12);
}

/* ── Fluid Interactive Magnetic Follower Dot ── */
.hero-magnetic-dot {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold-accent);
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.3s ease, transform 0.2s ease-out;
}

body:hover .hero-magnetic-dot {
  opacity: 0.65;
}

/* ── Mobile Responsive (<= 860px): Stacking Fallback ── */
@media (max-width: 860px) {
  .hero-scrub-track {
    height: auto !important;
  }

  .hero-scrub-stage {
    position: relative !important;
    height: auto !important;
    overflow: visible !important;
  }

  .hero-hud-top,
  .hero-hud-bottom {
    display: none !important;
  }

  .hero-chapters-stack {
    position: relative !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .chapter-frame {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    border-bottom: 1px solid var(--border-gold);
  }

  .chapter-photo-canvas {
    height: 48vh !important;
    min-height: 280px !important;
    order: 1 !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .chapter-content-panel {
    order: 2 !important;
    padding: 2.75rem 1.5rem 3.5rem !important;
    opacity: 1 !important;
  }

  .chapter-panel-body {
    transform: none !important;
    opacity: 1 !important;
    max-width: 100% !important;
  }

  .chapter-frame--full-overlay {
    min-height: 85vh !important;
    height: auto !important;
    order: 4 !important;
    padding: 2rem 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-position: center center !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .chapter-overlay-card {
    margin-right: 0 !important;
    padding: 2rem 1.5rem !important;
    transform: none !important;
    opacity: 1 !important;
    max-width: 100% !important;
  }

  .chapter-cta-actions {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .chapter-cta-actions .btn {
    width: 100% !important;
  }
}

/* ── Reduced Motion Fallback ── */
@media (prefers-reduced-motion: reduce) {
  .hero-scrub-track {
    height: auto !important;
  }
  .hero-scrub-stage {
    position: relative !important;
    height: auto !important;
  }
  .hero-hud-top,
  .hero-hud-bottom {
    display: none !important;
  }
  .hero-chapters-stack {
    position: relative !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .chapter-frame {
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
  }
  .chapter-panel-body,
  .chapter-overlay-card {
    transform: none !important;
    opacity: 1 !important;
  }
}
