/* Animated Text Block Widget Styles */

.animated-text-block-widget {
    width: 100%;
    position: relative;
    /* Modern rendering optimizations */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Reset heading default styles when using h1-h4 as the HTML tag */
.animated-text-block-widget h1.atb-text-wrapper,
.animated-text-block-widget h2.atb-text-wrapper,
.animated-text-block-widget h3.atb-text-wrapper,
.animated-text-block-widget h4.atb-text-wrapper,
.animated-text-block-widget p.atb-text-wrapper,
.animated-text-block-widget div.atb-text-wrapper {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.atb-text-wrapper {
    margin: 0;
    padding: 0;
    line-height: inherit;
    display: block;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Letter spans will be dynamically created by JavaScript */
.atb-text-wrapper .atb-letter {
    display: inline;
    position: relative;
    margin: 0;
    padding: 0;

    /* Modern performance optimizations */
    will-change: color, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Smooth transitions with modern easing */
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* GPU acceleration hints */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    /* CSS custom property for dynamic animations */
    --progress: 0;
}

/* Ensure first letter starts at the beginning */
.atb-text-wrapper .atb-letter:first-child {
    margin-left: 0;
    padding-left: 0;
}

/* Handle line breaks properly */
.atb-text-wrapper br {
    display: block;
    content: "";
    margin: 0;
}