/*
 * Priority: values set in the post editor > this design > block/site defaults.
 * Share this file between the front end, post editor and template previews.
 * The editor scope excludes the separate post title and template root canvas.
 */
:is(
	.wp-block-post-content.is-style-column-post-design,
	:where(
			.post-type-post.editor-styles-wrapper,
			.post-type-post .editor-styles-wrapper
		)
		.wp-block-post-content.is-root-container
) {
	font-weight: 400;
	letter-spacing: 0.05em;
	line-height: calc(22 / 15);

	& > :where(:not(:first-child)) {
		margin-block-start: calc(
			var(--wp--style--block-gap, var(--wp--preset--spacing--6)) * 1.5
		);
	}

	&:not(:where([class*="-font-family"])) {
		font-family: var(--wp--preset--font-family--noto-sans-jp);
	}

	&:not(:where([class*="-font-size"])) {
		font-size: 14.4px;

		@media (min-width: 64rem) {
			font-size: 16px;
		}
	}

	&:not(:where(.has-text-color)) {
		color: var(--wp--preset--color--gray-custom-600);
	}

	&:not(:where([class*="has-text-align-"])) {
		text-align: justify;
	}

	/* Inherit explicit group settings as well as the content defaults. */
	& :where(p) {
		font-weight: inherit;
		letter-spacing: inherit;
		line-height: inherit;
	}

	& :where(p):not(:where([class*="-font-family"])) {
		font-family: inherit;
	}

	& :where(p):not(:where([class*="-font-size"])) {
		font-size: inherit;
	}

	& :where(p):not(:where(.has-text-color)) {
		color: inherit;
	}

	&
		:where(p):not(
			:where([class*="has-text-align-"], [class*="is-style-justify"])
		) {
		text-align: inherit;
	}

	& :where(h1, h2, h3, h4, h5, h6) {
		margin-block-start: calc(
			var(--wp--style--block-gap, var(--wp--preset--spacing--6)) * 1.5 +
				0.5lh
		);
		padding-bottom: var(--wp--preset--spacing--3-auto);
		border-bottom: 1px solid var(--wp--preset--color--gray-custom-400);
		font-weight: 900;
		letter-spacing: 0.05em;
		line-height: calc(22 / 18);
	}

	& :where(h1, h2, h3, h4, h5, h6):not(:where([class*="-font-family"])) {
		font-family: var(--wp--preset--font-family--zen-old-mincho);
	}

	& :where(h1, h2):not(:where([class*="-font-size"])) {
		font-size: 24px;

		@media (min-width: 64rem) {
			font-size: 28px;
		}
	}

	& :where(h3, h4, h5, h6):not(:where([class*="-font-size"])) {
		font-size: 20px;

		@media (min-width: 64rem) {
			font-size: 24px;
		}
	}

	& :where(h1, h2, h3, h4, h5, h6):not(:where(.has-text-color)) {
		color: var(--wp--custom--column-post-design--heading-color);
	}

	/* User-selected typography/color on a containing group also takes priority. */
	&
		:where(h1, h2, h3, h4, h5, h6):where(
			[class*="-font-family"] *,
			[style*="font-family:"] *
		):not(:where([class*="-font-family"])) {
		font-family: inherit;
	}

	&
		:where(h1, h2, h3, h4, h5, h6):where(
			[class*="-font-size"] *,
			[style*="font-size:"] *
		):not(:where([class*="-font-size"])) {
		font-size: inherit;
	}

	& :where(h1, h2, h3, h4, h5, h6):where([style*="font-weight:"] *) {
		font-weight: inherit;
	}

	& :where(h1, h2, h3, h4, h5, h6):where([style*="letter-spacing:"] *) {
		letter-spacing: inherit;
	}

	& :where(h1, h2, h3, h4, h5, h6):where([style*="line-height:"] *) {
		line-height: inherit;
	}

	&
		:where(h1, h2, h3, h4, h5, h6):where(
			.has-text-color *,
			[style^="color:"] *,
			[style*=";color:"] *,
			[style*="; color:"] *
		):not(:where(.has-text-color)) {
		color: inherit;
	}

	& :where(hr, .wp-block-separator):not(:where(.is-style-dots)) {
		border: 0;
		border-top: 1px solid currentColor;
	}

	&
		:where(hr, .wp-block-separator):not(
			:where(.is-style-dots, .has-text-color)
		) {
		color: var(--wp--preset--color--gray-custom-400);
	}
}
