/**
 * Homepage Section Transitions
 * 
 * Comprehensive smooth transition effects for all homepage sections
 * Includes animations, hover effects, and smooth interactions
 */

/* ==========================================================================
   Global Smooth Scrolling
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Hero Section Enhancements (Additional to existing hero-buttons.css)
   ========================================================================== */

.mandyju-hero-section {
    animation: fadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.mandyju-hero-section .wp-block-heading {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    transition: all 0.3s ease !important;
}

.mandyju-hero-section .hero-subheading {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
    transition: all 0.3s ease !important;
}

/* Subtle background shimmer sweep across the hero
   - Implemented as an overlay inside the Cover block so it sits above the image
     but below the text content
   - Uses transform-based animation for GPU-friendly performance */
.mandyju-hero-section .wp-block-cover {
    position: relative;
    overflow: hidden;
}

.mandyju-hero-section .wp-block-cover::before {
    content: "";
    position: absolute;
    inset: -5% -20%; /* slightly larger to avoid clipping at edges */
    pointer-events: none;
    /* A narrow soft-light band that simulates a moving light */
    background: linear-gradient(110deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 32%,
        rgba(255,255,255,0.38) 48%,
        rgba(255,255,255,0) 64%,
        rgba(255,255,255,0) 100%
    );
    /* Use overlay blend for clearer yet still tasteful effect */
    mix-blend-mode: overlay;
    opacity: 0.26; /* slightly stronger so it’s noticeable */
    transform: translate3d(-120%, 0, 0);
    animation: heroShimmer 14s linear infinite;
    will-change: transform;
    /* Layer above cover background, below inner content */
    z-index: 1;
}





/* ==========================================================================
   Features Section Transitions
   ========================================================================== */

.mandyju-features-section {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
    transition: all 0.3s ease !important;
}

.mandyju-features-section .wp-block-heading {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
    transition: transform 0.3s ease, color 0.3s ease !important;
}

.mandyju-features-section .wp-block-heading:hover {
    transform: translateY(-2px) !important;
}

/* Feature items/columns */
.mandyju-features-section .wp-block-columns .wp-block-column {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: translateY(0) !important;
}

.mandyju-features-section .wp-block-columns .wp-block-column:nth-child(1) {
    animation-delay: 0.4s;
}

.mandyju-features-section .wp-block-columns .wp-block-column:nth-child(2) {
    animation-delay: 0.5s;
}

.mandyju-features-section .wp-block-columns .wp-block-column:nth-child(3) {
    animation-delay: 0.6s;
}

.mandyju-features-section .wp-block-columns .wp-block-column:nth-child(4) {
    animation-delay: 0.7s;
}

.mandyju-features-section .wp-block-columns .wp-block-column:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   Featured Products Section Transitions
   ========================================================================== */

.mandyju-featured-products-section {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    transition: all 0.3s ease !important;
}

.mandyju-featured-products-section .wp-block-heading {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
    transition: transform 0.3s ease !important;
}

.mandyju-featured-products-section .wp-block-heading:hover {
    transform: translateY(-2px) !important;
}

/* Product items */
.mandyju-featured-products-section .wc-block-grid__product,
.mandyju-featured-products-section .wp-block-woocommerce-product-grid .wp-block-post {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: translateY(0) !important;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.mandyju-featured-products-section .wc-block-grid__product:nth-child(1),
.mandyju-featured-products-section .wp-block-post:nth-child(1) {
    animation-delay: 0.5s;
}

.mandyju-featured-products-section .wc-block-grid__product:nth-child(2),
.mandyju-featured-products-section .wp-block-post:nth-child(2) {
    animation-delay: 0.6s;
}

.mandyju-featured-products-section .wc-block-grid__product:nth-child(3),
.mandyju-featured-products-section .wp-block-post:nth-child(3) {
    animation-delay: 0.7s;
}

.mandyju-featured-products-section .wc-block-grid__product:nth-child(4),
.mandyju-featured-products-section .wp-block-post:nth-child(4) {
    animation-delay: 0.8s;
}

.mandyju-featured-products-section .wc-block-grid__product:hover,
.mandyju-featured-products-section .wp-block-post:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Product images */
.mandyju-featured-products-section .wp-post-image,
.mandyju-featured-products-section .wc-block-grid-product__image img {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mandyju-featured-products-section .wp-post-image:hover,
.mandyju-featured-products-section .wc-block-grid-product__image img:hover {
    transform: scale(1.05) !important;
}

/* ==========================================================================
   Testimonials Section Transitions
   ========================================================================== */

.mandyju-testimonials-section {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
    transition: all 0.3s ease !important;
}

.mandyju-testimonials-section .wp-block-heading {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
    transition: transform 0.3s ease !important;
}

.mandyju-testimonials-section .wp-block-heading:hover {
    transform: translateY(-2px) !important;
}

/* Testimonial cards (if using shortcode) */
.mandyju-testimonials-section .testimonial-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.mandyju-testimonials-section .testimonial-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12) !important;
}

/* Mandyju Testimonials Plugin Enhancements */
.mj-testimonials {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both !important;
}

.mj-carousel {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both !important;
}

.mj-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both !important;
}

.mj-card:nth-child(1) { animation-delay: 0.6s !important; }
.mj-card:nth-child(2) { animation-delay: 0.7s !important; }
.mj-card:nth-child(3) { animation-delay: 0.8s !important; }
.mj-card:nth-child(4) { animation-delay: 0.9s !important; }

.mj-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
}

.mj-nav {
    transition: all 0.2s ease !important;
    opacity: 0.7 !important;
}

.mj-nav:hover {
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.1) !important;
    color: var(--wp--preset--color--primary) !important;
}

/* ==========================================================================
   Global Button Enhancements
   ========================================================================== */

.wp-block-button .wp-block-button__link:not(.mandyju-hero-section *):not(.mandyju-cta-section *) {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: translateY(0) !important;
}

.wp-block-button .wp-block-button__link:not(.mandyju-hero-section *):not(.mandyju-cta-section *):hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

/* ==========================================================================
   Image Transitions
   ========================================================================== */

img {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

img:hover {
    transform: scale(1.02) !important;
}

/* ==========================================================================
   Link Hover Effects
   ========================================================================== */

a:not(.wp-block-button__link) {
    transition: color 0.2s ease, opacity 0.2s ease !important;
}

a:not(.wp-block-button__link):hover {
    opacity: 0.8 !important;
}

/* ==========================================================================
   Scroll-Based Animations (Intersection Observer would be better, but CSS-only)
   ========================================================================== */

@media (min-width: 768px) {
    /* Enhanced hover effects for desktop */
    .mandyju-features-section .wp-block-column:hover {
        transform: translateY(-10px) scale(1.02) !important;
    }
    
    .mandyju-featured-products-section .wc-block-grid__product:hover,
    .mandyju-featured-products-section .wp-block-post:hover {
        transform: translateY(-10px) scale(1.03) !important;
    }
}

/* ==========================================================================
   Animation Keyframes
   ========================================================================== */

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}



/* ==========================================================================
   Accessibility: Respect reduced motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

}