/* ============================================
   RUTAS DE LECTURA — Libreos
   UI editorial premium con sección "¿Por qué aquí?"
   v2.0 — Diferenciada, exquisita, pedagógica
   ============================================ */

/* === CABECERA DE LA RUTA === */
.ruta-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.ruta-tipo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  background: linear-gradient(135deg, #d6b28b, #c49d77);
  color: #3a2918;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border: 1px solid rgba(130, 100, 70, 0.4);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(184, 138, 95, 0.25);
}

.ruta-meta-total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 24px;
  font-size: 16px;
  color: #6d5242;
}

.ruta-meta-item {
  padding: 7px 20px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(150, 120, 90, 0.22);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  font-weight: 500;
}

.ruta-meta-sep {
  margin: 0 12px;
  opacity: 0.4;
}

/* === PROGRESS ARC — indicador visual de la ruta === */
.ruta-progress-arc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 32px auto 0;
  max-width: 480px;
}

.ruta-arc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d6b28b, #b88a5f);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.ruta-arc-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(184, 138, 95, 0.6), rgba(184, 138, 95, 0.2));
}

/* === LÍNEA DE TIEMPO === */
.ruta-timeline {
  position: relative;
  padding-left: 70px;
  max-width: 780px;
  margin: 0 auto;
}

/* Línea vertical continua */
.ruta-timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 24px;
  bottom: 80px;
  width: 2px;
  background: linear-gradient(180deg,
    rgba(184, 146, 103, 0.9) 0%,
    rgba(196, 157, 119, 0.5) 70%,
    rgba(196, 157, 119, 0.05) 100%
  );
}

/* === PASO INDIVIDUAL === */
.ruta-paso {
  position: relative;
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.55s ease forwards;
}

.ruta-paso:nth-child(1) { animation-delay: 0.04s; }
.ruta-paso:nth-child(2) { animation-delay: 0.12s; }
.ruta-paso:nth-child(3) { animation-delay: 0.20s; }
.ruta-paso:nth-child(4) { animation-delay: 0.28s; }
.ruta-paso:nth-child(5) { animation-delay: 0.36s; }
.ruta-paso:nth-child(6) { animation-delay: 0.44s; }
.ruta-paso:nth-child(7) { animation-delay: 0.52s; }
.ruta-paso:nth-child(8) { animation-delay: 0.60s; }

/* === NÚMERO DEL PASO === */
.ruta-paso-numero {
  position: absolute;
  left: -70px;
  top: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d6b28b, #b88a5f);
  border: 2.5px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #3a2918;
  z-index: 2;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ruta-paso:hover .ruta-paso-numero {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* === TARJETA DEL PASO === */
.ruta-paso-card {
  background: linear-gradient(145deg, #f8ede0 0%, #f0ddc7 60%, #e8d0b8 100%);
  border: 1px solid rgba(160, 118, 85, 0.22);
  border-radius: 20px;
  padding: 26px 28px 22px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* Flecha que apunta al número */
.ruta-paso-card::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 28px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 10px solid rgba(160, 118, 85, 0.22);
}

.ruta-paso-card::after {
  content: '';
  position: absolute;
  left: -7px;
  top: 28px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 10px solid #f8ede0;
}

.ruta-paso-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.13),
    0 4px 8px rgba(0, 0, 0, 0.06);
}

/* === ETIQUETA DEL PASO (badge de rol) === */
.ruta-etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 13px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(140, 105, 72, 0.28);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #7a5530;
  margin-bottom: 14px;
  backdrop-filter: blur(4px);
}

/* === TÍTULO DEL LIBRO === */
.ruta-paso-titulo {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 5px;
  line-height: 1.2;
  color: transparent;
  background: linear-gradient(
    180deg,
    #4e3420 0%,
    #7a5530 40%,
    #9a7050 70%,
    #6a4a30 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

/* === AUTOR === */
.ruta-paso-autor {
  font-size: 16px;
  color: #8a6248;
  margin-bottom: 13px;
  font-style: italic;
  opacity: 0.9;
  font-weight: 500;
}

/* === META (páginas + tiempo) === */
.ruta-paso-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ruta-paso-meta span {
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 13px;
  border-radius: 10px;
  border: 1px solid rgba(160, 120, 85, 0.22);
  font-size: 14px;
  color: #7a6050;
  font-weight: 500;
}

/* === DESCRIPCIÓN === */
.ruta-paso-desc {
  font-size: 18px;
  color: #4e3a2a;
  line-height: 1.55;
  margin-bottom: 0;
}

/* === SECCIÓN "¿POR QUÉ ESTE LIBRO AQUÍ?" === */
.ruta-porqué {
  margin-top: 18px;
  padding: 13px 16px 13px 18px;
  background: linear-gradient(135deg,
    rgba(201, 168, 100, 0.16) 0%,
    rgba(201, 168, 100, 0.08) 100%
  );
  border: 1px solid rgba(168, 130, 61, 0.24);
  border-left: 3px solid rgba(196, 157, 80, 0.65);
  border-radius: 0 12px 12px 0;
}

.ruta-porqué-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #9a7530;
  margin-bottom: 6px;
}

.ruta-porqué-label::before {
  content: '¿Por qué aquí?';
  font-style: normal;
}

.ruta-porqué-texto {
  font-size: 15.5px;
  color: #5a4020;
  line-height: 1.5;
  font-style: italic;
  margin: 0;
  font-weight: 400;
}

/* === BOTÓN VER LIBRO === */
.ruta-paso-card .lista-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 20px;
  padding: 9px 20px;
  background: linear-gradient(135deg, #d4a96a, #b8843f);
  color: #fff9f0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  border: 1px solid rgba(140, 95, 40, 0.3);
  box-shadow: 0 3px 10px rgba(140, 95, 40, 0.25);
  transition: all 0.2s ease;
}

.ruta-paso-card .lista-btn::after {
  content: '→';
  font-size: 14px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.ruta-paso-card .lista-btn:hover {
  background: linear-gradient(135deg, #c49a58, #a8742e);
  box-shadow: 0 5px 16px rgba(140, 95, 40, 0.35);
  transform: translateY(-1px);
}

.ruta-paso-card .lista-btn:hover::after {
  transform: translateX(3px);
}

/* === PASO FINAL — destacado visualmente === */
.ruta-paso:last-child .ruta-paso-numero {
  background: linear-gradient(135deg, #c9a864, #a07830);
  box-shadow:
    0 5px 16px rgba(168, 130, 61, 0.45),
    inset 0 1px 0 rgba(255, 230, 140, 0.4);
  border-color: rgba(255, 225, 140, 0.5);
  font-size: 18px;
  width: 48px;
  height: 48px;
  left: -72px;
}

.ruta-paso:last-child .ruta-paso-card {
  background: linear-gradient(145deg, #f8ebd5 0%, #eed8b0 50%, #e4c898 100%);
  border-color: rgba(168, 130, 61, 0.32);
  box-shadow:
    0 8px 28px rgba(168, 130, 61, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 245, 200, 0.5);
}

.ruta-paso:last-child .ruta-paso-card::after {
  border-right-color: #f8ebd5;
}

.ruta-paso:last-child .ruta-etiqueta {
  background: rgba(201, 168, 100, 0.28);
  border-color: rgba(168, 130, 61, 0.38);
  color: #7a5020;
}

.ruta-paso:last-child .ruta-porqué {
  background: linear-gradient(135deg,
    rgba(201, 168, 100, 0.25) 0%,
    rgba(201, 168, 100, 0.14) 100%
  );
  border-color: rgba(168, 130, 61, 0.38);
  border-left-color: rgba(196, 150, 50, 0.85);
}

/* === ANIMACIÓN === */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .ruta-timeline {
    padding-left: 52px;
  }

  .ruta-timeline::before {
    left: 16px;
  }

  .ruta-paso-numero {
    left: -52px;
    width: 36px;
    height: 36px;
    font-size: 15px;
    top: 26px;
  }

  .ruta-paso:last-child .ruta-paso-numero {
    left: -54px;
    width: 38px;
    height: 38px;
    top: 26px;
  }

  .ruta-paso-card::before,
  .ruta-paso-card::after {
    top: 28px;
  }

  .ruta-paso-titulo {
    font-size: 22px;
  }

  .ruta-paso-desc {
    font-size: 16px;
  }

  .ruta-paso-card {
    padding: 20px 20px 18px;
  }

  .ruta-meta-total {
    flex-direction: column;
    gap: 8px;
  }

  .ruta-meta-sep {
    display: none;
  }

  .ruta-progress-arc {
    display: none;
  }

  .ruta-porqué-texto {
    font-size: 15px;
  }
}
