/* Оформление портала поверх темы Diplodoc.
   Правится то, чего не даёт палитра: фирменная типографика, обвязка сайта
   (шапка и футер) и карточки лендинга.
   Классы платформенные: pc-* — Page Constructor, dc-* и yfm-* — сам портал. */

/* ── Фирменные шрифты ────────────────────────────────────────────────────────
   Правило продукта (frontend/src/index.css): заголовки и кнопки — Unbounded,
   текст и интерфейс — Inter. Файлы раскладывает scripts/sync-brand.mjs,
   подключаются со своего домена: CSP разрешает только font-src 'self'. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/inter-400-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/inter-500-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/inter-600-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/unbounded-600-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/unbounded-600-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/unbounded-700-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/unbounded-700-latin.woff2) format('woff2');
}

:root {
  --vc-font-body: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
  --vc-font-display: 'Unbounded', 'SF Pro Display', 'Inter', sans-serif;
  --vc-header-height: 56px;
}

body,
.dc-root,
.yfm {
  font-family: var(--vc-font-body);
}

/* Diplodoc считает fixed/sticky от своей переменной. Обвязка вне #root,
   поэтому без этого значения mobile drawer открывается под шапкой.
   Режим чтения гасит переменную локально — возвращаем её и там. */
body.g-root,
body.g-root .g-root {
  --dc-header-height: var(--vc-header-height);
}

.dc-doc-page_full-screen {
  --dc-header-height: var(--vc-header-height);
}

/* Заголовки статьи и лендинга — фирменным дисплейным шрифтом. Unbounded
   заметно шире Inter, поэтому межбуквенное сжимаем, иначе строки распирает. */
.yfm h1,
.yfm h2,
.yfm h3,
.pc-header-block__title,
.pc-content__title,
.dc-doc-page__title {
  font-family: var(--vc-font-display);
  letter-spacing: -0.02em;
}

.pc-button,
.g-button {
  font-family: var(--vc-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Обвязка сайта ───────────────────────────────────────────────────────────
   Diplodoc отдаёт только область документации. Шапку и футер добавляет
   _assets/vcpay.js, здесь их оформление. */

.vc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
  height: var(--vc-header-height);
  padding: 0 24px;
  background: var(--g-color-base-background, #fff);
  border-bottom: 1px solid var(--g-color-line-generic, rgba(0, 0, 0, 0.1));
}

.vc-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 9px;
  min-height: 44px;
  text-decoration: none;
}

.vc-header__logo img {
  height: 26px;
  width: 26px;
  display: block;
}

.vc-header__wordmark {
  font-family: var(--vc-font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--g-color-text-primary, #0c0a09);
}

.vc-header__section {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  font-family: var(--vc-font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--g-color-text-primary, #0c0a09);
  padding-left: 16px;
  margin-left: 4px;
  border-left: 1px solid var(--g-color-line-generic, rgba(0, 0, 0, 0.12));
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-header__spacer {
  flex: 1;
  min-width: 0;
}

.vc-header__search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--g-color-text-secondary, #57534e);
  text-decoration: none;
  white-space: nowrap;
}

.vc-header__search:hover {
  color: var(--g-color-text-primary, #0c0a09);
  background: var(--g-color-base-simple-hover, rgba(0, 0, 0, 0.05));
}

.vc-header__search svg {
  flex-shrink: 0;
}

.vc-header__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--g-color-text-secondary, #57534e);
  cursor: pointer;
}

.vc-header__theme:hover {
  color: var(--g-color-text-primary, #0c0a09);
  background: var(--g-color-base-simple-hover, rgba(0, 0, 0, 0.05));
}

.vc-header__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--g-color-text-secondary, #57534e);
  text-decoration: none;
  white-space: nowrap;
}

.vc-header__link:hover {
  color: var(--g-color-text-primary, #0c0a09);
}

.vc-header__cta {
  font-family: var(--vc-font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--g-color-base-brand, #166e3f);
  color: var(--g-color-text-brand-contrast, #fff);
  text-decoration: none;
  white-space: nowrap;
}

.vc-header__cta:hover {
  opacity: 0.9;
}

/* Футер живёт в конце колонки статьи и скроллится вместе с ней: в body его
   класть нельзя — разметка портала выше своего контейнера и наезжает сверху. */
.vc-footer {
  margin-top: 48px;
  padding: 20px 0 40px;
  border-top: 1px solid var(--g-color-line-generic, rgba(0, 0, 0, 0.1));
  font-size: 13px;
  line-height: 1.55;
  color: var(--g-color-text-secondary, #57534e);
}

.vc-footer__text {
  margin: 0 0 8px;
}

.vc-footer__text:last-child {
  margin-bottom: 0;
}

.vc-footer a {
  color: inherit;
}

/* ── Лендинг ─────────────────────────────────────────────────────────────── */

.pc-layout-item {
  padding: 20px 22px;
  border: 1px solid var(--g-color-line-generic, rgba(0, 0, 0, 0.1));
  border-radius: 12px;
  height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pc-layout-item:hover {
  border-color: var(--g-color-line-brand, #166e3f);
  box-shadow: 0 6px 20px rgba(12, 10, 9, 0.08);
  transform: translateY(-2px);
}

.g-root_theme_light {
  color-scheme: light;
}

.g-root_theme_dark {
  color-scheme: dark;
}

.g-root_theme_dark .pc-layout-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.pc-layout-item .pc-content__title {
  font-size: 18px;
  font-weight: 600;
}

/* ── Навигация и статья ──────────────────────────────────────────────────── */

.dc-toc__list-item {
  line-height: 1.45;
}

.dc-toc__list-item .dc-toc-item {
  padding-top: 6px;
  padding-bottom: 6px;
  border-radius: 6px;
}

/* Цветная полоса слева читается быстрее сплошной заливки. */
.yfm .yfm-note {
  border-left: 3px solid currentColor;
  border-radius: 0 8px 8px 0;
}
