/* ==========================================================
   Rose scoped search
   Организации / Личности / Блог
   ========================================================== */

.privolge-rose-section {
    position: relative;
    z-index: 50;
    width: 100%;
    font-family: inherit;
}

.privolge-rose-section__form {
    width: 100%;
    margin: 0;
    padding: 0;
}


/* Поле повторяет прежний JetSearch */

.privolge-rose-section__input {
    appearance: none;
    -webkit-appearance: none;

    display: block;

    width: 100%;
    min-height: 0;

    margin: 0;
    padding: 14px 20px;

    border: 0 !important;
    border-bottom: 1px solid var(--e-global-color-7af1f09) !important;
    border-radius: 0 !important;

    outline: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    color: inherit !important;

    font: inherit !important;
    font-size: 15px !important;
    line-height: 1.4 !important;

    transition:
        border-color .25s ease;
}

.privolge-rose-section__input::placeholder {
    color: #9b9b9b !important;
    opacity: 1;
}

.privolge-rose-section__input:hover,
.privolge-rose-section__input:focus,
.privolge-rose-section__input:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;

    border-bottom-color:
        var(--e-global-color-nvsecondaryaccent) !important;
}

.privolge-rose-section__input::-webkit-search-decoration,
.privolge-rose-section__input::-webkit-search-cancel-button,
.privolge-rose-section__input::-webkit-search-results-button,
.privolge-rose-section__input::-webkit-search-results-decoration {
    display: none;
}


/* Выпадающая выдача */

.privolge-rose-section__results {
    position: absolute;
    z-index: 1000;

    top: calc(100% + 7px);
    left: 0;

    display: none;

    width: 100%;
    min-width: min(420px, calc(100vw - 24px));
    max-height: min(62vh, 540px);

    overflow-y: auto;
    overscroll-behavior: contain;

    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 8px;

    background: #fff;

    box-shadow:
        0 16px 38px rgba(0, 0, 0, .15);

    color: #111;
    text-align: left;
}

.privolge-rose-section__results.is-open {
    display: block;
}

.privolge-rose-section__status {
    padding: 15px 16px;

    color: #667085;

    font-size: 14px;
    line-height: 1.4;
}


/* Список */

.privolge-rose-section__list {
    margin: 0 !important;
    padding: 6px !important;
    list-style: none !important;
}

.privolge-rose-section__item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.privolge-rose-section__link {
    display: block;

    margin: 0;
    padding: 9px 10px;

    border-radius: 6px;

    color: #111 !important;
    text-decoration: none !important;
}

.privolge-rose-section__link.has-image {
    display: grid;

    grid-template-columns: 68px minmax(0, 1fr);
    gap: 11px;

    align-items: start;
}

.privolge-rose-section__link:hover,
.privolge-rose-section__link:focus,
.privolge-rose-section__link.is-active {
    outline: none;
    background: #f4f6f9;
}


/* Миниатюры */

.privolge-rose-section__media {
    display: block;

    width: 68px;
    height: 51px;

    overflow: hidden;

    border-radius: 5px;
    background: #f2f3f5;
}

.privolge-rose-section__thumb {
    display: block !important;

    width: 68px !important;
    height: 51px !important;

    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: cover;
}


/* Текст результата */

.privolge-rose-section__text {
    display: block;
    min-width: 0;
}

.privolge-rose-section__title {
    display: -webkit-box;

    margin: 0 0 3px;

    overflow: hidden;

    color: #111;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.privolge-rose-section__snippet {
    display: -webkit-box;

    overflow: hidden;

    color: #667085;

    font-size: 13px;
    line-height: 1.4;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.privolge-rose-section__footer {
    padding: 9px 14px 11px;

    border-top: 1px solid #edf0f3;

    color: #7a828e;

    font-size: 12px;
}


/* Mobile */

@media (max-width: 767px) {

    .privolge-rose-section__input {
        padding-right: 12px;
        padding-left: 12px;
    }

    .privolge-rose-section__results {
        width: min(520px, calc(100vw - 24px));
        min-width: 0;
        max-height: 60vh;
    }
}

@media (max-width: 480px) {

    .privolge-rose-section__link.has-image {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 9px;
    }

    .privolge-rose-section__media,
    .privolge-rose-section__thumb {
        width: 58px !important;
        height: 44px !important;
    }
}

/* ==========================================================
   Scoped search pagination
   ========================================================== */

.privolge-rose-section__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.privolge-rose-section__pagination {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.privolge-rose-section__page-number {
    min-width: 38px;

    color: #667085;

    font-size: 12px;
    text-align: center;
}

.privolge-rose-section__page-button {
    appearance: none;

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

    width: 28px;
    height: 28px;

    margin: 0 !important;
    padding: 0 !important;

    border: 1px solid #e1e5ea !important;
    border-radius: 5px !important;

    background: #fff !important;

    color: var(--e-global-color-nvprimaryaccent) !important;

    font-size: 21px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    cursor: pointer;

    transition:
        color .2s ease,
        border-color .2s ease,
        background-color .2s ease;
}

.privolge-rose-section__page-button:hover,
.privolge-rose-section__page-button:focus-visible {
    outline: none !important;

    border-color:
        var(--e-global-color-nvsecondaryaccent) !important;

    background:
        var(--e-global-color-nvsecondaryaccent) !important;

    color: #fff !important;
}

.privolge-rose-section__page-button:disabled {
    opacity: .35;
    cursor: default;
}

.privolge-rose-section__page-button:disabled:hover {
    border-color: #e1e5ea !important;
    background: #fff !important;
    color: var(--e-global-color-nvprimaryaccent) !important;
}

@media (max-width: 480px) {

    .privolge-rose-section__footer {
        gap: 8px;
    }

    .privolge-rose-section__page-button {
        width: 30px;
        height: 30px;
    }
}

/* ==========================================================
   Pagination loading without layout flicker
   ========================================================== */

/*
 * При загрузке следующей страницы
 * весь существующий список остаётся на месте.
 */
.privolge-rose-section__results.is-loading {
    cursor: progress;
}

/*
 * Блокируем только навигацию, пока идёт запрос.
 * Сам список не исчезает и даже не меняет высоту.
 */
.privolge-rose-section__results.is-loading
.privolge-rose-section__page-button {
    pointer-events: none;
    opacity: .4;
}


/* ==========================================================
   Rose: highlight matched query fragments
   ========================================================== */

.privolge-rose-search-highlight {
    padding: 0 .04em;
    border-radius: 2px;

    background: rgba(0, 184, 241, .18);
    background:
        color-mix(
            in srgb,
            var(--e-global-color-nvsecondaryaccent) 20%,
            transparent
        );

    color: inherit;
    font: inherit;
}


/* Комфортная позиция поиска при программной прокрутке */
.privolge-rose-section {
    scroll-margin-top: 96px;
}

/* Rose native morphological highlighting */
.privolge-rose-search-highlight {
    padding: 0 .04em;
    border-radius: 2px;

    background: rgba(0, 184, 241, .18);
    background:
        color-mix(
            in srgb,
            var(--e-global-color-nvsecondaryaccent) 20%,
            transparent
        );

    color: inherit;
    font: inherit;
}
