.wp-block-coblocks-posts {

	& + & {
		margin-top: var(--coblocks-spacing--2, map-get($spacing, 2));
	}

	&.has-1-columns > div:first-child {
		margin-top: 0;
	}

	&.has-1-columns > div:last-child {
		margin-bottom: 0;
	}
}

.wp-block-coblocks-posts__inner {
	margin-left: 0;
	padding-left: 0;
}

.wp-block-coblocks-posts__item {
	align-items: stretch;
	flex: 1 1 auto;
	margin-bottom: var(--coblocks-spacing--3, map-get($spacing, 3));
	margin-left: 0;
	margin-top: 0;
	padding-left: 0;
	width: 100%;

	.is-style-stacked & {
		flex-direction: column;
	}

	.is-style-horizontal .has-image-right  & {
		flex-direction: row-reverse;
	}
}

.wp-block-coblocks-posts.is-style-horizontal .wp-block-coblocks-posts__item {
	display: flex;
}

.wp-block-coblocks-posts__image {
	display: table;
	flex: 0 0 auto;
	height: 14.285%;
	margin-right: var(--coblocks-spacing--2, map-get($spacing, 2));
	position: relative;
	width: 14.285%;

	@include break-small() {
		margin-right: var(--coblocks-spacing--3, map-get($spacing, 3));
	}

	.has-image-right & {
		margin-left: var(--coblocks-spacing--2, map-get($spacing, 2));
		margin-right: 0;

		@include break-small() {
			margin-left: var(--coblocks-spacing--3, map-get($spacing, 3));
		}
	}

	> * {
		display: block;
		padding-top: 100%;
		width: 100%;
	}

	.is-style-stacked & {
		margin-bottom: var(--coblocks-spacing--2, map-get($spacing, 2));
		width: 100%;
	}

	.has-medium-image & {
		@include break-small() {
			height: 20%;
			width: 20%;
		}
	}

	.has-large-image & {
		@include break-small() {
			height: 33.33%;
			width: 33.33%;
		}
	}

	.has-huge-image & {
		@include break-small() {
			height: 33.33%;
			width: 33.33%;
		}
		@include break-medium() {
			height: 50%;
			width: 50%;
		}
	}

	.has-four-to-three-image & > * {
		padding-top: 75%; /* 4:3 Aspect ratio */
	}

	.has-sixteen-to-nine-image & > * {
		padding-top: 56.25%; /* 16:9 Aspect ratio */
	}

	.has-circle-image & > * {
		border-radius: 100%;
	}
}

.wp-block-coblocks-posts__content {
	display: flex;
	flex-direction: column;
	margin-top: auto;
	width: 100%;

	&.self-center {
		align-self: center;
	}
}

.wp-block-coblocks-posts__date {
	color: #6c7781;
	display: block;
	font-size: $editor-font-size;
	margin-top: var(--coblocks-spacing--1, map-get($spacing, 1));
}

.wp-block-coblocks-posts__excerpt {
	margin-top: var(--coblocks-spacing--1, map-get($spacing, 1));
}

.wp-block-coblocks-posts__more-link {
	align-self: self-start;
	display: block;
}

// Import style tweaks for core WordPress themes
@import "theme";
