/**
 * Responsive typography — body tier + enforcement.
 *
 * Token steps: style.css (headings + body), this file (enforcement).
 * Paragraphs often carry inline font-size from Gutenberg — use explicit mobile rules.
 */

:root,
.editor-styles-wrapper {
	--text-body: 21px;
	--text-body-small: 18px;
	--text-small: 16px;

	/* Re-link after WP global-styles (this file loads later). */
	--wp--preset--font-size--h-00: var(--text-h00);
	--wp--preset--font-size--h-0: var(--text-h0);
	--wp--preset--font-size--h-1: var(--text-h1);
	--wp--preset--font-size--h-2: var(--text-h2);
	--wp--preset--font-size--h-3: var(--text-h3);
	--wp--preset--font-size--h-4: var(--text-h4);
	--wp--preset--font-size--h-5: var(--text-h5);
	--wp--preset--font-size--h-6: var(--text-h6);
	--wp--preset--font-size--body: var(--text-body);
	--wp--preset--font-size--body-small: var(--text-body-small);
	--wp--preset--font-size--small: var(--text-small);
}

@media screen and (max-width: 1024px) {
	:root,
	.editor-styles-wrapper {
		--text-body: 19px;
		--text-body-small: 17px;
		--text-small: 15px;
		--wp--preset--font-size--body: 19px;
		--wp--preset--font-size--body-small: 17px;
		--wp--preset--font-size--small: 15px;
	}
}

@media screen and (max-width: 781px) {
	:root,
	.editor-styles-wrapper {
		--text-body: 19px;
		--text-body-small: 16px;
		--text-small: 14px;
		--wp--preset--font-size--body: 19px;
		--wp--preset--font-size--body-small: 16px;
		--wp--preset--font-size--small: 14px;
	}
}

/* Preset utility classes */
.has-h-00-font-size,
.h00-size {
	font-size: var(--text-h00) !important;
}

.has-h-0-font-size,
.h0-size {
	font-size: var(--text-h0) !important;
}

.has-h-1-font-size,
.h1-size {
	font-size: var(--text-h1) !important;
}

.has-h-2-font-size,
.h2-size {
	font-size: var(--text-h2) !important;
}

.has-h-3-font-size,
.h3-size {
	font-size: var(--text-h3) !important;
}

.has-h-4-font-size,
.h4-size {
	font-size: var(--text-h4) !important;
}

.has-h-5-font-size,
.h5-size {
	font-size: var(--text-h5) !important;
}

.has-h-6-font-size,
.h6-size {
	font-size: var(--text-h6) !important;
}

.has-body-font-size {
	font-size: var(--text-body) !important;
}

.has-body-small-font-size {
	font-size: var(--text-body-small) !important;
}

.has-small-font-size {
	font-size: var(--text-small) !important;
}

/* Page content — headings */
.editor-styles-wrapper :is(h1, h1.wp-block-heading) {
	font-size: var(--text-h1) !important;
}

.editor-styles-wrapper :is(h2, h2.wp-block-heading) {
	font-size: var(--text-h2) !important;
}

.editor-styles-wrapper :is(h3, h3.wp-block-heading) {
	font-size: var(--text-h3) !important;
}

.editor-styles-wrapper :is(h4, h4.wp-block-heading) {
	font-size: var(--text-h4) !important;
}

.editor-styles-wrapper :is(h5, h5.wp-block-heading) {
	font-size: var(--text-h5) !important;
}

.editor-styles-wrapper :is(h6, h6.wp-block-heading) {
	font-size: var(--text-h6) !important;
}

.editor-styles-wrapper :is(p, li, .wp-block-paragraph):not(:is(.eyebrow, .small, p.small)) {
	font-size: var(--text-body) !important;
}

/* Page content — headings + body (load after token blocks; mobile rules must be last) */
:is(main, .wp-block-post-content) :is(h1, .h1, h1.wp-block-heading) {
	font-size: var(--text-h1) !important;
}

:is(main, .wp-block-post-content) :is(h2, .h2, h2.wp-block-heading) {
	font-size: var(--text-h2) !important;
}

:is(main, .wp-block-post-content) :is(h3, .h3, h3.wp-block-heading) {
	font-size: var(--text-h3) !important;
}

:is(main, .wp-block-post-content) :is(h4, .h4, h4.wp-block-heading) {
	font-size: var(--text-h4) !important;
}

:is(main, .wp-block-post-content) :is(h5, .h5, h5.wp-block-heading) {
	font-size: var(--text-h5) !important;
}

:is(main, .wp-block-post-content) :is(h6, .h6, h6.wp-block-heading) {
	font-size: var(--text-h6) !important;
}

:is(main, .wp-block-post-content) :is(p, li, .wp-block-paragraph):not(:is(.eyebrow, .small, p.small)) {
	font-size: var(--text-body) !important;
}

@media screen and (max-width: 1024px) {
	body {
		font-size: 19px !important;
	}

	:is(main, .wp-block-post-content) :is(p, li, .wp-block-paragraph):not(:is(.eyebrow, .small, p.small)),
	.has-body-font-size {
		font-size: 19px !important;
	}

	.editor-styles-wrapper :is(p, li, .wp-block-paragraph):not(:is(.eyebrow, .small, p.small)) {
		font-size: 19px !important;
	}
}
