/**
 * MA Steelfixing: base
 * Colour tokens, the drawing-sheet frame, type, buttons, focus, page changes.
 */

:root {
	--ms-film: var(--wp--preset--color--base);
	--ms-ink: var(--wp--preset--color--contrast);
	--ms-orange: var(--wp--preset--color--accent-1);
	--ms-blue: var(--wp--preset--color--accent-2);
	--ms-concrete: var(--wp--preset--color--accent-3);
	--ms-pencil: var(--wp--preset--color--accent-4);
	--ms-shade: var(--wp--preset--color--accent-5);
	--ms-white: var(--wp--preset--color--accent-6);
	--ms-line: 1.5px;
	--ms-hair: rgba(0, 0, 0, 0.22);
	--ms-gutter: clamp(10px, 2.2vw, 28px);
	--ms-annot: var(--wp--preset--font-family--b612);
}

html {
	background: var(--ms-shade);
}

body {
	background: var(--ms-shade);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-feature-settings: "ss01" 1;
}

/* The sheet: everything sits inside a drawn border */
.wp-site-blocks {
	background: var(--ms-film);
	margin: 0 var(--ms-gutter);
	border-left: var(--ms-line) solid var(--ms-ink);
	border-right: var(--ms-line) solid var(--ms-ink);
	min-height: 100vh;
	padding: 0;
}

.wp-site-blocks > * {
	margin-block-start: 0;
}

main.wp-block-group,
main.wp-block-group > .wp-block-post-content {
	margin-top: 0 !important;
}

.wp-block-post-content > .alignfull {
	margin-top: 0;
	margin-bottom: 0;
}

/* Headings: Archivo in its wide cut, set in sentence case */
h1, h2, h3, h4,
.wp-block-heading {
	font-stretch: 118%;
	text-wrap: balance;
}

h1.wp-block-heading {
	font-stretch: 125%;
	font-weight: 750;
	max-width: 16ch;
}

p {
	text-wrap: pretty;
}

.ms-lead {
	font-size: clamp(1.1rem, 1.6vw, 1.3rem);
	line-height: 1.55;
	max-width: 36rem;
}

.ms-sub {
	color: var(--ms-pencil);
	margin-top: 0.5rem;
}

.ms-small {
	font-size: 0.9rem;
	color: var(--ms-pencil);
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* Buttons */
.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wp-block-button__link {
	border: var(--ms-line) solid var(--ms-ink) !important;
}

/* A quieter text-only button style */
.wp-block-button.is-style-ms-text > .wp-block-button__link {
	background: transparent;
	border-color: transparent !important;
	padding-left: 0.25rem;
	padding-right: 0.25rem;
	color: var(--ms-ink);
	text-decoration: underline;
	text-decoration-thickness: var(--ms-line);
	text-underline-offset: 0.3em;
}

.wp-block-button.is-style-ms-text > .wp-block-button__link:hover {
	background: transparent;
	color: var(--ms-blue);
}

/* Visible keyboard focus everywhere */
:focus-visible {
	outline: 2px solid var(--ms-blue);
	outline-offset: 3px;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Smooth page changes: the header stays still while the page underneath changes */
@view-transition {
	navigation: auto;
}

header.wp-block-template-part {
	view-transition-name: ms-header;
}

::view-transition-old(root),
::view-transition-new(root) {
	animation-duration: 0.18s;
}

@media (prefers-reduced-motion: reduce) {
	@view-transition {
		navigation: none;
	}
}

/* Nothing spills outside the sheet border */
.wp-site-blocks {
	overflow-x: clip;
}

h1, h2, h3 {
	hyphens: manual;
	overflow-wrap: normal;
	word-break: normal;
}
