/**
 * Standard Banner Styles
 * 
 * This file contains styles for the standard horizontal banner layout.
 * Features an offset overlay effect and consistent styling with other components.
 */

/* Standard Banner Component Styles */
.standard-banner-container {
    position: relative;
    width: 85vw;
    height: 600px;
    overflow: visible;
    margin-bottom: 60px;
    margin-left: 15vw;
    /* Create a new stacking context at the root level */
    isolation: isolate;
}

/* Add overflow-x hidden to prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Force proper stacking order for all banner elements */
.standard-banner-container * {
    position: relative;
}

/* The swiper wrapper contains the background images (bottom layer) */
.standard-banner-container .swiper-wrapper {
    display: flex;
    position: relative;
    z-index: 1 !important; /* Bottom layer - below overlay */
    height: 100%;
}

/* The slide contains the background image (bottom layer) and the overlay (pseudo-element) */
.standard-banner-slide {
    position: relative;
    width: 100%;
    height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1 !important; /* Bottom layer - below overlay */
}

/* Note: Overlay is now a pseudo-element defined in the inline style in the PHP file */

/* Hide navigation arrows */
.standard-banner-container .swiper-button-next,
.standard-banner-container .swiper-button-prev {
    display: none;
}

/* Pagination Styles - should be on top */
.standard-banner-container .swiper-pagination {
    position: absolute !important;
    bottom: 20px !important;
    right: 30px !important;
    left: auto !important;
    width: auto !important;
    text-align: right !important;
    z-index: 100 !important; /* Top layer - above everything */
}

.standard-banner-container .swiper-pagination-bullet {
    width: 25px !important;
    height: 25px !important;
    display: inline-block !important;
    background-color: #0B3367 !important; /* Dark Accent Blue */
    background-image: none !important;
    border: none !important; /* No border for flat look */
    margin: 0 8px !important; /* Consistent spacing */
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
}

.standard-banner-container .swiper-pagination-bullet-active {
    background-color: #0CB1E1 !important; /* Main Light Blue */
    background-image: none !important;
    transform: scale(1.1) !important;
    /* border-color: #fff !important; */ /* Border removed */
}

/* The content is the top layer */
.standard-banner-content {
    position: absolute !important;
    bottom: 80px !important;
    left: 40px !important; /* Adjusted from 50% */
    width: calc(100% - 80px) !important; /* Adjusted for padding */
    max-width: var(--container-width, 1200px) !important;
    padding: 0 40px !important;
    color: #fff !important;
    z-index: 50 !important; /* Top layer - above overlay */
    /* Additional properties to force stacking context */
    isolation: isolate;
}

/* Text animation styles - only affect the text content elements */
.standard-banner-title, 
.standard-banner-subtitle, 
.standard-banner-excerpt, 
.standard-banner-btn {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Enhanced animation for title */
.standard-banner-title {
    /* More dramatic initial state */
    transform: translateX(80px) translateY(30px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left bottom;
}

.content-active .standard-banner-title {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    transition-delay: 0.2s;
}

.content-active .standard-banner-subtitle {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.35s;
}

.content-active .standard-banner-excerpt {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.5s;
}

.content-active .standard-banner-btn {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.65s;
}

/* Enhanced exit animation for title */
.content-exit .standard-banner-title {
    opacity: 0;
    transform: translateX(50px) translateY(-20px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.7, 0, 0.84, 0);
    transition-delay: 0s;
}

/* Exit animations for other elements with staggered timing */
.content-exit .standard-banner-subtitle {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.7, 0, 0.84, 0);
    transition-delay: 0.05s;
}

.content-exit .standard-banner-excerpt {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.7, 0, 0.84, 0);
    transition-delay: 0.1s;
}

.content-exit .standard-banner-btn {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.7, 0, 0.84, 0);
    transition-delay: 0.15s;
}

/* Ensure all content elements inherit the high z-index */
.standard-banner-content > * {
    position: relative !important;
    z-index: 50 !important;
}

.standard-banner-title {
    font-size: 4.5rem !important;
    font-weight: 300 !important;
    margin-bottom: 20px !important;
    color: #fff !important;
    position: relative !important;
    padding-bottom: 25px !important;
    z-index: 50 !important;
}

.standard-banner-subtitle {
    font-size: 1.8rem !important;
    font-weight: 300 !important;
    margin-bottom: 20px !important;
    color: #fff !important;
    z-index: 50 !important;
}

/* Update title underline */
.standard-banner-title:after {
    content: '';
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 2px !important;
    background: #fff !important;
    z-index: 50 !important;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.4s;
}

.content-active .standard-banner-title:after {
    opacity: 1;
    transform: scaleX(1);
    transition-delay: 0.5s; /* Slightly later than the title itself */
}

/* Add exit animation for the underline */
.content-exit .standard-banner-title:after {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: right center; /* Changes direction for exit */
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.7, 0, 0.84, 0);
    transition-delay: 0s; /* Start immediately with title exit */
}

.standard-banner-excerpt {
    font-size: 1.2rem !important;
    margin-bottom: 30px !important;
    color: #fff !important;
    line-height: 1.6 !important;
    max-width: 700px !important; /* Added max-width constraint */
    z-index: 50 !important;
    position: relative !important;
}

/* Style similar to isotope-read-more */
.standard-banner-btn {
    display: block !important;
    width: fit-content !important;
    color: #fff !important;
    text-decoration: none !important;
    padding-bottom: 5px !important;
    border-bottom: 1px solid #fff !important;
    font-size: 2.125rem !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    padding-right: 80px !important; /* Space for arrow */
    z-index: 50 !important; /* Ensure this is above overlay */
    text-transform: capitalize;
}

.standard-banner-btn:after {
    content: '→' !important;
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: transform 0.3s ease !important;
    z-index: 50 !important;
}

.standard-banner-btn:hover {
    color: rgba(255, 255, 255, 0.8) !important;
    border-bottom-color: rgba(255, 255, 255, 0.8) !important;
}

.standard-banner-btn:hover:after {
    transform: translate(5px, -50%) !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .standard-banner-container {
        width: 90vw;
        margin-left: 10vw;
        height: 500px;
    }
    
    .standard-banner-slide {
        height: 500px;
    }
    
    /* Overlay responsive styles are now handled in the PHP inline style */
    
    .standard-banner-content {
        left: 30px !important;
        width: calc(100% - 60px) !important;
        padding: 0 30px !important;
    }
    
    .standard-banner-title {
        font-size: 2.5rem !important;
    }
    
    .standard-banner-excerpt {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .standard-banner-container {
        width: 95vw;
        margin-left: 5vw;
        height: 460px;
    }
    
    .standard-banner-slide {
        height: 460px;
    }
    
    /* Overlay responsive styles are now handled in the PHP inline style */
    
    .standard-banner-content {
        left: 20px !important;
        width: calc(100% - 70px) !important;
        padding: 0 15px !important;
        bottom: 40px !important;
        height: 360px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .standard-banner-title {
        font-size: 1.8rem !important;
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
    }

    .standard-banner-subtitle {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
    }
    
    .standard-banner-excerpt {
        font-size: 1rem !important;
        margin-bottom: 15px !important;
        line-height: 1.4 !important;
    }

    .standard-banner-btn {
        font-size: 1.25rem !important;
        padding-right: 50px !important;
        padding-bottom: 3px !important;
    }

    .standard-banner-btn:after {
        font-size: 1.25rem;
    }
}

/* For browsers that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .standard-banner-title, 
    .standard-banner-subtitle, 
    .standard-banner-excerpt, 
    .standard-banner-btn,
    .standard-banner-title:after {
        transition-duration: 0.1s !important;
        transition-delay: 0s !important;
    }
} 
/*--------------------------------------------------------------
# Smart auto-fit: flyer (portrait / square) banner treatment
#
# When an uploaded banner image is narrower than ~16:9 it gets the
# `is-flyer` class (see inc/banner.php). Instead of cropping it with
# `cover`, we show the WHOLE image centred, on a blurred backdrop of
# itself, and hide the overlaid title so the flyer's own text isn't
# doubled up. Wide "hero" images are untouched.
--------------------------------------------------------------*/
.standard-banner-slide.is-flyer {
    background-color: #0B3367; /* Dark Accent Blue, shows at the very edges */
}

/* Blurred, zoomed copy of the image filling the wide area behind the flyer */
.standard-banner-slide.is-flyer .banner-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(28px) brightness(0.85);
    transform: scale(1.12);
    z-index: 1;
}

/* The full flyer, contained and centred so nothing is cropped */
.standard-banner-slide.is-flyer .banner-flyer-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    max-width: min(92%, 1100px);
    max-height: 86%;
    object-fit: contain;
    z-index: 3;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Drop the dark gradient overlay on flyers (it dims the poster) */
.standard-banner-slide.is-flyer::before {
    display: none !important;
}

/* Hide the overlaid WP title/meta on flyers (the poster has its own text) */
.standard-banner-slide.is-flyer .standard-banner-title,
.standard-banner-slide.is-flyer .standard-banner-subtitle,
.standard-banner-slide.is-flyer .standard-banner-excerpt,
.standard-banner-slide.is-flyer .page-banner__title,
.standard-banner-slide.is-flyer .post-meta-banner,
.standard-banner-slide.is-flyer .event-date-banner {
    display: none;
}

/* Keep any call-to-action button visible, centred under the flyer */
.standard-banner-slide.is-flyer .standard-banner-content {
    position: absolute !important;
    bottom: 24px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    text-align: center;
    z-index: 4 !important;
}

@media (max-width: 768px) {
    .standard-banner-slide.is-flyer .banner-flyer-img {
        max-width: 94%;
        max-height: 82%;
    }
    .standard-banner-slide.is-flyer .banner-blur-bg {
        filter: blur(20px) brightness(0.85);
    }
}
