
/* GridBone wraps ordinary Shortcode widgets in its standard white widget box.
   Remove that wrapper styling only when the widget contains this carousel. */
.widget:has(.mbai-news-carousel),
.widget_block:has(.mbai-news-carousel),
.widget_text:has(.mbai-news-carousel),
.widget-shortcode:has(.mbai-news-carousel),
[class*="widget"]:has(> .mbai-news-carousel),
[class*="widget"]:has(.mbai-news-carousel) {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Some GridBone widget layouts put padding/background on an inner content wrapper. */
.widget:has(.mbai-news-carousel) > .widget-content,
.widget:has(.mbai-news-carousel) > .textwidget,
.widget_block:has(.mbai-news-carousel) > .wp-block-shortcode,
.widget:has(.mbai-news-carousel) .wp-block-shortcode {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.mbai-news-carousel {
    background: linear-gradient(180deg, #0b2f6b 0%, #071f49 100%) !important;
    border: 1px solid #2f7dff !important;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(47, 125, 255, 0.08), 0 8px 24px rgba(0, 20, 55, 0.18) !important;
    clear: both;
    padding: 22px 22px 24px;
    position: relative;
    z-index: 1;
}

.mbai-news-carousel {
    --mbai-gap: 18px;
    --mbai-visible: 5;
    margin: 8px 0 34px;
    width: 100%;
}

.mbai-news-carousel *,
.mbai-news-carousel *::before,
.mbai-news-carousel *::after {
    box-sizing: border-box;
}

.mbai-news-carousel__header {
    align-items: center;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    margin-bottom: 18px;
    min-height: 34px;
}

.mbai-news-carousel__title {
    font-size: clamp(21px, 2vw, 29px);
    grid-column: 2;
    line-height: 1.15;
    margin: 0;
    text-align: center;
}

.mbai-news-carousel__view-all {
    font-size: 14px;
    font-weight: 700;
    grid-column: 3;
    justify-self: end;
    text-decoration: none;
    white-space: nowrap;
}

.mbai-news-carousel__shell {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    width: 100%;
}

.mbai-news-carousel__viewport {
    min-width: 0;
    overflow: hidden;
}

.mbai-news-carousel__track {
    display: flex;
    gap: var(--mbai-gap);
    scroll-behavior: smooth;
    scrollbar-width: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
}

.mbai-news-carousel__track::-webkit-scrollbar {
    display: none;
}

.mbai-news-carousel__card {
    flex: 0 0 calc((100% - (var(--mbai-gap) * (var(--mbai-visible) - 1))) / var(--mbai-visible));
    margin: 0;
    min-width: 0;
    scroll-snap-align: start;
}

.mbai-news-carousel__image-link {
    aspect-ratio: 1 / 1;
    display: block;
    overflow: hidden;
    width: 100%;
}

.mbai-news-carousel__image,
.mbai-news-carousel__placeholder {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
    width: 100%;
}

.mbai-news-carousel__placeholder {
    background: #e7e7e7;
}

.mbai-news-carousel__image-link:hover .mbai-news-carousel__image {
    transform: scale(1.02);
}

.mbai-news-carousel__card-title {
    display: -webkit-box;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 9px 0 0;
    min-height: 2.6em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mbai-news-carousel__card-title a {
    color: inherit;
    text-decoration: none;
}

.mbai-news-carousel__card-title a:hover {
    text-decoration: underline;
}

.mbai-news-carousel__arrow {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    font: inherit;
    height: 34px;
    justify-content: center;
    opacity: .8;
    padding: 0;
    width: 34px;
}

.mbai-news-carousel__arrow span {
    font-size: 28px;
    line-height: 1;
    transform: translateY(-1px);
}

.mbai-news-carousel__arrow:hover {
    opacity: 1;
}

.mbai-news-carousel__arrow:disabled {
    cursor: default;
    opacity: .25;
}

.mbai-carousel-error {
    border-left: 4px solid #cc1818;
    padding-left: 10px;
}

@media (max-width: 1100px) {
    .mbai-news-carousel {
        --mbai-visible: 3;
    }
}

@media (max-width: 700px) {
    .mbai-news-carousel {
        --mbai-gap: 12px;
        --mbai-visible: 2;
    }

    .mbai-news-carousel__shell {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
    }

    .mbai-news-carousel__arrow {
        height: 28px;
        width: 28px;
    }

    .mbai-news-carousel__card-title {
        font-size: 14px;
    }
}

@media (max-width: 430px) {
    .mbai-news-carousel {
        --mbai-visible: 1;
    }

    .mbai-news-carousel__header {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .mbai-news-carousel__title {
        grid-column: 1;
        text-align: center;
    }

    .mbai-news-carousel__view-all {
        grid-column: 1;
        justify-self: center;
    }
}

@media (max-width: 700px) {
    .mbai-news-carousel {
        padding: 18px 14px 20px;
    }
}


/* Let the shortcode's pullup setting control vertical placement.
   Only remove extra top padding GridBone may add to this widget. */
.widget:has(.mbai-news-carousel),
.widget_block:has(.mbai-news-carousel),
.widget_text:has(.mbai-news-carousel),
.widget-shortcode:has(.mbai-news-carousel) {
    padding-top: 0 !important;
}


/* Dark electric-blue editorial treatment */
.mbai-news-carousel__title {
    color: #ffffff !important;
    letter-spacing: .01em;
}

.mbai-news-carousel__view-all {
    color: #7fc7ff !important;
}

.mbai-news-carousel__view-all:hover {
    color: #ffffff !important;
}

.mbai-news-carousel__card-title,
.mbai-news-carousel__card-title a {
    color: #ffffff !important;
}

.mbai-news-carousel__card-title a:hover {
    color: #9fd6ff !important;
}

.mbai-news-carousel__arrow {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, .75) !important;
    background: rgba(255, 255, 255, .05) !important;
}

.mbai-news-carousel__arrow:hover {
    background: rgba(255, 255, 255, .12) !important;
}

.mbai-news-carousel__placeholder {
    background: #123f7c !important;
}
