﻿/* ───────────────────────────────────────────────────────
   News Carousel Styles (full file, dynamic excerpt lines)
   ─────────────────────────────────────────────────────── */

/* ensure card background fills under its rounded corners */
.news-carousel-container .card {
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

/* give image & body their own rounded corners */
.news-carousel-container .card-img-top {
    border-top-left-radius: 0.5rem!important;
    border-top-right-radius: 0.5rem!important;
}

.news-carousel-container .card-body {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* make room for the static title */
.news-carousel-container {
    position: relative;
    padding-top: 8rem;
    overflow: visible;
}

    /* the title bar */
    .news-carousel-container .news-carousel-title {
        position: absolute;
        top: 1rem;
        left: 50%;
        transform: translateX(-50%);
        padding: 1rem 2.5rem;
        border-radius: 0.5rem;
        white-space: nowrap;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        z-index: 10;
    }

    /* carousel container */
    .news-carousel-container .carousel {
        position: relative;
    }

    /* flex‐row of cards */
    .news-carousel-container .carousel-item .d-flex {
        align-items: stretch;
        justify-content: center;
    }

        /* each card */
        .news-carousel-container .carousel-item .d-flex .card {
            flex: 0 0 calc((100% - 30px) / 3);
            margin-right: 15px;
            border-radius: 0.5rem;
            overflow: hidden;
            border: none;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

            /* no gutter on last card */
            .news-carousel-container .carousel-item .d-flex .card:last-child {
                margin-right: 0;
            }

        /* fixed image area */
        .news-carousel-container .carousel-item .d-flex .card-img-top {
            flex: 0 0 auto !important;
            width: 100%;
            height: 250px !important;
            object-fit: cover;
        }

        /* tightened card-body spacing */
        .news-carousel-container .carousel-item .d-flex .card-body {
            min-height: 0 !important;
            display: flex !important;
            flex-direction: column;
            align-items: flex-start;
            row-gap: 0.75rem;
        }

            .news-carousel-container .carousel-item .d-flex .card-body p {
                margin: 0;
            }

            .news-carousel-container .carousel-item .d-flex .card-body .btn {
                margin: 0;
            }

            /* clamp & reserve up to 2 lines of title */
            .news-carousel-container .carousel-item .d-flex .card-body .card-title {
                font-size: 22px;
                line-height: 1.2em;
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                overflow: hidden;
                min-height: calc(1.2em * 2);
                margin-bottom: 0.5rem;
            }

            /* default: excerpt is at least 4 lines tall */
            .news-carousel-container .carousel-item .d-flex .card-body .card-excerpt {
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 4;
                overflow: hidden;
                line-height: 1.4em;
                min-height: calc(1.4em * 4);
            }

        /* override: if only one card in the slide, clamp to 3 lines */
        .news-carousel-container .carousel-item .d-flex > .card:only-child
        .card-body .card-excerpt {
            -webkit-line-clamp: 3;
            min-height: calc(1.4em * 3);
        }

        /* reserve space for title + date (2 lines title + 1 line date + gap) */
        .news-carousel-container .carousel-item .d-flex .card-body .title-date {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: calc((1.2em * 3) + 0.5rem);
        }

            .news-carousel-container .carousel-item .d-flex .card-body .title-date .card-title {
                margin: 0 0 0.25rem;
            }

            .news-carousel-container .carousel-item .d-flex .card-body .title-date .card-post-date,
            .card-post-date2 {
                margin: 0.5rem 0;
                font-size: 0.9rem;
                line-height: 1.2em;
            }

    /* arrows */
    .news-carousel-container .carousel-control-prev,
    .news-carousel-container .carousel-control-next {
        background: none !important;
        width: auto;
        height: auto;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.8;
        transition: opacity .3s ease;
        z-index: 2;
    }

    .news-carousel-container .carousel-control-prev-icon,
    .news-carousel-container .carousel-control-next-icon {
        width: 2rem;
        height: 2rem;
        background-size: 100% 100%;
        filter: brightness(0) invert(1) !important;
        transform: scale(1.5);
        transition: transform .3s ease;
    }

    .news-carousel-container .carousel-control-prev:hover,
    .news-carousel-container .carousel-control-next:hover {
        opacity: 1;
    }

        .news-carousel-container .carousel-control-prev:hover .carousel-control-prev-icon,
        .news-carousel-container .carousel-control-next:hover .carousel-control-next-icon {
            transform: scale(1.6);
        }

/* mobile: single-card slides & title gap */
@media (max-width: 576px) {
    .news-carousel-container {
        padding-top: 5rem;
    }

        .news-carousel-container .news-carousel-title {
            top: 0.5rem;
            padding: 0.75rem 1.5rem;
        }

        .news-carousel-container .carousel-item .d-flex .card {
            flex: 0 0 100% !important;
            margin-right: 0 !important;
        }
        /* mobile: excerpt at 3 lines */
        .news-carousel-container .carousel-item .d-flex .card-body .card-excerpt {
            -webkit-line-clamp: 3;
            min-height: calc(1.4em * 3);
        }
}

.seeall a:hover {
    background-color: #005eb8;
    color: #ffffff;
    border-color: #ffffff;
}

.seeall a {
    background-color: #ffffff !important;
    border-color: #005eb8 !important;
    color: #005eb8 !important;
}

.news-carousel-container.event-carousel-container
.carousel-item
.d-flex > .card:only-child
.card-img-top {
    height: 350px !important;
    max-height: none !important;
}

.news-carousel-container
.carousel-item
.d-flex > .card:only-child
.card-img-top {
    height: 350px !important;
    max-height: none !important;
}