/*
	Startovní reset skillu riverlab-web. Malý, záměrně bez zbytečností.
	Každé pravidlo má důvod, ať ho nikdo nemaže "pro úklid".
*/

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

html {
	-webkit-text-size-adjust: 100%;      /* iOS po otočení nezvětšuje text */
	scroll-padding-top: calc(var(--header-h, 4.5rem) + 1rem);   /* kotvy nezajedou pod pevnou hlavičku */
	scrollbar-width: none;               /* posuvník stránky skrytý (rozhodnutí Riverlabu), posouvání funguje dál */
}

html::-webkit-scrollbar {
	display: none;                       /* totéž pro Safari */
}

body {
	margin: 0;
	min-height: 100svh;                  /* svh: stabilní výška i s lištou prohlížeče na telefonu */
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: var(--lh-body);
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
	margin: 0;
	font-family: var(--font-heading);
	line-height: var(--lh-heading);
	text-wrap: balance;                  /* vyvážené řádky nadpisů, bez efektu ve starších prohlížečích */
}

p, ul, ol, dl, figure, blockquote {
	margin: 0;
}

p {
	text-wrap: pretty;                   /* bez sirotků na posledním řádku, kde to prohlížeč umí */
}

p, li, h1, h2, h3, h4, dd {
	overflow-wrap: anywhere;             /* dlouhá česká slova a e-maily nesmí protlačit stránku do šířky */
}

ul[role="list"], ol[role="list"] {
	margin: 0;
	padding: 0;
	list-style: none;
}

img, picture, video, svg {
	display: block;
	max-width: 100%;
	height: auto;                        /* s atributy width a height tím vzniká poměr stran bez poskoku stránky */
}

img {
	font-style: italic;                  /* rozbitý obrázek je aspoň čitelný alt text */
}

a {
	color: var(--color-link);
	text-underline-offset: 0.2em;
}

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

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

input, select, textarea {
	font-size: max(1rem, 16px);          /* pod 16 px iOS při zaostření přiblíží stránku */
}

button {
	cursor: pointer;
}

:focus-visible {
	outline: 3px solid var(--color-focus);
	outline-offset: 3px;                 /* vidět, kde je klávesnice. Nikdy outline: none bez náhrady */
}

[hidden] {
	display: none !important;
}

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