/* ═══════════════════════════════════════════════
   TEH Titre Moderne — Styles design & animations
   ═══════════════════════════════════════════════ */

.teh-tm{
    --tm-blue: #193353;
    --tm-orange: #e05512;
    --tm-orange-light: #f07a3a;
    --tm-green: #507a2e;
    --tm-dur: 900ms;
    --tm-delay: 0ms;
    position: relative;
    padding: 20px 0;
}

/* ═══ EYEBROW ═══ */
.teh-tm__eyebrow{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    line-height: 1;
}

.teh-tm__eyebrow-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}
.teh-tm__eyebrow-icon i,
.teh-tm__eyebrow-icon svg{
    width: 1em;
    height: 1em;
    font-size: inherit;
}

.teh-tm__eyebrow--pill{
    --tm-eb-from: var(--tm-orange);
    --tm-eb-to: var(--tm-orange-light);
    background: linear-gradient(135deg, var(--tm-eb-from), var(--tm-eb-to));
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 50px;
    box-shadow: 0 10px 28px rgba(224,85,18,.4), inset 0 1px 0 rgba(255,255,255,.2);
}
.teh-tm__eyebrow--pill::before{
    content: '';
    width: 6px; height: 6px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255,255,255,.25);
    animation: tehTmPulse 2s ease-in-out infinite;
}
@keyframes tehTmPulse{
    0%,100%{box-shadow:0 0 0 4px rgba(255,255,255,.25);}
    50%{box-shadow:0 0 0 8px rgba(255,255,255,.1);}
}

.teh-tm__eyebrow--line{
    color: var(--tm-orange);
    padding-left: 56px;
    position: relative;
}
.teh-tm__eyebrow--line::before{
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 3px;
    background: linear-gradient(90deg, var(--tm-orange), var(--tm-green));
    border-radius: 2px;
}

.teh-tm__eyebrow--plain{ color: var(--tm-orange); }

.teh-tm[style*="text-align:center"] .teh-tm__eyebrow,
.teh-tm[style*="text-align: center"] .teh-tm__eyebrow{
    margin-left: auto;
    margin-right: auto;
}

/* ═══ TITRE — BASE ═══ */
.teh-tm__title{
    margin: 0 0 16px;
    font-size: 48px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--tm-blue);
}

.teh-tm--nowrap .teh-tm__title{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══ STYLES DE DESIGN ═══ */
.teh-tm--gradient .teh-tm__title{
    background: linear-gradient(135deg, var(--tm-blue) 0%, var(--tm-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.teh-tm--gradient2 .teh-tm__title{
    background: linear-gradient(135deg, var(--tm-orange) 0%, var(--tm-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.teh-tm--split .teh-tm__title{ color: var(--tm-blue); }
.teh-tm--split .teh-tm__highlight{ color: var(--tm-orange); }
.teh-tm--outline .teh-tm__title{
    color: transparent;
    -webkit-text-stroke: 2px var(--tm-blue);
    text-stroke: 2px var(--tm-blue);
}
.teh-tm--outline .teh-tm__highlight{
    color: var(--tm-orange);
    -webkit-text-stroke: 0;
    text-stroke: 0;
}
.teh-tm--underline .teh-tm__title{
    color: var(--tm-blue);
    display: inline-block;
    position: relative;
}
.teh-tm--underline .teh-tm__title::after{
    content: '';
    position: absolute;
    left: 0; bottom: -8px;
    height: 4px;
    width: 0;
    background: linear-gradient(90deg, var(--tm-orange), var(--tm-orange-light), var(--tm-green));
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(.25,.8,.25,1) 600ms;
    box-shadow: 0 4px 12px rgba(224,85,18,.3);
}
.teh-tm--underline.is-animating .teh-tm__title::after{ width: 100%; }
.teh-tm--underline:not(.teh-tm--pre-anim) .teh-tm__title::after{ width: 100%; }
.teh-tm[style*="text-align:center"] .teh-tm--underline .teh-tm__title::after,
.teh-tm[style*="text-align: center"] .teh-tm--underline .teh-tm__title::after{
    left: 50%;
    transform: translateX(-50%);
}
.teh-tm--highlight .teh-tm__title{ color: var(--tm-blue); }
.teh-tm--highlight .teh-tm__highlight{
    background: linear-gradient(120deg, transparent 0%, transparent 10%,
                rgba(224,85,18,.25) 10%, rgba(240,122,58,.35) 90%, transparent 90%, transparent 100%);
    padding: 0 .15em;
    background-size: 100% 60%;
    background-repeat: no-repeat;
    background-position: 0 75%;
    color: var(--tm-blue);
    font-weight: 900;
}
.teh-tm--solid .teh-tm__title{ color: var(--tm-blue); }

/* ═══ SUBTITLE ═══ */
.teh-tm__subtitle{
    margin: 0;
    font-size: 17px;
    color: #5a6478;
    line-height: 1.65;
    font-weight: 500;
    max-width: 600px;
}
.teh-tm[style*="text-align:center"] .teh-tm__subtitle,
.teh-tm[style*="text-align: center"] .teh-tm__subtitle{
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════
   ANIMATIONS — approche simplifiee et sure
   Par defaut TOUT est visible.
   Le JS ajoute .teh-tm--pre-anim pour poser l'etat
   initial, puis .is-animating pour jouer l'anim.
   Si le JS ne tourne pas : titre visible.
   ═══════════════════════════════════════════════ */

.teh-tm--pre-anim .teh-tm__eyebrow,
.teh-tm--pre-anim .teh-tm__title,
.teh-tm--pre-anim .teh-tm__subtitle{
    opacity: 0;
    will-change: transform, opacity, filter;
    transition: opacity var(--tm-dur) cubic-bezier(.25,.8,.25,1),
                transform var(--tm-dur) cubic-bezier(.25,.8,.25,1),
                filter var(--tm-dur) cubic-bezier(.25,.8,.25,1);
}

.teh-tm--pre-anim.teh-tm--anim-fade-up .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-fade-up .teh-tm__title,
.teh-tm--pre-anim.teh-tm--anim-fade-up .teh-tm__subtitle{ transform: translateY(30px); }

.teh-tm--pre-anim.teh-tm--anim-slide-right .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-slide-right .teh-tm__title,
.teh-tm--pre-anim.teh-tm--anim-slide-right .teh-tm__subtitle{ transform: translateX(-40px); }

.teh-tm--pre-anim.teh-tm--anim-slide-left .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-slide-left .teh-tm__title,
.teh-tm--pre-anim.teh-tm--anim-slide-left .teh-tm__subtitle{ transform: translateX(40px); }

.teh-tm--pre-anim.teh-tm--anim-blur-in .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-blur-in .teh-tm__title,
.teh-tm--pre-anim.teh-tm--anim-blur-in .teh-tm__subtitle{
    filter: blur(20px);
    transform: scale(1.05);
}

.teh-tm--pre-anim.teh-tm--anim-zoom-in .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-zoom-in .teh-tm__title,
.teh-tm--pre-anim.teh-tm--anim-zoom-in .teh-tm__subtitle{ transform: scale(.7); }

/* Reveal : masque orange */
.teh-tm--anim-reveal .teh-tm__title{
    position: relative;
    overflow: hidden;
    display: inline-block;
}
.teh-tm--pre-anim.teh-tm--anim-reveal .teh-tm__title::before{
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--tm-orange), var(--tm-orange-light));
    transform: translateX(0);
    transition: transform var(--tm-dur) cubic-bezier(.76,0,.24,1);
    z-index: 2;
}
.teh-tm--pre-anim.teh-tm--anim-reveal.is-animating .teh-tm__title::before{
    transform: translateX(100%);
}
.teh-tm--pre-anim.teh-tm--anim-reveal .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-reveal .teh-tm__subtitle{ transform: translateY(20px); }

/* Typewriter */
.teh-tm--pre-anim.teh-tm--anim-typewriter .teh-tm__title{
    opacity: 1;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid var(--tm-orange);
    width: 0;
    max-width: 100%;
}
.teh-tm--pre-anim.teh-tm--anim-typewriter.is-animating .teh-tm__title{
    animation: tehTmTypewriter var(--tm-dur) steps(var(--tm-tw-steps, 20), end) var(--tm-delay) forwards,
               tehTmCaret .7s step-end infinite var(--tm-delay);
}
@keyframes tehTmTypewriter{ from{width:0} to{width:var(--tm-tw-width, 100%)} }
@keyframes tehTmCaret{ 50%{border-color:transparent} }
.teh-tm--pre-anim.teh-tm--anim-typewriter .teh-tm__eyebrow,
.teh-tm--pre-anim.teh-tm--anim-typewriter .teh-tm__subtitle{ transform: translateY(20px); }

/* ETAT FINAL : is-animating declenche l'animation vers l'etat visible */
.teh-tm--pre-anim.is-animating .teh-tm__eyebrow,
.teh-tm--pre-anim.is-animating .teh-tm__title,
.teh-tm--pre-anim.is-animating .teh-tm__subtitle{
    opacity: 1;
    transform: none;
    filter: none;
}

/* Stagger */
.teh-tm--pre-anim.teh-tm--stagger .teh-tm__eyebrow{ transition-delay: calc(var(--tm-delay) + 0ms); }
.teh-tm--pre-anim.teh-tm--stagger .teh-tm__title{ transition-delay: calc(var(--tm-delay) + 150ms); }
.teh-tm--pre-anim.teh-tm--stagger .teh-tm__subtitle{ transition-delay: calc(var(--tm-delay) + 300ms); }

.teh-tm--pre-anim:not(.teh-tm--stagger) .teh-tm__eyebrow,
.teh-tm--pre-anim:not(.teh-tm--stagger) .teh-tm__title,
.teh-tm--pre-anim:not(.teh-tm--stagger) .teh-tm__subtitle{
    transition-delay: var(--tm-delay);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px){
    .teh-tm{ padding: 16px 0; }
    .teh-tm__eyebrow{ font-size: 11px; letter-spacing: 1.2px; }
    .teh-tm__eyebrow--pill{ padding: 8px 16px; }
    .teh-tm__title{ letter-spacing: -.5px; }
}
@media (max-width: 480px){
    .teh-tm--nowrap .teh-tm__title{ white-space: normal; }
}

/* prefers-reduced-motion : pas d'animation */
@media (prefers-reduced-motion: reduce){
    .teh-tm--pre-anim .teh-tm__eyebrow,
    .teh-tm--pre-anim .teh-tm__title,
    .teh-tm--pre-anim .teh-tm__subtitle{
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    .teh-tm--anim-typewriter .teh-tm__title{
        width: auto !important;
        animation: none !important;
        border-right: none !important;
    }
}
