/* Shared frontend/editor rules. Desktop tokens are defined in theme.json. */
:where(.wp-site-blocks, .editor-styles-wrapper),
:where(.wp-site-blocks, .editor-styles-wrapper) * {
	text-underline-offset: 5px;
}

:is(.wp-site-blocks, .editor-styles-wrapper) :is(b, strong) {
	font-weight: 800;
}

.has-script-font-family {
	font-family: var(--wp--preset--font-family--script);
	font-weight: 500;
	font-style: normal;
}

@media (max-width: 767px) {
	:root,
	body,
	.editor-styles-wrapper {
		--wp--custom--section-gap: 65px;
		--wp--custom--font-size--body: 15px;
		--wp--custom--font-size--medium: 15px;
		--wp--custom--font-size--large: 17px;
		--wp--custom--font-size--h-1: 40px;
		--wp--custom--font-size--h-2: 36px;
		--wp--custom--font-size--h-3: 26px;
		--wp--custom--margin--h-2: 17px;
		--wp--custom--margin--h-3: 24px;
		--wp--custom--margin--paragraph: 24px;
	}
}

/* Apply once between adjacent top-level sections, including the editor canvas. */
:is(.entry-content, .editor-styles-wrapper .is-root-container, main.wp-block-group)
	> :is(
		section,
		.wp-block-group,
		.wp-block-columns,
		.wp-block-media-text,
		.wp-block-cover
	) {
	margin-block-end: 0;
}

:is(.entry-content, .editor-styles-wrapper .is-root-container, main.wp-block-group)
	> :is(
		section,
		.wp-block-group,
		.wp-block-columns,
		.wp-block-media-text,
		.wp-block-cover
	)
	+ :is(
		section,
		.wp-block-group,
		.wp-block-columns,
		.wp-block-media-text,
		.wp-block-cover
	) {
	/* The starter applies an important top margin to direct column blocks. */
	margin-block-start: var(--wp--custom--section-gap) !important;
}

/* Content → footer: same rhythm as between sections (not on the inner footer group). */
footer {
	margin-block-start: var(--wp--custom--section-gap);
}

footer > :first-child {
	margin-block-start: 0 !important;
}

/* Override the starter's generic group margins with the typography rhythm. */
:is(.wp-site-blocks, .editor-styles-wrapper) h1 {
	margin-block-end: var(--wp--custom--margin--h-1);
}

:is(.wp-site-blocks, .editor-styles-wrapper) h2 {
	margin-block-end: var(--wp--custom--margin--h-2);
}

:is(.wp-site-blocks, .editor-styles-wrapper) h3 {
	margin-block-end: var(--wp--custom--margin--h-3);
}

:is(.wp-site-blocks, .editor-styles-wrapper) p {
	margin-block-end: var(--wp--custom--margin--paragraph);
}

/* The starter forces a top margin and breaks words in direct content blocks. */
.entry-content > :is(h1, h2, h3, p, .wp-block-list) {
	margin-top: 0 !important;
	word-break: normal;
}

.editor-styles-wrapper .is-root-container > :is(.wp-block-heading, p, .wp-block-list) {
	margin-top: 0 !important;
}

:is(.entry-content, .editor-styles-wrapper .is-root-container) > :is(.wp-block-heading, p, .wp-block-list, .wp-block-image, .wp-block-quote) + h2.wp-block-heading {
	margin-top: clamp(2rem, 1.7451rem + 1.0458vw, 3rem) !important;
}

.wp-block-button .wp-block-button__link:hover {
	background-color: transparent;
	text-decoration: none;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background-color: transparent;
	text-decoration: none;
}
