.main-slider .slide-wrapper {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.main-slider img.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-slider .overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 1;
}

/* Revolution Slider overlay effect - persistent overlay */
.main-slider .rev_slider_wrapper {
    position: relative;
}

.main-slider .rev_slider_wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 10;
    pointer-events: none;
}

/* Ensure text captions stay above overlay */
.main-slider .tp-caption {
    z-index: 20 !important;
}

/* Target Revolution Slider generated background images */
.main-slider .tp-bgimg.defaultimg {
    position: relative;
}

.main-slider .tp-bgimg.defaultimg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 2;
    pointer-events: none;
}

/* Alternative targeting for all tp-bgimg elements */
.main-slider .tp-bgimg {
    position: relative;
}

.main-slider .tp-bgimg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 2;
    pointer-events: none;
}

.main-slider .hero-content {
    position: absolute;
    top: 50%;
    z-index: 2;
    color: #fff;
}

@media (max-width: 389px) {

    /* Adjust tp-parallax-wrap positions for smaller screens */
    .main-slider .tp-parallax-wrap:nth-child(2) {
        top: 12.5% !important; /* First element at 12.5% of container height */
    }

    .main-slider .tp-parallax-wrap:nth-child(3) {
        top: 37.5% !important; /* Second element at 37.5% of container height */
    }

    .main-slider .tp-parallax-wrap:nth-child(4) {
        top: 62.5% !important; /* Third element at 62.5% of container height */
    }
}

/* Mobile-first: center and constrain width to viewport */
@media (max-width: 767.98px) {

    .main-slider .hero-content {
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px);
        max-width: 520px;
        padding: 0 16px;
        text-align: left;
    }
    .main-slider .hero-content h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    .main-slider .hero-content p {
        font-size: 1rem;
        margin-top: 16px;
    }

    /* Mobile tp-parallax-wrap selectors - evenly distributed based on container height */
    .main-slider .tp-parallax-wrap:nth-child(2) {
        top: 12.5% !important; /* First element at 12.5% of container height */
    }

    .main-slider .tp-parallax-wrap:nth-child(3) {
        top: 37.5% !important; /* Second element at 37.5% of container height */
    }

    .main-slider .tp-parallax-wrap:nth-child(4) {
        top: 62.5% !important; /* Third element at 62.5% of container height */
    }
}

/* Tablets / Desktop: align from left with comfortable width */
@media (min-width: 768px) {
    .main-slider .hero-content {
        left: 20%;
        transform: translateY(-50%);
        width: 100%;
        max-width: 800px;
    }
}
