/* SPM Base: global layout CSS. Keep this small. Section styling lives in each SPM block's style.css. */

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

img, svg, video { max-width: 100%; height: auto; }

:where(h1, h2, h3, h4) { text-wrap: balance; margin-block: 0 0.5em; }
:where(p) { text-wrap: pretty; }

/* Header */
.spm-header { padding-block: var(--wp--preset--spacing--20); border-bottom: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--base); }
.spm-header__inner { gap: var(--wp--preset--spacing--30); }
.spm-header .wp-block-site-title { font-weight: 700; font-size: var(--wp--preset--font-size--md); }
.spm-header .wp-block-site-title a { color: inherit; text-decoration: none; }
.spm-header .wp-block-navigation a { text-decoration: none; font-weight: 500; }
.spm-header .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }

/* Footer */
.spm-footer { margin-top: 0; padding-block: var(--wp--preset--spacing--40); background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.spm-footer a { color: inherit; }
.spm-footer .wp-block-site-title a { color: inherit; text-decoration: none; }
.spm-footer__copy { font-size: var(--wp--preset--font-size--sm); opacity: 0.75; margin: 0; }

/* Header, main and footer sit flush: sections handle their own spacing. Footer pins to the bottom on short pages. */
.wp-site-blocks { min-height: 100vh; display: flex; flex-direction: column; }
.wp-site-blocks > * { margin-block-start: 0; }
.wp-site-blocks > footer, .wp-site-blocks > .wp-block-template-part:last-child { margin-top: auto; }

/* Main: sections run edge to edge, loose content is constrained. */
.spm-main { margin-top: 0; }
.spm-page-content > * { margin-block: 0; }
.spm-page-content > :not([class*="wp-block-spm-"]):not(.alignfull):not(.woocommerce):not([class*="wp-block-woocommerce"]) {
	max-width: var(--wp--style--global--content-size);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--30);
}
.spm-page-content > :not([class*="wp-block-spm-"]) + :not([class*="wp-block-spm-"]) { margin-top: var(--wp--preset--spacing--30); }
.spm-page-content > [class*="wp-block-woocommerce"],
.spm-page-content > .woocommerce { max-width: var(--wp--style--global--wide-size); margin-inline: auto; padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30); }

.spm-page-title { padding-top: var(--wp--preset--spacing--50); }
.spm-single, .spm-archive { padding-block: var(--wp--preset--spacing--50); }
.spm-post-list { display: grid; gap: var(--wp--preset--spacing--40); padding: 0; }

/* Accessible focus */
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
