.rsf-card-grid {
    padding-bottom: 1.6rem;
}

.rsf-card-grid.bg-dark-blue-top {
    background: linear-gradient(180deg, var(--rsf-dark-blue) 0, var(--rsf-dark-blue) 122px, transparent 122px, transparent 100%);
    padding-bottom: 9rem;
    position: relative;
    top: -1px;
}

.rsf-card-grid.bg-neutral-top {
    background: linear-gradient(180deg, var(--rsf-neutral) 0, var(--rsf-neutral) 122px, transparent 122px, transparent 100%);
    padding-bottom: 9rem;
    position: relative;
    top: -1px;
}

.rsf-card-grid.bg-red-brown-top {
    background: linear-gradient(180deg, var(--apply-red) 0, var(--apply-red) 122px, transparent 122px, transparent 100%);
    padding-bottom: 9rem;
    position: relative;
    top: -1px;
}

.rsf-card-grid.bg-research-active {
    background-image: url(active-research-bg.jpg);
    background-repeat: no-repeat;
    background-size: 100% 293px;
    padding-top: 104.625px;
}

.rsf-card-grid.bg-research-completed {
    background: url(past-research-bg.jpg) no-repeat;
    background-size: 120%;
    background-position: center 120px;
}

.rsf-card-grid.bg-pencil {
    background: url('pencil-bg.jpg') no-repeat var(--rsf-dark-blue);
    background-size: 100%;
    background-position: center 118px;
    padding-bottom: 63px;
}

.rsf-card-grid.bg-grant-seekers {
    background-color: var(--grant-green);
    background-image: url(grant-seekers-bg.jpg);
    background-repeat: no-repeat;
    background-size: contain;
    background-blend-mode: lighten;
    background-position: center 184px;
    padding-bottom: 102px;
}

.rsf-card-grid.bg-search-column {
    background: linear-gradient(to right, var(--rsf-neutral-2) 0, var(--rsf-neutral-2) calc( (100% - 1320px) / 2 + 390px ), var(--rsf-neutral) calc( (100% - 1320px) / 2 + 390px ), var(--rsf-neutral) 100%);
    padding-bottom: 9rem;
    position: relative;
    top: -1px;
}

.rsf-card-grid .grid,
.rsf-card-grid.layout-builder__layout .grid .layout-builder__region {
    display: grid;
}

.rsf-card-grid .grid.col-9,
.rsf-card-grid.layout-builder__layout .grid.col-9 {
    width: 76.97%; /* (992 + 12 + 12) 1016 / xxl 1320 */
    gap: 2rem;
}

.rsf-card-grid.rsf-card-grid--three-column-news .grid.col-8,
.rsf-card-grid.rsf-card-grid--three-column-news.layout-builder__layout .grid.col-8 {
    width: 69.394%; /* (892 + 12 + 12) 916 / xxl 1320 */
    gap: 11.5px;
}

.rsf-card-grid.rsf-card-grid--three-column-news.grid-to-list-view .grid.col-8,
.rsf-card-grid.rsf-card-grid--three-column-news.grid-to-list-view.layout-builder__layout .grid.col-8 {
    width: 70.152%; /* (902 + 12 + 12) 926 / xxl 1320 */
    gap: 27px;
    grid-template-columns: 1fr !important;
}

.rsf-card-grid.rsf-card-grid--four-column .grid,
.rsf-card-grid.rsf-card-grid--four-column.layout-builder__layout .grid .layout-builder__region {
    gap: 14px;
}

.rsf-card-grid .grid.g-cols-5,
.rsf-card-grid.layout-builder__layout .grid.g-cols-5 .layout-builder__region {
    gap: 1rem;
}

.rsf-card-grid.rsf-card-grid--five-column-fellows.grid-to-list-view .grid,
.rsf-card-grid.rsf-card-grid--five-column-fellows.grid-to-list-view.layout-builder__layout .grid .layout-builder__region {
    grid-template-columns: 1fr !important;
}

.rsf-card-grid.layout-builder__layout .grid {
    display: block;
}

.rsf-card-grid .grid .card {
    max-width: none;
    aspect-ratio: auto;
}

.rsf-card-grid .grid .content,
.rsf-card-grid .grid .content .card {
    height: 100%;
}

@media (min-width: 48rem) { /* md */
    .rsf-card-grid .grid,
    .rsf-card-grid.layout-builder__layout .grid .layout-builder__region {
        grid-template-columns: repeat(2, 1fr);
    }

    .rsf-card-grid.rsf-card-grid--three-column-news.grid-to-list-view .grid,
    .rsf-card-grid.rsf-card-grid--three-column-news.grid-to-list-view.layout-builder__layout .grid .layout-builder__region {
        grid-template-columns: 1fr !important;
    }

    .rsf-card-grid.rsf-card-grid--five-column-fellows.grid-to-list-view .grid,
    .rsf-card-grid.rsf-card-grid--five-column-fellows.grid-to-list-view.layout-builder__layout .grid .layout-builder__region {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 75rem) { /* xl */
    .rsf-card-grid .grid.grid--center > *,
    .rsf-card-grid.layout-builder__layout .grid.grid--center .layout-builder__region > * {
        grid-column: span 2;
    }

    .rsf-card-grid .grid.g-cols-3,
    .rsf-card-grid.layout-builder__layout .grid.g-cols-3 .layout-builder__region {
        grid-template-columns: repeat(3, 1fr);
    }

    .rsf-card-grid .grid.g-cols-3.grid--center,
    .rsf-card-grid.layout-builder__layout .grid.g-cols-3.grid--center .layout-builder__region {
        grid-template-columns: repeat(6, 1fr);
    }

    /* Grid Three Centered - Two items on last row */
    .rsf-card-grid .grid.g-cols-3.grid--center > *:last-child:nth-child(3n + 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-3.grid--center .layout-builder__region > *:last-child:nth-child(3n + 2) {
        grid-column-end: 6;
    }
    .rsf-card-grid .grid.g-cols-3.grid--center > *:nth-last-child(2):nth-child(3n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-3.grid--center .layout-builder__region > *:nth-last-child(2):nth-child(3n + 1) {
        grid-column-end: 4;
    }

    /* Grid Three Centered - One item on last row */
    .rsf-card-grid .grid.g-cols-3.grid--center > *:last-child:nth-child(3n - 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-3.grid--center .layout-builder__region > *:last-child:nth-child(3n - 2) {
        grid-column-end: 5;
    }

    .rsf-card-grid .grid.g-cols-4,
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4 .layout-builder__region {
        grid-template-columns: repeat(4, 1fr);
    }

    .rsf-card-grid .grid.g-cols-4.grid--center,
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region {
        grid-template-columns: repeat(8, 1fr);
    }

    /* Grid Four Centered - Three items on last row */
    .rsf-card-grid .grid.g-cols-4.grid--center > *:last-child:nth-child(4n + 3),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region > *:last-child:nth-child(4n + 3) {
        grid-column-end: 8;
    }
    .rsf-card-grid .grid.g-cols-4.grid--center > *:nth-last-child(2):nth-child(4n + 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region > *:nth-last-child(2):nth-child(4n + 2) {
        grid-column-end: 6;
    }
    .rsf-card-grid .grid.g-cols-4.grid--center > *:nth-last-child(3):nth-child(4n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region > *:nth-last-child(3):nth-child(4n + 1) {
        grid-column-end: 4;
    }

    /* Grid Four Centered - Two items on last row */
    .rsf-card-grid .grid.g-cols-4.grid--center > *:last-child:nth-child(4n + 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region > *:last-child:nth-child(4n + 2) {
        grid-column-end: 7;
    }
    .rsf-card-grid .grid.g-cols-4.grid--center > *:nth-last-child(2):nth-child(4n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region > *:nth-last-child(2):nth-child(4n + 1) {
        grid-column-end: 5;
    }

    /* Grid Four Centered - One item on last row */
    .rsf-card-grid .grid.g-cols-4.grid--center > *:last-child:nth-child(4n - 3),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-4.grid--center .layout-builder__region > *:last-child:nth-child(4n - 3) {
        grid-column-end: 6;
    }

    .rsf-card-grid .grid.g-cols-5,
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5 .layout-builder__region {
        grid-template-columns: repeat(5, 1fr);
    }

    .rsf-card-grid .grid.g-cols-5.grid--center,
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region {
        grid-template-columns: repeat(10, 1fr);
    }

    /* Grid Five Centered - Four items on last row */
    .rsf-card-grid .grid.g-cols-5.grid--center > *:last-child:nth-child(5n + 4),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:last-child:nth-child(5n + 4) {
        grid-column-end: 10;
    }
    .rsf-card-grid .grid.g-cols-5.grid--center > *:nth-last-child(2):nth-child(5n + 3),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:nth-last-child(2):nth-child(5n + 3) {
        grid-column-end: 8;
    }
    .rsf-card-grid .grid.g-cols-5.grid--center > *:nth-last-child(3):nth-child(5n + 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:nth-last-child(3):nth-child(5n + 2) {
        grid-column-end: 6;
    }
    .rsf-card-grid .grid.g-cols-5.grid--center > *:nth-last-child(4):nth-child(5n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:nth-last-child(4):nth-child(5n + 1) {
        grid-column-end: 4;
    }

    /* Grid Five Centered - Three items on last row */
    .rsf-card-grid .grid.g-cols-5.grid--center > *:last-child:nth-child(5n + 3),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:last-child:nth-child(5n + 3) {
        grid-column-end: 9;
    }
    .rsf-card-grid .grid.g-cols-5.grid--center > *:nth-last-child(2):nth-child(5n + 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:nth-last-child(2):nth-child(5n + 2) {
        grid-column-end: 7;
    }
    .rsf-card-grid .grid.g-cols-5.grid--center > *:nth-last-child(3):nth-child(5n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:nth-last-child(3):nth-child(5n + 1) {
        grid-column-end: 5;
    }

    /* Grid Five Centered - Two items on last row */
    .rsf-card-grid .grid.g-cols-5.grid--center > *:last-child:nth-child(5n + 2),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:last-child:nth-child(5n + 2) {
        grid-column-end: 8;
    }
    .rsf-card-grid .grid.g-cols-5.grid--center > *:nth-last-child(2):nth-child(5n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:nth-last-child(2):nth-child(5n + 1) {
        grid-column-end: 6;
    }

    /* Grid Five Centered - One item on last row */
    .rsf-card-grid .grid.g-cols-5.grid--center > *:last-child:nth-child(5n + 1),
    .rsf-card-grid.layout-builder__layout .grid.g-cols-5.grid--center .layout-builder__region > *:last-child:nth-child(5n + 1) {
        grid-column-end: 7;
    }
}

/* Layout Builder */
.rsf-card-grid.layout-builder__layout .layout-builder-block {
    padding: 0;
}

.rsf-card-grid.layout-builder__layout .mx-auto {
    margin-left: auto;
    margin-right: auto;
}
