.grave-post-hero-body > * {
	max-width: var(--wp--style--global--content-size);
}

.grave-post-hero .wp-block-post-title,
.grave-post-layout {
	overflow-wrap: anywhere;
}

.grave-post-container {
	container-type: inline-size;
	container-name: post;
}

.grave-post-layout {
	display: grid;
	grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--60);
	align-items: start;
}

.grave-post-layout > * {
	min-width: 0;
	margin-block: 0;
}

.grave-post-content {
	grid-area: 1 / 1;
}

.grave-post-aside {
	grid-area: 1 / 2;
	align-self: stretch;
}

.grave-post-toc-card {
	position: sticky;
	top: var(--grave-sticky-top, calc(var(--wp--custom--header--content-inset) + var(--wp--preset--spacing--40) + var(--wp-admin--admin-bar--height, 0px)));
	/* Transition the sticky inset so the card stays within the article column at its lower edge. */
	transition: top var(--wp--custom--motion--duration--base) var(--wp--custom--motion--easing-in-out);
}

.grave-post-aside .wp-block-post-featured-image {
	margin: 0;
}

.grave-post-aside .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius--image);
}

.grave-post-toc-title {
	margin-block: 0 var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: var(--wp--custom--typography--font-weight--semibold);
	line-height: var(--wp--custom--typography--line-height--compact);
	color: var(--wp--preset--color--fg-dark);
}

.wp-block-grave-post-toc ul {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: var(--wp--custom--typography--font-weight--semibold);
}

.wp-block-grave-post-toc a {
	color: var(--wp--preset--color--fg);
	text-decoration: none;
}

.wp-block-grave-post-toc a:hover {
	color: var(--wp--preset--color--primary-dark);
	text-decoration: underline;
}

.grave-post :is(a, button, [tabindex]):focus-visible {
	outline: 0.125rem solid var(--wp--preset--color--primary-dark);
	outline-offset: 0.125rem;
}

.grave-post-content :is(h2, h3, [id]) {
	scroll-margin-top: calc(var(--wp--custom--header--content-inset) + var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--30));
}

.grave-post-content :where(h2:not([class*="has-"][class*="-font-size"])) {
	font-size: var(--wp--preset--font-size--2-xl);
	margin-block-start: var(--wp--preset--spacing--60);
}

.grave-post-content :where(h3:not([class*="has-"][class*="-font-size"])) {
	font-size: var(--wp--preset--font-size--xl);
	margin-block-start: var(--wp--preset--spacing--50);
}

.grave-post-content > :first-child {
	margin-block-start: 0;
}

.grave-post-content :where(img, video, iframe) {
	max-width: 100%;
}

.grave-post-content :where(img, video) {
	height: auto;
	border-radius: var(--wp--custom--radius--sm);
}

.grave-post-content :where(figure, blockquote) {
	margin-inline: 0;
}

.grave-post-content :where(.wp-block-table, pre) {
	max-width: 100%;
	overflow-x: auto;
}

.grave-post-content :where(table) {
	width: 100%;
}

.grave-post-content :where(th, td) {
	padding: var(--wp--preset--spacing--20);
}

.grave-post-content .alignfull {
	width: auto;
	max-width: 100%;
	margin-inline: 0;
}

.grave-post-content :where(.schema-faq-section) + .schema-faq-section {
	margin-block-start: var(--wp--preset--spacing--40);
}

.grave-post-content :where(.schema-faq-question) {
	color: var(--wp--preset--color--fg-dark);
}

@container post (max-width: 56rem) {
	.grave-post-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--wp--preset--spacing--50);
	}

	.grave-post-content,
	.grave-post-aside {
		grid-area: auto;
	}

	.grave-post-toc-card {
		position: static;
	}
}

@media (prefers-reduced-motion: reduce) {
	.grave-post-toc-card {
		transition: none;
	}
}
