/* =========================
   HIDDEN ELEMENTS
========================= */

.records-card[hidden],
.records-lookup__empty[hidden],
.records-lookup__arrow[hidden] {
    display: none !important;
}


/* =========================
   EMPTY RESULT
========================= */

.records-lookup__empty {
    width: 100%;
    padding: 36px 20px;

    grid-column: 1 / -1;

    color: #0b2f52;

    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    text-align: center;

    background: #ffffff;
    border: 1px solid rgba(11, 47, 82, 0.14);
}


/* =========================
   MODAL BASE
========================= */

.records-modal {
    position: fixed;
    z-index: 999999;

    inset: 0;

    display: none;

    width: 100%;
    height: 100%;

    padding: 24px;

    box-sizing: border-box;

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


/* Очень важно:
   пока класс --open отсутствует,
   модальное окно полностью скрыто.
*/

.records-modal:not(.records-modal--open) {
    display: none !important;
}


.records-modal.records-modal--open {
    display: flex;

    align-items: center;
    justify-content: center;
}


/* =========================
   MODAL OVERLAY
========================= */

.records-modal__overlay {
    position: fixed;
    z-index: 1;

    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(4, 24, 43, 0.72);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    cursor: pointer;
}


/* =========================
   MODAL DIALOG
========================= */

.records-modal__dialog {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 48px);

    margin: auto;
    padding: 50px;

    box-sizing: border-box;

    overflow-y: auto;

    background: #ffffff;

    border-radius: 4px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.22);

    opacity: 0;

    transform: translateY(20px) scale(0.98);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}


.records-modal--open .records-modal__dialog {
    opacity: 1;

    transform: translateY(0) scale(1);
}


/* =========================
   MODAL CLOSE
========================= */

.records-modal__close {
    position: absolute;

    top: 18px;
    right: 18px;

    display: flex;

    width: 42px;
    height: 42px;

    padding: 0;

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

    color: #0b2f52;

    background: #f2f5f7;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

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


.records-modal__close:hover {
    background: #e2e9ee;

    transform: rotate(5deg);
}


.records-modal__close:focus-visible {
    outline: 2px solid #0b2f52;
    outline-offset: 3px;
}


.records-modal__close svg {
    display: block;

    width: 22px;
    height: 22px;
}


/* =========================
   MODAL CONTENT
========================= */

.records-modal__content {
    width: 100%;
}


.records-modal__label {
    margin: 0 0 10px;

    color: #b38b57;

    font-family: "Open Sans", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.records-modal__title {
    margin: 0 50px 8px 0;

    color: #0b2f52;

    font-family: "Open Sans", sans-serif;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.18;
}


.records-modal__years {
    margin: 0 0 32px;

    color: #607284;

    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
}


/* =========================
   MODAL DETAILS
========================= */

.records-modal__details {
    width: 100%;

    margin-bottom: 32px;

    border-top: 1px solid rgba(11, 47, 82, 0.14);
}


.records-modal__row {
    display: grid;

    grid-template-columns: 145px minmax(0, 1fr);

    gap: 20px;

    padding: 16px 0;

    border-bottom: 1px solid rgba(11, 47, 82, 0.14);
}


.records-modal__key {
    color: #0b2f52;

    font-family: "Open Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}


.records-modal__value {
    color: #526678;

    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
}


/* =========================
   MODAL TEXT BLOCKS
========================= */

.records-modal__text-block + .records-modal__text-block {
    margin-top: 28px;
}


.records-modal__subtitle {
    margin: 0 0 10px;

    color: #0b2f52;

    font-family: "Open Sans", sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}


.records-modal__text {
    margin: 0;

    color: #526678;

    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.7;
}


/* =========================
   PAGE SCROLL LOCK
========================= */

html.records-modal-is-open,
body.records-modal-is-open {
    overflow: hidden !important;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 767px) {

    .records-modal {
        padding: 12px;
        align-items: flex-end;
    }


    .records-modal__dialog {
        max-height: calc(100vh - 24px);

        padding: 42px 24px 30px;

        border-radius: 4px 4px 0 0;
    }


    .records-modal__close {
        top: 12px;
        right: 12px;

        width: 38px;
        height: 38px;
    }


    .records-modal__title {
        margin-right: 40px;

        font-size: 25px;
    }


    .records-modal__years {
        margin-bottom: 24px;
    }


    .records-modal__row {
        grid-template-columns: 1fr;

        gap: 5px;
    }
}