/* News & Events listings only. Loaded by inc/news/head.php, not globally. */
.news-events-layout.row-inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding-left: clamp(16px, 3vw, 48px);
    padding-right: clamp(16px, 3vw, 48px);
}

.news-events-layout .news-events-main,
.news-events-layout .news-events-sidebar {
    min-width: 0;
}

.news-events-layout .featured-item h2,
.news-events-layout .featured-item p,
.news-events-layout .grid-item h3,
.news-events-layout .grid-item p {
    overflow-wrap: anywhere;
}

/* Keep the existing Bootstrap grid; only the featured columns are overridden. */
.news-events-layout .featured-item > .row > .col-xl-6 {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
}

.news-events-layout .featured-item > .row > .col-xl-6.p-4 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.news-events-layout .news-featured-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #fff;
}

.news-events-layout .news-featured-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
}

.news-events-layout .grid-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.news-events-layout .grid-item .btn {
    max-width: 100%;
    white-space: normal;
}

/* Name the container and use the SAME selector in both layout states.
   An unscoped selector here loses to the stacked rule above. */
@supports (container-type: inline-size) {
    .news-events-layout .news-events-main {
        container-type: inline-size;
        container-name: leea-news-main;
    }

    @container leea-news-main (min-width: 760px) {
        .news-events-layout .featured-item > .row > .col-xl-6 {
            flex: 0 0 50%;
            max-width: 50%;
        }
    }
}

/* Conservative fallback; no changes to Bootstrap's global column classes. */
@supports not (container-type: inline-size) {
    @media (min-width: 1200px) {
        .news-events-layout .featured-item > .row > .col-xl-6 {
            flex: 0 0 50%;
            max-width: 50%;
        }
    }
}

/* Preserve the existing mobile filter state and desktop visibility. */
@media (max-width: 991.98px) {
    .news-events-layout #sidebar-content {
        clear: both;
        display: none !important;
    }

    .news-events-layout #sidebar-content.news-filters-open {
        display: block !important;
    }
}

@media (max-width: 767.98px) {
    /* The enclosing container and Bootstrap columns already provide gutters. */
    .news-events-layout.row-inner {
        padding-left: 0;
        padding-right: 0;
    }

    .news-events-layout .featured-item > .row > .col-xl-6.p-4 {
        padding: 1.25rem !important;
    }

    .news-events-layout .featured-item h2 {
        font-size: clamp(1.5rem, 5vw, 2rem);
        line-height: 1.25;
    }

    .news-events-layout .news-featured-img {
        max-height: 280px;
    }
}

.news-events-layout .pagination {
    flex-wrap: wrap;
}
