/**
 * Block styles — loaded on the front end and in the block editor.
 */

 /* Custom Roundup Items
--------------------------------------------- */

.wp-block-group.is-style-roundup-item img {
	aspect-ratio: 3 / 2;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.wp-block-group.is-style-roundup-item .roundup-content {
	padding: 20px;
}

.wp-block-group.is-style-roundup-item .wp-block-query .wp-block-post-title {
	line-height: 1.1 !important;
    margin-bottom: 0.65rem !important;
	text-align: left !important;
}

.wp-block-group.is-style-roundup-item .wp-block-post-excerpt {
	margin-top: 0 !important;
}

.wp-block-group.is-style-roundup-item .wp-block-post-excerpt__more-text {
	margin-bottom: 0;
    margin-top: 1em;
}

.wp-block-group.is-style-roundup-item .wp-block-post-excerpt__more-link {
	-webkit-appearance: none;
	background-color: #215465;
	border: 0;
	border-radius: 5px;
	color: #fff;
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 500 !important;
	line-height: 1;
	margin-bottom: 0;
	padding: 12px 20px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	width: auto;
}

.wp-block-group.is-style-roundup-item .wp-block-post-excerpt__more-link:focus,
.wp-block-group.is-style-roundup-item .wp-block-post-excerpt__more-link:hover {
	background-color: #215465;
	border-width: 0;
	color: #fff;
	opacity: 0.8;
	text-decoration: none;
}

.wp-block-group.is-style-roundup-item .wp-block-post-template.is-layout-grid.wp-block-post-template.is-layout-grid.wp-block-post-template.is-layout-grid.wp-block-post-template.is-layout-grid {
	grid-template-columns: 1fr !important;
}

@media (min-width: 768px) {

	/*
	 * Pattern A: roundup group wraps a Post block (inner .wp-block-post).
	 * Pattern B: Query Loop — featured image + roundup group are siblings on li.wp-block-post
	 * (previous rules only matched A, so loop roundups never got flex / 50–50).
	 */
	.wp-block-group.is-style-roundup-item .wp-block-post {
		align-items: center;
		display: flex;
		flex-direction: row;
	}

	/* Core can set list items to layout grid with inline columns; flex must win for 50/50. */
	.wp-block-post:has(> .wp-block-group.is-style-roundup-item) {
		align-items: center;
		display: flex !important;
		flex-direction: row;
	}

	.wp-block-group.is-style-roundup-item .wp-block-post > *,
	.wp-block-post:has(> .wp-block-group.is-style-roundup-item) > * {
		flex: 1 1 50%;
		min-width: 0;
	}

	.wp-block-group.is-style-roundup-item .wp-block-post > *:not(.roundup-content) img,
	.wp-block-post:has(> .wp-block-group.is-style-roundup-item) > .wp-block-post-featured-image img {
		height: auto;
		max-width: 100%;
		object-fit: cover;
		width: 100%;
	}

	.wp-block-group.is-style-roundup-item img,
	.wp-block-post:has(> .wp-block-group.is-style-roundup-item) > .wp-block-post-featured-image img {
		aspect-ratio: 1;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
		border-top-right-radius: 0;
	}

	.wp-block-group.is-style-roundup-item .roundup-content {
		padding: 25px;
	}

}

/* Media & Text
--------------------------------------------- */

.is-style-external-roundup-item .wp-block-media-text.has-background {
	border-radius: 0;
    margin-bottom: 30px;
	overflow: hidden;
}

.is-style-external-roundup-item .wp-block-media-text.has-background > .wp-block-media-text__media img {
	border-radius: 0;
}

.is-style-external-roundup-item .wp-block-media-text > .wp-block-media-text__content {
    padding: 25px 0 0;
}

.is-style-external-roundup-item .wp-block-media-text.has-background > .wp-block-media-text__content {
    padding: 25px 20px 0;
}

@media (min-width: 415px) {

	.is-style-external-roundup-item .wp-block-media-text.has-background > .wp-block-media-text__content {
		padding: 25px 25px 0;
	}

}

@media (min-width: 601px) {

	.is-style-external-roundup-item .wp-block-media-text.has-background > .wp-block-media-text__content,
	.is-style-external-roundup-item .wp-block-media-text > .wp-block-media-text__content {
		padding: 25px 25px 0;
	}

}

@media (min-width: 768px) {

	.is-style-external-roundup-item .wp-block-media-text.is-image-fill-element>.wp-block-media-text__media {
		aspect-ratio: 1 !important;
	}

}