/* Custom Block Styles — loaded on both frontend and editor */

.is-style-pre-title {
	font-size: var(--wp--preset--font-size--tiny);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-red);
	margin-bottom: var(--wp--preset--spacing--sm);
}

.is-style-pre-title + h2,
.is-style-pre-title + h3 {
	margin-top: 0;
}

.wp-block-heading.is-style-h3-style {
	font-size: var(--wp--preset--font-size--x-large);
	margin-top: var(--wp--preset--spacing--70);
}

.is-style-pre-title + .wp-block-heading.is-style-h3-style {
	margin-top: 0;
}

/* ---------- 091 Latest Posts (Query Loop variation) ---------- */

.post-card {
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	overflow: hidden;
}

.post-card__image {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.post-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.post-card__content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--wp--preset--spacing--lg);
}

.post-card__date {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--meta);
	margin-bottom: var(--wp--preset--spacing--sm);
}

.post-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 600;
	color: var(--wp--preset--color--headings);
	margin: 0 0 var(--wp--preset--spacing--sm);
	line-height: 1.2;
}

.post-card__title a {
	color: inherit;
	text-decoration: none;
}

.post-card__excerpt {
	flex: 1;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--body-text);
	margin-bottom: var(--wp--preset--spacing--md);
}

.post-card__more {
	margin-top: auto;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--brand-red);
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* Query Loop variation: force grid on the <ul> post-template */
.wp-block-post-template.post-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--preset--spacing--lg);
	list-style: none;
	padding: 0;
	margin: 0;
}

.wp-block-post-template.post-grid > li {
	display: flex;
}

.wp-block-post-template.post-grid > li > .post-card {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* Fix featured image inside Query Loop cards */
.post-card .wp-block-post-featured-image {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	margin: 0;
}

.post-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Fix content group inside Query Loop cards */
.post-card .post-card__content.wp-block-group {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.post-card .wp-block-post-excerpt {
	flex: 1;
}

.post-card .wp-block-read-more {
	margin-top: auto;
}

@media (max-width: 768px) {
	.wp-block-post-template.post-grid {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.wp-block-post-template.post-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
