/* SRG-оверрайды поверх темы USCBC (app.css). Подключается ПОСЛЕ app.css на каждой странице. */

/* (Откат 2026-06-26: убраны мои правки точечного делителя и ширины контента —
   они ломали пропорции/масштаб публичного сайта относительно эталона USCBC.
   Возвращаемся к идентичной USCBC раскладке; точки и поля разберём заново и точечно.) */

/* === BEGIN safari-font-fix (генерится gen-safari-font-fix.mjs) === */
/* WebKit не берёт var() в shorthand font: — до-задаём семейство longhand'ом (45 правил). */
.card3.-v4 .card3-title { font-family: var(--ff_3) !important; }
.fields1 label:first-child:not([class]) { font-family: var(--ff_2) !important; }
.gforms1 .gfield_label { font-family: var(--ff_1) !important; }
.gforms1 .gfield_description { font-family: var(--ff_1) !important; }
.gforms1 .gfield_checkbox, .gforms1 .ginput_container_radio { font-family: var(--ff_1) !important; }
.nav1-links > li > a { font-family: var(--ff_2) !important; }
[outdated]:before { font-family: var(--ff_2) !important; }
.skips1 li { font-family: var(--ff_2) !important; }
.slot1 { font-family: var(--ff_2) !important; }
.toaster1 p { font-family: var(--ff_2) !important; }
.button1, .tag1, [type="submit"], [type="button"], [type="reset"] { font-family: var(--ff_2) !important; }
.tag1 { font-family: var(--ff_3) !important; }
input, select, textarea { font-family: var(--ff_3) !important; }
html { font-family: var(--ff_1) !important; }
body, h1, h2, h3, h4, h5, h6, blockquote, cite, figcaption, [class*="-t:"] { font-family: var(--ff_1) !important; }
.-t\:1, h1 { font-family: var(--ff_2) !important; }
.-t\:2, h2 { font-family: var(--ff_2) !important; }
.-t\:3, h3 { font-family: var(--ff_2) !important; }
.-t\:4, h4 { font-family: var(--ff_2) !important; }
.-t\:5, h5, th { font-family: var(--ff_2) !important; }
.-t\:6, h6 { font-family: var(--ff_2) !important; }
.-t\:7, blockquote { font-family: var(--ff_1) !important; }
.-t\:8, cite { font-family: var(--ff_3) !important; }
.-t\:9, figcaption { font-family: var(--ff_3) !important; }
.-t\:10 { font-family: var(--ff_1) !important; }
.-t\:11, td { font-family: var(--ff_3) !important; }
.-t\:12 { font-family: var(--ff_3) !important; }
.-t\:13 { font-family: var(--ff_1) !important; }
.-t\:14 { font-family: var(--ff_1) !important; }
.-t\:15 { font-family: var(--ff_1) !important; }
.-t\:16 { font-family: var(--ff_2) !important; }
.-t\:17 { font-family: var(--ff_3) !important; }
.-t\:18 { font-family: var(--ff_1) !important; }
.-t\:19 { font-family: var(--ff_1) !important; }
.-t\:20 { font-family: var(--ff_2) !important; }
.-t\:21 { font-family: var(--ff_2) !important; }
.-t\:22 { font-family: var(--ff_2) !important; }
.-t\:23 { font-family: var(--ff_1) !important; }
.-t\:24 { font-family: var(--ff_3) !important; }
.-t\:25 { font-family: var(--ff_2) !important; }
.-t\:26 { font-family: var(--ff_2) !important; }
.split1 h2 { font-family: var(--ff_1) !important; }
#cc-main .cm.cm--box * { font-family: var(--ff_3) !important; }
#cc-main .cm__btn-group button.cm__btn:first-of-type { font-family: var(--ff_2) !important; }
.wrap1 > .wrap1-inner > .body1 .wp-caption { font-family: var(--ff_2) !important; }
/* === END safari-font-fix === */

/* === BEGIN lang-switcher (одна иконка-дропдаун в правой группе меню; см. lib/locale.ts) === */
[x-cloak] { display: none !important; }
/* li и кнопка ведут себя КАК соседние пункты меню (обычный inline-текст, та же базовая линия) —
   НЕ flex, иначе у inline-flex базовая линия по нижнему краю и «RU» съезжал на ~1px вверх.
   flex:0 0 auto на li (как flex-элементе nav1-side) — чтобы не сжимался (анти-wrap фикс «R/U»). */
.nav1-lang { position: relative; list-style: none; flex: 0 0 auto; white-space: nowrap; }
.nav1-lang .lang1-btn { text-decoration: none; white-space: nowrap; }
/* тема даёт span внутри nav-ссылок display:block + overflow-wrap:break-word → держим в одну строку */
.nav1-lang .lang1-btn > span { white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
/* каретка — inline-block по центру строки рядом с текстом (а не флекс-айтем) */
.nav1-lang .lang1-caret { display: inline-block; vertical-align: middle; margin-left: 0.4em; width: 0; height: 0; border-left: 0.22em solid transparent; border-right: 0.22em solid transparent; border-top: 0.26em solid currentColor; opacity: 0.55; transition: opacity 0.12s ease; }
.nav1-lang .lang1-btn:hover .lang1-caret { opacity: 1; }
/* лёгкая панель: тонкий хайрлайн + чуть заметная тень в тон navy, без серой подложки */
.nav1-lang .lang1-menu { position: absolute; top: calc(100% + 0.5em); right: 0; display: flex; flex-direction: column; background: var(--c_b1, #fff); border: 1px solid var(--c_o3, #E2DED8); box-shadow: 0 4px 16px rgba(0, 34, 67, 0.07); padding: 0.3em 0; z-index: 60; }
.nav1-lang .lang1-menu .lang1-opt { font-family: var(--ff_2); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1; text-align: center; padding: 0.55em 1.2em; color: var(--c_a2, #002243); text-decoration: none; white-space: nowrap; transition: color 0.12s ease; }
.nav1-lang .lang1-menu .lang1-opt:hover,
.nav1-lang .lang1-menu .lang1-opt.-on { color: var(--c_a1, #AF1414); }
/* === END lang-switcher === */

/* === BEGIN per-locale fonts (переопределяем --ff_*; safari-fix-правила читают эти переменные) === */
/* ZH: Noto Sans SC — иначе китайский падает на случайный системный CJK (оба шрифта уже self-hosted). */
html[lang="zh-Hans"] {
  --ff_1: "Noto Sans SC", sans-serif;
  --ff_2: "Noto Sans SC", sans-serif;
  --ff_3: "Noto Sans SC", sans-serif;
}
/* KZ: Montserrat — гарантированно покрывает казахские буквы Ә Ғ Қ Ң Ө Ұ Ү Һ І (cyrillic-ext). */
html[lang="kk"] {
  --ff_1: "Montserrat", sans-serif;
  --ff_2: "Montserrat", sans-serif;
  --ff_3: "Montserrat", sans-serif;
}
/* RU — без изменений (системный кириллический фолбэк). EN — дефолтные parabolica/Libre Caslon. */
/* === END per-locale fonts === */

/* === BEGIN length-clamp (обрезаем заголовки/лиды карточек, чтобы разноязычные тексты не ломали сетку) === */
/* Заголовок карточки: clamp по строкам (число строк = «макс. длина до обрыва» на язык). */
.card3-title,
.card3-title > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
/* Лид/тизер карточки. */
.card3-lead,
.card3-lead p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
/* Пер-языковые правила: китайский плотнее (иероглиф ≈ слово) → заголовок в 2 строки достаточно. */
html[lang="zh-Hans"] .card3-title,
html[lang="zh-Hans"] .card3-title > span {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
/* === END length-clamp === */

/* === Mobile logo fit (≤599px) ===
   На узких экранах полноразмерный логотип (звезда 64px + крупная надпись ~430px)
   не помещается и выталкивает кнопку меню на новую строку, ломая сетку шапки.
   Уменьшаем звезду и текст ТОЛЬКО на телефонах. !important — т.к. инлайн
   <style id="srg-logo-style"> в шаблоне идёт ПОСЛЕ этого файла в <head>.
   Десктоп и планшет (≥600px) не затрагиваются — лого там в исходном размере. */
@media screen and (max-width: 599px) {
  .srg-logo  { gap: 8px !important; transform: none !important; }
  .srg-badge { width: 40px !important; height: 40px !important; }
  .srg-wm    { margin-top: 0 !important; }
  .srg-wm b  { font-size: 13px !important; letter-spacing: .02em !important; white-space: nowrap !important; }
  .srg-rule  { margin: 3px 0 2px !important; }
  .srg-cn i  { font-size: 10px !important; }
}
/* === END mobile logo fit === */

/* === «О нас»: центрирование вступительного текста (миссия) ===
   Scoped на блок aboutMission (есть только на /about) — другие страницы не затронуты. */
[data-srg-block="aboutMission"] .body1 { text-align: center; }
[data-srg-block="aboutMission"] .body1 h2 { text-align: center; }
/* === END about-center === */
