.blog-post-list .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.blog-post-list .posts-list {
    display: block;
}

.blog-post-list .post-item {
    border: 1px solid #f1f1f1;
    border-radius: var(--ca-card-radius, 8px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.blog-post-list .post-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-post-list.blog-mode-list .post-item {
    flex-direction: row;
    margin-bottom: 20px;
}

.blog-post-list.blog-mode-list .post-image {
    flex: 0 0 280px;
}

.blog-post-list.blog-mode-list .post-image img {
    height: 100%;
    min-height: 200px;
}

.blog-post-list.blog-mode-list .post-content {
    flex: 1 1 auto;
}

.blog-post-list.blog-mode-list .post-summary {
    margin-bottom: 0;
}

.blog-post-list.blog-mode-list .post-title {
    font-size: 16px;
}

.blog-post-list.blog-mode-list .post-meta {
    margin-bottom: 8px;
}

@media (max-width: 767px) {
    .blog-post-list.blog-mode-list .post-item {
        flex-direction: column;
    }

    .blog-post-list.blog-mode-list .post-image {
        flex: 0 0 auto;
        width: 100%;
    }

    .blog-post-list.blog-mode-list .post-image img {
        height: 200px;
    }
}

.blog-post-list .post-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-post-list .post-title {
    margin: 0 0 10px;
    font-size: 17px;
}

.blog-post-list .posts-grid .post-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ca-color-text-primary, #212529);
    font-weight: 400;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.blog-post-list .posts-grid .post-title a {
    color: inherit;
}

.blog-post-list .post-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 10px;
}

.blog-post-list .post-summary {
    margin-bottom: 0;
    flex-grow: 1;
}

/* Keep the homepage post-list cards aligned with the carousel card elevation. */
.blog-widget-post-list .blog-post-list .post-item {
    box-shadow: var(--ca-card-shadow, 0 1px 2px rgba(15, 23, 42, .08));
    transition: box-shadow 200ms ease;
}

.blog-widget-post-list .blog-post-list .post-item:hover,
.blog-widget-post-list .blog-post-list .post-item:focus-within {
    box-shadow: var(--ca-card-shadow-hover, 0 8px 18px rgba(15, 23, 42, .14));
}

/* Detail View */
.blog-post-view .post-image {
    text-align: center;
    border-radius: var(--ca-card-radius, 8px);
    overflow: hidden;
}

.blog-post-view .post-image img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.blog-post-view .post-header {
    margin-bottom: 20px;
}

.blog-post-view .post-title {
    margin-bottom: 5px;
}

.blog-post-view .post-meta {
    margin-top: 2rem;
    color: #666;
}

.blog-post-view .post-content {
    line-height: 1.6;
}

.blog-toolbar {
    margin-top: 50px;
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.blog-toolbar .pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: auto;
}

.blog-toolbar .pager .toolbar-amount {
    margin: 0;
    white-space: nowrap;
}

.blog-toolbar .pager .pages {
    margin: 0;
}

.block-blog-categories .blog-categories-list,
.block-blog-recent-posts .blog-recent-posts-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.block-blog-categories .blog-categories-list>.item,
.block-blog-recent-posts .blog-recent-posts-list>.item {
    margin-bottom: 5px;
    border-bottom: 1px dotted #efefef;
    padding-bottom: 5px;
}

.block-blog-categories .blog-categories-list>.item:last-child,
.block-blog-recent-posts .blog-recent-posts-list>.item:last-child {
    margin-bottom: 0;
    border-bottom: 0;
    padding-bottom: 0;
}

/*
 * A Blog sidebar component must be flush when it is the first rendered block.
 * Add separation only when another actual Blog block precedes it; empty,
 * disabled blocks emit no markup and therefore do not create a false gap.
 */
.sidebar.sidebar-main > .block-blog-search + :is(.block-blog-categories, .block-blog-recent-posts),
.sidebar.sidebar-main > .block-blog-categories + .block-blog-recent-posts {
    margin-top: 2rem;
}

.block-blog-search .blog-search-form {
    display: grid;
    gap: .75rem;
}

.block-blog-search .blog-search-form .control,
.block-blog-search .blog-search-form .input-text {
    width: 100%;
}

.block-blog-search .blog-search-form .actions {
    display: flex;
}

.blog-search-results-header {
    margin-bottom: 1.5rem;
}

.blog-search-results-header h1 {
    margin: 0;
}

/* Widget Blog Carousel */
.ca-blog-carousel-item {
    box-shadow: var(--ca-card-shadow, 0 1px 2px rgba(15, 23, 42, .08));
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ca-blog-carousel-item:hover,
.ca-blog-carousel-item:focus-within {
    box-shadow: var(--ca-card-shadow-hover, 0 8px 18px rgba(15, 23, 42, .14));
}

.ca-blog-carousel-item .post-content {
    padding: 15px;
    text-align: center;
}

.ca-blog-carousel-item .post-meta {
    font-size: 0.875rem;
    color: #666;
}

.ca-blog-carousel-item .post-title {
    margin: 0 0 10px;
    font-size: 18px;
}

/* Widget Title Truncation */
.blog-widget-post-list .post-title,
.blog-widget-carousel .post-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    color: var(--ca-color-text-primary, #212529);
    font-weight: 400;
    text-overflow: ellipsis;
}

.blog-widget-post-list .post-title a,
.blog-widget-carousel .post-title a {
    color: inherit;
}
