/* assets/css/chronicle.css
   Heritage Archives – Historical Chronicle Page
   Light Theme: White-Cream / Heritage Red / Deep Blue / Forest Green
   Font: Montserrat
   ============================================================ */

/* ─── READING PROGRESS BAR ──────────────────────────────────── */
.chronicle-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-blue), var(--accent-green));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* ─── PAGE WRAPPER ───────────────────────────────────────────── */
.chronicle-wrapper {
  background: var(--bg-primary);
  min-height: 100vh;
}

/* ─── SHARED CONTAINER ───────────────────────────────────────── */
.chronicle-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */
.chronicle-hero {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--accent-red-light) 0%,
    var(--bg-primary) 45%,
    var(--accent-blue-light) 100%
  );
  border-bottom: 2.5px solid var(--accent-red);
  padding: 5rem 1.5rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
}

.chronicle-hero-content {
  max-width: 640px;
  position: relative;
  z-index: 2;
}

.chronicle-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chronicle-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 1.1rem;
  letter-spacing: -0.5px;
}

.chronicle-hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 560px;
}

.chronicle-hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chronicle-start-btn {
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
}

/* Hero Ornament */
.chronicle-hero-ornament {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ornament-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  animation: pulse-ring 3s ease-in-out infinite;
}

.ring-1 {
  width: 220px;
  height: 220px;
  border-color: rgba(200, 30, 50, 0.20);
  animation-delay: 0s;
}

.ring-2 {
  width: 160px;
  height: 160px;
  border-color: rgba(29, 95, 168, 0.25);
  animation-delay: 0.8s;
}

.ring-3 {
  width: 100px;
  height: 100px;
  border-color: rgba(26, 122, 74, 0.30);
  animation-delay: 1.6s;
}

.ornament-icon {
  font-size: 3.5rem;
  position: relative;
  z-index: 2;
  animation: float-icon 4s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%       { transform: scale(1.06); opacity: 1; }
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ═══════════════════════════════════════════════════════════════
   TABLE OF CONTENTS
   ═══════════════════════════════════════════════════════════════ */
.chronicle-toc-section {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 3rem 0;
}

.chronicle-section-heading {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.toc-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-normal);
  color: inherit;
}

.toc-card:hover {
  border-color: var(--accent-red);
  background: var(--accent-red-light);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.toc-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent-red);
  min-width: 2rem;
  opacity: 0.6;
}

.toc-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.toc-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.toc-arrow {
  margin-left: auto;
  color: var(--accent-red);
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.toc-card:hover .toc-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ═══════════════════════════════════════════════════════════════
   ERA CHAPTERS
   ═══════════════════════════════════════════════════════════════ */
.chronicle-era {
  padding: 5rem 0;
  background: var(--bg-primary);
}

.chronicle-era.era-alt {
  background: var(--bg-secondary);
}

/* Era Header */
.era-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.era-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
}

.era-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.era-period {
  font-size: 0.875rem;
  color: var(--accent-blue);
  font-weight: 700;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-blue-light);
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(29, 95, 168, 0.25);
}

.era-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 720px;
  font-style: italic;
}

/* Era Two-Col Body */
.era-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* Text column */
.era-text-col p {
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 1.2rem;
}

.era-text-col p strong {
  color: var(--text-primary);
  font-weight: 700;
}

.era-text-col p em {
  color: var(--accent-green);
  font-style: italic;
}

/* Pull-Quote */
.chronicle-quote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--accent-red);
  background: var(--accent-red-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.chronicle-quote cite {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 600;
}

/* Sidebar */
.era-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 80px;
}

/* Fact Cards */
.era-fact-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.era-fact-card:hover {
  border-color: var(--border-red);
  box-shadow: var(--shadow-sm);
}

.era-fact-card.feature-card {
  border-color: var(--border-red);
  background: var(--accent-red-light);
}

.era-fact-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  display: block;
}

.era-fact-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.era-fact-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Mini timeline inside sidebar */
.era-timeline-mini {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mini-event {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mini-dot.red   { background: var(--accent-red); }
.mini-dot.blue  { background: var(--accent-blue); }
.mini-dot.green { background: var(--accent-green); }

/* ─── CLAN GRID ──────────────────────────────────────────────── */
.clan-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.clan-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  background: var(--accent-green-light);
  border: 1px solid rgba(26, 122, 74, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-green);
  transition: all var(--transition-fast);
}

.clan-pill:hover {
  background: var(--accent-green);
  color: #fff;
  transform: translateY(-2px);
}

/* ─── CHAPTER DIVIDER ────────────────────────────────────────── */
.chronicle-divider {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  letter-spacing: 0.75rem;
  opacity: 0.5;
  background: var(--bg-primary);
}

/* ─── BRIDGE CARD ────────────────────────────────────────────── */
.chronicle-bridge {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-green-light), var(--accent-blue-light));
  border: 1.5px solid rgba(26, 122, 74, 0.3);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.bridge-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.bridge-text {
  flex: 1;
  min-width: 200px;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.55;
}

.bridge-btn {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CLOSING SECTION
   ═══════════════════════════════════════════════════════════════ */
.chronicle-closing {
  background: linear-gradient(135deg, var(--accent-cream), var(--bg-secondary));
  border-top: 2.5px solid var(--accent-red);
  padding: 5rem 0;
}

.closing-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.closing-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.closing-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.closing-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 2rem;
}

.closing-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .era-body {
    grid-template-columns: 1fr;
  }

  .era-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .chronicle-hero {
    flex-direction: column;
    padding: 3rem 1.25rem 2.5rem;
    text-align: center;
  }

  .chronicle-hero-actions {
    justify-content: center;
  }

  .chronicle-hero-ornament {
    width: 140px;
    height: 140px;
  }

  .ring-1 { width: 140px; height: 140px; }
  .ring-2 { width: 100px; height: 100px; }
  .ring-3 { width: 60px;  height: 60px;  }

  .ornament-icon { font-size: 2.2rem; }

  .chronicle-era {
    padding: 3rem 0;
  }

  .toc-grid {
    grid-template-columns: 1fr;
  }

  .chronicle-bridge {
    flex-direction: column;
    text-align: center;
  }

  .bridge-btn {
    width: 100%;
    justify-content: center;
  }

  .era-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .chronicle-hero-title {
    font-size: 1.75rem;
  }

  .era-title {
    font-size: 1.4rem;
  }

  .closing-actions {
    flex-direction: column;
  }

  .closing-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
