/* ==========================================================================
   Hero rotating word — premium animated word swap for the hero heading.
   Only the colored word crossfades (fade + slide-up + blur); the sentence
   itself never changes and the box height is locked by JS so nothing else
   in the layout ever shifts. Scoped to .hero-rotating-title so it cannot
   affect any other .section-title usage across the template.
   ========================================================================== */

/* Give the rotating heading the full column width instead of the theme's
   default shrink-to-fit inline-block, so the longest rotating word has
   room to sit on one line instead of wrapping mid-phrase on wide screens. */
.hero-rotating-title {
    display: block;
    width: 100%;
}

.word-rotator {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    /* Fallback single-line box before JS measures the exact height; JS
       overwrites this with a precise pixel value so no word ever gets
       clipped and the box never has to jump to fit a taller word. */
    min-height: 2.4em;
    padding-top: 0.08em;
    padding-bottom: 0.08em;
    margin-top: 10px;
    margin-bottom: -0.08em;
}

.word-rotator-item {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    color: var(--tl-color-theme-primary);
    opacity: 0;
    transform: translateY(42%);
    filter: blur(12px);
    text-shadow: 0 4px 30px rgba(237, 37, 55, 0);
    transition:
        opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        text-shadow 0.85s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform, filter;
}

.word-rotator-item.is-active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    text-shadow: 0 4px 30px rgba(237, 37, 55, 0.28);
}

.word-rotator-item.is-leaving {
    opacity: 0;
    transform: translateY(-42%);
    filter: blur(12px);
    text-shadow: 0 4px 30px rgba(237, 37, 55, 0);
}

/* Respect users who've asked the OS to reduce motion: keep the word swap
   (content still changes) but drop the movement/blur, just a soft fade. */
@media (prefers-reduced-motion: reduce) {
    .word-rotator-item {
        transition: opacity 0.4s ease;
        transform: none;
        filter: none;
    }

    .word-rotator-item.is-leaving {
        transform: none;
        filter: none;
    }
}

@media only screen and (max-width: 767px) {
    .word-rotator-item {
        transform: translateY(30%);
        filter: blur(8px);
    }

    .word-rotator-item.is-leaving {
        transform: translateY(-30%);
        filter: blur(8px);
    }
}
