/* ES — Header top bar */
.es-htb {
    --es-htb-d: 0px;
    position: relative;
    overflow: hidden;
    padding: 8px 24px;
    font-size: 13px;
    line-height: 1.4;
}

.es-htb__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

/* Gauche / droite (fixes) */
.es-htb__left a {
    color: inherit;
    text-decoration: underline;
    font-size: 13px;
}

.es-htb__right {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: flex-end;
}

.es-htb__right button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: inherit;
    padding: 0;
}

.es-htb__right button:hover {
    text-decoration: underline;
}

/* Centre */
.es-htb__center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
}

.es-htb__empty {
    opacity: .7;
    font-weight: 400;
    font-style: italic;
}

.es-htb__stage {
    position: relative;
}

/* Toutes les phrases sont empilées dans la même cellule : la zone prend la taille de la plus grande. */
.es-htb__cube {
    display: grid;
}

.es-htb__item {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

.es-htb__item.is-active {
    visibility: visible;
}

.es-htb__text {
    text-align: center;
}

.es-htb__text p {
    margin: 0;
}

.es-htb__text svg,
.es-htb__text img {
    vertical-align: -0.18em;
}

/* Transition : cube (rotation 3D, uniquement sur la zone centrale) */
.es-htb--cube .es-htb__stage {
    perspective: 240px;
}

.es-htb--cube .es-htb__cube {
    transform-style: preserve-3d;
    transform: translateZ(calc(var(--es-htb-d) * -1));
}

.es-htb--cube .es-htb__cube.is-rotating {
    transform: translateZ(calc(var(--es-htb-d) * -1)) rotateX(90deg);
    transition: transform .7s cubic-bezier(.65, 0, .35, 1);
}

.es-htb--cube .es-htb__item {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateX(-90deg) translateZ(var(--es-htb-d));
}

.es-htb--cube .es-htb__item.is-active {
    transform: rotateX(0deg) translateZ(var(--es-htb-d));
}

.es-htb--cube .es-htb__item.is-next {
    visibility: visible;
}

/* Transition : machine à écrire (curseur) */
.es-htb__ch {
    position: relative;
}

.es-htb__ch.is-hidden {
    visibility: hidden;
}

.es-htb__ch.is-cursor-after::after,
.es-htb__ch.is-cursor-before::before {
    content: "";
    position: absolute;
    top: .05em;
    bottom: .05em;
    width: 2px;
    background: currentColor;
    animation: es-htb-blink 1s steps(1) infinite;
}

/* Le curseur doit rester visible même si son caractère est masqué (début de phrase),
   mais uniquement dans la phrase affichée : jamais celui d'une phrase inactive. */
.es-htb__item.is-active .es-htb__ch.is-cursor-after::after,
.es-htb__item.is-active .es-htb__ch.is-cursor-before::before {
    visibility: visible;
}

.es-htb__ch.is-cursor-after::after {
    right: -2px;
}

.es-htb__ch.is-cursor-before::before {
    left: -2px;
}

@keyframes es-htb-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Mobile : gauche et droite masqués, le texte peut passer à la ligne */
@media (max-width: 768px) {
    .es-htb {
        padding: 8px 12px;
    }

    .es-htb__inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 6px;
    }

    .es-htb__left,
    .es-htb__right {
        display: none;
    }

    .es-htb__center {
        white-space: normal;
    }
}


