/* ============================================
  STORY PAGE CSS - story.css
   ============================================ */


/* ============================================
  STORY HERO SECTION
   ============================================ */

.story-hero {
  position: relative;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;

  background:
        linear-gradient(rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.68)),
        url('../assets/forest-bg.jpg') center 35%/cover no-repeat;

  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(212,176,106,0.15), transparent 60%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  max-width: 680px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 10px rgba(212,176,106,0.6),
    0 0 30px rgba(212,176,106,0.3);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: #e8e3d4;
  margin-bottom: 1.5rem;
  font-style: italic;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Decorative floating images */
.hero-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.38;
  filter: blur(0.5px);
  animation: float 8s ease-in-out infinite;
}

.deco-1 {
  top: 15%;
  left: 0%;
  width: clamp(80px, 11vw, 140px);
}

.deco-2 {
  top: 15%;    
  right: 2%;
  width: clamp(80px, 11vw, 140px)
}

@keyframes float {
  0%   { transform: translateY(0px) rotate(-10deg); }
  50%  { transform: translateY(-15px) rotate(-8deg); }
  100% { transform: translateY(0px) rotate(-10deg); }
}

/* Dark mode: make sun/moon deco more visible against dark backgrounds */
[data-theme="dark"] .story-hero .hero-deco {
  opacity: 0.98;
  filter: drop-shadow(0 20px 48px rgba(212,176,106,0.55)) saturate(1.2) brightness(1.14);
  mix-blend-mode: screen;
  z-index: 3;
}

[data-theme="dark"] .story-hero .deco-1 {
  width: clamp(110px, 14vw, 200px);
  transform: scale(1.08);
}

[data-theme="dark"] .story-hero .deco-2 {
  width: clamp(120px, 16vw, 220px);
  transform: scale(1.06);
}


/* Ensure all story sections sit above the decorative layers */
.story-hero,
.story-overview,
.timeline-section,
.lore-section,
.story-preview,
.site-footer {
    position: relative;
    z-index: 1;
}

.timeline-content,
.lore-item,
.story-preview-card,
.prophecy-text {
    isolation: isolate;
}


/* ============================================
STORY OVERVIEW SECTION
   ============================================ */

.story-overview {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--divider);
}

.story-intro {
  max-width: 75ch;
  margin: 0 auto;
  padding: 0 1.5rem
}

.story-intro h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
  padding-bottom: var(--space-md);
  font-size: clamp(1.65rem, 3vw, 2.75rem);
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: 0.01em;
}

.story-intro h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  margin: var(--space-sm) auto 0;
}

.story-lead {
  font-size: clamp(1.2rem, 2vw, 1.35rem);
  line-height: var(--leading-relaxed);
  font-style: italic;
  color: var(--accent-rose);
  border-left: 3px solid var(--accent-gold);
  padding-left: var(--space-md);
  margin-bottom: var(--space-lg);
  max-width: 100%;
  font-weight: 700;
}

.story-intro p {
  max-width: 100%;
  line-height: var(--leading-relaxed);
  color: var(--text-soft);
}

/* ============================================
  TIMELINE SECTION
   ============================================ */

.timeline-section {
  padding: var(--space-2xl) 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-lg);
}

/* The vertical centre line */
.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent-gold) 10%,
    var(--accent-gold) 90%,
    transparent
  );
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--space-xl);
}

/* Odd items sit on the LEFT of the line */
.timeline-item:nth-child(odd) {
  flex-direction: row;
  padding-right: calc(50% + 32px);
}

/* Even items sit on the RIGHT of the line */
.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
  padding-left: calc(50% + 32px);
}

/* The glowing dot on the centre line */
.timeline-marker {
  position: absolute;
  left: 50%;
  top: var(--space-md);
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: var(--accent-gold);
  border: 3px solid var(--bg-alt);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent-gold), var(--glow-gold);
  z-index: 2;
  flex-shrink: 0;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.timeline-content {
  flex: 1;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.timeline-item:hover .timeline-content {
  transform: translateY(-4px);
  border-color: rgba(212, 176, 106, 0.9);
  box-shadow:
    0 0 24px rgba(212, 176, 106, 0.24),
    0 18px 34px rgba(18, 50, 35, 0.16);
}

.timeline-item:hover .timeline-marker {
  transform: translateX(-50%) scale(1.15);
  box-shadow:
    0 0 0 3px var(--accent-gold),
    0 0 22px rgba(212, 176, 106, 0.78),
    0 0 42px rgba(212, 176, 106, 0.35);
}

.timeline-date {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-gold);
  margin-bottom: var(--space-xs);
}

.timeline-content h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.timeline-content p {
  font-size: var(--text-sm);
  max-width: 100%;
  margin-bottom: 0;
  color: var(--text-soft);
}


/* ============================================
  LORE / EXPANDABLE SECTIONS
  Styled to match the FAQ accordion on the Join page.
   ============================================ */

.lore-section {
  padding: var(--space-2xl) 0;
}

/* Outer card — matches .faq-item */
.lore-item {
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    rgba(212, 176, 106, 0.10) 0%,
    rgba(18, 50, 35, 0.06) 50%,
    rgba(212, 176, 106, 0.08) 100%
  );
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

/* Aged line texture — matches .faq-item::before */
.lore-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 29px,
    rgba(18, 50, 35, 0.018) 29px,
    rgba(18, 50, 35, 0.018) 30px
  );
  pointer-events: none;
  z-index: 0;
}

.lore-item > * {
  position: relative;
  z-index: 1;
}

/* Header row — matches .faq-question layout and colours */
.lore-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(245, 241, 230, 0.84);
  border: none;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.lore-header:hover {
  background: rgba(212, 176, 106, 0.10);
}

[data-theme="dark"] .lore-header {
  background: rgba(27, 24, 18, 0.82);
}

[data-theme="dark"] .lore-header:hover {
  background: rgba(212, 176, 106, 0.08);
}

/* Title — matches .faq-question font treatment */
.lore-header h3 {
  margin-bottom: 0;
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 600;
  color: var(--primary-green);
  line-height: 1.4;
  text-align: left;
}

[data-theme="dark"] .lore-header h3 {
  color: var(--logo-light-green);
}

/* +/× icon — matches .faq-icon size, colour and rotation animation */
.lore-toggle {
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--accent-gold);
  flex-shrink: 0;
  transition: transform var(--transition-normal);
  line-height: 1;
  width: 32px;
  text-align: center;
}

/* Rotate to × when open (story-page specific animation kept) */
.lore-header.active .lore-toggle {
  transform: rotate(45deg);
  color: var(--primary-green);
}

[data-theme="dark"] .lore-header.active .lore-toggle {
  color: var(--logo-light-green);
}

/* Answer panel — matches .faq-answer collapse behaviour */
.lore-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s ease;
  padding: 0 var(--space-lg);
}

.lore-content.active {
  max-height: 2000px;
  padding-bottom: var(--space-lg);
}

.lore-body {
  padding-top: var(--space-sm);
}

.lore-body p {
  max-width: 100%;
  line-height: var(--leading-relaxed);
  color: var(--text-soft);
  font-size: var(--text-sm);
  margin: 0;
}

[data-theme="dark"] .lore-body p {
  color: var(--text-primary);
}

.lore-body h4 {
  font-size: var(--text-lg);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.kingdom {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--divider);
}

.kingdom:last-child {
  border-bottom: none;
}

.kingdom h4 {
  margin-bottom: var(--space-xs);
}

.kingdom p {
  margin-bottom: 0;
  color: var(--text-soft);
}

/* Prophecy blockquote */
.prophecy-text {
  background: rgba(212,176,106,0.08);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
}

.prophecy-text p {
  font-style: italic;
  font-size: clamp(1.15rem, 1.9vw, 1.3rem);
  color: var(--accent-rose);
  margin-bottom: var(--space-xs);
  max-width: 100%;
  font-weight: 700;
}

.prophecy-text p:last-child {
  margin-bottom: 0;
}


/* ================================================================
STORY PREVIEW SECTION
================================================================ */

.story-preview {
  padding: var(--space-2xl) 0;
}

.story-preview-card {
  display: grid;
  gap: var(--space-md);
  background:
        linear-gradient(rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.68)),
        url('../assets/forest-bg.jpg') center 35%/cover no-repeat;
  overflow: hidden;
}

.story-preview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(245, 241, 230, 0.84), rgba(245, 241, 230, 0.9));
}

.story-preview-card > * {
  position: relative;
  z-index: 1;
}

.story-preview-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--primary-green);
}

.story-preview-card p {
  max-width: 58ch;
}

[data-theme="dark"] .story-preview-card::before {
  background:
        linear-gradient(rgba(10, 10, 10, 0.52), rgba(10, 10, 10, 0.68)),
        url('../assets/forest-bg.jpg') center 35%/cover no-repeat;
}

[data-theme="dark"] .story-preview-card h2 {
  color: var(--logo-light-green);
}

.story-preview-card p {
  max-width: 58ch;
  color: var(--text-soft);
}


/* ============================================
  RESPONSIVE — TABLET (≤ 768px)
   ============================================ */

@media (max-width: 768px) {

  .main-nav .container {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .nav-links {
    gap: var(--space-md);
    flex-wrap: wrap;
  }

  /* Timeline collapses to a single left-aligned column */
  .timeline::before {
    left: 18px;
    transform: none;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    flex-direction: column;
    padding-left: 48px;
    padding-right: 0;
  }

  .timeline-marker {
    left: 18px;
    top: var(--space-sm);
    transform: none;
  }

  .timeline-item:nth-child(odd)  .timeline-content::after,
  .timeline-item:nth-child(even) .timeline-content::after {
    display: none;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .deco-1 { width: 90px; }
  .deco-2 { width: 140px; }
}

/* ============================================
  RESPONSIVE — MOBILE (≤ 480px)
   ============================================ */

@media (max-width: 480px) {

  .nav-links {
    gap: var(--space-sm);
  }

  .lore-header {
    padding: var(--space-sm);
  }

  .lore-header h3 {
    font-size: var(--text-base);
  }

  .lore-content {
    padding: 0 var(--space-sm);
  }

  .lore-content.active {
    padding-bottom: var(--space-md);
  }

  .timeline-section,
  .lore-section,
  .story-overview {
    padding: var(--space-xl) 0;
  }

  .prophecy-text {
    padding: var(--space-sm) var(--space-md);
  }

  .prophecy-text p {
    font-size: 1.05rem;
  }

  .story-lead {
    font-size: 1.08rem;
    padding-left: var(--space-sm);
  }

  .deco-1 { width: 70px; }
  .deco-2 { width: 100px; }
}
