/* EchoFather Familias · Investigación: pasos visibles (v7.3)
   - Línea de progreso con los 7 pasos numerados: hechos en oro suave, el actual destacado, los siguientes atenuados.
   - Botón «Siguiente: <paso>» grande y dorado; «Anterior» discreto. En el último paso vuelve al primero.
   - Al cambiar, el texto entra desde el lado del avance y el esquema se enfoca con un barrido de luz.
   - En móvil y tableta también se puede deslizar sobre el esquema. */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Línea de pasos */
.research-steps {
  --progress: 0; --node: 38px;
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  margin-top: 22px; padding: 2px 0 4px; border: 0;
}
.research-steps::before, .research-steps::after {
  content: ''; position: absolute; top: calc(2px + var(--node) / 2 - 1px); left: calc(100% / 14); height: 2px; border-radius: 2px; pointer-events: none;
}
.research-steps::before { right: calc(100% / 14); background: #ffffff1c; }
.research-steps::after {
  width: calc((100% - 100% / 7) * var(--progress));
  background: linear-gradient(90deg, #b8964f, var(--gold), var(--bright));
  box-shadow: 0 0 14px #dfbd7680;
  transition: width .65s cubic-bezier(.3, .9, .3, 1);
}
.research-steps button {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 0; padding: 0 4px 6px; border: 0; background: none; cursor: pointer; color: #a9c1bd;
}
.research-steps button b {
  width: var(--node); height: var(--node); border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
  color: #a9c1bd; background: #0a2a33; border: 1px solid #dfbd7640;
  transition: background .35s, color .35s, border-color .35s, box-shadow .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1);
}
.research-steps button span { font-size: 13px; color: #b7ceca; transition: color .3s; }
.research-steps button:hover b { border-color: var(--gold); color: var(--gold); }
.research-steps button.is-done b { background: #2a3f35; border-color: #dfbd7690; color: var(--bright); }
.research-steps button[aria-selected=true] { border: 0; }
.research-steps button[aria-selected=true] b {
  background: linear-gradient(145deg, var(--bright), var(--gold)); color: var(--night); border-color: transparent;
  transform: scale(1.18); box-shadow: 0 0 0 6px #dfbd7624, 0 0 26px #dfbd7690;
}
.research-steps button[aria-selected=true] span { color: var(--gold); font-weight: 650; }
.research-steps button:focus-visible { outline: none; }
.research-steps button:focus-visible b { outline: 2px solid var(--gold); outline-offset: 4px; }

/* Botones de avance */
.research-controls { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 20px; }
.step-btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .25s, border-color .25s, box-shadow .3s, opacity .25s, transform .45s cubic-bezier(.3, 1.6, .5, 1), translate .6s cubic-bezier(.22, 1.5, .45, 1);
}
.step-btn:active { transform: scale(.96); }
.step-prev { background: transparent; border: 1px solid #ffffff33; color: #d2dfdc; }
.step-prev:hover { border-color: var(--gold); color: var(--gold); }
.step-prev:disabled { opacity: .3; cursor: default; border-color: #ffffff22; color: #d2dfdc; }
.step-prev > span { font-size: 18px; line-height: 1; }
.step-next {
  margin-left: auto; border: 0; color: var(--night);
  background: linear-gradient(145deg, var(--bright), var(--gold));
  box-shadow: 0 10px 28px #dfbd7645, inset 0 1px 0 #fff8;
}
.step-next:hover { box-shadow: 0 14px 34px #dfbd7666, inset 0 1px 0 #fff8; }
.step-next b { font-weight: 750; }
.step-arrow { font-size: 20px; line-height: 1; transition: translate .3s; }
.step-next:hover .step-arrow { translate: 4px 0; }
/* Un empujoncito al llegar, para que se entienda que se avanza por aquí */
.room.active .step-next .step-arrow { animation: step-nudge 2.2s ease-in-out 1.4s 3; }
@keyframes step-nudge { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 6px 0; } }
.step-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Transición entre pasos */
.research-visual { overflow: hidden; }
@keyframes step-text-in { from { opacity: 0; translate: calc(var(--dir, 1) * 34px) 0; filter: blur(5px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }
@keyframes step-image-in { from { opacity: .2; scale: 1.05; filter: blur(8px) saturate(.6); } to { opacity: 1; scale: 1; filter: blur(0) saturate(1); } }
@keyframes step-sweep { from { translate: calc(var(--dir, 1) * -110%) 0; opacity: 1; } to { translate: calc(var(--dir, 1) * 110%) 0; opacity: 0; } }
.research-detail.step-in > :not(.research-controls) { animation: step-text-in .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.research-detail.step-in > :nth-child(2) { animation-delay: .05s; }
.research-detail.step-in > :nth-child(3) { animation-delay: .1s; }
.research-detail.step-in > :nth-child(4) { animation-delay: .16s; }
.research-visual.step-in img { animation: step-image-in .75s cubic-bezier(.2, .8, .2, 1); }
.research-visual::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 2;
  background: linear-gradient(100deg, transparent 35%, #dfbd7638 50%, transparent 65%);
}
.research-visual.step-in::after { animation: step-sweep .9s cubic-bezier(.3, .6, .3, 1); }

/* Tableta */
@media (max-width: 980px) {
  .research-steps { --node: 34px; }
  .research-steps button span { font-size: 12px; }
}

/* Móvil: los 7 números en una fila; el nombre del paso está en el panel */
@media (max-width: 720px) {
  .research-steps { --node: 32px; grid-template-columns: repeat(7, 1fr); gap: 0; margin-top: 18px; }
  .research-steps button { padding: 0 0 4px; min-height: 0; justify-content: flex-start; }
  .research-steps button span { display: none; }
  .research-controls { gap: 10px; }
  .step-btn { min-height: 48px; padding: 0 16px; font-size: 14px; }
  .step-prev { font-size: 0; width: 48px; padding: 0; justify-content: center; flex-shrink: 0; }
  .step-prev > span { font-size: 19px; }
  .step-next { white-space: nowrap; }
}
@media (max-width: 380px) {
  .research-steps { --node: 30px; }
  /* Pantallas estrechas: solo el nombre del paso siguiente (antes quedaba «Siguiente:» sin nombre) */
  .step-next-word { display: none; }
  .step-next-text b { display: inline-block; }
  .step-next-text b::first-letter { text-transform: uppercase; }
}

body.simple .research-steps::after { transition: none; }
