.wp-block-beech-articles {
    padding-inline: var(--gutter, 2rem);
    padding-block: var(--block-space, 6rem);
}
.wp-block-beech-articles > .wp-block-beech-articles {
    padding: 0;
}
.articles-wrapper {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    row-gap: 5rem;
    column-gap: var(--xy-col-gap);
}

.articles__inner-blocks > *:last-child,
.articles__inner-blocks *:has(~ .block-list-appender) {
    margin-bottom: 6rem;
}

.is-style-projects .articles__inner-blocks > *:last-child {
    margin-bottom: 0;
}

.bb-post-card img {
    aspect-ratio: 6 / 4;
    height: auto;
    object-fit: cover;
}

.wp-block-beech-articles .bb-post-card {
    grid-column: span 4;
}
.bb-post-card .card-categories a, .bb-post-card .card-title a {
    color: inherit;
    text-decoration: none;
}

.is-style-projects .articles-track {
    padding-top: var(--block-space, 6rem);
}
.is-style-projects .articles-wrapper {
    row-gap: 6rem;
}

.is-style-projects  .bb-post-card:nth-child(6n+1) { grid-column: span 6; }
.is-style-projects  .bb-post-card:nth-child(6n+2) { grid-column: 8 / 13;  /* Offset by 1 column */ }
.is-style-projects  .bb-post-card:nth-child(6n+3) { grid-column: span 4; }
.is-style-projects  .bb-post-card:nth-child(6n+4) { grid-column: 6 / 13; /* Offset by 1 column */ }
.is-style-projects  .bb-post-card:nth-child(6n+5) { grid-column: span 7; }
.is-style-projects  .bb-post-card:nth-child(6n+6) { grid-column:  9 / 13; /* Offset by 1 column */ }

.is-style-projects .bb-post-card img { aspect-ratio: auto; width: 100%; }
.is-style-projects .bb-post-card .card-title,
.is-style-related .bb-post-card .card-title {
    font-size: var(--wp--preset--font-size--large);
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}
.is-style-projects .bb-post-card .card-date {
    display: none;
}
.is-style-projects .bb-post-card .card-categories {
    color: var(--wp--preset--color--mid-gray);
}
.is-style-projects .card-excerpt { display: none; }

.article-footer {
    text-align: center;
    padding-top: 5rem;
}
.is-style-projects .card-meta {
    text-transform: none;
    padding-top: 0;
    margin-top: 0;
}
.is-style-projects .bb-post-card {
    border-bottom: none;
}

.is-style-related .bb-post-card {
    grid-column: span calc(12 / var(--article-count, 3));
    border-width: 0;
}
.is-style-related .bb-post-card .card-title {
    /* margin-bottom: 1rem; */
}
.is-style-related .card-excerpt,
.is-style-related .card-date { display: none; }

.is-style-related .card-meta { padding-top: 0; text-transform: none; color:  var(--wp--preset--color--mid-gray); }
.is-style-related .card-meta .card-categories { width: 100%; }

.is-style-related .bb-post-card img {
    aspect-ratio: 800 / 565; }


.is-style-articles .bb-post-card .card-title,
.is-style-articles .bb-post-card .card-excerpt {
    padding-right: 2rem;
}


.is-style-related .type-project .card-meta { margin-top: 0; } 

.wp-block-beech-articles .filter-list {
    padding-top: 0rem;
    margin-bottom: 0rem;
}
.wp-block-beech-articles .filter-list-inner {
    padding-top: 0;
}
.posts-pagination.within-grid {
    grid-column: span 12;
    padding-top: var(--block-space-narrow);
}
.posts-pagination.within-grid:empty {
    display: none;
}

.bb-btn.read-more {    
    text-decoration: none;
    color: inherit;
    padding: 1.5rem 2.65rem 1.55rem;
    border: solid 1px currentColor;
    border-radius: 3rem;
    display: inline-block;
    transition: all 150ms ease;
    position: relative;
    line-height: 1;
}
.bb-btn.read-more:hover {
    color: var(--body-bg);
    background-color: var(--body-text);
}
.bb-btn .count {
    vertical-align: super;
    margin-left: 0.1rem;
    color: var(--wp--preset--color--mid-gray);
    font-size: 0.65em;
    position: absolute;
    margin-top: -0.15rem;
}

.is-style-related .articles-wrapper.project { align-items: flex-start; max-width: 100%;}

/** Videos */
.card-video-wrapper video {
    /* aspect-ratio: 16 / 9; */
    object-fit: cover;
    max-height: 80vh;
    background: var(--body-text);
    display: block;
}
.card-video-wrapper video[data-loaded="true"] + img.video-poster {
    animation: 1s fadeOut linear normal 1 forwards;
    animation-delay: 500ms;
}
.card-video-wrapper {
    position: relative;
}
.card-video-wrapper img.video-poster {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
}
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@media screen and (max-width: 768px) {
    .wp-block-beech-articles {
        padding-inline:0;
    }
    .wp-block-beech-articles > * {
        padding-inline: var(--gutter);
    }
    .is-style-articles.wp-block-beech-articles .articles-track {
        overflow: scroll;
    }

    .is-style-articles.wp-block-beech-articles .articles-wrapper {
        overflow: scroll;
        width: calc( (var(--article-count) - 1) * 75vw );
        grid-template-columns: repeat(var(--article-count), 1fr);
        padding-bottom: 2rem;
    }
    .wp-block-beech-articles.is-style-articles .bb-post-card { grid-column: span 1; }


    .is-style-related .bb-post-card {
        grid-column: span 12;
    }
    .is-style-projects .articles-wrapper { row-gap: 3rem; }
    .is-style-projects .articles-wrapper .bb-post-card { grid-column: span 12; }

    .wp-block-beech-articles .bb-post-card {
        grid-column: span 6;
    }

    .articles__inner-blocks>*:last-child {
        margin-bottom: 4rem;
    }

    .posts-pagination.within-grid { 
        padding-top: 2rem;
    }
    .article-footer {
        padding-top: 3rem;
    }
}

@media screen and (max-width: 480px) {
    .is-style-articles.wp-block-beech-articles .articles-wrapper {
        width: calc( (var(--article-count) ) * 80vw );
        gap: var(--gutter);
    }

    .is-style-related.wp-block-beech-articles .articles-track {
        overflow: scroll;
    }
    .is-style-related .articles-track .articles-wrapper {
        width: calc((var(--article-count) - 1) * 90vw);
        grid-template-columns: repeat(var(--article-count), 1fr);
        padding-bottom: 2rem;
    }
    .wp-block-beech-articles.is-style-related .bb-post-card {
        grid-column: span 1;
    }
    .wp-block-beech-articles:not(.is-style-related, .is-style-projects, .is-style-articles) .bb-post-card {
        grid-column: span 12; 
    }

    .is-style-projects .bb-post-card .card-categories {
        width: 80%;
    }

    .wp-block-beech-articles .filter-list-inner { display: none; }

    .single-project .is-style-related .articles-track .articles-wrapper {
        display: flex;
        flex-direction: column;
    }
    .is-style-related .bb-post-card .card-title {
        margin-bottom: 0.3rem;
    }
}

