/* =============================================================
   PIARNYA — Base Styles
   Reset, типографика, контейнер, кнопки, утилиты
   Зависит от: variables.css
   ============================================================= */

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* CLS prevention: хедер position:fixed занимает 112px сверху.
     Резервируем место, чтобы контент не прыгал при загрузке страницы. */
  padding-top: var(--header-total-h);
  overflow-x: hidden;
}

/* ── ТИПОГРАФИКА ────────────────────────────────────────────── */
h1, h2 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  font-weight: 700;
  color: var(--color-text);
}

h3, h4, h5, h6 {
  font-family: var(--font-body);
  line-height: var(--leading-snug);
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  max-width: 70ch; /* читаемость: ~70 символов в строке */
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease);
}

strong { font-weight: 700; }
em     { font-style: italic; }

/* ── МЕДИА ──────────────────────────────────────────────────── */
img, video, svg {
  max-width: 100%;
  display: block;
}

/* ── СПИСКИ ─────────────────────────────────────────────────── */
ul, ol { list-style: none; }

/* ── ФОРМЫ ──────────────────────────────────────────────────── */
button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── КОНТЕЙНЕР ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* ── FOCUS (WCAG 2.1 AA — keyboard navigation) ──────────────── */
:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── КНОПКИ ─────────────────────────────────────────────────── */
/* ui-ux-pro-max: минимальная высота 44px (44pt touch target) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--btn-h);        /* 44px */
  padding: 0 var(--btn-padding-x); /* 0 24px */
  font-family: var(--font-body);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: 1;
  color: var(--btn-color);
  background: var(--btn-bg);
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: var(--btn-transition);
  white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover {
  background: var(--btn-bg-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

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

/* Вторичная кнопка (контур) */
.btn--outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── УТИЛИТЫ ────────────────────────────────────────────────── */
/* Доступный способ скрыть элемент визуально, но оставить для screen reader */
.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;
}

/* Секции страницы */
.section {
  padding: var(--sp-20) 0;
}

.section--sm {
  padding: var(--sp-12) 0;
}

.section--lg {
  padding: var(--sp-24) 0;
}

/* ── BREADCRUMB — используется на всех внутренних страницах ──── */
.svc-breadcrumb ol {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: nowrap;
  overflow: hidden;
  list-style: none;
}

.svc-breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.svc-breadcrumb li:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-breadcrumb a {
  color: var(--color-text-muted);
  transition: color var(--dur-base) var(--ease);
}

.svc-breadcrumb a:hover { color: var(--color-primary); }

.svc-breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

/* ── ШАПКА СЕКЦИИ — используется во всех блоках ─────────────── */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--sp-12);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--sp-3);
  max-width: none;
}

.section-title {
  margin-bottom: var(--sp-4);
  color: var(--color-text);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  max-width: 52ch;
  margin-inline: auto;
}
