/* Страница иллюстраций. Сетка, группы, поиск и сайдпейдж — общие с UI-иконками
   (client/styles-icons-lists), здесь только то, что отличает иллюстрации. */

:root {
    /* Светлая плитка — нейтральная подложка, чтобы плитки читались и на белой карточке группы.
       --illustration-main и --illustration-dark задаёт страница по выбранному цвету продукта */
    --illustration-light: var(--k-color-shape-faint-neutral-alpha, rgba(0, 0, 0, 0.04));
    scrollbar-gutter: stable;
}

/* --- Панель настроек: выбор цвета продукта --- */

.page-settings-panel__item > .color-input:not(:last-child) {
    margin-right: 8px;
}

.color-input {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.color-input input {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    inset: 0;
    margin: 0;
    border-radius: 50%;
    cursor: pointer;
}

.color-input span {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: box-shadow .15s ease;
}

.color-input:hover input:not(:checked) + span {
    box-shadow: 0 0 0 2px var(--body-background-color, #fff), 0 0 0 4px var(--k-color-line-neutral-pale, rgba(0, 0, 0, 0.16));
}

.color-input input:checked + span {
    box-shadow: 0 0 0 2px var(--body-background-color, #fff), 0 0 0 4px var(--k-color-line-accent-bold, #484848);
}

.color-input input:focus-visible {
    outline: 2px solid var(--k-color-line-accent-bold, #484848);
    outline-offset: 4px;
}

/* --- Сетка иллюстраций --- */

.illustrations-list {
    --illustrations-gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: var(--illustrations-gap);
}

@media screen and (max-width: 767px) {
    .illustrations-list {
        --illustrations-gap: 16px;
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    }
}

/* Рамка фокуса вылетает на половину зазора со всех сторон — у соседних плиток не наезжает.
   Скругление — плитки плюс вылет, чтобы углы шли параллельно */
.illustrations-list .icons-group__icon:focus-visible:before {
    inset: calc(var(--illustrations-gap) / -2);
    border-radius: calc(16px + var(--illustrations-gap) / 2);
}

.illustration__tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    background-color: var(--illustration-light);
    transition: background-color .2s;
}

[data-background="brand"] .illustration__tile {
    background-color: var(--illustration-main);
}

[data-background="dark"] .illustration__tile {
    background-color: var(--illustration-dark);
}

.icons-group__icon.illustration img {
    width: 75%;
    max-width: 96px;
    transition: transform .2s ease-out;
}

/* Ховер — плавное увеличение иллюстрации; общей подложки из icons-group.css нет */
.illustrations-list .icons-group__icon:after {
    content: none;
}

.icons-group__icon.illustration:hover img,
.icons-group__icon.illustration.isActive img {
    transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
    .icons-group__icon.illustration img {
        transition: none;
    }
}

/* --- Сайдпейдж --- */

.sidepage_name[hidden] {
    display: none;
}

.illustration__tile_large {
    width: 100%;
    height: 176px;
    aspect-ratio: auto;
}

.sidepage .illustration__tile_large img {
    display: block;
}

/* «SVG»/«PNG» — серые подписи, ссылки на размеры — чёрные, как на странице логотипов */
.sidepage_format {
    color: var(--k-color-text-neutral-pale, rgba(0, 0, 0, 0.4));
}

.sidepage_container {
    align-items: stretch;
}

.sidepage_note {
    margin: -16px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: var(--k-color-text-neutral-soft, rgba(0, 0, 0, 0.56));
}

/* --- Мобильные: панель настроек не прячем (на странице иконок она скрыта), иначе цвет не выбрать --- */

@media screen and (max-width: 767px) {
    .page-settings-panel {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 24px;
        margin: 16px 0 0;
    }

    .page-settings-panel__item {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    /* Шапка поиска выше, чем на странице иконок, — растёт по содержимому, а не 124px.
       Фон сплошной: у градиента прозрачна нижняя четверть, а там строка «Фон» */
    .sticked-block {
        height: auto !important;
        padding-top: 40px;
        padding-bottom: 16px;
        background: var(--body-background-color);
    }

    /* Сетка и «Ничего не найдено» отбиваются от этой шапки, а не от 124px (170px в _common.css) */
    #icons-block,
    .empty-result {
        margin-top: 264px;
    }
}
