/* Blog, archive and long-form content. Presets only. */

/* ---- Chips (core/buttons) */
.wp-block-buttons.is-style-chips {
	gap: 8px;
}

.wp-block-buttons.is-style-chips .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--button);
	background: transparent;
	color: var(--wp--preset--color--soil);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	text-decoration: none;
}

.wp-block-buttons.is-style-chips .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--moss);
	background: transparent;
	color: var(--wp--preset--color--moss);
}

.wp-block-buttons.is-style-chips .wp-block-button__link[aria-current="page"] {
	border-color: var(--wp--preset--color--moss);
	background: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--on-moss);
}

.gm-blog-chips {
	padding-bottom: 0;
}

/* ---- Media frame: shows a marked placeholder until a featured image is set */
.gm-media-frame {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--sand);
}

.gm-media-frame::before {
	content: "Featured image placeholder";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: var(--wp--preset--font-size--x-small);
}

.gm-media-frame .wp-block-post-featured-image {
	position: relative;
	margin: 0;
}

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

.gm-media-frame--card {
	aspect-ratio: 16 / 10;
}

.gm-media-frame--feature {
	width: 100%;
	aspect-ratio: 16 / 10;
}

@media (min-width: 782px) {

	.gm-media-frame--feature {
		height: 100%;
		min-height: 280px;
		aspect-ratio: auto;
	}
}

.gm-media-frame--hero {
	aspect-ratio: 21 / 9;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--card);
}

.gm-media-frame--hero::before {
	border: 1px dashed var(--wp--preset--color--field);
	border-radius: var(--wp--custom--radius--card);
	inset: 16px;
}

/* ---- Blog grid, featured card, pagination */
.gm-featured-card.is-style-card {
	padding: 0;
	overflow: hidden;
}

.gm-featured-card__columns {
	gap: 0;
	margin: 0;
}

.gm-featured-card__body {
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--40);
}

.gm-featured-card__body .wp-block-post-title,
.gm-featured-card__body .wp-block-post-excerpt {
	margin: 0;
}

.gm-featured-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.gm-featured-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.gm-featured-card {
	position: relative;
}

.gm-featured-card .wp-block-post-terms a {
	position: relative;
	z-index: 1;
}

.gm-byline {
	gap: 12px;
}

.gm-byline .wp-block-group {
	gap: 0;
}

.gm-byline p {
	margin: 0;
}

.gm-initials {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--moss-tint);
	color: var(--wp--preset--color--moss);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.gm-initials--lg {
	width: 56px;
	height: 56px;
	font-size: var(--wp--preset--font-size--medium);
}

.gm-post-card .gm-post-meta a {
	position: relative;
	z-index: 1;
}

.gm-pagination {
	gap: var(--wp--preset--spacing--20);
	margin-top: var(--wp--preset--spacing--50);
}

.gm-pagination a,
.gm-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--wp--custom--radius--button);
	color: var(--wp--preset--color--soil);
	text-decoration: none;
}

.gm-pagination a:hover {
	background: var(--wp--preset--color--sand);
	color: var(--wp--preset--color--moss);
}

.gm-pagination .page-numbers.current {
	background: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--on-moss);
}

.gm-pagination .wp-block-query-pagination-numbers {
	display: flex;
	gap: 4px;
}

/* ---- Single post */
.gm-post-head .wp-block-post-title,
.gm-post-head .wp-block-post-excerpt {
	margin: 0;
}

.gm-post-head .wp-block-group {
	gap: var(--wp--preset--spacing--20);
}

.gm-post-head .gm-byline,
.gm-post-head .gm-byline > .wp-block-group {
	gap: 0 12px;
}

.gm-post-head .gm-byline {
	margin-top: var(--wp--preset--spacing--10);
}

.gm-post-head .gm-crumbs {
	gap: 0 8px;
}

.gm-post-head .wp-block-post-terms a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.gm-post-layout__grid {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: minmax(0, 1fr);
}

.gm-article > * {
	min-width: 0;
	max-width: 100%;
}

.gm-post-content.has-global-padding {
	padding-inline: 0;
}

.gm-article {
	gap: var(--wp--preset--spacing--40);
	min-width: 0;
	max-width: 720px;
	margin-inline: auto;
	width: 100%;
}

.gm-post-layout__grid > .gm-toc {
	display: none;
}

.gm-toc:not(:has(.gm-toc__list)) {
	display: none !important;
}

.gm-toc__list ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gm-toc__list a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding-inline: 12px 0;
	border-inline-start: 2px solid transparent;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.gm-toc__list a:hover {
	border-inline-start-color: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--moss);
}

.gm-toc__item--h3 a {
	padding-inline-start: 28px;
}

/* On this page: left of the article from 1100px, sticky; hidden below. */
@media (min-width: 1100px) {

	/*
	 * The article always takes the second column, so a post with no headings
	 * (no TOC) stays centred.
	 */
	.gm-post-layout__grid > .gm-article {
		grid-column: 2;
	}

	.gm-post-layout__grid:not(:has(.gm-toc__list)) {
		grid-template-columns: minmax(0, 720px);
	}

	.gm-post-layout__grid:not(:has(.gm-toc__list)) > .gm-article {
		grid-column: 1;
	}

	.gm-post-layout__grid {
		grid-template-columns: 220px minmax(0, 720px);
		column-gap: 96px;
		justify-content: center;
	}

	.gm-post-layout__grid > .gm-toc {
		position: sticky;
		top: var(--wp--preset--spacing--40);
		display: flex;
		align-self: start;
	}
}

.gm-post-foot {
	gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--stone);
}

.gm-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.gm-tag-list .wp-block-post-terms__separator {
	display: none;
}

.gm-tag-list a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--button);
	color: var(--wp--preset--color--soil);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
}

.gm-tag-list a:hover {
	border-color: var(--wp--preset--color--moss);
	color: var(--wp--preset--color--moss);
}

.gm-share-row {
	gap: 8px;
}

.gm-share-row p {
	margin: 0;
}

.gm-share .wp-block-button__link {
	min-height: 44px;
	font-size: var(--wp--preset--font-size--small);
}

.gm-author-box.is-style-card {
	gap: 20px;
	padding: var(--wp--preset--spacing--40);
}

.gm-author-box .wp-block-group {
	gap: 4px;
}

.gm-author-box p,
.gm-author-box .wp-block-post-author-name {
	margin: 0;
}

.gm-author-box__link a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.gm-callout.is-style-card {
	gap: 16px 24px;
	padding: 20px 24px;
	margin-block: var(--wp--preset--spacing--40);
}

.gm-callout__main {
	gap: 16px;
}

.gm-callout .wp-block-group,
.gm-callout p {
	margin: 0;
}

.gm-callout__title {
	font-weight: 600;
}

/* ---- Long-form content: spacing and every block ---- */
.gm-post-content {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.65;
}

.gm-post-content > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.gm-post-content > h2 {
	margin-block-start: var(--wp--preset--spacing--50);
	scroll-margin-top: var(--wp--preset--spacing--40);
}

.gm-post-content > h3 {
	margin-block-start: var(--wp--preset--spacing--40);
	scroll-margin-top: var(--wp--preset--spacing--40);
}

.gm-post-content > h2 + *,
.gm-post-content > h3 + * {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* Lists */
.wp-block-list {
	padding-inline-start: 1.4em;
}

.wp-block-list li + li {
	margin-block-start: 0.5em;
}

.wp-block-list li::marker {
	color: var(--wp--preset--color--moss);
}

/*
 * Quote: Fraunces with a Moss rule (set in theme.json); attribution in muted
 * small caps.
 */
.wp-block-quote {
	margin-inline: 0;
	padding-inline-start: var(--wp--preset--spacing--30);
}

.wp-block-quote p {
	margin: 0;
}

.wp-block-quote cite {
	display: block;
	margin-top: var(--wp--preset--spacing--10);
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
}

/* Inline code */
:where(p, li, td, figcaption, summary) code {
	padding: 2px 6px;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 6px;
	background: var(--wp--preset--color--sand);
	font-family: var(--wp--preset--font-family--jetbrains-mono);
	font-size: 0.875em;
}

/* Code block: horizontal scroll, never wraps the page. */
.wp-block-code {
	overflow-x: auto;
	padding: var(--wp--preset--spacing--30);
	line-height: 1.6;
}

.wp-block-code code {
	padding: 0;
	border: 0;
	background: none;
	font-size: inherit;
}

/* Image and caption */
.wp-block-image img {
	height: auto;
	border-radius: var(--wp--custom--radius--card);
}

.wp-block-image figcaption,
.gm-caption {
	margin: var(--wp--preset--spacing--10) 0 0;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

.gm-figure-placeholder .gm-shot.gm-placeholder {
	min-height: 240px;
}

/* Table: scrolls inside its own frame; header on Sand. */
.wp-block-table {
	overflow-x: auto;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-table table {
	min-width: 480px;
	border-collapse: collapse;
}

.wp-block-table thead {
	border-bottom: 0;
}

.wp-block-table th,
.wp-block-table td {
	padding: 12px 16px;
	border: 0;
	border-top: 1px solid var(--wp--preset--color--stone);
	text-align: start;
}

.wp-block-table thead th {
	border-top: 0;
	background: var(--wp--preset--color--sand);
	font-weight: 600;
}

/* Notices inside content keep a little air above and below. */
.gm-post-content > [class*="is-style-notice-"] {
	margin-block: var(--wp--preset--spacing--40);
}

[class*="is-style-notice-"] p {
	margin: 0;
}

/* Separator */
.wp-block-separator {
	width: 100%;
	max-width: none;
	margin-block: var(--wp--preset--spacing--40);
	border: 0;
	border-top: 1px solid var(--wp--preset--color--stone);
	background: none;
	opacity: 1;
}

/* Code never uses ligatures: "--" and "->" must read as typed. */
code,
pre,
.wp-block-code {
	font-variant-ligatures: none;
}

:where(p, li, td, figcaption, summary) code {
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.gm-share-row .wp-block-buttons {
	gap: 8px;
}

.gm-callout__main {
	flex: 1 1 320px;
}

.gm-callout__main .wp-block-group {
	gap: 4px;
}

.gm-post-head .wp-block-post-terms a {
	color: var(--wp--preset--color--moss);
}

.wp-block-code code {
	white-space: pre;
}
