/* --- GLOBAL SLIDER SETTINGS --- */
body.home .main-hero-slider {
    margin-top: 15px !important; 
    width: 100% !important;
    height: auto !important;
    position: relative;
    z-index: 1;
}

/* Force standard 16:9 Widescreen */
.splide__track {
    aspect-ratio: 16 / 9 !important;
    width: 100% !important;
    height: auto !important;
}

/* Fix: Removed height: 100% to allow aspect-ratio to dictate the size */
.splide__slide img {
    width: 100% !important;
    height: auto !important; 
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important; 
    display: block !important;
}

/* --- TEXT OVERLAY (Responsive) --- */
.slide-overlay {
    position: absolute;
    bottom: 15% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90%;
    z-index: 20;
    text-align: center;
}

.slide-overlay h2 {
    color: #ffffff !important;
    font-size: clamp(1.4rem, 4vw, 3rem) !important;
    text-shadow: 0px 4px 15px rgba(0,0,0,0.7) !important;
}

/* --- MOBILE & LARGE SCREEN OPTIMIZATION --- */

/* Tablets / iPad */
@media screen and (min-width: 768px) and (max-width: 991px) {
    body.home .main-hero-slider,
    body.home .wp-block-group.has-background {
        min-height: 0 !important;
        height: auto !important;
        padding-top: 0 !important;
        margin-top: 80px !important; /* Increased to push past tablet menus */
        overflow: hidden !important;
        position: relative !important;
        z-index: 9 !important; /* Forces layout forward over site layers */
    }

    body.home .main-hero-slider .splide,
    body.home .main-hero-slider .splide__track,
    body.home .main-hero-slider .splide__list,
    body.home .main-hero-slider .splide__slide {
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: 4 / 3 !important;
    }

    body.home .main-hero-slider .splide__track {
        padding-top: 0 !important;
        overflow: hidden !important;
    }

    body.home .main-hero-slider .splide__list {
        display: flex !important;
    }

    body.home .main-hero-slider .splide__slide {
        position: relative !important;
        overflow: hidden !important;
    }

    body.home .main-hero-slider .splide__slide img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        aspect-ratio: auto !important;
        object-fit: cover !important;
        display: block !important;
        z-index: 1 !important; 
    }

    body.home .main-hero-slider .slide-overlay {
        z-index: 2 !important; 
    }
}

/* Mobile Phones */
@media screen and (max-width: 767px) {
    body.home .main-hero-slider,
    body.home .wp-block-group.has-background {
        min-height: 0 !important;
        height: auto !important;
        padding-top: 0 !important;
        margin-top: 110px !important; /* Fixes the overlapping menu hide bug */
        overflow: hidden !important;
        position: relative !important;
        z-index: 9 !important; /* Elevates the container over hidden theme barriers */
    }

    body.home .main-hero-slider .splide,
    body.home .main-hero-slider .splide__track,
    body.home .main-hero-slider .splide__list,
    body.home .main-hero-slider .splide__slide {
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
    }

    body.home .main-hero-slider .splide__track {
        padding-top: 0 !important;
        overflow: hidden !important;
    }

    body.home .main-hero-slider .splide__list {
        display: flex !important;
    }

    body.home .main-hero-slider .splide__slide {
        position: relative !important;
        overflow: hidden !important;
    }

    body.home .main-hero-slider .splide__slide img {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        aspect-ratio: auto !important;
        object-fit: cover !important;
        display: block !important;
        z-index: 1 !important; 
    }

    body.home .main-hero-slider .slide-overlay {
        bottom: 10% !important;
        width: 92% !important;
        z-index: 2 !important; 
    }
}
/* --- END MOBILE & LARGE SCREEN OPTIMIZATION --- */

/* --- SEO H1 COMPATIBILITY --- */
.slide-overlay h1 {
    color: #ffffff !important;
    font-size: clamp(1.4rem, 4vw, 3rem) !important;
    text-shadow: 0px 4px 15px rgba(0,0,0,0.7) !important;
    margin: 0 !important; 
    font-weight: inherit !important; 
}
