/**
 * LuckyTrials — базовые стили темы
 * Reset, типографика, контейнер, утилиты.
 * Кнопки, карточки, формы, шапка и футер — в отдельных файлах.
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

/* main растягивается, футер всегда внизу */
main { flex: 1 0 auto; }

main#main.site-main{margin: 0;}

img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* ── Типографика ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  color: var(--color-text);
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); font-weight: 700; }
h4 { font-size: var(--fs-base); font-weight: 700; }

p { color: var(--color-text-2); }

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-blue-dark); }

strong, b { font-weight: 700; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-block: var(--sp-5);
}

/* ── Контейнер ── */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px))
                  max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ── Фокус ── */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Тёмные поверхности (шапка, футер, hero, CTA) ──
   Переопределяем переменные текста, поэтому базовые правила p и h1–h4
   сами становятся светлыми, без наращивания специфичности.
   Кнопки (.btn-wh, .btn-pri) внутри тёмных блоков должны задавать
   color явно, иначе a:hover сделает текст белым на белом. */
.site-header, .site-footer, .on-dark {
  --color-text:   var(--on-dark-1);
  --color-text-2: var(--on-dark-2);
}
.site-header a:not(.btn):hover,
.site-footer a:not(.btn):hover,
.on-dark a:not(.btn):hover { color: var(--on-dark-1); }

.site-header :focus-visible,
.site-footer :focus-visible,
.on-dark :focus-visible { outline-color: var(--color-accent); }

.site-header ul, .site-footer ul,
.on-dark ul { list-style: none; padding: 0; }

/* ── Утилиты ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--sp-2); top: -100%;
  z-index: var(--z-modal);
  padding: var(--sp-2) var(--sp-4);
  background: var(--color-white);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--sp-2); }

.text-center { text-align: center; }
.text-muted  { color: var(--color-text-3); }
.nowrap      { white-space: nowrap; }
[hidden]     { display: none !important; }

/* Блокировка скролла при открытом меню/модалке */
.is-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}