/**
 * Typewriter Heading - Styles
 * Animation d'écriture machine à écrire
 */

/* Wrapper principal */
.typewriter-heading-wrapper {
    position: relative;
    display: block;
}

/* Titre */
.typewriter-heading-title {
    display: inline-block;
    margin: 0;
    line-height: 1.3;
}

/* Texte préfixe (fixe) */
.typewriter-prefix {
    display: inline;
}

/* Texte tapé */
.typewriter-text {
    display: inline;
    position: relative;
}

/* Texte suffixe (fixe) */
.typewriter-suffix {
    display: inline;
}

/* Curseur clignotant */
.typewriter-cursor {
    display: inline-block;
    margin-left: 2px;
    font-weight: 100;
    animation: typewriter-blink 0.7s step-end infinite;
    color: #6366f1;
}

@keyframes typewriter-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Curseur en pause (ne clignote pas pendant la frappe) */
.typewriter-cursor.typing {
    animation: none;
    opacity: 1;
}

/* Style de curseur alternatif - Bloc */
.typewriter-cursor.cursor-block {
    background-color: currentColor;
    color: transparent;
    width: 0.6em;
    height: 1.1em;
    vertical-align: text-bottom;
}

/* Style de curseur alternatif - Underscore */
.typewriter-cursor.cursor-underscore {
    text-decoration: none;
    border-bottom: 3px solid currentColor;
    margin-left: 0;
}

/* ========================
   VARIANTES DE STYLE
   ======================== */

/* Style Glow */
.typewriter-heading-wrapper.style-glow .typewriter-text {
    text-shadow: 0 0 10px currentColor;
}

.typewriter-heading-wrapper.style-glow .typewriter-cursor {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

/* Style Gradient */
.typewriter-heading-wrapper.style-gradient .typewriter-text {
    background: linear-gradient(90deg, #6366f1, #ec4899, #06b6d4);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: typewriter-gradient 3s linear infinite;
}

@keyframes typewriter-gradient {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Style Highlight */
.typewriter-heading-wrapper.style-highlight .typewriter-text {
    background: linear-gradient(transparent 60%, rgba(99, 102, 241, 0.3) 60%);
    padding: 0 5px;
    margin: 0 -5px;
}

/* ========================
   ANIMATION D'ENTRÉE
   ======================== */
.typewriter-heading-wrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.typewriter-heading-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mode immédiat sans animation d'entrée */
.typewriter-heading-wrapper.no-entrance {
    opacity: 1;
    transform: none;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .typewriter-cursor {
        margin-left: 1px;
    }
}

/* ========================
   ACCESSIBILITÉ
   ======================== */
@media (prefers-reduced-motion: reduce) {
    .typewriter-cursor {
        animation: none !important;
        opacity: 1;
    }
    
    .typewriter-heading-wrapper {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .typewriter-heading-wrapper.style-gradient .typewriter-text {
        animation: none !important;
    }
}

/* ========================
   MODE ÉDITEUR ELEMENTOR
   ======================== */
.elementor-editor-active .typewriter-heading-wrapper {
    opacity: 1;
    transform: none;
}

.elementor-editor-active .typewriter-text {
    min-width: 100px;
    display: inline-block;
}
