/* ==========================================================================
   WINFORGE — REGISTRO DE CAMBIOS (cambios.css)
   Lo cargan /cambios (lista completa) y /descargas (últimas versiones).
   ========================================================================== */

/* Línea de tiempo */
.timeline {
  position: relative;
  padding-left: var(--space-2xl);
  margin: var(--space-2xl) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, rgba(127, 0, 255, 0.3) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-2xl);
  /* Al saltar a una versión desde el índice, que no quede tapada por la cabecera fija */
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-2xl) + 6px);
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-surface-elevated);
  border: 2px solid rgba(0, 242, 254, 0.55);
}

/* El punto encendido es solo para la versión que se puede descargar ahora */
.timeline-item.is-current .timeline-dot {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  border-color: var(--bg-main);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.timeline-version {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

a.timeline-version:hover {
  color: var(--accent-cyan);
}

.timeline-item:target .timeline-version {
  color: var(--accent-cyan);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-notes {
  list-style: disc;
  padding-left: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.timeline-notes strong {
  color: var(--text-primary);
}

/* Página /cambios */
.changelog-hero-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--space-lg);
}

.changelog-layout {
  grid-template-columns: 240px minmax(0, 1fr);
}

.changelog-content .timeline {
  margin-top: 0;
}

.changelog-index {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  max-height: calc(100vh - var(--header-height) - var(--space-xl) * 2);
  overflow-y: auto;
}

.changelog-index-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-sm) var(--space-sm);
}

.changelog-index-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.changelog-index-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 6px var(--space-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.changelog-index-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.changelog-index-version {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.changelog-index-link.is-current .changelog-index-version {
  color: var(--accent-cyan);
}

.changelog-index-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.changelog-update-note {
  margin-top: var(--space-2xl);
  margin-bottom: 0;
}

.changelog-update-note a {
  color: var(--accent-cyan);
}

/* Bloque "últimas versiones" de /descargas */
.changelog-more {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-left: var(--space-2xl);
}

.changelog-more-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* En pantallas estrechas el índice pasa arriba, como fila de botones */
@media (max-width: 1024px) {
  .changelog-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xl);
  }

  .changelog-index {
    max-height: none;
  }

  .changelog-index-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .changelog-index-link {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 4px 12px;
  }

  .changelog-index-date {
    display: none;
  }
}

@media (max-width: 768px) {
  .timeline {
    padding-left: var(--space-xl);
  }

  .timeline-dot {
    left: calc(-1 * var(--space-xl) + 6px);
  }

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

  .changelog-more {
    padding-left: var(--space-xl);
  }
}
