/* ════════════════════════════════════════════
   Chronicles — Dark Cosmic Design
   Uses variables from style.css:
   --bg, --bg-alt, --bg-card, --text, --text-muted,
   --accent, --accent-glow, --warm, --warm-glow,
   --cyan, --cyan-glow, --border, --border-hover
   ════════════════════════════════════════════ */

/* ── Shared Page Layout ── */
.chronicles-page {
  padding-top: 5rem;
}

.chronicles-hero-banner {
  text-align: center;
  padding: 6rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.chronicles-hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 40% 60%, var(--accent-glow) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, var(--warm-glow) 0%, transparent 50%);
  pointer-events: none;
}

.chronicles-hero-banner .section-inner {
  position: relative;
  z-index: 1;
}

.chronicles-hero-banner h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.chronicles-hero-banner h1 .highlight {
  background: linear-gradient(135deg, var(--accent), var(--warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chronicles-hero-banner .section-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

.chronicles-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.chronicles-back:hover {
  color: var(--accent);
}

/* ── Explore Cards (bottom nav) ── */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.explore-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.3s, transform 0.3s;
  color: var(--text);
}

.explore-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  color: var(--text);
}

.explore-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.explore-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.explore-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ── Character Grid ── */
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.character-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
  color: var(--text);
  display: block;
}

.character-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  color: var(--text);
}

.character-card-top {
  height: 4px;
}

.character-card-body {
  padding: 1.8rem 1.5rem 1.5rem;
}

.character-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
  overflow: hidden;
}

.character-card-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}

.character-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.character-card .character-role {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.character-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.character-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.character-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 50px;
  letter-spacing: 0.02em;
  color: white;
}

/* ── Story Grid ── */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
  display: flex;
  flex-direction: column;
}

.story-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.story-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.story-card .story-excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1rem;
}

.story-card .story-characters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

/* ── Filter Pills ── */
.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.filter-pill {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-entry {
  position: relative;
  padding-left: 72px;
  padding-bottom: 3rem;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 20px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent), 0 0 12px var(--accent-glow);
  z-index: 1;
}

.timeline-dot.future {
  background: var(--bg);
  border-color: var(--warm);
  box-shadow: 0 0 0 2px var(--warm), 0 0 16px var(--warm-glow);
}

.timeline-date {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.timeline-entry h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.timeline-entry p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.7;
}

/* ── Character Detail Page ── */
.character-detail {
  max-width: 720px;
  margin: 0 auto;
}

.character-portrait {
  text-align: center;
  margin-bottom: 2.5rem;
}

.character-portrait img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 4px solid var(--border);
  box-shadow: 0 0 40px var(--accent-glow);
}

.character-detail-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.character-detail-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.character-detail-role {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.character-detail-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.character-detail-bio {
  margin-bottom: 2.5rem;
}

.character-detail-bio p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.2rem;
}

.character-detail-bio blockquote {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(124, 108, 240, 0.05);
  border-radius: 0 12px 12px 0;
}

.character-detail-bio blockquote p {
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0;
}

.character-detail-section {
  margin-bottom: 2.5rem;
}

.character-detail-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.character-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.meta-item {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 500;
}

.character-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.character-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.character-nav a:hover {
  color: var(--accent);
}

/* ════════════════════════════════════════════
   RESPONSIVE — Chronicles
   ════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .character-grid,
  .story-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .explore-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .chronicles-hero-banner {
    padding: 4rem 1.5rem 2.5rem;
  }

  .character-grid,
  .story-grid,
  .explore-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }

  .character-portrait img {
    width: 200px;
    height: 200px;
  }

  .character-detail-meta {
    grid-template-columns: 1fr;
  }

  .filter-pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex-shrink: 0;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-dot {
    left: 12px;
    width: 16px;
    height: 16px;
  }

  .timeline-entry {
    padding-left: 52px;
    padding-bottom: 2.5rem;
  }
}
