/**
 * Cover Block Gradient Fix
 * Prevents WordPress/plugins from overriding gradients on mobile
 * Version: 1.0.1
 */

/* HOME PAGE ONLY: Apply gradient overlay on mobile */
@media (max-width: 782px) {
    .home .wp-block-cover__background {
        background: linear-gradient(0deg, rgb(245, 245, 245) 0%, rgba(245, 245, 245, 0.6) 50%, rgba(245, 245, 245, 0) 100%) !important;
    }
}

/* Override any mobile gradient changes on cover blocks (NON-HOME PAGES) */
@media (max-width: 782px) {
    /* Restore proper gradient overlay for all cover blocks on non-home pages */
    body:not(.home) .wp-block-cover__background {
        background: rgba(0, 0, 0, 0.5) !important;
        background-image: none !important;
    }
    
    body:not(.home) .wp-block-cover__background.has-background-dim-30 {
        background: rgba(0, 0, 0, 0.3) !important;
        background-image: none !important;
    }
    
    body:not(.home) .wp-block-cover__background.has-background-dim-50 {
        background: rgba(0, 0, 0, 0.5) !important;
        background-image: none !important;
    }
    
    body:not(.home) .wp-block-cover__background.has-background-dim {
        background: rgba(0, 0, 0, 0.5) !important;
        background-image: none !important;
    }
    
    /* Specific fix for contrast background color overlays */
    body:not(.home) .wp-block-cover__background.has-contrast-background-color.has-background-dim-30 {
        background-color: rgba(0, 0, 0, 0.3) !important;
        background-image: none !important;
    }
    
    body:not(.home) .wp-block-cover__background.has-contrast-background-color.has-background-dim {
        background-color: rgba(0, 0, 0, 0.5) !important;
        background-image: none !important;
    }
    
    /* Fix for take-action cards specifically */
    body:not(.home) .take-action-card .wp-block-cover__background {
        background: rgba(0, 0, 0, 0.5) !important;
        background-image: none !important;
    }
    
    /* Newsletter signup section fix */
    body:not(.home) .newsletter-signup-section-793 .wp-block-cover__background {
        background: rgba(0, 0, 0, 0.5) !important;
        background-image: none !important;
    }
    
    /* Prevent any linear-gradient overrides on mobile (non-home) */
    body:not(.home) .wp-block-cover__background {
        background-image: none !important;
    }
    
    /* Only allow gradients if explicitly set via inline style (non-home) */
    body:not(.home) .wp-block-cover__background[style*="gradient"] {
        background-image: unset !important;
    }
}

/* Force proper layering of cover elements */
.wp-block-cover {
    position: relative;
}

.wp-block-cover__image-background {
    z-index: 0;
}

.wp-block-cover__background {
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.wp-block-cover__inner-container {
    z-index: 2;
    position: relative;
}
