/**
 * Moore Health — Base
 *
 * Reset, element defaults, typography and accessibility primitives.
 * Loaded on every page immediately after tokens.css.
 *
 * @package MooreHealth
 */

/* ---------------------------------------------------------------------
 * Reset
 * --------------------------------------------------------------------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--mh-header-height) + var(--mh-space-4));
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	background-color: var(--mh-bg);
	color: var(--mh-text-body);
	font-family: var(--mh-font-body);
	font-size: var(--mh-size-body);
	font-weight: var(--mh-weight-regular);
	line-height: var(--mh-leading-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-synthesis-weight: none;
}

/* Locked while the mobile navigation panel is open. */
body.mh-nav-open {
	overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	color: var(--mh-text);
	font-weight: var(--mh-weight-medium);
	text-wrap: balance;
}

h1,
h2,
h3 {
	font-family: var(--mh-font-display);
}

h1 {
	font-size: var(--mh-size-h1);
	line-height: var(--mh-leading-h1);
	letter-spacing: var(--mh-tracking-h1);
}

h2 {
	font-size: var(--mh-size-h2);
	line-height: var(--mh-leading-h2);
	letter-spacing: var(--mh-tracking-h2);
}

h3 {
	font-size: var(--mh-size-h3);
	line-height: var(--mh-leading-h3);
}

h4 {
	font-family: var(--mh-font-body);
	font-size: var(--mh-size-h4);
	font-weight: var(--mh-weight-semibold);
	line-height: 1.35;
}

h5,
h6 {
	font-family: var(--mh-font-body);
	font-size: var(--mh-size-body);
	font-weight: var(--mh-weight-semibold);
	line-height: 1.4;
}

p {
	margin: 0 0 var(--mh-space-3);
	text-wrap: pretty;
}

p:last-child {
	margin-bottom: 0;
}

ul,
ol {
	margin: 0 0 var(--mh-space-3);
	padding-left: var(--mh-space-4);
}

li + li {
	margin-top: var(--mh-space-1);
}

a {
	color: var(--mh-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--mh-duration) var(--mh-ease);
}

a:hover {
	color: var(--mh-link-hover);
}

strong,
b {
	font-weight: var(--mh-weight-bold);
	color: var(--mh-text);
}

small {
	font-size: var(--mh-size-small);
	line-height: var(--mh-leading-small);
}

blockquote {
	margin: var(--mh-space-5) 0;
	padding-left: var(--mh-space-4);
	border-left: 2px solid var(--mh-border);
	font-family: var(--mh-font-display);
	font-size: var(--mh-size-h3);
	line-height: var(--mh-leading-h3);
	color: var(--mh-text);
}

hr {
	margin: var(--mh-space-6) 0;
	border: 0;
	border-top: 1px solid var(--mh-border);
}

code,
pre,
kbd,
samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

/* ---------------------------------------------------------------------
 * Media
 * --------------------------------------------------------------------- */

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
}

img,
video {
	height: auto;
}

svg {
	fill: currentColor;
}

/**
 * Inline icon default. Component classes such as .mh-button__icon appear later
 * in the cascade at equal specificity, so they win where a size is set.
 */
.mh-icon {
	width: 1.125em;
	height: 1.125em;
	flex-shrink: 0;
}

figure {
	margin: 0;
}

figcaption {
	margin-top: var(--mh-space-2);
	font-size: var(--mh-size-small);
	line-height: var(--mh-leading-small);
	color: var(--mh-slate);
}

/* WordPress alignment classes on editor content. */
.alignleft,
.alignright,
.aligncenter,
.alignwide,
.alignfull {
	margin-bottom: var(--mh-space-4);
}

.aligncenter {
	margin-inline: auto;
}

/* ---------------------------------------------------------------------
 * Forms — element level. Component styling lives in forms.css.
 * --------------------------------------------------------------------- */

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	margin: 0;
}

button {
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}

textarea {
	resize: vertical;
}

/* ---------------------------------------------------------------------
 * Focus
 *
 * Outlines are never removed, only replaced with a higher-contrast ring.
 * --------------------------------------------------------------------- */

:focus-visible {
	outline: 2px solid var(--mh-focus);
	outline-offset: 3px;
	border-radius: 2px;
}

/**
 * Links on tinted surfaces.
 *
 * Primary Blue clears AA on warm white (4.98:1) and mist (4.73:1) but not on
 * Light Blue (4.27:1), so panel and stone sections use the press shade.
 */
.mh-section--panel a:not(.mh-button),
.mh-section--warm a:not(.mh-button),
.mh-section--panel .mh-eyebrow,
.mh-section--warm .mh-eyebrow,
.mh-section--panel .mh-link-arrow,
.mh-section--warm .mh-link-arrow {
	color: var(--mh-blue-press);
}

/* Dark surfaces need a light ring to stay visible. */
.mh-section--dark :focus-visible,
.mh-footer :focus-visible {
	outline-color: var(--mh-blue-clear);
}

/* ---------------------------------------------------------------------
 * Accessibility utilities
 * --------------------------------------------------------------------- */

.mh-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.mh-skip-link {
	position: absolute;
	top: 0;
	left: var(--mh-space-3);
	z-index: var(--mh-z-skip-link);
	transform: translateY(-120%);
	padding: var(--mh-space-2) var(--mh-space-4);
	background-color: var(--mh-navy);
	color: var(--mh-text-inverse);
	font-size: var(--mh-size-small);
	font-weight: var(--mh-weight-semibold);
	text-decoration: none;
	border-radius: 0 0 var(--mh-radius-sm) var(--mh-radius-sm);
	transition: transform var(--mh-duration) var(--mh-ease);
}

.mh-skip-link:focus {
	transform: translateY(0);
	color: var(--mh-text-inverse);
}

/* ---------------------------------------------------------------------
 * Typography utilities
 * --------------------------------------------------------------------- */

.mh-display-xl {
	font-family: var(--mh-font-display);
	font-size: var(--mh-size-display-xl);
	line-height: var(--mh-leading-display-xl);
	letter-spacing: var(--mh-tracking-display-xl);
	font-weight: var(--mh-weight-display);
}

.mh-display {
	font-family: var(--mh-font-display);
	font-size: var(--mh-size-display);
	line-height: var(--mh-leading-display);
	letter-spacing: var(--mh-tracking-display);
	font-weight: var(--mh-weight-display);
}

.mh-h1,
.mh-h2,
.mh-h3 {
	font-family: var(--mh-font-display);
	font-weight: 700;
	color: var(--mh-text);
}

.mh-h1 {
	font-size: var(--mh-size-h1);
	line-height: var(--mh-leading-h1);
	letter-spacing: var(--mh-tracking-h1);
}

.mh-h2 {
	font-size: var(--mh-size-h2);
	line-height: var(--mh-leading-h2);
	letter-spacing: var(--mh-tracking-h2);
}

.mh-h3 {
	font-size: var(--mh-size-h3);
	line-height: var(--mh-leading-h3);
}

.mh-lead {
	font-size: var(--mh-size-body-lg);
	line-height: var(--mh-leading-body-lg);
	color: var(--mh-text-body);
}

.mh-small {
	font-size: var(--mh-size-small);
	line-height: var(--mh-leading-small);
}

/**
 * Eyebrow label. The only place all-caps is permitted.
 */
.mh-eyebrow {
	display: block;
	margin: 0 0 var(--mh-space-3);
	font-family: var(--mh-font-body);
	font-size: var(--mh-size-label);
	font-weight: var(--mh-weight-bold);
	line-height: var(--mh-leading-label);
	letter-spacing: var(--mh-tracking-label);
	text-transform: uppercase;
	color: var(--mh-accent);
}

.mh-section--dark .mh-eyebrow {
	color: var(--mh-blue-clear);
}

/* ---------------------------------------------------------------------
 * Reduced motion
 * --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------------------------------------------------------------------
 * Print
 * --------------------------------------------------------------------- */

@media print {
	.mh-header,
	.mh-footer,
	.mh-announcement,
	.mh-skip-link {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}
}
