/**
 * AtomCAE — универсальный контент-блок (Figma 2174:6344). Светлая секция:
 * фиксированная шапка (eyebrow + H2 + лид) + произвольное тело из визуального
 * редактора (подзаголовки H3, абзацы, галочные списки, изображения). Грузится
 * после layout.css. Десктоп-first. Значения из макета.
 */

/* Квалифицируем голый .content классом .section (у секции он всегда есть) —
   иначе правило пересеклось бы с чужим .content (плагины), ср. .single.section. */
.content.section {
  background: var(--color-surface);
  color: var(--color-dark);
}

.content__inner {
  width: min(1402px, 100% - 2 * 40px);
  margin-inline: auto;
}

/* ===== Шапка ===== */
.content__head {
  display: flex;
  flex-direction: column;
}

.content__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  font-size: var(--font-size-eyebrow);
  line-height: var(--font-size-eyebrow);
  letter-spacing: var(--letter-spacing-tight);
  white-space: nowrap;
}

/* стрелка → горизонтальная (Figma 2174:6349), бренд-синяя, маска + currentColor */
.content__eyebrow-arrow {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  background-color: var(--color-primary);
  -webkit-mask: url("../icons/arrow-down-right.svg") center / contain no-repeat;
  mask: url("../icons/arrow-down-right.svg") center / contain no-repeat;
  transform: rotate(-45deg);
}

.content__eyebrow-text {
  opacity: 0.4;
}

/* eyebrow → H2 = 40 (Figma) */
.content__title {
  margin: 40px 0 0;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-h2);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-heading);
}

/* Перенос строк заголовка БЕЗ <br>: строки-<span> становятся блочными (форс-перенос
   там, где в поле задан \n) ТОЛЬКО на десктопе >1024px. Ниже 1024px — инлайн (текст
   течёт одной фразой и переносится естественно). */
@media (min-width: 1024px) {
  .content__title-line {
    display: block;
  }
}

/* H2 → лид = 22 (Figma) */
.content__lead-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-top: 22px;
}

.content__lead {
  margin: 0;
  flex: 1 1 auto;
  font-size: var(--font-size-nav);
  line-height: var(--line-height-relaxed);
  letter-spacing: var(--letter-spacing-tight);
  opacity: 0.7;
}

/* декоративный «плюс» справа от лида (Figma 2174:6355, #162238 @ 25%) */
.content__plus {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin-top: 4px;
  opacity: 0.25;
  background-color: var(--color-dark);
  -webkit-mask: url("../icons/plus.svg") center / contain no-repeat;
  mask: url("../icons/plus.svg") center / contain no-repeat;
}

/* ===== Тело (WYSIWYG). Шапка → тело = 24 (Figma) ===== */
.content__body {
  margin-top: 24px;
}

.content__body > :first-child {
  margin-top: 0;
}

/* абзацы */
.content__body p {
  margin: 16px 0 0;
  font-size: var(--font-size-nav);
  line-height: var(--line-height-relaxed);
  letter-spacing: var(--letter-spacing-tight);
  opacity: 0.7;
}

/* подзаголовки — отступ сверху 32 (разделение смысловых групп) */
.content__body h2,
.content__body h3,
.content__body h4 {
  margin: 32px 0 0;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-dark);
}

.content__body h2 {
  font-size: 34px;
}

.content__body h3 {
  font-size: var(--font-size-h3); /* 26 */
}

.content__body h4 {
  font-size: 20px;
}

/* заголовок → первый следующий элемент = 16 (Figma) */
.content__body :is(h2, h3, h4) + * {
  margin-top: 16px;
}

/* ===== Списки ===== */
.content__body ul,
.content__body ol {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.content__body li {
  position: relative;
  padding-left: 30px;
  font-size: 17px;
  line-height: 24px;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-dark);
}

.content__body li + li {
  margin-top: 8px;
}

/* маркер маркированного списка — СВЕТЛАЯ скруглённая плашка + СИНЯЯ галочка
   (Figma 2174:6365/6366: бокс 18×18 rgba(22,34,56,.06), радиус 4; галочка 14×14
   done_16 бренд-синим). Совпадает с .services__gost-check. */
.content__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(22, 34, 56, 0.06);
}

.content__body ul li::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 14px;
  height: 14px;
  background-color: var(--color-primary);
  -webkit-mask: url("../icons/check.svg") center / contain no-repeat;
  mask: url("../icons/check.svg") center / contain no-repeat;
}

/* нумерованный список — синие полужирные номера */
.content__body ol {
  counter-reset: content-ol;
}

.content__body ol li::before {
  counter-increment: content-ol;
  content: counter(content-ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-family-display);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
}

/* ===== Изображения ===== */
.content__body img {
  max-width: 100%;
  height: auto;
}

.content__body figure {
  margin: 32px 0 0;
}

.content__body figure img {
  display: block;
}

.content__body figcaption {
  margin-top: 12px;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: var(--letter-spacing-tight);
  opacity: 0.5;
}

/* ссылки / выделение */
.content__body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.content__body strong,
.content__body b {
  font-weight: var(--font-weight-medium);
  opacity: 1;
}

/* ===== Планшет ===== */
@media (max-width: 1100px) {
  .content__title {
    font-size: 40px;
  }
}

/* ===== Смартфон ===== */
@media (max-width: 640px) {
  .content.section {
    padding-block: 30px;
  }

  .content__inner {
    width: min(1402px, 100% - 2 * 15px);
  }

  .content__eyebrow {
    font-size: 16px;
    line-height: 16px;
  }

  .content__title {
    margin-top: 24px;
    font-size: 28px;
    letter-spacing: -1px;
  }

  .content__lead {
    font-size: 16px;
    line-height: 22px;
  }

  .content__plus {
    display: none;
  }

  .content__body p,
  .content__body li {
    font-size: 16px;
    line-height: 22px;
  }

  .content__body h2 {
    font-size: 26px;
  }

  .content__body h3 {
    font-size: 22px;
  }
}
