/* Banner positioning and sizing. */
.custom-hero-banner {
    position: relative;
    width: 100%;
    min-height: 520px;
    height: 38vw;
    /* Scale with the viewport. */
    overflow: hidden;
    background-color: #141414;
}

/* Carousel wrapper. */
.custom-banner-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #141414;
}

/* Carousel viewport and track. */
.custom-banner-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-bottom: 20px;
}

.custom-banner-slider-track {
    display: flex;
    width: 100%;
}

.custom-banner-slider-track>div {
    width: 100%;
}

/* Each slide fills the carousel width. */
.custom-banner-slide-item {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    min-height: 520px;
    height: 38vw;
    overflow: hidden;
}

.custom-banner-slide-box {
    width: 100%;
}

/* Keep the image inside the slide bounds. */
.custom-banner-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Each slide owns its mask; text, links and carousel controls stay above it. */
.custom-banner-text-overlay {
    --banner-overlay-solid: rgb(var(--banner-overlay-color) / 1);
    --banner-overlay-soft: rgb(var(--banner-overlay-color) / 0.65);
    --banner-overlay-clear: rgb(var(--banner-overlay-color) / 0);
    --banner-overlay-left: linear-gradient(to right, var(--banner-overlay-solid) 0%, var(--banner-overlay-soft) 35%, var(--banner-overlay-clear) 80%);
    --banner-overlay-right: linear-gradient(to left, var(--banner-overlay-solid) 0%, var(--banner-overlay-soft) 35%, var(--banner-overlay-clear) 80%);
    --banner-overlay-top: linear-gradient(to bottom, var(--banner-overlay-solid) 0%, var(--banner-overlay-soft) 35%, var(--banner-overlay-clear) 80%);
    --banner-overlay-bottom: linear-gradient(to top, var(--banner-overlay-solid) 0%, var(--banner-overlay-soft) 35%, var(--banner-overlay-clear) 80%);
    --banner-overlay-center: radial-gradient(ellipse at center, var(--banner-overlay-solid) 0%, var(--banner-overlay-soft) 20%, var(--banner-overlay-clear) 75%);
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: var(--banner-overlay-opacity, 0%);
    background: var(--banner-overlay-left);
}

.custom-banner-text-overlay[data-overlay-position="right"] {
    background: var(--banner-overlay-right);
}

.custom-banner-text-overlay[data-overlay-position="center"] {
    background: var(--banner-overlay-center);
}

.custom-banner-text-overlay[data-overlay-position="top"] {
    background: var(--banner-overlay-top);
}

.custom-banner-text-overlay[data-overlay-position="bottom"] {
    background: var(--banner-overlay-bottom);
}

.custom-banner-text-overlay[data-overlay-position="full"] {
    background: var(--banner-overlay-solid);
}

@media (max-width: 768px) {
    .custom-banner-text-overlay {
        opacity: var(--banner-overlay-mobile-opacity, var(--banner-overlay-opacity, 0%));
        background: var(--banner-overlay-bottom);
    }

    .custom-banner-text-overlay[data-overlay-mobile-position="left"] {
        background: var(--banner-overlay-left);
    }

    .custom-banner-text-overlay[data-overlay-mobile-position="right"] {
        background: var(--banner-overlay-right);
    }

    .custom-banner-text-overlay[data-overlay-mobile-position="center"] {
        background: var(--banner-overlay-center);
    }

    .custom-banner-text-overlay[data-overlay-mobile-position="top"] {
        background: var(--banner-overlay-top);
    }

    .custom-banner-text-overlay[data-overlay-mobile-position="bottom"] {
        background: var(--banner-overlay-bottom);
    }

    .custom-banner-text-overlay[data-overlay-mobile-position="full"] {
        background: var(--banner-overlay-solid);
    }
}

/* Show the image configured for the current viewport. */
.custom-banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.custom-banner-bg img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.custom-banner-bg picture {
    display: block;
    width: 100%;
    height: 100%;
}

.custom-banner-bg--pc {
    display: block;
}

.custom-banner-bg--mobile {
    display: none;
}

@media (max-width: 768px) {
    .custom-banner-bg--pc {
        display: none;
    }

    .custom-banner-bg--mobile {
        display: block;
    }

    .custom-banner-bg img {
        object-fit: contain;
        width: 100%;
        height: 100%;
    }
}

.custom-banner-desktop-img,
.custom-banner-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Text sits above the image and mask. */
.custom-banner-page-width {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    padding: 0 4%;
    box-sizing: border-box;
}

.custom-banner-content-matrix {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center vertically. */
    align-items: flex-start;
    /* Align to the left. */
    position: relative;
}

.banner-text-content-wrapper {
    margin-top: -20px;
    animation: fadeInUp 0.8s ease-out;
}

.custom-banner-slide-item .banner-main-title {
    font-size: 3.2rem;
    font-weight: bold;
    color: rgb(var(--color-text));
    margin: 0 0 10px 0;
    letter-spacing: 2px;

}

.banner-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 35px 0;
    letter-spacing: 1.5px;
}

/* Keep the highlight blue; other text follows the slide color scheme. */
.banner-subtitle .highlight-blue {
    color: #1974F9;
}

.custom-banner-slide-item .banner-subtitle .normal-white {
    color: rgb(var(--color-text));
}

/* Pill-shaped call to action. */
.custom-banner-slide-item .banner-action-btn {
    display: inline-block;
    background-color: #1974F9;
    color: rgb(var(--color-button-text)) !important;
    font-size: 1rem;
    font-weight: normal;
    padding: 12px 36px;
    border-radius: 50px;
    /* Rounded ends. */
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(63, 98, 246, 0.4);
}

.custom-banner-slide-item .banner-action-btn:hover {
    background-color: #2546d0;
    transform: translateY(-1px);
}

/* Optional feature bar. */
.custom-banner-slide-item .banner-features-blur-bar {
    position: absolute;
    bottom: 50px;
    left: 0;
    background: rgba(var(--color-background), 0.65);
    /* Use the slide background color with transparency. */
    backdrop-filter: blur(10px);
    /* Blur the backdrop. */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 15px 25px;
    gap: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.feature-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Feature icons. */
.feature-icon svg {
    width: 20px;
    height: 20px;
    color: #1974F9;
    display: block;
}

.custom-banner-slide-item .feature-text-box h4 {
    font-size: 18px;
    font-weight: normal;
    color: rgb(var(--color-text));
    margin: 0;
    line-height: 1.2;
}

.custom-banner-slide-item .feature-text-box p {
    font-size: 18px;
    font-weight: normal;
    color: rgb(var(--color-text));
    margin: 0;
    line-height: 1.2;
}

/* Feature divider. */
.feature-bar-divider {
    width: 1px;
    height: 28px;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Carousel navigation. */
.custom-banner-slider-controls {
    position: absolute;
    bottom: 0px;
    right: 4%;
    z-index: 3;
    display: flex;
    gap: 12px;
}

.custom-banner-arrow {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #383838;
    border: 1px solid #383838;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.25s, transform 0.2s;
}

.custom-banner-arrow:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Mobile slides and viewport follow the active image aspect ratio. */
@media (max-width: 768px) {
    .custom-hero-banner {
        height: auto;
        min-height: 0;
    }

    .custom-banner-slider-container {
        padding-bottom: 0;
        aspect-ratio: var(--banner-active-mobile-aspect-ratio, var(--banner-initial-mobile-aspect-ratio, 1));
    }

    .custom-banner-slider-track {
        position: absolute;
        inset: 0 0 auto;
        align-items: flex-start;
    }

    .custom-banner-slide-item {
        height: auto;
        min-height: 0;
        aspect-ratio: var(--banner-mobile-aspect-ratio, 1);
        container-type: size;
    }

    .custom-banner-slider-controls {
        bottom: 12px;
    }

    .custom-banner-slide-item .banner-main-title {
        font-size: 2.2rem;
    }

    .banner-subtitle {
        font-size: 1.3rem;
    }

    /* Hide the optional feature bar on mobile. */
    .custom-banner-slide-item .banner-features-blur-bar {
        position: relative;
        bottom: 0;
        margin-top: 40px;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        background: rgba(var(--color-background), 0.9);
        display: none;
    }

    .feature-bar-divider {
        display: none;
    }

    .banner-text-content-wrapper {
        text-align: center;
    }

    .custom-banner-content-matrix {
        padding-bottom: 50px;
        justify-content: flex-end;
        align-items: center;
    }

    /* Keep text and the button inside a short desktop-image fallback. */
    @container (max-height: 360px) {
        .custom-banner-content-matrix {
            padding-block: 12px;
            justify-content: center;
        }

        .banner-text-content-wrapper {
            margin-top: 0;
        }

        .custom-banner-slide-item .banner-main-title {
            font-size: clamp(1rem, 8cqh, 1.6rem);
            line-height: 1.15;
            letter-spacing: 1px;
            margin-bottom: 6px;
        }

        .banner-subtitle {
            font-size: clamp(0.7rem, 5cqh, 1rem);
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .custom-banner-slide-item .banner-action-btn {
            font-size: 0.75rem;
            padding: 6px 18px;
        }
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
