/*
   Sequencia de temas
*/

#temas-sequencia.topic-depth {
    position: relative;
    isolation: isolate;
    height: clamp(140px, 12vw, 175px);
    margin: 0;
    overflow: hidden;
    border: 0;
    background: #491b30;
    color: #c895ab;
}

#temas-sequencia .depth-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    transform-style: preserve-3d;
}

#temas-sequencia .depth-phrase {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 8vw;
    text-align: center;
    font-family: var(--font-primary);
    font-size: clamp(28px, 3.4vw, 50px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: calc(-.045em + var(--track-400));
    color: #c895ab;
    opacity: 0;
    transform-origin: center;
    backface-visibility: hidden;
    will-change: transform, opacity;
    pointer-events: none;
    animation: topic-depth-flight var(--depth-duration, 76s) linear var(--depth-delay, 0s) infinite both;
    animation-play-state: paused;
}
#temas-sequencia .depth-phrase span { display: block; max-width: 100%; }
#temas-sequencia.in-view .depth-phrase { animation-play-state: running; }
#temas-sequencia.is-paused .depth-phrase,
#temas-sequencia.is-window-hidden .depth-phrase { animation-play-state: paused; }

#temas-sequencia .depth-pause {
    position: absolute;
    right: 14px;
    bottom: 8px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 1px solid #c895ab44;
    border-radius: 50%;
    background: #491b30;
    color: #c895ab;
    font: inherit;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
}
#temas-sequencia .depth-pause:focus-visible { outline: 2px solid #c895ab; outline-offset: 2px; }

/* Lista legivel para leitores de tela (as frases animadas sao aria-hidden). */
#temas-sequencia .depth-readable {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 700px) {
    #temas-sequencia.topic-depth { height: 145px; }
    #temas-sequencia .depth-phrase { font-size: clamp(24px, 5.6vw, 34px); padding: 17px 9vw; }
}

/* Sem movimento: mostra so o primeiro tema, parado. */
@media (prefers-reduced-motion: reduce) {
    #temas-sequencia .depth-phrase { animation: none; opacity: 0; transform: none; will-change: auto; }
    #temas-sequencia .depth-phrase:first-child { opacity: 1; }
    #temas-sequencia .depth-pause { display: none; }
}
