/* =========================================================
   RECORDS MODAL
========================================================= */

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

    inset: 0;

    display: flex;

    width: 100%;
    height: 100%;

    padding: 24px;

    box-sizing: border-box;

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

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    font-family: "Open Sans", Arial, sans-serif;

    transition:
        opacity 0.2s ease,
        visibility 0s linear 0.2s;
}


.records-modal.records-modal--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;

    transition-delay: 0s;
}


/* =========================================================
   OVERLAY — ТОЛЬКО ЗАТЕМНЕНИЕ, БЕЗ BLUR
========================================================= */

.records-modal__overlay,
.record-profile-modal__overlay {
    position: absolute;
    z-index: 1;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.55);

    opacity: 1;

    cursor: pointer;

    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}


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

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

    display: flex;

    width: min(640px, 100%);
    max-width: 640px;

    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);

    margin: 0;
    padding: 0;

    box-sizing: border-box;

    flex-direction: column;

    color: #002347;

    background: #ffffff;

    border: 0;
    border-radius: 0;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.28);

    overflow: hidden;

    opacity: 0;

    transform:
        translateY(12px)
        scale(0.99);

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


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

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


/* =========================================================
   HEADER
========================================================= */

.records-modal__header {
    position: relative;

    flex: 0 0 auto;

    min-height: 134px;

    padding:
        24px
        64px
        24px
        24px;

    box-sizing: border-box;

    color: #ffffff;

    background: #002347;
}


.record-profile-modal__header-top {
    display: block;

    width: 100%;
}


.record-profile-modal__header-top > div {
    width: 100%;
    min-width: 0;
}


.records-modal__label {
    display: none;

    margin: 0;
}


.records-modal__title {
    width: 100%;

    margin: 0;

    color: #ffffff;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 32px;
    font-style: normal;
    font-weight: 500;
    line-height: 130%;
    letter-spacing: 0;

    overflow-wrap: break-word;
}


.records-modal__years {
    display: none;

    margin: 0;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.records-modal__close {
    position: absolute;
    z-index: 10;

    top: 24px;
    right: 24px;

    display: flex;

    width: 24px;
    height: 24px;

    margin: 0;
    padding: 0;

    box-sizing: border-box;

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

    color: #ffffff;

    background: rgba(201, 205, 211, 0.21);

    border: 0;
    border-radius: 4px;

    appearance: none;
    cursor: pointer;

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


.records-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
}


.records-modal__close:active {
    transform: scale(0.94);
}


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


.records-modal__close svg {
    display: block;

    width: 20px;
    height: 20px;

    pointer-events: none;
}


/* =========================================================
   STATUS
========================================================= */

.records-modal__status {
    display: inline-flex;

    width: auto;
    min-width: 0;
    min-height: 32px;

    margin-top: 12px;
    padding: 4px 8px;

    box-sizing: border-box;

    align-items: center;

    gap: 8px;

    background: rgba(245, 245, 245, 0.15);

    border: 1px solid rgba(255, 255, 255, 0.51);
    border-radius: 8px;
}


.record-profile-modal__status-main {
    display: inline-flex;

    align-items: center;

    gap: 6px;
}


.record-profile-modal__status-dot {
    display: block;

    width: 6px;
    height: 6px;

    flex: 0 0 6px;

    background: #3fb07a;

    border-radius: 50%;
}


.records-modal__status-label {
    color: rgba(255, 255, 255, 0.78);

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 24px;
    letter-spacing: -0.08px;
}


.records-modal__status-value {
    color: #ffffff;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: -0.08px;
}


/* =========================================================
   SCROLL AREA
========================================================= */

.record-profile-modal__scroll {
    min-height: 0;

    flex: 1 1 auto;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: #d5d7da transparent;
}


.record-profile-modal__scroll::-webkit-scrollbar {
    width: 16px;
}


.record-profile-modal__scroll::-webkit-scrollbar-track {
    background: transparent;
}


.record-profile-modal__scroll::-webkit-scrollbar-thumb {
    min-height: 100px;

    background: #d5d7da;

    border: 5px solid #ffffff;
    border-radius: 10px;
}


.record-profile-modal__scroll::-webkit-scrollbar-thumb:hover {
    background: #b9bdc3;
}


/* =========================================================
   BODY
========================================================= */

.record-profile-modal__body {
    display: flex;

    width: 100%;

    padding:
        16px
        24px
        24px;

    box-sizing: border-box;

    flex-direction: column;

    gap: 24px;
}


/* =========================================================
   SECTION HEADING
========================================================= */

.record-profile-modal__section-heading {
    display: flex;

    width: 100%;

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

    gap: 24px;
}


.records-modal__section-title,
.record-profile-modal__section-meta {
    margin: 0;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    line-height: 20px;
}


.records-modal__section-title {
    color: #002347;

    font-weight: 300;

    text-transform: uppercase;
}


.record-profile-modal__section-meta {
    color: #62778d;

    font-weight: 300;

    text-align: right;
    white-space: nowrap;
}


/* =========================================================
   HISTORY
========================================================= */

.record-profile-modal__history {
    width: 100%;
}


.records-modal__history {
    display: flex;

    width: 100%;

    margin-top: 16px;

    flex-direction: column;
}


.records-modal__history-item {
    position: relative;

    display: grid;

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

    min-height: 40px;

    column-gap: 8px;

    align-items: start;
}


.records-modal__history-period {
    min-width: 0;

    color: #62778d;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 20px;

    text-align: right;
    white-space: nowrap;
}


.record-profile-timeline__marker {
    position: relative;

    width: 17px;
    min-height: 40px;
}


.record-profile-timeline__marker::before {
    position: absolute;

    top: 10px;
    bottom: -10px;
    left: 8px;

    width: 1px;

    content: "";

    background: #d5d7da;
}


.record-profile-timeline__marker::after {
    position: absolute;

    top: 9px;
    left: 0;

    width: 17px;
    height: 1px;

    content: "";

    background: #d5d7da;
}


.records-modal__history-item:last-child
.record-profile-timeline__marker::before {
    display: none;
}


.records-modal__history-content {
    min-width: 0;
}


.records-modal__history-place {
    display: inline;

    margin: 0;

    color: #002347;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;

    overflow-wrap: anywhere;
}


.records-modal__history-location {
    display: inline;

    margin: 0;

    color: #62778d;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 20px;
}


.records-modal__history-location:not(:empty)::before {
    content: " — ";
}


.records-modal__history-place--event {
    color: #8a6700;
}


/* =========================================================
   MORE INFO
========================================================= */

.record-profile-modal__info {
    width: 100%;

    padding-top: 16px;

    box-sizing: border-box;

    border-top: 1px solid #d5d7da;
}


.record-profile-modal__info-title {
    margin: 0 0 16px;

    color: #002347;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;

    text-transform: uppercase;
}


.records-modal__more-info {
    width: 100%;

    color: #002347;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 140%;
}


.records-modal__more-info p {
    margin: 0;
}


.records-modal__more-info p + p {
    margin-top: 14px;
}


/* =========================================================
   SOURCE
========================================================= */

.record-profile-modal__source {
    display: inline-flex;

    width: fit-content;

    align-items: center;

    gap: 6px;

    color: #62778d;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;

    text-decoration: none;

    transition: color 0.2s ease;
}


.record-profile-modal__source[hidden] {
    display: none;
}


.record-profile-modal__source:hover {
    color: #002347;
}


.record-profile-modal__source:focus-visible {
    outline: 2px solid #8a6700;
    outline-offset: 4px;
}


.record-profile-modal__source svg {
    display: block;

    width: 18px;
    height: 18px;

    flex: 0 0 18px;
}


/* =========================================================
   CTA
========================================================= */

.record-profile-modal__cta {
    display: flex;

    width: 100%;
    min-height: 118px;

    padding: 20px;

    box-sizing: border-box;

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

    gap: 32px;

    background: #f5f5f5;

    border: 1px solid #d5d7da;
}


.record-profile-modal__cta-content {
    width: 100%;
    max-width: 357px;

    min-width: 0;
}


.record-profile-modal__cta-title {
    margin: 0 0 16px;

    color: #002347;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 17px;
    font-style: normal;
    font-weight: 500;
    line-height: 130%;
}


.record-profile-modal__cta-text {
    margin: 0;

    color: #002347;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 300;
    line-height: 140%;
}


.record-profile-modal__cta-button {
    display: inline-flex;

    width: 142px;
    min-width: 142px;
    min-height: 52px;

    padding: 14px 23px;

    box-sizing: border-box;

    flex: 0 0 142px;

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

    color: #000000;

    background: #e8ae00;

    border: 0;
    border-radius: 4px;

    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: 24px;

    text-align: center;
    text-decoration: none;

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


.record-profile-modal__cta-button:hover {
    color: #000000;

    background: #f1b700;
}


.record-profile-modal__cta-button:active {
    transform: translateY(1px);
}


.record-profile-modal__cta-button:focus-visible {
    outline: 3px solid rgba(232, 174, 0, 0.4);
    outline-offset: 3px;
}


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

html.records-modal-open,
body.records-modal-open {
    overscroll-behavior: none;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 700px) {

    .records-modal {
        padding: 16px;
    }


    .records-modal__dialog {
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
    }


    .records-modal__header {
        padding:
            22px
            62px
            22px
            22px;
    }


    .records-modal__close {
        top: 22px;
        right: 22px;
    }


    .record-profile-modal__body {
        padding:
            16px
            22px
            22px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .records-modal {
        padding: 0;

        align-items: stretch;
    }


    .records-modal__dialog {
        width: 100%;
        max-width: none;

        height: 100vh;
        height: 100dvh;

        max-height: 100vh;
        max-height: 100dvh;

        box-shadow: none;
    }


    .records-modal__header {
        min-height: 120px;

        padding:
            20px
            56px
            20px
            16px;
    }


    .records-modal__close {
        top: 20px;
        right: 16px;
    }


    .records-modal__title {
        font-size: 26px;
        line-height: 130%;
    }


    .record-profile-modal__scroll::-webkit-scrollbar {
        width: 8px;
    }


    .record-profile-modal__scroll::-webkit-scrollbar-thumb {
        border-width: 2px;
    }


    .record-profile-modal__body {
        padding: 16px;

        gap: 24px;
    }


    .record-profile-modal__section-heading {
        gap: 12px;
    }


    .records-modal__section-title,
    .record-profile-modal__section-meta {
        font-size: 12px;
    }


    .records-modal__history-item {
        display: flex;

        min-height: auto;

        margin-bottom: 12px;
        padding-bottom: 12px;

        flex-direction: column;

        gap: 5px;

        border-bottom: 1px solid #d5d7da;
    }


    .records-modal__history-item:last-child {
        margin-bottom: 0;

        border-bottom: 0;
    }


    .records-modal__history-period {
        width: 100%;

        text-align: left;
    }


    .record-profile-timeline__marker {
        display: none;
    }


    .records-modal__history-content {
        width: 100%;
    }


    .record-profile-modal__cta {
        min-height: 0;

        flex-direction: column;

        align-items: stretch;

        gap: 20px;
    }


    .record-profile-modal__cta-content {
        max-width: none;
    }


    .record-profile-modal__cta-button {
        width: 100%;
        min-width: 0;

        flex-basis: auto;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .records-modal__title {
        font-size: 24px;
    }


    .record-profile-modal__section-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 2px;
    }


    .record-profile-modal__section-meta {
        text-align: left;
        white-space: normal;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .records-modal,
    .records-modal__dialog,
    .records-modal__close,
    .record-profile-modal__cta-button {
        transition: none !important;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .records-modal {
        padding: 0;

        align-items: stretch;
        justify-content: stretch;

        background: #ffffff;
    }


    .records-modal__overlay,
    .record-profile-modal__overlay {
        display: none;
    }


    .records-modal__dialog {
        width: 100%;
        max-width: none;

        height: 100vh;
        height: 100dvh;

        max-height: 100vh;
        max-height: 100dvh;

        margin: 0;

        border-radius: 0;
        box-shadow: none;

        transform: translateX(20px);
    }


    .records-modal.records-modal--open
    .records-modal__dialog {
        transform: translateX(0);
    }


    /* =====================================================
       MOBILE HEADER
    ===================================================== */

    .records-modal__header {
        min-height: 120px;

        padding:
            20px
            56px
            20px
            16px;

        background: #002347;
    }


    .record-profile-modal__header-top {
        width: 100%;
    }


    .record-profile-modal__header-top > div {
        width: 100%;
    }


    .records-modal__title {
        max-width: 271px;

        font-size: 28px;
        font-weight: 500;
        line-height: 130%;

        overflow-wrap: anywhere;
    }


    .records-modal__close {
        top: 20px;
        right: 16px;

        width: 24px;
        height: 24px;
    }


    .records-modal__close svg {
        width: 20px;
        height: 20px;
    }


    .records-modal__status {
        min-height: 32px;

        margin-top: 12px;
        padding: 4px 8px;

        gap: 8px;

        border-radius: 8px;
    }


    .record-profile-modal__status-main {
        gap: 6px;
    }


    .records-modal__status-label,
    .records-modal__status-value {
        font-size: 14px;
        line-height: 24px;
    }


    /* =====================================================
       MOBILE SCROLL
    ===================================================== */

    .record-profile-modal__scroll {
        width: 100%;

        flex: 1 1 auto;

        overflow-x: hidden;
        overflow-y: auto;

        scrollbar-width: thin;
        scrollbar-color: #d5d7da transparent;
    }


    .record-profile-modal__scroll::-webkit-scrollbar {
        width: 16px;
    }


    .record-profile-modal__scroll::-webkit-scrollbar-track {
        background: transparent;
    }


    .record-profile-modal__scroll::-webkit-scrollbar-thumb {
        min-height: 100px;

        background: #d5d7da;

        border: 5px solid #ffffff;
        border-radius: 10px;
    }


    /* =====================================================
       MOBILE BODY
    ===================================================== */

    .record-profile-modal__body {
        width: 100%;

        padding:
            16px
            16px
            27px;

        gap: 24px;
    }


    /* =====================================================
       MOBILE SECTION HEADING
    ===================================================== */

    .record-profile-modal__section-heading {
        width: 100%;

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

        gap: 12px;
    }


    .records-modal__section-title,
    .record-profile-modal__section-meta {
        font-size: 12px;
        line-height: 20px;
    }


    .records-modal__section-title {
        font-weight: 300;
    }


    .record-profile-modal__section-meta {
        font-weight: 300;

        text-align: right;
        white-space: nowrap;
    }


    /* =====================================================
       MOBILE HISTORY
    ===================================================== */

    .record-profile-modal__history {
        width: 100%;
    }


    .records-modal__history {
        width: 100%;

        margin-top: 16px;

        gap: 0;
    }


    .record-profile-timeline__decade {
        width: 100%;

        margin:
            4px
            0
            12px;

        color: #cd8f2f;

        font-family: "Open Sans", Arial, sans-serif;
        font-size: 14px;
        font-style: normal;
        font-weight: 500;
        line-height: 20px;
    }


    .record-profile-timeline__decade:first-child {
        margin-top: 0;
    }


    .records-modal__history-item {
        display: flex;

        width: 100%;
        min-height: auto;

        margin: 0 0 12px;
        padding: 0 0 12px;

        box-sizing: border-box;

        flex-direction: column;

        align-items: flex-start;

        gap: 8px;

        border-bottom: 1px solid #d5d7da;
    }


    .records-modal__history-item:last-child {
        margin-bottom: 0;
        padding-bottom: 0;

        border-bottom: 0;
    }


    .records-modal__history-period {
        width: 100%;

        color: #62778d;

        font-size: 14px;
        font-weight: 300;
        line-height: 20px;

        text-align: left;
        white-space: normal;
    }


    .record-profile-timeline__marker {
        display: none;
    }


    .records-modal__history-content {
        display: block;

        width: 100%;
        min-width: 0;
    }


    .records-modal__history-place,
    .records-modal__history-location {
        font-size: 14px;
        line-height: 20px;
    }


    .records-modal__history-place {
        display: inline;

        font-weight: 500;
    }


    .records-modal__history-location {
        display: inline;

        font-weight: 300;
    }


    .records-modal__history-location:not(:empty)::before {
        content: " — ";
    }


    .records-modal__history-place--event {
        color: #8a6700;
    }


    /* =====================================================
       MOBILE MORE INFO
    ===================================================== */

    .record-profile-modal__info {
        width: 100%;

        padding-top: 16px;

        border-top: 1px solid #d5d7da;
    }


    .record-profile-modal__info-title {
        margin-bottom: 16px;

        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
    }


    .records-modal__more-info {
        width: 100%;

        font-size: 14px;
        font-weight: 300;
        line-height: 140%;
    }


    .records-modal__more-info p {
        margin: 0;
    }


    .records-modal__more-info p + p {
        margin-top: 14px;
    }


    /* =====================================================
       MOBILE SOURCE
    ===================================================== */

    .record-profile-modal__source {
        gap: 6px;

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


    .record-profile-modal__source svg {
        width: 18px;
        height: 18px;
    }


    /* =====================================================
       MOBILE CTA
    ===================================================== */

    .record-profile-modal__cta {
        width: 100%;
        min-height: 190px;

        padding: 20px;

        flex-direction: column;

        align-items: stretch;
        justify-content: flex-start;

        gap: 20px;
    }


    .record-profile-modal__cta-content {
        width: 100%;
        max-width: none;
    }


    .record-profile-modal__cta-title {
        margin-bottom: 16px;

        font-size: 17px;
        font-weight: 500;
        line-height: 130%;
    }


    .record-profile-modal__cta-text {
        font-size: 14px;
        font-weight: 300;
        line-height: 140%;
    }


    .record-profile-modal__cta-button {
        width: 100%;
        min-width: 0;
        min-height: 52px;

        flex: 0 0 auto;

        padding: 14px 23px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .records-modal__title {
        max-width: calc(100% - 8px);

        font-size: 25px;
    }


    .record-profile-modal__body {
        padding:
            16px
            14px
            24px;
    }


    .record-profile-modal__section-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 2px;
    }


    .record-profile-modal__section-meta {
        text-align: left;
        white-space: normal;
    }
}