/* ==============================================
   Responsive Hero Banner Component
   ============================================== */

.be-hero {
    --be-hero-image: none;
    --be-hero-overlay: linear-gradient(90deg,
            rgba(70, 193, 168, 0.9) 0%,
            rgba(72, 169, 207, 0.7) 40%,
            rgba(72, 169, 234, 0.3) 60%,
            transparent 85%);
    --be-hero-text-color: #ffffff;
    --be-hero-max-width: 100%;

    width: 100%;
    margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
    padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 6vw, 3.5rem);
    position: relative;
    display: grid;
    align-items: center;
    overflow: hidden;
    background-image: var(--be-hero-overlay), var(--be-hero-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--be-hero-text-color);
    min-height: clamp(16rem, 34vh, 24rem);
    border-radius: 0;
    box-shadow: none;
    place-items: center;
}

.be-hero__align-left {
    justify-items: start;
    text-align: left;
}

.be-hero__align-center {
    justify-items: center;
    text-align: center;
}

/* Desktop alignment for left-aligned banners */
@media (min-width: 768px) {
    .be-hero__align-left {
        place-items: center start;
        text-align: left;
    }

    .be-hero__align-left .be-hero__content {
        margin-left: clamp(2rem, 15vw, 8rem);
    }

    .be-hero__align-center {
        place-items: center;
        text-align: center;
    }
}

/* Medium to large screens - prevent text from being too wide while keeping good line length */
@media (min-width: 768px) and (max-width: 1199px) {
    /* Ensure content is left-aligned */
    .be-hero {
        place-items: center start !important;
        text-align: left !important;
    }

    /* Override Bootstrap row/column alignment */
    .be-hero .row {
        justify-content: flex-start !important;
    }

    .be-hero .row > [class*="col-"] {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        text-align: left !important;
    }

    /* Control content width directly for optimal readability */
    .be-hero .be-hero__content,
    .be-hero .hero-content {
        max-width: 50ch !important;
        width: 100%;
        margin-left: clamp(2rem, 8vw, 6rem) !important;
        margin-right: auto;
    }

    /* Ensure title and paragraphs don't exceed optimal reading width */
    .be-hero__title,
    .be-hero__lead,
    .be-hero__text,
    .be-hero .hero-info p {
        max-width: 50ch;
    }
}

/* Extra large screens */
@media (min-width: 1200px) {
    .be-hero .be-hero__content,
    .be-hero .hero-content {
        max-width: 60ch;
    }
}

.be-hero--boxed {
    max-width: var(--be-hero-max-width);
    margin-left: auto;
    margin-right: auto;
    border-radius: clamp(0.75rem, 2vw, 1.5rem);
}

.be-hero--shadow {
    box-shadow: 0 15px 40px rgba(15, 74, 76, 0.18);
}

.be-hero--rounded {
    border-radius: clamp(0.75rem, 2vw, 1.5rem);
}

.be-hero__content {
    position: relative;
    z-index: 1;
    max-width: min(50ch, 90vw);
}

.be-hero__title {
    font-size: clamp(1.75rem, 3.8vw, 2.75rem);
    line-height: 1.15;
    margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
    font-weight: 900;
    color: var(--be-hero-text-color);
}

.be-hero__lead {
    font-size: clamp(1.05rem, 2.4vw, 1.3rem);
    line-height: 1.5;
    margin-bottom: clamp(0.75rem, 2vw, 1.1rem);
    font-weight: 500;
    color: var(--be-hero-text-color);
}

.be-hero__text {
    font-size: clamp(0.95rem, 2.1vw, 1.15rem);
    line-height: 1.55;
    margin-bottom: clamp(0.6rem, 1.6vw, 1rem);
    color: var(--be-hero-text-color);
}

.be-hero__text:last-child {
    margin-bottom: 0;
}

/* Mobile refinements - ALL mobile devices */
@media (max-width: 767px) {
    .be-hero {
        /* Balanced overlay for mobile - NO transparent, covers entire banner uniformly */
        --be-hero-overlay: linear-gradient(90deg,
            rgba(70, 193, 168, 0.75) 0%,
            rgba(72, 169, 207, 0.7) 30%,
            rgba(72, 169, 234, 0.65) 60%,
            rgba(70, 193, 168, 0.7) 100%
        ) !important;

        padding: clamp(0.75rem, 3vw, 1.5rem);
        margin: 0 0 clamp(1.25rem, 3vw, 2rem);

        /* Center content on mobile */
        place-items: center !important;
        text-align: center !important;
    }

    .be-hero__content {
        max-width: 95vw;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        /* Reset margin to center the content */
        margin-left: auto;
        margin-right: auto;
    }

    /* Center Bootstrap Grid rows when used */
    .be-hero .row {
        justify-content: center !important;
    }

    /* Center Bootstrap Grid columns */
    .be-hero .row > [class*="col-"] {
        text-align: center !important;
    }

    .be-hero__title,
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: clamp(0.5rem, 1.5vw, 1rem);
    }

    .be-hero__lead,
    .hero-content p {
        font-size: 1rem;
        margin-bottom: clamp(0.4rem, 1.2vw, 0.75rem);
    }
}

/* Small mobile screens */
@media (max-width: 575px) {
    .be-hero {
        min-height: clamp(10rem, 30vh, 14rem);
        padding: clamp(1rem, 4vw, 1.5rem);
    }

    .be-hero__title {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
        margin-bottom: clamp(0.4rem, 1.2vw, 0.75rem);
    }

    .be-hero__lead {
        font-size: clamp(0.9rem, 2.2vw, 1.1rem);
        margin-bottom: clamp(0.3rem, 1vw, 0.5rem);
    }

    .be-hero__text {
        font-size: clamp(0.85rem, 2vw, 1rem);
    }
}

/* Ultra narrow screens */
@media (max-width: 420px) {
    .be-hero {
        min-height: clamp(8rem, 25vh, 12rem);
        padding: clamp(0.75rem, 3vw, 1.25rem);
    }

    .be-hero__title {
        font-size: clamp(1.1rem, 3.5vw, 1.5rem);
        margin-bottom: clamp(0.3rem, 1vw, 0.5rem);
        line-height: 1.1;
    }

    .be-hero__lead {
        font-size: clamp(0.85rem, 2vw, 0.95rem);
        margin-bottom: clamp(0.25rem, 0.8vw, 0.4rem);
    }

    .be-hero__text {
        font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    }
}

/* Large desktop adjustments */
@media (min-width: 768px) {
    .be-hero {
        padding-top: clamp(4.5rem, 8vw, 6.5rem);
        padding-bottom: clamp(3rem, 6vw, 4.5rem);
        min-height: clamp(20rem, 36vh, 28rem);
        background-position: center 35%;
    }
}

@media (min-width: 1400px) {
    .be-hero {
        padding-top: clamp(5rem, 7vw, 7rem);
        padding-bottom: clamp(3.25rem, 6vw, 4.75rem);
        min-height: clamp(22rem, 34vh, 30rem);
        background-position: center 30%;
    }

    .be-hero__content {
        max-width: min(40rem, 55vw);
    }
}

@media (max-width: 767px) {
    .be-hero.be-hero--no-mobile-image {
        background: var(--be-hero-overlay);
    }

    .be-hero.be-hero--no-mobile-image .be-hero__content {
        color: var(--be-hero-text-color);
    }
}

