/**
 * CLM Base — reset, base element styles, fluid typography.
 * Mobile-first, 375px baseline. Requires clm-tokens.css to be loaded first.
 */

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

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

body {
	min-height: 100vh;
	font-family: var(--clm-font-body);
	font-size: var(--clm-fs-body);
	line-height: var(--clm-lh-body);
	color: var(--clm-text);
	background: var(--clm-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

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

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

a {
	color: var(--clm-link);
	text-decoration-thickness: from-font;
}

a:visited {
	color: var(--clm-link-visited);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--clm-primary);
	outline-offset: 2px;
}

ul,
ol {
	list-style: none;
	padding: 0;
}

table {
	border-collapse: collapse;
	width: 100%;
}

/* Prevent long words/URLs from breaking mobile layouts. */
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
blockquote {
	overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------
   Fluid typography
--------------------------------------------------------------------- */

h1,
.clm-h1 {
	font-family: var(--clm-font-heading);
	font-size: var(--clm-fs-h1);
	line-height: var(--clm-lh-tight);
	font-weight: 700;
	letter-spacing: -0.01em;
}

h2,
.clm-h2 {
	font-family: var(--clm-font-heading);
	font-size: var(--clm-fs-h2);
	line-height: var(--clm-lh-heading);
	font-weight: 700;
}

h3,
.clm-h3 {
	font-family: var(--clm-font-heading);
	font-size: var(--clm-fs-h3);
	line-height: var(--clm-lh-heading);
	font-weight: 600;
}

h4,
.clm-h4 {
	font-size: var(--clm-fs-h4);
	line-height: var(--clm-lh-heading);
	font-weight: 600;
}

h5,
.clm-h5 {
	font-size: var(--clm-fs-h5);
	line-height: var(--clm-lh-heading);
	font-weight: 600;
}

h6,
.clm-h6 {
	font-size: var(--clm-fs-h6);
	line-height: var(--clm-lh-heading);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

p {
	font-size: var(--clm-fs-body);
	max-width: 70ch;
}

small,
.clm-text-sm {
	font-size: var(--clm-fs-body-sm);
}

.clm-text-caption {
	font-size: var(--clm-fs-caption);
	color: var(--clm-text-muted);
}

.clm-text-lg {
	font-size: var(--clm-fs-body-lg);
}

.clm-text-muted {
	color: var(--clm-text-muted);
}

/* ---------------------------------------------------------------------
   Selection
--------------------------------------------------------------------- */

::selection {
	background: var(--clm-primary);
	color: var(--clm-text-inverse);
}

/* ---------------------------------------------------------------------
   Skip link (accessibility)
--------------------------------------------------------------------- */

.clm-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: var(--clm-z-toast);
	background: var(--clm-primary);
	color: #fff;
	padding: var(--clm-space-3) var(--clm-space-4);
	border-radius: 0 0 var(--clm-radius-sm) 0;
}

.clm-skip-link:focus {
	left: 0;
}
