/*
Theme component: shared header
Used on every public page.
*/

:root {
    --sj-global-width: 1180px;
    --sj-global-topline-height: 38px;
    --sj-global-header-height: 78px;
    --sj-global-logo-size: 42px;
    --sj-global-logo-font-size: 23px;
    --sj-global-blue: #2563eb;
    --sj-global-dark: #0f172a;
    --sj-global-text: #334155;
    --sj-global-border: #e2e8f0;
    --sj-global-active: #eff6ff;
}

.sj-global-topline,
.sj-global-header,
.sj-global-topline *,
.sj-global-header * {
    box-sizing: border-box;
}

.sj-global-container {
    width: min(calc(100% - 40px), var(--sj-global-width));
    margin-right: auto;
    margin-left: auto;
}

.sj-global-topline {
    width: 100%;
    min-height: var(--sj-global-topline-height);
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    background: #0f172a;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}

.sj-global-header {
    position: relative;
    z-index: 20;
    width: 100%;
    min-height: var(--sj-global-header-height);
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--sj-global-border);
    background: #ffffff;
}

.sj-global-header-inner {
    min-height: var(--sj-global-header-height);
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) 260px;
    align-items: center;
    gap: 28px;
}

.sj-global-brand {
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    color: var(--sj-global-dark);
    text-decoration: none;
    white-space: nowrap;
}

.sj-global-brand:hover,
.sj-global-brand:focus {
    color: var(--sj-global-dark);
    text-decoration: none;
}

.sj-global-brand .sj-custom-logo,
.sj-global-brand .sj-logo-img,
.sj-global-brand .article-logo,
.sj-global-brand img,
.sj-global-brand svg {
    width: var(--sj-global-logo-size) !important;
    height: var(--sj-global-logo-size) !important;
    min-width: var(--sj-global-logo-size) !important;
    min-height: var(--sj-global-logo-size) !important;
    max-width: var(--sj-global-logo-size) !important;
    max-height: var(--sj-global-logo-size) !important;
    display: block !important;
    flex: 0 0 var(--sj-global-logo-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
    border: 0 !important;
    transform: none !important;
}

.sj-global-brand-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2em;
    margin: 0;
    padding: 0;
    font-family: inherit;
    font-size: var(--sj-global-logo-font-size);
    font-weight: 800;
    font-style: normal;
    line-height: 1;
    letter-spacing: -0.45px;
    white-space: nowrap;
}

.sj-global-brand-system,
.sj-global-brand-journal {
    margin: 0;
    padding: 0;
    font: inherit;
    font-style: normal;
    line-height: inherit;
}

.sj-global-brand-system {
    color: var(--sj-global-dark);
}

.sj-global-brand-journal {
    color: var(--sj-global-blue);
}

.sj-global-nav {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.sj-global-nav ul,
.sj-global-nav .menu {
    min-width: 0;
    display: flex !important;
    flex-flow: row nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.sj-global-nav li {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.sj-global-nav li::before,
.sj-global-nav li::after {
    display: none !important;
    content: none !important;
}

.sj-global-nav a {
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 8px 11px !important;
    border: 0 !important;
    border-radius: 20px !important;
    background: transparent !important;
    color: var(--sj-global-text) !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-style: normal !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

.sj-global-nav a:hover,
.sj-global-nav a:focus,
.sj-global-nav a[aria-current="page"],
.sj-global-nav .current-menu-item > a,
.sj-global-nav .current_page_item > a,
.sj-global-nav .active > a,
.sj-global-nav a.active {
    background: var(--sj-global-active) !important;
    color: var(--sj-global-blue) !important;
    text-decoration: none !important;
}

.sj-global-search {
    width: 260px;
    height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 4px 5px 4px 14px;
    border: 1px solid var(--sj-global-border);
    border-radius: 23px;
    background: #ffffff;
    box-shadow: none;
}

.sj-global-search input[type="search"] {
    width: 100% !important;
    min-width: 0 !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--sj-global-dark) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 32px !important;
    appearance: none !important;
}

.sj-global-search input[type="search"]::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.sj-global-search button {
    min-width: 64px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: var(--sj-global-blue) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    appearance: none !important;
}

.sj-global-search button:hover,
.sj-global-search button:focus {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

.sj-global-screen-reader {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1120px) {
    .sj-global-header-inner {
        grid-template-columns: max-content minmax(0, 1fr);
        row-gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .sj-global-search {
        width: min(100%, 520px);
        grid-column: 1 / -1;
        justify-self: end;
    }

    .sj-global-nav ul,
    .sj-global-nav .menu {
        justify-content: flex-end !important;
    }
}

@media (max-width: 760px) {
    :root {
        --sj-global-logo-size: 40px;
        --sj-global-logo-font-size: 20px;
    }

    .sj-global-container {
        width: min(calc(100% - 28px), var(--sj-global-width));
    }

    .sj-global-topline {
        min-height: 34px;
        font-size: 12px;
    }

    .sj-global-header-inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sj-global-brand {
        justify-self: start;
    }

    .sj-global-nav {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sj-global-nav::-webkit-scrollbar {
        display: none;
    }

    .sj-global-nav ul,
    .sj-global-nav .menu {
        width: max-content;
        justify-content: flex-start !important;
    }

    .sj-global-search {
        width: 100%;
        grid-column: auto;
        justify-self: stretch;
    }
}

/* SJ_HEADER_EXACT_SIZE_BEGIN */

/*
 * Полная изоляция шапки от шрифтов и размеров
 * site-clean.css и assets/style.css.
 */
body .sj-global-topline,
body .sj-global-header,
body .sj-global-topline *,
body .sj-global-header * {
    font-family: "Segoe UI", Arial, sans-serif !important;
    text-size-adjust: 100% !important;
    -webkit-text-size-adjust: 100% !important;
    transform: none !important;
    zoom: 1 !important;
}

/* Точные одинаковые размеры блоков */
body .sj-global-topline {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 34px !important;
}

body .sj-global-header {
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    padding: 0 !important;
}

body .sj-global-container {
    width: 1180px !important;
    max-width: calc(100% - 40px) !important;
    margin-right: auto !important;
    margin-left: auto !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

body .sj-global-header-inner {
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    grid-template-columns: 300px minmax(0, 1fr) 260px !important;
    align-items: center !important;
    gap: 24px !important;
    padding: 0 !important;
}

/* Логотип */
body .sj-global-brand {
    width: 300px !important;
    height: 42px !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .sj-global-brand img,
body .sj-global-brand svg,
body .sj-global-brand .sj-custom-logo,
body .sj-global-brand .sj-logo-img,
body .sj-global-brand .article-logo {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
}

body .sj-global-brand-text {
    gap: 5px !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-size: 23px !important;
    font-weight: 800 !important;
    font-style: normal !important;
    line-height: 23px !important;
    letter-spacing: -0.45px !important;
}

body .sj-global-brand-system,
body .sj-global-brand-journal {
    font: inherit !important;
    font-style: normal !important;
    line-height: inherit !important;
}

/* Меню */
body .sj-global-nav,
body .sj-global-nav ul,
body .sj-global-nav .menu {
    font-family: "Segoe UI", Arial, sans-serif !important;
}

body .sj-global-nav a {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 11px !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 38px !important;
}

/* Поиск */
body .sj-global-search {
    width: 260px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
}

body .sj-global-search input[type="search"] {
    height: 32px !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 32px !important;
}

body .sj-global-search button {
    width: 64px !important;
    min-width: 64px !important;
    height: 32px !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 32px !important;
}

@media (max-width: 1120px) {
    body .sj-global-header {
        height: auto !important;
        min-height: 78px !important;
        max-height: none !important;
    }

    body .sj-global-header-inner {
        height: auto !important;
        min-height: 78px !important;
        max-height: none !important;
        grid-template-columns: 300px minmax(0, 1fr) !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    body .sj-global-search {
        grid-column: 1 / -1 !important;
        width: min(100%, 520px) !important;
    }
}

@media (max-width: 760px) {
    body .sj-global-container {
        max-width: calc(100% - 28px) !important;
    }

    body .sj-global-header-inner {
        grid-template-columns: 1fr !important;
    }

    body .sj-global-brand {
        width: auto !important;
    }

    body .sj-global-brand-text {
        font-size: 20px !important;
        line-height: 20px !important;
    }
}

/* SJ_HEADER_EXACT_SIZE_END */

/* SJ_MOBILE_HEADER_FINAL_BEGIN */

@media (max-width: 760px) {
    :root {
        --sj-header-mobile-side: 16px;
    }

    body .sj-global-topline {
        height: auto !important;
        min-height: 32px !important;
        max-height: none !important;
        padding-top: 7px !important;
        padding-bottom: 7px !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        text-align: center !important;
    }

    body .sj-global-topline .sj-global-container,
    body .sj-global-header .sj-global-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-right:
            max(
                var(--sj-header-mobile-side),
                env(safe-area-inset-right)
            ) !important;
        padding-left:
            max(
                var(--sj-header-mobile-side),
                env(safe-area-inset-left)
            ) !important;
    }

    body .sj-global-header {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    body .sj-global-header-inner {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 11px !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    body .sj-global-brand {
        order: 1 !important;
        width: auto !important;
        height: auto !important;
        align-self: flex-start !important;
        gap: 10px !important;
    }

    body .sj-global-brand img,
    body .sj-global-brand svg,
    body .sj-global-brand .sj-custom-logo,
    body .sj-global-brand .sj-logo-img,
    body .sj-global-brand .article-logo {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        max-width: 38px !important;
        max-height: 38px !important;
        flex-basis: 38px !important;
    }

    body .sj-global-brand-text {
        gap: 4px !important;
        font-size: 20px !important;
        line-height: 20px !important;
        letter-spacing: -0.3px !important;
    }

    body .sj-global-search {
        order: 2 !important;
        width: 100% !important;
        max-width: none !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        grid-column: auto !important;
    }

    body .sj-global-search input[type="search"] {
        height: 34px !important;
        font-size: 16px !important;
        line-height: 34px !important;
    }

    body .sj-global-search button {
        min-width: 72px !important;
        height: 34px !important;
        font-size: 14px !important;
        line-height: 34px !important;
    }

    body .sj-global-nav {
        order: 3 !important;
        width: calc(
            100% + (var(--sj-header-mobile-side) * 2)
        ) !important;
        margin-right:
            calc(var(--sj-header-mobile-side) * -1)
            !important;
        margin-left:
            calc(var(--sj-header-mobile-side) * -1)
            !important;
        padding-right: var(--sj-header-mobile-side) !important;
        padding-left: var(--sj-header-mobile-side) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    body .sj-global-nav::-webkit-scrollbar {
        display: none !important;
    }

    body .sj-global-nav ul,
    body .sj-global-nav .menu {
        width: max-content !important;
        min-width: max-content !important;
        justify-content: flex-start !important;
        gap: 3px !important;
    }

    body .sj-global-nav a {
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 12px !important;
        font-size: 14px !important;
        line-height: 40px !important;
    }
}

@media (max-width: 430px) {
    :root {
        --sj-header-mobile-side: 14px;
    }

    body .sj-global-brand img,
    body .sj-global-brand svg,
    body .sj-global-brand .sj-custom-logo,
    body .sj-global-brand .sj-logo-img,
    body .sj-global-brand .article-logo {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }

    body .sj-global-brand-text {
        font-size: 18px !important;
        line-height: 18px !important;
    }
}

/* SJ_MOBILE_HEADER_FINAL_END */
