﻿/*
	EUtility design system: base.css
	---------------------------------
	A small reset and the page's basics, read from the --ds-* tokens: body, headings, links, the focus ring,
	text selection, and no motion for people who asked for less (prefers-reduced-motion).
	Never sets the root font size: each app keeps its own (IOU uses 17px), and the rem sizes follow it.
	In a Bootstrap app, Bootstrap loads after this file and bootstrap.css brings its styles back to the tokens.
*/

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

body {
	margin: 0;
	background: var(--ds-bg);
	color: var(--ds-text);
	font-family: var(--ds-font-body);
	font-size: var(--ds-text-base);
	line-height: 1.5;
	/* Checkboxes, radios, range sliders and progress bars in the accent color */
	accent-color: var(--ds-accent);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

h1, h2, h3, h4 {
	margin: 0 0 var(--ds-space-3);
	font-family: var(--ds-font-display);
	font-style: var(--ds-display-style);
	font-weight: var(--ds-display-weight);
	line-height: 1.2;
}

h1 { font-size: var(--ds-text-3xl); }
h2 { font-size: var(--ds-text-2xl); }
h3 { font-size: var(--ds-text-xl); }
h4 { font-size: var(--ds-text-lg); }

p {
	margin: 0 0 var(--ds-space-4);
}

a {
	color: var(--ds-accent-text);
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--ds-text);
}

/* Fields and buttons don't take the page's font by themselves */
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

code,
kbd,
pre,
samp {
	font-family: var(--ds-font-mono);
	font-size: 0.9em;
}

/* Something with the hidden attribute never shows, even when a class gives it a display */
[hidden] {
	display: none !important;
}

/* One focus ring everywhere, only when the keyboard moved focus (not on every click) */
:focus-visible {
	outline: 2px solid var(--ds-accent);
	outline-offset: 2px;
}

::selection {
	background: color-mix(in srgb, var(--ds-accent) 30%, var(--ds-bg));
	color: var(--ds-text);
}

/* Less motion: animations and transitions end at once (their end state still applies) */
@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;
	}
}
