/* ============================================================
   base.css — базовая типографика, контейнер, общие элементы.
   Mobile-first: 320–767px — базовые правила,
                 ≥768px — планшет,
                 ≥1025px — десктоп.
   ============================================================ */

/* ---------- Document ---------- */
html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  color: var(--color-text-main);
  background-color: var(--color-bg-site);
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-site);
  color: var(--color-text-main);
}

/* ============================================================
   Типографика — Mobile (320–767px)
   На мобайле H1–H4 используют значения H1, p и small — Light (300).
   ============================================================ */

h1,
h2,
h3,
h4 {
  font-weight: var(--fw-bold);   /* 700 — H1 mobile */
  font-size: 24px;
  line-height: normal;            /* "Auto" из ТЗ */
}

p {
  font-weight: var(--fw-light);  /* 300 на мобайле */
  font-size: 16px;
  line-height: 22px;
}

small,
.text-small {
  font-weight: var(--fw-light);  /* 300 на мобайле */
  font-size: 14px;
  line-height: 20px;
  display: inline-block;
}

/* ---------- Ссылки ---------- */
a {
  color: var(--color-primary);
  transition: color 0.2s ease-out;
}

a:hover,
a:focus-visible {
  color: var(--color-primary-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Кнопки ---------- */
button {
  font-family: inherit;
  font-weight: var(--fw-semibold);
  font-size: 16px;
  line-height: 1.2;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---------- Формы ---------- */
input,
textarea,
select {
  font-family: inherit;
  width: 100%;
  background-color: var(--color-bg-site);
  color: var(--color-text-main);
  border: 1px solid var(--color-bg-elements);
  border-radius: 6px;
  padding: 12px 14px;
  transition: border-color 0.2s ease-out;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-secondary);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--color-text-secondary);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
}

/* ---------- Контейнер ---------- */
.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 13px;            /* mobile (Figma) */
}

/* Сервисная утилита для скрин-ридеров */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Типографика — Tablet (768–1024px)
   ============================================================ */
@media (min-width: 768px) {
  h1 {
    font-weight: var(--fw-bold);    /* 700 */
    font-size: 36px;
    line-height: normal;
  }

  h2 {
    font-weight: var(--fw-semibold); /* 600 */
    font-size: 32px;
    line-height: normal;
  }

  h3 {
    font-weight: var(--fw-semibold); /* 600 */
    font-size: 28px;
    line-height: 32px;
  }

  h4 {
    font-weight: var(--fw-regular); /* 400 */
    font-size: 20px;
    line-height: 32px;
  }

  p {
    font-weight: var(--fw-regular);
    font-size: 18px;
    line-height: 25px;
  }

  small,
  .text-small {
    font-weight: var(--fw-regular);
    font-size: 14px;
    line-height: normal;
  }

  .container {
    padding-inline: 70px;        /* выровнено с шапкой/футером (Figma) */
  }
}

/* ============================================================
   Типографика — Desktop (≥1025px)
   ============================================================ */
@media (min-width: 1025px) {
  h1 {
    font-weight: var(--fw-bold);     /* 700 */
    font-size: 50px;
    line-height: normal;
  }

  h2 {
    font-weight: var(--fw-semibold); /* 600 */
    font-size: 40px;
    line-height: normal;
  }

  h3 {
    font-weight: var(--fw-semibold); /* 600 */
    font-size: 36px;
    line-height: normal;
  }

  h4 {
    font-weight: var(--fw-regular); /* 400 */
    font-size: 24px;
    line-height: 34px;
  }

  p {
    font-weight: var(--fw-regular);
    font-size: 18px;
    line-height: 23px;
  }

  small,
  .text-small {
    font-weight: var(--fw-regular);
    font-size: 16px;
    line-height: 23px;
  }

  .container {
    padding-inline: 100px;       /* выровнено с шапкой/футером (Figma) */
  }
}
