/*
 * Custom styles for KyiaKB theme
 * Add your custom CSS here
 */

/* Carousel smooth transitions */
.carousel-container {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    animation: fade-in 0.5s ease-in;
}

/* Carousel wrapper with gradient masks */
.carousel-wrapper {
    position: relative;
}

.carousel-gradient-left {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), transparent);
}

.carousel-gradient-right {
    background: linear-gradient(to left, rgba(255, 255, 255, 0.95), transparent);
}

/* Carousel navigation buttons */
.carousel-nav-btn {
    backdrop-filter: blur(8px);
}

.carousel-nav-btn:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(239, 68, 68, 0.5);
    ring-offset: 2px;
}

/* Carousel dots */
.carousel-dot {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot.active {
    width: 2rem;
    border-radius: 9999px;
}

@media (min-width: 768px) {
    .carousel-dot.active {
        width: 2.5rem;
    }
}

/* Carousel card enhancements */
.carousel-card {
    will-change: transform;
    backface-visibility: hidden;
    max-width: 100%;
}

/* Constrain carousel card size */
.video-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

@media (max-width: 640px) {
    .video-container a {
        max-width: 200px;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .video-container a {
        max-width: 240px;
    }
}

.carousel-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.carousel-card:hover::before {
    opacity: 1;
}

/* Enhanced video overlay */
.video-overlay {
    backdrop-filter: blur(1px);
}

/* Smooth image transitions */
.static-image {
    will-change: opacity, transform;
}

.hover-video {
    will-change: opacity;
}

/* Enhanced fade transitions for carousel */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Improved responsive spacing */
@media (max-width: 640px) {
    .carousel-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .carousel-gradient-left,
    .carousel-gradient-right {
        width: 2rem;
    }
}

/* Smooth hover video transitions */
.video-container:hover .hover-video {
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-container:hover .static-image {
    opacity: 0.4;
    transform: scale(1.05);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Overlay opacity on hover - keep image visible */
.video-container:hover .video-overlay {
    opacity: 0.7 !important;
}

/* Mobile Menu Styles */
#mobileMenu {
    overflow-y: auto;
}

/* Ensure all mobile menu links have consistent styling */
#mobileMenu a {
    display: block;
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
    font-weight: 500 !important;
    text-align: left;
    width: 100%;
    transform: none !important;
    scale: 1 !important;
}

/* Override hover scale transforms in mobile menu */
#mobileMenu a:hover {
    transform: none !important;
    scale: 1 !important;
}

/* Override active state scaling in mobile menu */
#mobileMenu a.font-bold {
    font-weight: 600 !important;
    transform: none !important;
    scale: 1 !important;
}

/* Ensure WordPress menu items in mobile menu have proper styling */
#mobileMenu .flex.flex-col a,
#mobileMenu > div > a {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
    font-weight: 500 !important;
    transform: none !important;
    scale: 1 !important;
}

/* Mobile menu button hover state */
#mobileMenuButton:hover span {
    opacity: 0.8;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Hero image overlay for text readability */
.hero-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
}

/* Hero heading background for readability */
.hero-heading-wrapper {
    display: block;
    padding: 1rem 2rem;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    text-align: center;
}

.hero-heading {
    margin-bottom: 0 !important;
}

/* Hero subheading background for readability */
.hero-subheading {
    padding: 1.25rem 2rem;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 0.75rem;
}

/* Hero button background for readability */
.hero-button {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(4px);
}

.hero-button:hover {
    background-color: rgb(239, 68, 68) !important;
    color: white !important;
}

/* Mobile-specific hero section styles */
@media (max-width: 768px) {
    /* Reduce section padding on mobile */
    section.text-center.py-16 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    /* Add background to heading wrapper on mobile */
    section.text-center.py-16 > div.overflow-hidden.relative.z-10:first-of-type {
        display: inline-block;
        padding: 0.75rem 1.25rem;
        background-color: rgba(255, 255, 255, 0.85);
        border-radius: 0.5rem;
        margin-bottom: 1rem;
        width: auto;
        max-width: 90%;
    }
    
    /* Adjust heading spacing on mobile */
    .hero-heading {
        margin-bottom: 0 !important;
        line-height: 1.1 !important;
        font-size: 2rem !important;
    }
    
    /* Reduce subheading padding on mobile */
    .hero-subheading {
        padding: 0.875rem 1.125rem;
        margin: 20px !important;
        font-size: 0.875rem !important;
        line-height: 1.5;
        max-width: 90%;
    }
    
    /* Adjust button padding on mobile */
    .hero-button {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        padding-top: 0.625rem !important;
        padding-bottom: 0.625rem !important;
        font-size: 0.875rem !important;
        margin-top: 0.5rem;
    }
    
    /* Ensure proper spacing between elements */
    section.text-center.py-16 > div:not(.absolute) {
        margin-bottom: 1rem;
    }
    
    /* Adjust background container border radius on mobile */
    section.text-center.py-16 > div.absolute {
        border-radius: 1rem;
    }
    
    /* Reduce overlay opacity slightly on mobile for better image visibility */
    .hero-overlay {
        border-radius: 1rem;
    }
}

