/* Base: page, text, links, images, focus and motion preferences */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background-color: var(--color-background);
	color: var(--color-text);
	font-family: var(--font-text);
	font-size: 100%;
	line-height: var(--line-height-text);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* anchors stop below the sticky header */
	scroll-padding-top: calc(var(--size-header) + var(--space-m));
}

body {
	margin: 0;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
	font-size: var(--font-size-text);
}

/* the content takes the free height, so the header is at the top and the footer at the bottom */
body > main {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: var(--line-height-display);
	margin: 0;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

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

img {
	display: block;
	max-width: 100%;
	height: auto;
	/* blurred preview until the image is loaded, see partials/image.html */
	background-image: var(--placeholder);
	background-size: cover;
	background-position: center;
}

figure {
	margin: 0;
}

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

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}
