/* === TIMELINE MODULE === */

/* Summary cards row */
.timeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.timeline-summary .card {
  text-align: center;
  padding: 1rem;
}

.timeline-summary__value {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.timeline-summary__label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Filter bar */
.timeline-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.timeline-filters__btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.timeline-filters__btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.timeline-filters__btn.active {
  background: var(--bg-tertiary);
  border-color: var(--color-neutral);
  color: var(--text-primary);
}

/* Chart container */
.timeline-chart {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  min-height: 280px;
  position: relative;
}

.timeline-chart canvas {
  width: 100% !important;
}

/* Episode cards — horizontal scroll */
.episode-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.episode-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

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

.episode-card__number {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.episode-card__title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.episode-card__meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Slide-in detail panel */
.episode-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 90vw);
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  padding: 1.5rem;
}

.episode-panel.open {
  transform: translateX(0);
}

.episode-panel__close {
  position: sticky;
  top: 0;
  float: right;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  z-index: 1;
}

.episode-panel__close:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

@media (max-width: 768px) {
  .episode-card { flex: 0 0 220px; }
  .episode-panel { width: 100vw; }
}
