/* ==========================================================
   Typed Text Sub - Estilos finales
   Cursor como ::after del texto
   Autor: Subgráfica
   ========================================================== */

/* =========================================
   CONTENEDOR PRINCIPAL
========================================= */

.typed-text-sub {
  display: flex;
  align-items: flex-start;          /* alineación correcta arriba */
  gap: 0.25em;

  font-size: 2rem;
  line-height: 1.2;
  color: inherit;

  white-space: normal;              /* multilínea */
  max-width: 100%;
  overflow-wrap: break-word;

  position: relative;
  vertical-align: middle;

  /* evita salto 1 → 2 líneas */
  min-height: calc(1.2em * 2);
}

/* =========================================
   TEXTO ESCRITO
========================================= */

.typed-text-sub .typed-output {
  display: inline;
  min-width: 0.25em;
  white-space: normal;

  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

/* =========================================
   CURSOR COMO ::AFTER
========================================= */

.typed-text-sub .typed-output::after {
  content: "|";
  display: inline-block;
  margin-left: 0.1em;
  opacity: 1;
  animation: blink 1s steps(1) infinite;
}

/* No mostrar cursor si no hay texto */
.typed-text-sub .typed-output:empty::after {
  content: "";
}

/* =========================================
   ESTADOS Y OPCIONES
========================================= */

/* Si NO se debe mostrar cursor nunca */
.typed-text-sub:not([data-conf*='"showCursor":true'])
.typed-output::after {
  content: "";
}

/* Si NO debe quedarse el cursor al finalizar */
.typed-text-sub.is-finished:not([data-conf*='"cursorAfterFinish":true'])
.typed-output::after {
  content: "";
}

/* 👉 NOTA:
   NO apagamos la animación al finalizar,
   por lo tanto el cursor SIGUE PARPADEANDO
*/

/* =========================================
   ANIMACIONES
========================================= */

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   VISUAL BUILDER (Divi)
========================================= */

/* Mostrar texto completo, sin typing */
.et-fb .typed-text-sub .typed-strings {
  display: inline !important;
}

.et-fb .typed-text-sub .typed-line {
  display: inline;
}

.et-fb .typed-text-sub .typed-output {
  display: none;
}

/* Sin cursor en el builder */
.et-fb .typed-text-sub .typed-output::after {
  content: "";
}

/* =========================================
   ALINEACIONES (Divi)
========================================= */

.et_pb_text_align_left .typed-text-sub {
  justify-content: flex-start;
  text-align: left;
}

.et_pb_text_align_center .typed-text-sub {
  justify-content: center;
  text-align: center;
}

.et_pb_text_align_right .typed-text-sub {
  justify-content: flex-end;
  text-align: right;
}