/*
 * База: скидання стилів і типографіка за тегами.
 * Заголовки стилізуються ЛИШЕ тегом: усі h2 однакові, усі h3 однакові тощо.
 * Класи на заголовках задають лише позицію/відступи, але не розмір і шрифт.
 */

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

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

body {
  margin: 0;
  background-color: var(--ds-bg);
  color: var(--ds-text);
  font-family: var(--ds-font-body);
  font-size: var(--ds-text-body-size);
  font-weight: var(--ds-text-body-weight);
  line-height: var(--ds-text-body-line);
  letter-spacing: var(--ds-text-body-tracking);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

/* Списки з класом — це елементи інтерфейсу, без маркерів і відступів */
ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: inherit;
}

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

svg {
  flex-shrink: 0;
}

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

address {
  font-style: normal;
}

hr {
  height: 0;
  margin: 0;
  border: 0;
  border-top: var(--ds-border-width) solid var(--ds-border);
}

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

/* ---------- Заголовки ---------- */
h1, h2, h3, h4 {
  font-family: var(--ds-font-heading);
  color: var(--ds-heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  line-height: var(--h1-line);
  letter-spacing: var(--h1-tracking);
}

h2 {
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  line-height: var(--h2-line);
  letter-spacing: var(--h2-tracking);
}

h3 {
  font-size: var(--h3-size);
  font-weight: var(--h3-weight);
  line-height: var(--h3-line);
  letter-spacing: var(--h3-tracking);
}

h4 {
  font-size: var(--h4-size);
  font-weight: var(--h4-weight);
  line-height: var(--h4-line);
  letter-spacing: var(--h4-tracking);
}

@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;
  }
}
