/* Timeline — mobile-first vertical layout */

.timeline-container {
  max-width: var(--width-reading);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.timeline-header {
  margin-bottom: var(--space-8);
}

.timeline-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.timeline-subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
}

/* Vertical line */
.timeline-line {
  position: relative;
  padding-left: 28px;
}

.timeline-line::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

/* Date markers */
.timeline-date-marker {
  position: relative;
  margin: var(--space-6) 0 var(--space-4);
}

.timeline-date-pill {
  display: inline-block;
  background: var(--spacex-blue);
  color: #fff; /* hardcoded: white on colored pill badge */
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

/* Card */
.timeline-card {
  position: relative;
  margin-bottom: var(--space-4);
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--space-gray-700);
  border: 2px solid var(--bg-primary);
}

.timeline-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.timeline-card-inner:hover {
  border-color: var(--spacex-blue);
  box-shadow: var(--glow-blue);
}

.timeline-card-image {
  width: 100%;
  max-height: 180px;
  overflow: hidden;
}

.timeline-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-card-body {
  padding: var(--space-4);
}

/* Meta row */
.timeline-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Type badges */
.timeline-type-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-type--article {
  background: var(--color-info-tint);
  color: var(--color-info);
}

.timeline-type--qa {
  background: var(--color-success-tint);
  color: var(--color-success);
}

.timeline-type--insight {
  background: var(--color-warning-tint);
  color: var(--color-warning);
}

.timeline-type--news {
  background: var(--color-error-tint);
  color: var(--color-error);
}

.timeline-topic-badge {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
}

.timeline-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-left: auto;
}

/* Title + snippet */
.timeline-card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: 1.4;
  margin-bottom: var(--space-2);
}

.timeline-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.timeline-card-title a:hover {
  color: var(--spacex-blue-light);
}

.timeline-card-snippet {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty state */
.timeline-empty {
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--text-muted);
}

.timeline-empty i {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
  display: block;
}

/* Loading / sentinel */
.timeline-loading {
  text-align: center;
  padding: var(--space-8) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.timeline-sentinel {
  min-height: 1px;
}

/* Desktop: wider gutter */
@media (width >= 768px) {
  .timeline-line {
    padding-left: 40px;
  }

  .timeline-line::before {
    left: 12px;
  }

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

  .timeline-card-image {
    max-height: 240px;
  }

  .timeline-title {
    font-size: var(--text-4xl);
  }
}
