/* === NEW: B-28 Баннер «Биржевые виджеты» | И-02 — start === */
/*
 * Компонент — баннер сайта (как B-03 / B-05, C-16): .news-list-img__container > .news-list-img > a.news-list-zag + .news-list-ar.
 * Здесь: фон (ПК / моб), отступ сверху, заголовок по макету, кнопка-стрелка при наведении остаётся зелёной.
 * Фоны: img/bg-widgets.jpg (ПК, 2576×129), img/bg-widgets-mob.jpg (≤800px, 688×444) →
 * залить в /local/templates/butb/img/content/ и поправить пути (относительно этого CSS).
 */
.butb-widgets-banner {
    margin-top: 40px;
}

.butb-widgets-banner__img {
    background-color: #0e0e0e;
    background-image: url("../img/bg-widgets.jpg");
    background-position: center;
    background-repeat: no-repeat;
}

/* override: заголовок по макету — Pragmatica Medium 28/130 %, без разрядки (у баннеров сайта letter-spacing .04em, line-height 1.28571).
   Начертания Medium в шрифтах сайта нет (есть 300 / 400 / 700) — font-weight: 500 отрисуется как Regular; файл Medium — запросить */
.butb-widgets-banner .news-list-zag {
    font-family: "pragmatica", Arial, sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 1.3;
    letter-spacing: 0;
}

/* override: при наведении кнопка-стрелка остаётся зелёной (штатная полупрозрачная белая сливается с тёмным фоном) */
.butb-widgets-banner .news-list-zag:hover .news-list-ar {
    background-color: #4daa59;
}

.butb-widgets-banner .news-list-zag:hover .news-list-ar .icon {
    fill: #fff;
}

@media screen and (max-width: 800px) {
    .butb-widgets-banner {
        margin-top: 30px;
    }

    .butb-widgets-banner__img {
        background-image: url("../img/bg-widgets-mob.jpg");
        background-position: center bottom;
    }

    /* override: по макету «моб» — заголовок в одну строку, стрелка под ним справа */
    .butb-widgets-banner .news-list-zag {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: stretch;
        -webkit-align-items: stretch;
        -ms-flex-align: stretch;
        align-items: stretch;
        gap: 0;
    }

    .butb-widgets-banner .news-list-ar {
        -webkit-align-self: flex-end;
        -ms-flex-item-align: end;
        align-self: flex-end;
    }
}
/* === NEW: B-28 Баннер «Биржевые виджеты» | И-02 — end === */

/* === NEW: B-29 Общая структура участников | И-02 v2 — start === */
/*
 * Плитки — C-38 KPI-плитка (И-04, butb-dashboard.css) в горизонтальном варианте `kpi-tile--row`:
 * иконка слева, число и подпись по центру, бейдж справа. Вид — по макету «Виджеты» (фон #f9f9f9, рамка #dbdbdb, бейдж C-39),
 * раскладка — по скриншоту (решение пользователя 09.11.2026).
 * Классы C-38 / C-39 повторены здесь в области `.main-participants`: файлы И-04 на главную не подключаются,
 * при слиянии CSS в один файл правила не пересекаются со страницей виджетов.
 */
.main-participants {
    margin-top: 40px;
    color: #202020;
}

.main-participants__title {
    margin: 0 0 20px;
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    color: #202020;
}

.main-participants .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-participants .kpi-grid > li {
    margin: 0;
}

.main-participants .kpi-grid > li::before {
    content: none;
}

/* C-38 KPI-плитка, вариант --row (горизонтальный) */
.main-participants .kpi-tile {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    min-height: 90px;
    padding: 16px;
    background: #f9f9f9;
    border: 1px solid #dbdbdb;
}

.main-participants .kpi-tile__icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #4daa59;
}

.main-participants .kpi-tile__icon img {
    display: block;
    max-width: 100%;
    height: auto;
}

.main-participants .kpi-tile__value {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -.6px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.main-participants .kpi-tile__label {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 14px;
    line-height: 20px;
    color: #939393;
    text-align: center;
}

.main-participants .kpi-tile__badge {
    grid-column: 3;
    grid-row: 1 / span 2;
}

/* C-39 Бейдж прироста, вариант --square: квадрат размером с иконку. > 0 ▲, < 0 --down ▼; 0 / пусто — не выводится (сервером) */
.main-participants .kpi-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 65px;              /* общая ширина под трёхзначный прирост (решение пользователя 26.11.2026) */
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 16px;
    line-height: 16px;
    font-weight: 700;
    color: #23b236;
    white-space: nowrap;
    cursor: default;
    outline: none;
}

.main-participants .kpi-badge:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4daa59;
}

.main-participants .kpi-badge--down {
    border: 0;
    background: transparent;
    color: #f00;
}

/* число прироста и «%» — один неразрывный блок: в узком бейдже (число над стрелкой) не переносятся */
.main-participants .kpi-badge__value {
    white-space: nowrap;
}

/* знак «%» прилегает к числу прироста, без пробела; на 2px меньше цифр бейджа */
.main-participants .kpi-badge__unit {
    margin-left: 0;
    font-size: calc(1em - 2px);
    font-weight: inherit;
}

.main-participants__sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Подсказка бейджа — C-42 (И-04): белая, 12/16 700, тень, носик 5px; справа от бейджа, у правого края — слева.
   Показ: наведение, фокус с клавиатуры, касание (бейдж фокусируемый, tabindex="0") */
.main-participants__tip {
    position: absolute;
    left: 100%;
    top: 50%;
    z-index: 5;
    width: max-content;
    max-width: 190px;
    margin-left: 9px;
    padding: 5px 7px;
    background: #fff;
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    color: #202020;
    white-space: normal;
    text-align: left;
    box-shadow: 0 4px 16px -4px rgba(13, 21, 40, .08);
    filter: drop-shadow(0 1px 2px rgba(13, 21, 40, .04)) drop-shadow(0 2px 8px rgba(13, 21, 40, .1));
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, visibility .15s;
}

.main-participants__tip::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    margin-top: -5px;
    border-style: solid;
    border-width: 5px 5px 5px 0;
    border-color: transparent #fff transparent transparent;
}

.main-participants .kpi-badge:hover .main-participants__tip,
.main-participants .kpi-badge:focus .main-participants__tip {
    opacity: 1;
    visibility: visible;
}

/* правый столбец сетки — подсказка слева от бейджа (зеркально) */
.main-participants .kpi-grid > li:nth-child(4n) .main-participants__tip {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 9px;
}

.main-participants .kpi-grid > li:nth-child(4n) .main-participants__tip::before {
    left: auto;
    right: -5px;
    border-width: 5px 0 5px 5px;
    border-color: transparent transparent transparent #fff;
}

/* 1220–991: плитки уже — подпись и число мельче (промежуточная ширина без макета, peredacha §3) */
@media screen and (max-width: 1220px) {
    .main-participants .kpi-grid {
        gap: 12px;
    }

    .main-participants .kpi-tile {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        column-gap: 8px;
        padding: 12px;
    }

    .main-participants .kpi-tile__icon {
        width: 44px;
        height: 44px;
    }

    .main-participants .kpi-tile__icon img {
        width: 34px;
    }

    .main-participants .kpi-badge {
        width: 44px;
        height: 44px;
        flex-direction: column;   /* число над стрелкой — помещается и трёхзначный прирост */
        gap: 0;
    }
}

/* ≤990: 2 × 2 (по макету «моб»), плитка горизонтальная */
@media screen and (max-width: 990px) {
    .main-participants .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-participants .kpi-grid > li:nth-child(4n) .main-participants__tip {
        left: auto;
        right: auto;
    }

    .main-participants .kpi-grid > li:nth-child(2n) .main-participants__tip {
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: 9px;
    }

    .main-participants .kpi-grid > li:nth-child(2n) .main-participants__tip::before {
        left: auto;
        right: -5px;
        border-width: 5px 0 5px 5px;
        border-color: transparent transparent transparent #fff;
    }

    .main-participants .kpi-grid > li:nth-child(2n+1) .main-participants__tip {
        left: 100%;
        right: auto;
        margin-left: 9px;
        margin-right: 0;
    }

    .main-participants .kpi-grid > li:nth-child(2n+1) .main-participants__tip::before {
        left: -5px;
        right: auto;
        border-width: 5px 5px 5px 0;
        border-color: transparent #fff transparent transparent;
    }
}

/* ≤600: моб — раскладка как на ПК (иконка | число и подпись | бейдж), 2 плитки в ряд (решение пользователя 09.11.2026);
   иконка и бейдж 32px (≤374 — 30px), отступы от текста уменьшены. Подсказка — под плиткой на её ширину (сбоку не помещается) */
@media screen and (max-width: 600px) {
    .main-participants {
        margin-top: 30px;
    }

    .main-participants__title {
        margin-bottom: 14px;
        font-size: 18px;
        line-height: 24px;
    }

    .main-participants .kpi-grid {
        gap: 10px;
    }

    .main-participants .kpi-tile {
        grid-template-columns: 32px minmax(0, 1fr) 40px;
        column-gap: 2px;
        min-height: 0;
        padding: 6px;
    }

    .main-participants .kpi-tile__icon {
        width: 32px;
        height: 32px;
    }

    .main-participants .kpi-tile__icon img {
        width: 24px;
    }

    .main-participants .kpi-tile__value {
        font-size: 18px;
        line-height: 22px;
        letter-spacing: -.4px;
    }

    .main-participants .kpi-tile__label {
        font-size: 11px;
        line-height: 14px;
        overflow-wrap: anywhere;
    }

    .main-participants .kpi-badge {
        width: 40px;
        height: 32px;
        flex-direction: column;   /* число над стрелкой — помещается и трёхзначный прирост (+198) */
        gap: 0;
        font-size: 12px;
        line-height: 12px;
        position: static;
    }

    .main-participants .kpi-grid > li .main-participants__tip,
    .main-participants .kpi-grid > li:nth-child(n) .main-participants__tip {
        left: 0;
        right: 0;
        top: calc(100% + 6px);
        width: auto;
        max-width: none;
        margin: 0;
        transform: none;
    }

    .main-participants .kpi-grid > li .main-participants__tip::before,
    .main-participants .kpi-grid > li:nth-child(n) .main-participants__tip::before {
        left: auto;
        right: 17px;
        top: -5px;
        margin-top: 0;
        border-width: 0 5px 5px 5px;
        border-color: transparent transparent #fff transparent;
    }
}

/* ≤374 (320–374): плитка ~145px — иконка 30px, бейдж 40px, подпись 10px, чтобы «Нерезиденты» не переносилось */
@media screen and (max-width: 374px) {
    .main-participants .kpi-tile {
        grid-template-columns: 30px minmax(0, 1fr) 40px;
        column-gap: 2px;
        padding: 5px;
    }

    .main-participants .kpi-tile__icon {
        width: 30px;
        height: 30px;
    }

    .main-participants .kpi-badge {
        width: 40px;
        height: 30px;
    }

    .main-participants .kpi-tile__icon img {
        width: 22px;
    }

    .main-participants .kpi-tile__label {
        font-size: 10px;
    }

    .main-participants .kpi-badge {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-participants__tip {
        transition: none;
    }
}
/* === NEW: B-29 Общая структура участников | И-02 v2 — end === */

/* === NEW: B-30 Группа «Виджеты» (баннер B-28 + «Общая структура участников» B-29) | И-04 — start === */
/* Общий серый фон связывает баннер и плитки в одну группу; баннер — на всю ширину группы, без отступов вокруг;
   отступы по бокам и снизу — только у блока плиток; плитки белые, подпись #404040 (решения пользователя 09.11.2026) */
.main-widgets-group {
    margin-top: 40px;
    padding: 0 0 30px;
    background: #f9f9f9;
}

.main-widgets-group > .butb-widgets-banner {
    margin-top: 0;
}

.main-widgets-group .main-participants {
    margin: 30px 20px 0;
}

.main-widgets-group > .main-participants:first-child {
    margin-top: 30px;
}

/* override B-29: фон плиток — белый (на сером фоне группы), подпись под числом — #404040 */
.main-widgets-group .main-participants .kpi-tile {
    background: #fff;
}

.main-widgets-group .main-participants .kpi-tile__label {
    color: #404040;
}

@media screen and (max-width: 800px) {
    .main-widgets-group {
        margin-top: 30px;
    }
}

@media screen and (max-width: 600px) {
    .main-widgets-group {
        padding-bottom: 20px;
    }

    .main-widgets-group .main-participants,
    .main-widgets-group > .main-participants:first-child {
        margin: 20px 10px 0;
    }
}
/* === NEW: B-30 Группа «Виджеты» | И-04 — end === */
