/* Site header (layout/site_header.html): a thin utility bar, then the sticky main bar.
   Colours follow the page hero and the side tabs (page-hero.css, page-tabs.css).
   One moving idea: the blue glide line under the menu, which ties the hovered item to its panel. */

:root {
    --sh-blue: #0096db;
    --sh-blue-dark: #0987c2;
    --sh-blue-deep: #075e87;
    --sh-ink: #1e293b;
    --sh-muted: #64748b;
    --sh-line: #e2e8f0;
    --sh-tint: rgba(0, 150, 219, .08);
    --sh-marked: #d92d20;
    --sh-shadow: 0 30px 60px -30px rgba(2, 74, 110, .45);
    --sh-h: 84px;
    --sh-h-compact: 66px;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

.sh input { font-family: inherit; }

.sh a, .sh-util a { text-decoration: none; }
.sh ul, .sh-util ul { list-style: none; margin: 0; padding: 0; }
.sh button { font-family: inherit; line-height: inherit; }

.sh :focus-visible, .sh-util :focus-visible {
    outline: 3px solid var(--sh-blue);
    outline-offset: 2px;
    border-radius: 8px;
}

.sh-chev { flex-shrink: 0; transition: transform 250ms var(--ease-out); }
.sh-item.is-open > [data-sh-toggle] .sh-chev { transform: rotate(180deg); }

/* ---------- Utility bar ---------- */

/* the site's own blue, as in the footer, with scattered white strokes */
.sh-util {
    position: relative;
    z-index: 1031;
    background:
        url("../img/header-lines.595e4e9c7ea2.svg") repeat-x left center / auto 100%,
        linear-gradient(90deg, var(--sh-blue) 0%, var(--sh-blue-dark) 100%);
    color: #fff;
    font-size: 14px;
}

.sh-util__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
}

.sh-util__list { display: flex; align-items: center; gap: 4px; }

.sh-util__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: rgba(255, 255, 255, .88);
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease;
}

.sh-util__link:hover, .sh-item.is-open > .sh-util__link { color: #fff; background: rgba(255, 255, 255, .12); }

.sh-item--drop { position: relative; }

/* grows out of its trigger */
.sh-util__drop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 260px;
    padding: 6px;
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 0 0 1px rgba(2, 74, 110, .07),
        0 2px 4px rgba(2, 74, 110, .05),
        0 16px 32px -12px rgba(2, 74, 110, .22);
    transform-origin: 24px top;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(.96);
    transition: opacity 180ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms;
}

.sh-item--drop.is-open > .sh-util__drop {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 180ms ease, transform 200ms var(--ease-out);
}

.sh-util__drop a {
    display: block;
    padding: 10px 14px;
    border-radius: 10px; /* 16 - 6 */
    color: var(--sh-ink);
    font-size: 14px;
    transition: color 150ms ease, background-color 150ms ease;
}

.sh-util__drop a:hover { background: #f0f7fc; color: var(--sh-blue-dark); }

.sh-util__right { display: flex; align-items: center; gap: 18px; }

.sh-util__phone { color: #fff; font-weight: 600; white-space: nowrap; }
.sh-util__phone i { font-size: 12px; margin-right: 4px; opacity: .8; }

.sh-social { display: flex; gap: 2px; }

.sh-social a {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
    transition: color 150ms ease, background-color 150ms ease;
}

.sh-social a:hover { background: #fff; color: var(--sh-blue-dark); }

/* ---------- Main bar ---------- */

.sh {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--sh-line);
    transition: box-shadow 200ms ease;
}

html.cms-toolbar-expanded .sh { top: 46px; }

.sh.is-compact { box-shadow: 0 8px 24px -14px rgba(2, 74, 110, .4); }

.sh__bar {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--sh-h);
    transition: height 250ms var(--ease-in-out);
}

.sh.is-compact .sh__bar { height: var(--sh-h-compact); }

.sh__logo { flex-shrink: 0; display: block; }

.sh__logo img {
    display: block;
    width: auto;
    height: 54px;
    transform-origin: left center;
    transition: transform 250ms var(--ease-in-out);
}

.sh.is-compact .sh__logo img { transform: scale(.82); }

.sh__nav { display: flex; align-items: center; flex: 1; min-width: 0; }

.sh__menu { display: flex; align-items: center; gap: 2px; margin-left: auto !important; }

.sh-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--sh-ink);
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: color 150ms ease;
}

.sh-link:hover, .sh-item.is-open > .sh-link, .sh-link.is-current { color: var(--sh-blue-dark); }

/* The glide line: one bar that slides to the hovered item and rests on the open or current one.
   Base width 100px, scaled by --gw so only transform moves. */
.sh__glide {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--sh-blue);
    transform-origin: left center;
    transform: translateX(var(--gx, 0)) scaleX(var(--gw, 0));
    opacity: 0;
    pointer-events: none;
    transition: transform 300ms var(--ease-out), opacity 150ms ease;
}

.sh__glide.is-on { opacity: 1; }
.sh__glide.is-jump { transition: opacity 150ms ease; }

.sh__extra { display: flex; align-items: center; gap: 10px; margin-left: 12px; }

.sh__icon-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--sh-line);
    border-radius: 50%;
    background: #fff;
    color: var(--sh-ink);
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}

.sh__icon-btn:hover { border-color: var(--sh-blue); color: var(--sh-blue-dark); }
.sh-item.is-open > .sh__icon-btn { border-color: var(--sh-blue); background: var(--sh-blue); color: #fff; }

.sh .header-nav__lang { margin: 0; }

.sh__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--sh-blue);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 18px -10px rgba(0, 150, 219, .9);
    transition: background-color 150ms ease, box-shadow 200ms ease, transform 160ms var(--ease-out);
}

.sh__cta:hover { background: var(--sh-blue-dark); color: #fff; box-shadow: 0 10px 22px -10px rgba(0, 150, 219, 1); }

.sh__cta i { transition: transform 200ms var(--ease-out); }

.sh__icon-btn:active, .sh__cta:active, .sh__burger:active { transform: scale(.97); }

/* When the menu does not fit (Russian titles are longer), site-header.js adds .is-tight, then .is-tighter:
   the bar tightens step by step; the Cabinet button drops its icon but always keeps its name. */
.sh.is-tight .sh-link { padding: 0 8px; }
.sh.is-tight .sh__logo img { height: 40px; }
.sh.is-tight .sh__extra { gap: 6px; margin-left: 4px; }
.sh.is-tight .sh__cta { padding: 0 14px; }
.sh.is-tight .sh__cta i { display: none; }
.sh.is-tighter .sh-link { padding: 0 6px; font-size: 15px; }
.sh.is-tighter .sh__logo img { height: 36px; }
.sh.is-tighter .sh__bar { gap: 12px; }

/* ---------- Mega panels and the search panel ---------- */
/* The panel floats under the bar as a card, with a notch over its trigger (--cx, set by site-header.js).
   Radii are concentric: card 24, padding 10, so what sits inside takes 14. */

.sh-panel {
    --card-r: 24px;
    --card-pad: 10px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding-top: 14px;
    transform-origin: var(--ox, 50%) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.985);
    transition: opacity 200ms ease, transform 250ms var(--ease-out), visibility 0s linear 250ms;
}

.sh-item.is-open > .sh-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 200ms ease, transform 250ms var(--ease-out);
}

/* moving from one open panel to the next: the frame stays put, only the content changes */
.sh.is-swapping .sh-panel { transition: none; }

.sh-panel__card, .sh-search__form {
    position: relative;
    padding: var(--card-pad);
    border-radius: var(--card-r);
    background: #fff;
    box-shadow:
        0 0 0 1px rgba(2, 74, 110, .07),
        0 2px 4px rgba(2, 74, 110, .05),
        0 16px 32px -12px rgba(2, 74, 110, .22),
        0 48px 96px -32px rgba(2, 74, 110, .32);
}

.sh-panel__card::before, .sh-search__form::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 0;
    width: 12px;
    height: 12px;
    border-radius: 3px 0 0 0;
    background: #fff;
    box-shadow: -1px -1px 0 rgba(2, 74, 110, .07);
    transform: translateX(calc(var(--cx, 50vw) - 6px)) rotate(45deg);
}

/* on a swap the notch slides from the old trigger to the new one */
.sh.is-swapping .sh-panel__card::before { transition: transform 300ms var(--ease-out); }

.sh-panel__card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 8px;
}

/* the section's tile: the page heroes' gradient and motif */
.sh-panel__lead {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 26px 26px 28px;
    overflow: hidden;
    border-radius: calc(var(--card-r) - var(--card-pad));
    color: #fff;
    background:
        radial-gradient(120% 120% at 85% 0%, rgba(255, 255, 255, .2), transparent 55%),
        linear-gradient(135deg, var(--sh-blue) 0%, var(--sh-blue-dark) 45%, var(--sh-blue-deep) 100%);
}

.sh-panel__title {
    position: relative;
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
}

.sh-panel__desc {
    position: relative;
    max-width: 30ch;
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: 14.5px;
    line-height: 1.55;
}

.sh-panel__motif {
    position: absolute;
    right: -40px;
    bottom: -50px;
    width: 190px;
    height: 190px;
    opacity: .6;
    pointer-events: none;
}

.sh-panel__motif .page-hero__orbit { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1.5; stroke-dasharray: 4 8; }
.sh-panel__motif .page-hero__route { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; }
.sh-panel__motif .page-hero__shape { fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .9); stroke-width: 4; stroke-linejoin: round; }
.sh-panel__motif .page-hero__dot { fill: #fff; }

/* the motif's lines draw themselves as the panel opens (pathLength="100" on each) */
.sh-panel__motif .page-hero__line {
    fill: none;
    stroke: rgba(255, 255, 255, .7);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 250ms ease;
}

.sh-item.is-open .sh-panel__motif .page-hero__line {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 700ms var(--ease-out) 120ms;
}

.sh-panel__list {
    columns: 2;
    column-gap: 6px;
    align-self: start;
    max-height: calc(100vh - var(--sh-h) - 48px);
    overflow-y: auto;
    padding: 14px 12px !important;
}

.sh-panel__list.is-long { columns: 3; }

.sh-panel.is-short .sh-panel__card {
    width: 620px;
    max-width: calc(100% - 32px);
    margin-right: 0;
    margin-left: clamp(16px, calc(var(--ox, 50%) - 220px), calc(100% - 636px));
    grid-template-columns: 270px 1fr;
}

.sh-panel.is-short .sh-panel__list { columns: 1; }

.sh-panel__list li {
    break-inside: avoid;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 200ms ease, transform 250ms var(--ease-out);
}

.sh-item.is-open .sh-panel__list li {
    opacity: 1;
    transform: none;
    transition-delay: min(calc(var(--i, 0) * 25ms), 250ms);
}

.sh-panel__link {
    position: relative;
    display: block;
    padding: 11px 14px 11px 20px;
    border-radius: 12px;
    color: var(--sh-ink);
    font-size: 15px;
    line-height: 1.35;
    transition: color 150ms ease, background-color 150ms ease;
}

/* a rail grows on the left of the hovered link */
.sh-panel__link::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--sh-blue);
    transform: scaleY(0);
    transition: transform 200ms var(--ease-out);
}

.sh-panel__link span { display: inline-block; transition: transform 200ms var(--ease-out); }

.sh-panel__link:hover, .sh-panel__link:focus-visible { background: #f0f7fc; color: var(--sh-blue-dark); }
.sh-panel__link:focus-visible::before, .sh-panel__link.is-current::before { transform: scaleY(1); }
.sh-panel__link.is-current { color: var(--sh-blue-dark); font-weight: 600; }

/* the admission cities stand out, as they did in red before */
.sh-panel__link.is-marked { color: var(--sh-marked); font-weight: 600; }
.sh-panel__link.is-marked:hover { background: #fdf1f0; color: var(--sh-marked); }
.sh-panel__link.is-marked::before { background: var(--sh-marked); }

.sh-search__form {
    display: flex;
    gap: 8px;
}

.sh-search__form input {
    flex: 1;
    min-width: 0;
    height: 56px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: calc(var(--card-r) - var(--card-pad));
    background: #f4f8fb;
    font-size: 17px;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.sh-search__form input::placeholder { color: #7a8699; }

.sh-search__form input:focus { outline: none; border-color: var(--sh-blue); background: #fff; }

.sh-search__form button {
    height: 56px;
    padding: 0 30px;
    border: 0;
    border-radius: calc(var(--card-r) - var(--card-pad));
    background: var(--sh-blue);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 150ms ease, transform 160ms var(--ease-out);
}

.sh-search__form button:hover { background: var(--sh-blue-dark); }
.sh-search__form button:active { transform: scale(.97); }

/* dims the page while a panel is open; a click on it closes the panel */
.sh-scrim {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100vh;
    z-index: -1;
    background: rgba(7, 40, 64, .35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 0s linear 250ms;
}

.sh.has-open .sh-scrim { opacity: 1; visibility: visible; transition: opacity 250ms ease; }

/* ---------- Hover motion, only where a real pointer hovers ---------- */

@media (hover: hover) and (pointer: fine) {
    .sh-panel__link:hover::before { transform: scaleY(1); }
    .sh-panel__link:hover span { transform: translateX(4px); }
    .sh__cta:hover i { transform: translateY(-1px) scale(1.1); }
}

/* ---------- Mobile-only parts, hidden on wide screens ---------- */

.sh__msearch, .sh__mutil, .sh__burger { display: none; }

/* ---------- Wide but not widest: tighter menu ---------- */

@media (min-width: 1200px) and (max-width: 1399px) {
    .sh__bar { gap: 16px; }
    .sh__logo img { height: 40px; }
    .sh-link { padding: 0 9px; font-size: 15px; }
    .sh__extra { gap: 8px; margin-left: 6px; }
    .sh__cta { padding: 0 14px; }
    .sh-panel__card { grid-template-columns: 260px 1fr; }
    .sh-panel__motif { right: -34px; bottom: -44px; width: 150px; height: 150px; }
}

/* ---------- Drawer below 1200px ---------- */

@media (max-width: 1199px) {
    :root { --sh-h: 68px; --sh-h-compact: 68px; }

    .sh-util { display: none; }

    .sh__logo img { height: 42px; }
    .sh.is-compact .sh__logo img { transform: none; }
    .sh__glide, .sh-scrim { display: none; }

    .sh__burger {
        display: grid;
        align-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        margin-left: auto;
        padding: 0 11px;
        border: 1px solid var(--sh-line);
        border-radius: 12px;
        background: #fff;
        cursor: pointer;
        transition: background-color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
    }

    .sh__burger span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: var(--sh-ink);
        transition: transform 300ms var(--ease-out), opacity 200ms ease, background-color 200ms ease;
    }

    .sh.is-drawer .sh__burger { background: var(--sh-blue); border-color: var(--sh-blue); }
    .sh.is-drawer .sh__burger span { background: #fff; }
    .sh.is-drawer .sh__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .sh.is-drawer .sh__burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .sh.is-drawer .sh__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* the drawer slides in from the right; its rows follow one after another */
    .sh__nav {
        position: fixed;
        top: var(--sh-h);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px 16px 32px;
        overflow-y: auto;
        background: #fff;
        visibility: hidden;
        transform: translateX(100%);
        transition: transform 400ms var(--ease-drawer), visibility 0s linear 400ms;
    }

    html.cms-toolbar-expanded .sh__nav { top: calc(var(--sh-h) + 46px); }

    .sh.is-drawer .sh__nav {
        visibility: visible;
        transform: none;
        transition: transform 400ms var(--ease-drawer);
    }

    .sh__nav > *, .sh__menu > .sh-item {
        opacity: 0;
        transform: translateX(24px);
        transition: opacity 200ms ease, transform 300ms var(--ease-out);
    }

    .sh.is-drawer .sh__nav > *, .sh.is-drawer .sh__menu > .sh-item {
        opacity: 1;
        transform: none;
        transition-delay: calc(80ms + var(--d, 0) * 40ms);
    }

    .sh__nav > .sh__menu { opacity: 1; transform: none; }

    .sh__msearch {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 48px;
        padding: 0 16px;
        border: 1px solid var(--sh-line);
        border-radius: 12px;
        background: #f4f8fb;
        color: var(--sh-muted);
    }

    .sh__msearch input { flex: 1; min-width: 0; border: 0; background: none; font-size: 16px; outline: none; }

    .sh__menu { flex-direction: column; align-items: stretch; gap: 0; margin-left: 0 !important; }

    .sh__menu > .sh-item { border-bottom: 1px solid var(--sh-line); }

    .sh-link {
        justify-content: space-between;
        width: 100%;
        height: 54px;
        padding: 0 4px;
        font-size: 17px;
    }

    .sh-item.is-open > .sh-link .sh-chev {
        border-radius: 50%;
        background: var(--sh-tint);
    }

    /* accordion: the rows open from 0fr to 1fr, so the height follows the content */
    .sh-panel {
        position: static;
        display: grid;
        grid-template-rows: 0fr;
        padding-top: 0;
        overflow: hidden;
        transform: none;
        transition: grid-template-rows 300ms var(--ease-in-out), opacity 200ms ease, visibility 0s linear 300ms;
    }

    .sh-item.is-open > .sh-panel {
        grid-template-rows: 1fr;
        transition: grid-template-rows 300ms var(--ease-in-out), opacity 200ms ease;
    }

    /* in the drawer the card dissolves: the description leads the list as plain text */
    .sh-panel .sh-panel__card, .sh-panel.is-short .sh-panel__card {
        display: block;
        width: auto;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .sh-panel__card::before, .sh-panel__title, .sh-panel__motif { display: none; }

    .sh-panel__lead {
        min-height: 0;
        padding: 0 4px 10px;
        border-radius: 0;
        background: none;
        color: var(--sh-muted);
    }

    .sh-panel__desc { max-width: none; color: var(--sh-muted); font-size: 14px; }

    .sh-panel .sh-panel__list { columns: 1; max-height: none; overflow: visible; padding: 0 0 14px !important; }
    .sh-panel__link { margin-bottom: 4px; background: #f6f9fc; }

    .sh__extra { flex-wrap: wrap; gap: 12px; margin-left: 0; }
    .sh-item--search { display: none; }
    .sh__cta { flex: 1; justify-content: center; height: 48px; }

    .sh__mutil {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        border-radius: 16px;
        background:
            url("../img/header-lines.595e4e9c7ea2.svg") repeat left top / auto 40px,
            linear-gradient(135deg, var(--sh-blue) 0%, var(--sh-blue-dark) 100%);
        color: #fff;
    }

    .sh__mutil .sh-util__list { flex-wrap: wrap; }
    .sh__mutil .sh-util__drop { position: static; display: none; margin-top: 6px; box-shadow: none; transform: none; }
    .sh__mutil .sh-item--drop.is-open > .sh-util__drop { display: block; }
}

html.sh-locked { overflow: hidden; }

/* the assistant's mascot would cover the drawer's last links */
html.sh-locked #ka { display: none !important; }

/* fewer, gentler: keep the fades, drop the movement */
@media (prefers-reduced-motion: reduce) {
    .sh-panel, .sh-panel__list li, .sh-panel__link span, .sh-util__drop,
    .sh__nav, .sh__nav > *, .sh__menu > .sh-item, .sh__cta i { transform: none !important; }
    .sh__glide { transition: opacity 150ms ease; } /* jumps instead of sliding */
    .sh-panel__motif .page-hero__line { stroke-dashoffset: 0 !important; transition: none !important; }
    .sh.is-swapping .sh-panel__card::before { transition: none; }
}

/* the drawer fades in place of sliding */
@media (prefers-reduced-motion: reduce) and (max-width: 1199px) {
    .sh__nav { opacity: 0; transition: opacity 200ms ease, visibility 0s linear 200ms; }
    .sh.is-drawer .sh__nav { opacity: 1; transition: opacity 200ms ease; }
}
