/**
 * MM News — block styles and shared block refinements.
 *
 * Loaded on the front end and added as an editor style (functions.php), so
 * the four custom block styles look the same in the post editor, the widget
 * editor, and on the site.
 *
 * Styles:
 *  is-style-news-card      core/group, core/post-template
 *  is-style-news-list      core/post-template, core/latest-posts
 *  is-style-headline       core/heading, core/post-title
 *  is-style-breaking-news  core/group, core/paragraph
 */

/* News card ----------------------------------------------------------------- */

.wp-block-group.is-style-news-card {
	background-color: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: var(--wp--custom--radius--medium);
	padding: var(--wp--preset--spacing--40);
}

.wp-block-group.is-style-news-card.has-background {
	border-color: transparent;
}

.wp-block-post-template.is-style-news-card > li {
	background-color: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: var(--wp--custom--radius--medium);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	overflow: hidden;
	padding: 0 0 1.25rem;
}

.wp-block-post-template.is-style-news-card > li > *:not(.wp-block-post-featured-image) {
	margin-block: 0;
	padding-inline: 1.25rem;
}

.wp-block-post-template.is-style-news-card > li > .wp-block-post-featured-image {
	margin: 0 0 0.5rem;
}

.wp-block-post-template.is-style-news-card .wp-block-post-featured-image img {
	border-radius: 0;
}

/* News list ----------------------------------------------------------------- */

.wp-block-post-template.is-style-news-list > li {
	border-block-end: 1px solid var(--wp--preset--color--rule);
	column-gap: 1rem;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	padding-block: 0.9rem;
	row-gap: 0.25rem;
}

.wp-block-post-template.is-style-news-list > li:first-child {
	padding-block-start: 0;
}

.wp-block-post-template.is-style-news-list > li > * {
	margin-block: 0;
}

.wp-block-post-template.is-style-news-list > li:has(> .wp-block-post-featured-image) {
	grid-template-columns: 6rem minmax(0, 1fr);
}

.wp-block-post-template.is-style-news-list > li > .wp-block-post-featured-image {
	grid-column: 1;
	grid-row: 1 / span 4;
}

.wp-block-post-template.is-style-news-list > li:has(> .wp-block-post-featured-image) > :not(.wp-block-post-featured-image) {
	grid-column: 2;
}

.wp-block-post-template.is-style-news-list .wp-block-post-featured-image img {
	aspect-ratio: 1;
	border-radius: var(--wp--custom--radius--small);
	object-fit: cover;
}

.wp-block-latest-posts.is-style-news-list {
	padding-inline-start: 0;
}

.wp-block-latest-posts.is-style-news-list > li {
	border-block-end: 1px solid var(--wp--preset--color--rule);
	list-style: none;
	margin: 0;
	overflow: hidden;
	padding-block: 0.9rem;
}

.wp-block-latest-posts.is-style-news-list > li:last-child {
	border-block-end: 0;
}

.wp-block-latest-posts.is-style-news-list .wp-block-latest-posts__post-title {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--headline);
	font-weight: 700;
	line-height: var(--wp--custom--line-height--snug);
	text-decoration: none;
}

.wp-block-latest-posts.is-style-news-list .wp-block-latest-posts__post-title:hover {
	text-decoration: underline;
}

.wp-block-latest-posts.is-style-news-list .wp-block-latest-posts__featured-image {
	margin-block-end: 0.5rem;
}

.wp-block-latest-posts.is-style-news-list .wp-block-latest-posts__post-date,
.wp-block-latest-posts.is-style-news-list .wp-block-latest-posts__post-author {
	color: var(--wp--preset--color--slate);
	font-size: var(--wp--preset--font-size--x-small);
}

/* Headline ------------------------------------------------------------------ */

.wp-block-heading.is-style-headline,
.wp-block-post-title.is-style-headline {
	border-block-start: var(--wp--custom--rail) solid currentColor;
	font-family: var(--wp--preset--font-family--headline);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: var(--wp--custom--line-height--tight);
	padding-block-start: 0.6rem;
}

/* Breaking news -------------------------------------------------------------- */

.wp-block-group.is-style-breaking-news {
	background-color: #fef3f2;
	border-inline-start: 6px solid var(--wp--preset--color--signal);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--ink);
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

.wp-block-group.is-style-breaking-news :where(h2, h3, h4) {
	color: var(--wp--preset--color--ink);
}

.wp-block-paragraph.is-style-breaking-news,
p.is-style-breaking-news {
	background-color: var(--wp--preset--color--signal);
	border-radius: var(--wp--custom--radius--small);
	color: var(--wp--preset--color--on-signal);
	display: inline-block;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 800;
	line-height: 1.2;
	padding: 0.35rem 0.65rem;
}

.wp-block-paragraph.is-style-breaking-news a,
p.is-style-breaking-news a {
	color: inherit;
}

/* Query Loop and pattern refinements ----------------------------------------- */

.wp-block-post-template {
	margin-block: 0;
}

.wp-block-post-featured-image img {
	border-radius: var(--wp--custom--radius--small);
}

.wp-block-post-title a:hover {
	text-decoration: underline;
}

.mm-news-pattern--hero .wp-block-post-excerpt {
	font-size: var(--wp--preset--font-size--medium);
}

.mm-news-pattern--showcase .wp-block-post-date {
	color: #c9c8e0;
}

.mm-news-pattern--newsletter .wp-block-button__link:hover,
.mm-news-pattern--newsletter .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

.wp-block-post-author {
	align-items: center;
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-post-author__avatar img {
	border-radius: 50%;
}

.wp-block-post-author__name {
	font-weight: 700;
}
