/* Базовые стили страницы: типографика, фокус, уменьшение анимаций. */

body {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h1 {
  font-size: var(--text-xl);
}

h2 {
  font-size: var(--text-lg);
}

h3 {
  font-size: var(--text-md);
}

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

/* Ссылки цветом текста с подчеркиванием. Bootstrap 5.3 берет цвет из --bs-link-color-rgb,
   поэтому одной --bs-link-color было мало: ссылки оставались синими с контрастом 4.2:1 (найдено axe). */
a {
  color: var(--color-ink);
  text-underline-offset: 0.15em;
}

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

/* У fieldset по умолчанию min-inline-size: min-content: поля внутри не дают ему сжаться
   и страница становится шире телефона (найдено E2E на 320 px в расписании). */
fieldset {
  min-inline-size: 0;
}

input,
select,
textarea {
  min-width: 0;
}

h1,
h2 {
  overflow-wrap: break-word;
  hyphens: auto;
}

.page-narrow {
  max-width: var(--page-narrow);
  margin-inline: auto;
  padding: var(--space-5) var(--space-4);
}

.visually-hidden-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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