/**
 * Button Animation styles - Fixed version
 *
 * @package p2publicaffairs
 */

.wp-block-button.has-slash-animation {
    position: relative;
    overflow: visible !important; /* Important to override any other styles */
}

.wp-block-button.has-slash-animation .wp-block-button__link {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Ensure background color doesn't change on hover */
.wp-block-button.has-slash-animation .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--accent-1) !important;
    /* Add drop shadow on hover */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.wp-block-button.has-slash-animation .button-slash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99 !important; /* Very high z-index to ensure it's on top */
    overflow: visible !important;
}

/* Position the SVG to extend beyond the button boundaries */
.wp-block-button.has-slash-animation .button-slash-overlay svg {
    position: absolute;
    left: 5px;
    top: -20px !important; /* Important to override any inline styles */
    width: 0;
    height: calc(100% + 40px) !important; /* Much taller than the button */
    opacity: 0;
    transition: opacity 0.2s ease-out;
    overflow: visible !important;
    z-index: 999 !important; /* Ultra high z-index */
}

/* Animation for the slash to grow and slide */
@keyframes slashGrowAndSlide {
    0% {
        left: 5px;
        width: 0;
        opacity: 1;
    }
    35% {
        left: 5px;
        width: 20.89px;
        opacity: 1;
    }
    70% {
        left: calc(100% - 25.89px);
        width: 20.89px;
        opacity: 1;
    }
    100% {
        left: calc(100% - 25.89px);
        width: 20.89px;
        opacity: 1; /* Keep visible at the end */
    }
}

/* Add a stronger drop shadow on click */
.wp-block-button.has-slash-animation:active .wp-block-button__link {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(1px);
}

/* Drop shadow styles for button hover state */
.wp-block-button.has-slash-animation:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* Reset transform on mouseout */
.wp-block-button.has-slash-animation {
    transform: translateY(0);
    transition: transform 0.2s ease;
}

/* Force the SVG out of any containing element */
.wp-block-button.has-slash-animation::after {
    content: none !important;
}

/* Responsive adjustments - maintain the slash extending outside the button */
@media (max-width: 767px) {
    .wp-block-button.has-slash-animation .button-slash-overlay svg {
        height: calc(100% + 32px) !important;
        top: -16px !important;
    }
}