/**
 * Animated Red Underline Styles
 * Automatically applies to mark elements with .has-inline-color.has-accent-1-color classes
 */

/* Base styles for animated underline marks */
.animated-underline-mark {
    position: relative;
    display: inline-block;
    background-color: transparent !important;
    color: white !important;
    transition: color 0.8s ease-in-out;
}

/* The animated underline pseudo-element */
.animated-underline-mark::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--wp--preset--color--accent-1);
    transition: width 0.8s ease-in-out;
    transform-origin: left;
    z-index: 1;
}

/* Animation trigger when element is in view */
.animated-underline-mark.animate {
    color: var(--wp--preset--color--accent-1) !important;
}

.animated-underline-mark.animate::after {
    width: 100%;
}

/* Hover effect for interactivity */
.animated-underline-mark:hover::after {
    background-color: var(--wp--preset--color--accent-1);
    filter: brightness(0.9);
}

/* Alternative animation styles you can apply by adding classes */

/* Gradient underline */
.animated-underline-mark.gradient-style::after {
    background: linear-gradient(90deg, var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-2, var(--wp--preset--color--accent-1)));
    height: 2px;
    border-radius: 1px;
}

/* Thicker underline */
.animated-underline-mark.thick-style::after {
    height: 4px;
    bottom: -3px;
}

/* Slower animation */
.animated-underline-mark.slow-style::after {
    transition-duration: 1.5s;
}

/* Bouncy animation */
.animated-underline-mark.bouncy-style::after {
    transition: width 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .animated-underline-mark::after {
        height: 2px;
        bottom: -1px;
    }
    
    .animated-underline-mark.thick-style::after {
        height: 3px;
        bottom: -2px;
    }
}

@media (max-width: 480px) {
    .animated-underline-mark::after {
        height: 2px;
        bottom: 0px;
    }
}

/* Ensure the mark element doesn't interfere with line height */
.animated-underline-mark {
    line-height: inherit;
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .animated-underline-mark {
        transition: none;
    }
    
    .animated-underline-mark::after {
        transition: none;
        animation: none;
    }
    
    .animated-underline-mark.animate {
        color: var(--wp--preset--color--accent-1) !important;
    }
    
    .animated-underline-mark.animate::after {
        width: 100%;
    }
}

/* Print styles - hide underline animations in print */
@media print {
    .animated-underline-mark::after {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .animated-underline-mark::after {
        background-color: currentColor;
    }
}