/* SelectMesa Hero Carousel styles */
.sm-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
    min-height: clamp(560px, 72vh, 960px);
}

.sm-hero .swiper-wrapper {
    align-items: stretch;
    min-height: inherit;
    height: inherit;
}

.sm-hero .swiper-slide {
    height: auto;
}

/* Remove default Divi module margin for this module */
.et_pb_module.sm_hero_carousel {
    margin: 0 !important;
}

/* Support custom slideClass so Swiper treats Divi child wrappers as slides */
.sm-hero .sm_hero_slide {
    height: 100%;
    min-height: inherit;
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

.sm-hero.swiper-fade .sm_hero_slide {
    transition-property: opacity;
}

/* Media layers */
.sm-hero__slide {
    position: relative;
    width: 100%;
    min-height: inherit;
}

.sm-hero__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.sm-hero__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sm-hero__grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Text panel */
.sm-hero__panel {
    position: absolute;
    z-index: 1;
    color: #fff;
    margin: 0;
    /* default, can be overridden by module field */
    max-width: 600px;
    /* overridable via inline style */
    left: clamp(48px, 6vw, 120px);
    top: 50%;
    transform: translateY(-50%);
    padding: 55px 60px 60px 60px;
}

.sm-hero__subtitle {
    line-height: 1;
    margin-bottom: 32px;
    font-size: 40px;
    font-weight: 700;
}

.sm-hero__title {
    font-size: 130px;
    line-height: 115px;
    font-weight: 600;
    margin: 0 0 18px;

}

/* Buttons */
.sm-hero__buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.sm-hero__btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: background .2s ease, border-color .2s ease;
}

.sm-hero__btn:hover,
.sm-hero__btn:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Responsiveness */
@media (max-width: 768px) {

    /* Let the slide height be driven by the stacked content */
    .sm-hero {
        min-height: 0;
    }

    /* Media becomes a normal block element instead of an absolute layer */
    .sm-hero__media {
        position: relative;
        inset: auto;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        aspect-ratio: 1 / 1;
        height: auto;
        overflow: hidden;
    }

    /* Ensure background + grid fill the square */
    .sm-hero__bg,
    .sm-hero__grid {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Panel is stacked under the image */
    .sm-hero__panel {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        max-width: none;
        /* keep Divi/module-set padding; don't force a new value here */
        z-index: 1;
        padding: 50px 20px 30px;
    }

    .sm-hero__subtitle {
        font-size: 36px;
        line-height: 28px;
    }

    .sm-hero__title {
        font-size: 80px;
        line-height: 70px;
    }
}

@media (max-width: 600px) {
    /* Keep the stacked mobile layout; only adjust type rhythm if needed */

    .sm-hero__subtitle {
        margin-bottom: 18px;
    }
}


/* ===========================================
   Hero helpers (Divi spacing reset for hero section)
   =========================================== */
.et_pb_section.sm-hero-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.et_pb_section.sm-hero-section .et_pb_row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.et_pb_section.sm-hero-section .et_pb_module {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Auto-apply spacing reset when a hero module is present (modern browsers) */
.et_pb_section:has(.sm_hero_carousel) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.et_pb_section:has(.sm_hero_carousel) .et_pb_row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* JS will also add these classes at runtime so this works even without :has support */
.et_pb_row.sm-hero-row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure no extra margins on the hero section itself */
.et_pb_section.sm-hero-section {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.et_pb_section:has(.sm_hero_carousel) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove column vertical padding within the hero row */
.et_pb_section.sm-hero-section .et_pb_column,
.et_pb_section:has(.sm_hero_carousel) .et_pb_column,
.et_pb_row.sm-hero-row .et_pb_column {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


.sm_hero_carousel .et_pb_module_inner {
    padding: 0 !important;
    min-height: inherit;
    height: inherit;
}

/* Ensure consistent sizing semantics */
.sm-hero,
.sm-hero .swiper-wrapper,
.sm-hero .sm_hero_slide {
    box-sizing: border-box;
}

.sm-hero__panel {
    box-sizing: border-box;
}
