/*
Theme Name: MR Wax
Description: The custom WooCommerce storefront theme for MR Wax.
Author: MR Wax
Version: 0.1.0
Requires at least: 7.1
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mrwax
*/

/* Tokens and body defaults are authored only in theme.json. */

/* Outer theme titles, direct post headings, and explicitly editorial regions.
 * Never select .entry-title or .wp-block-heading indiscriminately: WooCommerce
 * uses both. Do not place native commerce blocks/forms inside .mrwax-prose.
 */
:where(
	.site-main > article > .entry-header > .entry-title,
	.site-main > article.type-post > .entry-content > :is(h1, h2, h3, h4, h5, h6),
	.mrwax-prose :is(h1, h2, h3, h4, h5, h6)
) {
	font-family: var(--wp--preset--font-family--mrwax-display);
	font-weight: var(--wp--custom--mrwax--font-weight--bold);
	line-height: var(--wp--custom--mrwax--line-height--compact);
}

:where(.site-main > article > .entry-header > h1.entry-title, .site-main > article.type-post > .entry-content > h1, .mrwax-prose h1) {
	font-size: var(--wp--preset--font-size--mrwax-heading-1);
}

:where(.site-main > article > .entry-header > h2.entry-title, .site-main > article.type-post > .entry-content > h2, .mrwax-prose h2) {
	font-size: var(--wp--preset--font-size--mrwax-heading-2);
}

:where(.site-main > article > .entry-header > h3.entry-title, .site-main > article.type-post > .entry-content > h3, .mrwax-prose h3) {
	font-size: var(--wp--preset--font-size--mrwax-heading-3);
}

:where(.site-main > article > .entry-header > h4.entry-title, .site-main > article.type-post > .entry-content > h4, .mrwax-prose h4) {
	font-size: var(--wp--preset--font-size--mrwax-lead);
}

:where(.site-main > article > .entry-header > h5.entry-title, .site-main > article.type-post > .entry-content > h5, .mrwax-prose h5) {
	font-size: var(--wp--preset--font-size--mrwax-body);
}

:where(.site-main > article > .entry-header > h6.entry-title, .site-main > article.type-post > .entry-content > h6, .mrwax-prose h6) {
	font-size: var(--wp--preset--font-size--mrwax-small);
}

/* Link styling excludes native commerce wrappers and controls by ownership. */
:where(
	.site-header > .site-title a,
	.site-footer a,
	.site-main > article > .entry-header a,
	.site-main > article.type-post > .entry-content > :is(p, ul, ol, blockquote) a,
	.mrwax-prose a
) {
	color: var(--wp--preset--color--mrwax-muted);
	text-decoration-line: underline;
	text-underline-offset: 0.15em;
}

:where(
	.site-header > .site-title a,
	.site-footer a,
	.site-main > article > .entry-header a,
	.site-main > article.type-post > .entry-content > :is(p, ul, ol, blockquote) a,
	.mrwax-prose a
):is(:hover, :active) {
	color: var(--wp--preset--color--mrwax-ink);
	text-decoration-thickness: 0.12em;
}

/* Native focus remains intact elsewhere; this is not a global outline reset. */
:where(
	.site-header > .site-title a,
	.site-footer a,
	.site-main > article > .entry-header a,
	.site-main > article.type-post > .entry-content > :is(p, ul, ol, blockquote) a,
	.mrwax-prose :is(a, button, input, select, textarea, [tabindex])
):focus-visible {
	outline: var(--wp--custom--mrwax--focus--width) solid var(--wp--preset--color--mrwax-ink);
	outline-offset: var(--wp--custom--mrwax--focus--width);
	box-shadow: 0 0 0 var(--wp--custom--mrwax--focus--width) var(--wp--preset--color--mrwax-surface);
}

@media (forced-colors: active) {
	:where(
		.site-header > .site-title a,
		.site-footer a,
		.site-main > article > .entry-header a,
		.site-main > article.type-post > .entry-content > :is(p, ul, ol, blockquote) a,
		.mrwax-prose :is(a, button, input, select, textarea, [tabindex])
	):focus-visible {
		outline-color: Highlight;
		box-shadow: none;
	}
}

/* Accessible text stays available to assistive technology and keyboard focus. */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.screen-reader-text:focus {
	background: var(--wp--preset--color--mrwax-surface);
	clip-path: none;
	color: var(--wp--preset--color--mrwax-ink);
	height: auto;
	/* Native top/left offsets must not reveal text above a scrolled viewport. */
	inset: auto;
	margin: 0;
	overflow: visible;
	padding: var(--wp--preset--spacing--mrwax-space-2);
	white-space: normal;
	width: auto;
}

/* Opt-in content only: no new wrapper or page content is introduced here. */
:where(.mrwax-prose) {
	overflow-wrap: break-word;
}

:where(.mrwax-prose > *) {
	margin-block: 0;
}

:where(.mrwax-prose > * + *) {
	margin-block-start: var(--wp--preset--spacing--mrwax-space-3);
}

:where(.mrwax-prose img, .site-main > article.type-post > .entry-content > :is(p, figure) img) {
	max-inline-size: 100%;
	block-size: auto;
}

/* Maximum content width; gutters are supplied by the surrounding margins. */
:where(.mrwax-container) {
	inline-size: min(calc(100% - 2 * var(--wp--custom--mrwax--gutter)), var(--wp--style--global--wide-size));
	margin-inline: auto;
}
