/* H2M Express base styles. Tokens come from tokens.css; no literal colours here. */

body {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--text-body-size);
	line-height: var(--text-body-line);
	background: var(--surface-page);
	color: var(--text-body);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-sans);
	font-weight: var(--weight-extrabold);
	color: var(--text-heading);
}

h1 {
	font-size: var(--text-h1-size);
	line-height: var(--text-h1-line);
}

h2 {
	font-size: clamp(34px, 3.6vw, 52px);
	line-height: 1.15;
}

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

.is-dark :where(h1, h2, h3, h4, h5, h6) {
	color: var(--text-on-dark);
}

a {
	color: var(--text-link);
	transition: var(--transition-default);
}

a:hover,
a:focus-visible {
	color: var(--text-link-hover);
}

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

/* Focus (P4-R1): 2px solid outline, 2px offset. Navy on light backgrounds, blue-light on dark ones. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--otw-navy);
	outline-offset: 2px;
}

:where(.is-dark, .h2m-on-dark) :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
:where(a, button, [tabindex]).h2m-on-dark:focus-visible {
	outline-color: var(--otw-blue-light);
}

/* Skip link: visually hidden until focused, then pinned top-left above everything. */
.h2m-skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 100;
	padding: var(--space-3) var(--space-4);
	background: var(--otw-navy);
	color: var(--text-on-dark);
	font-weight: var(--weight-bold);
	text-decoration: none;
	border-radius: var(--radius-sm);
	transform: translateY(-200%);
}

.h2m-skip-link:focus,
.h2m-skip-link:focus-visible {
	transform: none;
	color: var(--text-on-dark);
	outline: 2px solid var(--otw-blue-light);
	outline-offset: 2px;
}

.h2m-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media (max-width: 1199px) {
	h1 {
		font-size: var(--text-h1-size-md);
	}

	h3 {
		font-size: var(--text-h3-size-md);
	}
}

@media (max-width: 767px) {
	h1 {
		font-size: var(--text-h1-size-sm);
		line-height: var(--text-h1-line-sm);
	}

	h3 {
		font-size: var(--text-h3-size-sm);
	}
}

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