/* collection/static/collection/css/exhibits.css */


/* =========================================================
   1. ОБЩАЯ СТРАНИЦА КОЛЛЕКЦИИ
   ========================================================= */

.collection-page {
    padding: 28px 0 80px;
}

.collection-page .container {
    width: min(100% - 96px, 1320px);
    margin: 0 auto;
}

.page-title {
    margin: 0 0 18px;
    font-size: 46px;
    line-height: 1.1;
    font-weight: 400;
    color: #0077c8;
}


/* =========================================================
   2. ОСНОВНАЯ РАСКЛАДКА: САЙДБАР + КАРТОЧКИ
   ========================================================= */

.collection-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 38px;
    align-items: start;
}

.collection-sidebar {
    width: 100%;
}

.collection-results {
    min-width: 0;
}


/* =========================================================
   3. СОРТИРОВКА / ФИЛЬТРЫ
   ========================================================= */

/* -------------------------
   3.1 Форма фильтра
   ------------------------- */

.filter-form {
    margin: 0;
}

/* Заголовок "Сортировать" нужен только на мобильной версии */
.mobile-sort-title {
    display: none;
}


/* -------------------------
   3.2 Поисковик
   ------------------------- */

.search-form {
    position: relative;
    margin: 0 0 22px;
}

.search-form input {
    width: 100%;
    height: 30px;
    padding: 0 36px 0 42px;
    border: 1px solid #c8cbd1;
    border-radius: 16px;
    background: #fff;
    color: #111;
    font-size: 13px;
    line-height: 30px;
    outline: none;
}

.search-form input::placeholder {
    color: #b9bcc4;
}

.search-form input:focus {
    border-color: #0077c8;
}


/* Иконка поиска */
.search-icon {
    position: absolute;
    z-index: 2;
    left: 13px;
    top: 50%;
    width: 15px;
    height: 15px;
    padding: 0;
    border: 1.4px solid #b8bbc2;
    border-radius: 50%;
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 8px;
    height: 1.4px;
    background: #b8bbc2;
    transform: rotate(45deg);
    border-radius: 2px;
}


/* Кнопка очистки поиска */
.search-clear {
    position: absolute;
    top: 50%;
    right: 11px;
    z-index: 4;

    width: 20px;
    height: 20px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: transparent;

    color: #aeb3bd;
    font-size: 22px;
    line-height: 1;
    font-family: Arial, sans-serif;

    cursor: pointer;
    transform: translateY(-50%);
}

.search-clear:hover {
    color: #0077c8;
}

.search-clear.is-hidden {
    display: none;
}


/* -------------------------
   3.3 Список категорий
   ------------------------- */

.category-list {
    display: grid;
    gap: 10px;
}

/* Одна строка категории:
   1 колонка — чекбокс,
   2 колонка — название,
   3 колонка — количество.
*/
.category-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    column-gap: 12px;
    min-height: 27px;

    color: #111;
    font-size: 16px;
    line-height: 1.25;

    cursor: pointer;
}

.category-row-link {
    text-decoration: none;
}

/* Настоящий input скрываем, рисуем свой чекбокс */
.category-row input {
    display: none;
}

.category-name {
    min-width: 0;
}

.category-count {
    color: #111;
    white-space: nowrap;
}


/* -------------------------
   3.4 Чекбоксы категорий
   ------------------------- */

/* Общий вид квадратика */
.custom-checkbox,
.fake-checkbox {
    width: 20px;
    height: 20px;

    border: 1.5px solid #b8bbc2;
    border-radius: 5px;
    background: #fff;

    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Галочка внутри квадратика */
.category-row input:checked + .custom-checkbox::after,
.fake-checkbox.checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;

    width: 7px;
    height: 12px;

    border-right: 2px solid #0077c8;
    border-bottom: 2px solid #0077c8;

    transform: rotate(45deg);
}


/* -------------------------
   3.5 Скрытые категории
   ------------------------- */

/* Этот класс ставится категориям после первых 10.
   JS убирает его при нажатии "Показать ещё". */
.category-item-js.is-category-hidden {
    display: none;
}


/* =========================================================
   4. КНОПКИ "ПОКАЗАТЬ ЕЩЁ"
   ========================================================= */

/* Общий стиль для кнопки категорий и кнопки экспонатов */
.show-more-button,
.show-more-exhibits {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    min-width: 185px;
    height: 38px;
    padding: 0 26px;

    border: none;
    border-radius: 20px;
    background: #0077c8;

    color: #fff;
    font-size: 15px;
    line-height: 1;
    font-weight: 400;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
    position: relative;
    box-sizing: border-box;

    transition: background 0.2s ease;
}

.show-more-button:hover,
.show-more-exhibits:hover {
    background: #0067ad;
}

.show-more-button:active,
.show-more-exhibits:active {
    background: #005c9b;
}

/* Кнопка "Показать ещё" у категорий */
.show-more-button {
    margin-top: 16px;
}

/* Обёртка кнопки "Показать ещё" у экспонатов */
.pagination-more {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* Стрелка внутри кнопки */
.show-more-arrow {
    display: block;
    width: 9px;
    height: 9px;

    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;

    transform: rotate(45deg);
    margin-top: -4px;

    transition: transform 0.2s ease, margin-top 0.2s ease;
}

/* Когда список категорий открыт — стрелка смотрит вверх */
.category-show-toggle.is-open .show-more-arrow {
    transform: rotate(225deg);
    margin-top: 4px;
}


/* =========================================================
   5. СЕТКА ЭКСПОНАТОВ
   ========================================================= */

.exhibit-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}


/* -------------------------
   5.1 Карточка экспоната
   ------------------------- */

.exhibit-card {
    position: relative;
    display: block;
    height: 146px;
    overflow: hidden;

    border-radius: 7px;
    background: #d9d9d9;

    color: #fff;
    text-decoration: none;
}

.exhibit-card-image {
    position: absolute;
    inset: 0;
}

.exhibit-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Заглушка, если изображения нет */
.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #f2f2f2, #bdbdbd);
}

/* Затемнение снизу карточки */
.exhibit-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.46) 0%,
        rgba(0, 0, 0, 0.18) 45%,
        rgba(0, 0, 0, 0) 78%
    );
}


/* -------------------------
   5.2 Текст на карточке
   ------------------------- */

.exhibit-card-text {
    position: absolute;
    z-index: 2;
    left: 10px;
    right: 10px;
    bottom: 8px;

    color: #fff;
}

.exhibit-card-text h2 {
    margin: 0 0 2px;

    font-size: 17px;
    line-height: 1.05;
    font-weight: 400;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exhibit-card-text p {
    margin: 0;

    font-size: 12px;
    line-height: 1.15;
    font-weight: 400;
    opacity: 0.95;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* -------------------------
   5.3 Пустой результат
   ------------------------- */

.empty-result {
    grid-column: 1 / -1;
    padding: 70px 0;

    text-align: center;
    color: #9b9b9b;
    font-size: 22px;
}


/* =========================================================
   6. ПАГИНАЦИЯ ЭКСПОНАТОВ
   ========================================================= */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    margin-top: 52px;
}

.pagination-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.pagination-link,
.pagination-arrow,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 38px;
    height: 38px;
    padding: 0;

    border: none;
    border-radius: 50%;
    background: transparent;

    font-size: 18px;
    line-height: 1;
    text-decoration: none;

    box-sizing: border-box;
}

.pagination-link,
.pagination-arrow {
    color: #0878bd;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.pagination-link:hover,
.pagination-arrow:hover {
    background: rgba(8, 120, 189, 0.1);
}

.pagination-link.is-active {
    background: #0878bd;
    color: #ffffff;

    pointer-events: none;
}

.pagination-arrow {
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
}

.pagination-ellipsis {
    color: #888888;
}
/* =========================================================
   6. АДАПТИВ: ПЛАНШЕТЫ
   ========================================================= */

@media (max-width: 1200px) {
    .collection-layout {
        grid-template-columns: 220px 1fr;
        gap: 28px;
    }

    .exhibit-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .collection-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .exhibit-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .exhibit-card {
        height: 180px;
    }
}


/* =========================================================
   7. АДАПТИВ: МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================= */

@media (max-width: 768px) {

    /* -------------------------
       7.1 Общая страница
       ------------------------- */

    .collection-page {
        padding: 10px 0 64px;
    }

    .collection-page .container {
        width: min(100% - 52px, 650px);
    }

    .page-title {
        margin-bottom: 20px;
        font-size: 42px;
        line-height: 1.05;
    }

    .collection-layout {
        display: block;
    }

    .collection-sidebar {
        margin-bottom: 26px;
    }


    /* -------------------------
       7.2 Мобильный поисковик
       ------------------------- */

    .search-form {
        margin-bottom: 28px;
    }

    .search-form input {
        height: 54px;
        padding-left: 66px;
        padding-right: 52px;

        border-radius: 30px;

        font-size: 22px;
        line-height: 54px;
    }

    .search-icon {
        left: 21px;
        width: 26px;
        height: 26px;
        border-width: 1.7px;
    }

    .search-icon::after {
        right: -9px;
        bottom: -6px;
        width: 14px;
        height: 1.7px;
    }

    .search-clear {
        right: 22px;
        width: 28px;
        height: 28px;
        font-size: 32px;
    }


    /* -------------------------
       7.3 Мобильная сортировка
       ------------------------- */

    .mobile-sort-title {
        display: flex;
        align-items: center;
        gap: 13px;

        margin-bottom: 28px;

        color: #a9adb5;
        font-size: 26px;
        line-height: 1;
    }

    .sort-icon {
        width: 38px;
        height: 38px;

        border: 2px solid #a9adb5;
        border-radius: 5px;

        position: relative;
        flex-shrink: 0;
    }

    .sort-icon::before {
        content: "";
        position: absolute;
        left: 11px;
        top: 8px;

        width: 12px;
        height: 12px;

        border-right: 2px solid #a9adb5;
        border-bottom: 2px solid #a9adb5;

        transform: rotate(45deg);
    }


    /* -------------------------
       7.4 Мобильные категории и чекбоксы
       ------------------------- */

    .category-list {
        gap: 12px;
    }

    .category-row {
        grid-template-columns: 28px 1fr auto;
        align-items: center;
        column-gap: 12px;

        min-height: 34px;

        font-size: 25px;
        line-height: 1.25;
    }

    .custom-checkbox,
    .fake-checkbox {
        width: 24px;
        height: 24px;
        border-radius: 5px;
    }

    .category-row input:checked + .custom-checkbox::after,
    .fake-checkbox.checked::after {
        left: 6px;
        top: 2px;

        width: 8px;
        height: 14px;
    }

    .category-count {
        margin-left: 12px;
    }


    /* -------------------------
       7.5 Мобильные кнопки
       ------------------------- */

    .show-more-button,
    .show-more-exhibits {
        min-width: 240px;
        height: 46px;

        border-radius: 24px;

        font-size: 17px;
    }

    .show-more-button {
        margin-top: 24px;
    }


    /* -------------------------
       7.6 Мобильная сетка экспонатов
       ------------------------- */

    .exhibit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 16px;
        margin-top: 24px;
    }

    .exhibit-card {
        height: auto;
        aspect-ratio: 1.32 / 1;
        border-radius: 9px;
    }

    .exhibit-card-text {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .exhibit-card-text h2 {
        font-size: 22px;
        line-height: 1.05;
        font-weight: 500;
    }

    .exhibit-card-text p {
        font-size: 14px;
        line-height: 1.15;
    }
}
.pagination {
    gap: 4px;
    margin-top: 35px;
}

.pagination-pages {
    gap: 4px;
}

.pagination-link,
.pagination-arrow,
.pagination-ellipsis {
    min-width: 34px;
    height: 34px;
    font-size: 16px;
}

.pagination-arrow {
    font-size: 25px;
}

/* =========================================================
   8. АДАПТИВ: МАЛЕНЬКИЕ ТЕЛЕФОНЫ
   ========================================================= */

@media (max-width: 520px) {

    /* -------------------------
       8.1 Общая страница
       ------------------------- */

    .collection-page .container {
        width: min(100% - 32px, 430px);
    }

    .page-title {
        font-size: 38px;
    }


    /* -------------------------
       8.2 Поисковик
       ------------------------- */

    .search-form input {
        height: 50px;
        padding-left: 58px;
        padding-right: 46px;

        font-size: 19px;
        line-height: 50px;
    }

    .search-icon {
        left: 19px;
        width: 23px;
        height: 23px;
    }

    .search-clear {
        right: 17px;
        width: 26px;
        height: 26px;
        font-size: 28px;
    }


    /* -------------------------
       8.3 Сортировка и категории
       ------------------------- */

    .mobile-sort-title {
        font-size: 23px;
    }

    .sort-icon {
        width: 34px;
        height: 34px;
    }

    .sort-icon::before {
        left: 9px;
        top: 7px;
    }

    .category-row {
        font-size: 22px;
    }


    /* -------------------------
       8.4 Кнопки
       ------------------------- */

    .show-more-button,
    .show-more-exhibits {
        width: 100%;
        min-width: 0;
    }


    /* -------------------------
       8.5 Карточки
       ------------------------- */

    .exhibit-grid {
        gap: 16px 14px;
    }

    .exhibit-card-text h2 {
        font-size: 18px;
    }

    .exhibit-card-text p {
        font-size: 13px;
    }
}

.pagination {
    gap: 4px;
}

.pagination-pages {
    gap: 4px;
}

.pagination-link,
.pagination-arrow {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;

    font-size: 13px;
}

.pagination-arrow {
    font-size: 21px;
}

.pagination-ellipsis {
    min-width: 18px;
    height: 32px;
}