/*
 * Header and footer.
 *
 * The first piece of the redesign. Visually identical to what the inherited
 * theme drew — the goal here was to get off the Bootstrap grid and the legacy
 * class names, not to change the design.
 *
 * Because the new markup uses none of the old class names (.nav, .logo, .row,
 * .group, .mobil_nav, .footer_*), the fifty-odd rules legacy.css had for the
 * chrome no longer match anything. The four that hung on the bare `header` and
 * `footer` tags are reproduced here, so this pair keeps its look on the day
 * legacy.css is deleted.
 *
 * Geometry note: the container sizes below are the ones the site actually uses.
 * The bundled Bootstrap is a hand-edited copy — 10px gutters instead of 12 and
 * its own breakpoints (540/730/960/1140/1236) — so the max-widths here are that
 * plus the 20px padding, which keeps the content edges exactly where they were.
 */

/* ============================================================
 * Container
 * ============================================================ */

.ud-container {
    width: 100%;
    max-width: 560px;
    padding: 0 20px;
    margin: 0 auto;
}

@media (max-width: 575.98px) {
    .ud-container {
        max-width: none;
    }
}

@media (min-width: 768px) {
    .ud-container {
        max-width: 750px;
    }
}

@media (min-width: 992px) {
    .ud-container {
        max-width: 980px;
    }
}

@media (min-width: 1200px) {
    .ud-container {
        max-width: 1160px;
    }
}

@media (min-width: 1400px) {
    .ud-container {
        max-width: 1256px;
    }
}

/* ============================================================
 * Header
 * ============================================================ */

/*
 * Sticky, so the menu stays reachable down a long page. `sticky` rather than
 * `fixed`: the header keeps its place in the flow, so nothing below it jumps
 * up by the header's height and no spacer is needed.
 */
.ud-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 20px 0 17px;
    background: #010101;
    font-family: "Google Sans", sans-serif;
}

/*
 * The showcase runs a full-screen scroll of its own, with a progress bar and a
 * caption already sitting at top: 0. A sticky header would land on top of them.
 */
.ud-header--static {
    position: relative;
    z-index: auto;
}

.ud-header--page {
    background: #fff;
}

/*
 * Columns keep the proportions the grid gave them. The -10px on the row
 * against 10px on each cell is what puts the outer edges flush with the
 * container, exactly as before.
 */
.ud-header__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 -10px;
}

.ud-header__cell {
    box-sizing: border-box;
    padding: 0 10px;
}

.ud-header__logo {
    width: 66.6667%;
}

.ud-header__logo a {
    display: inline-block;
}

.ud-header__logo img {
    width: 160px;
}

@media (max-width: 575.98px) {
    .ud-header__logo img {
        width: 120px;
    }
}

.ud-header__nav {
    display: none;
    padding: 0 10px;
}

.ud-header__lang {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 16.6667%;
}

.ud-header__burger-cell {
    order: 2;
    width: 16.6667%;
}

@media (min-width: 768px) {
    .ud-header__logo {
        width: 25%;
    }

    .ud-header__nav {
        display: block;
        width: 58.3333%;
    }

    .ud-header__burger-cell {
        display: none;
    }
}

/* legacy-responsive.css turned the row's right gutter positive below 660 */
@media (max-width: 660px) {
    .ud-header__row {
        margin-right: 10px;
    }
}

/* Separator under the header on inner pages */
.ud-header__rule {
    width: 100%;
    height: 1px;
    margin: 17px 0 0;
    background: #AEAEAE;
}

/* ============================================================
 * Main menu
 * ============================================================ */

.ud-menu {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

.ud-menu__item {
    padding: 0 40px;
}

.ud-menu__item:first-child {
    padding-left: 0;
}

.ud-menu__item:last-child {
    padding-right: 0;
}

@media (max-width: 991.98px) {
    .ud-menu__item {
        padding: 0 25px;
    }
}

.ud-menu__link {
    display: inline-flex;
    position: relative;
    border-radius: 8px;
    color: #fff;
    font-size: 17px;
    line-height: 20px;
    text-decoration: none;
    transition: background-color .3s ease, transform .3s ease;
}

/*
 * Underline growing left to right. currentColor means it follows the link —
 * white over the dark header, black over the white one — with no second rule.
 */
.ud-menu__link::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: -4px;
    left: 0;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease;
}

.ud-menu__link:hover::before,
.ud-menu__link:focus-visible::before {
    transform: scaleX(1);
}

.ud-header--page .ud-menu__link {
    color: #000;
}

.ud-menu__arrow {
    margin: 0 0 0 6px;
    color: currentColor;
}

.ud-menu__sub {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* ============================================================
 * Language switcher
 * ============================================================ */

.ud-lang {
    position: relative;
    padding: 0 23px 0 0;
    color: #FCFCFC;
    font-size: 17px;
    line-height: 20px;
}

@media (max-width: 575.98px) {
    .ud-lang,
    .ud-lang__toggle {
        padding: 0;
    }
}

.ud-header--page .ud-lang {
    color: #000;
}

/* 23px again: legacy.css set it on the block and on the link inside it */
/*
 * display:inline so the button sits on the baseline exactly where the <a> it
 * replaces did — an inline-block would push the text down a couple of pixels.
 */
.ud-lang__toggle {
    display: inline;
    padding: 0 23px 0 0;
    white-space: nowrap;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-transform: uppercase;
    cursor: pointer;
}

/*
 * Drawn as a background rather than an inline <svg> so the metrics match what
 * the Bootstrap dropdown produced: an inline-block box after the text, offset
 * by .255em, which is what put the chevron where it sits today.
 */
.ud-lang__chevron {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0 0 0 .255em;
    vertical-align: middle;
    background: url('data:image/svg+xml,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(%23clip0_3120_6342)"><path d="M8 13L16 5.5L14.4 4L8 10L1.6 4L0 5.5L8 13Z" fill="%232E62FF"/></g><defs><clipPath id="clip0_3120_6342"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>') center no-repeat;
}

.ud-lang__list {
    display: none;
    position: absolute;
    top: 100%;
    right: 23px;
    z-index: 100;
    min-width: 80px;
    padding: 6px 0;
    margin: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    list-style: none;
}

.ud-lang__list--open {
    display: block;
}

.ud-lang__link {
    display: block;
    padding: 4px 16px;
    color: #000;
    font-size: 17px;
    font-weight: 400;
    line-height: 20px;
    text-decoration: none;
    text-transform: capitalize;
}

/* ============================================================
 * Burger and the drawer it opens
 * ============================================================ */

.ud-burger {
    position: absolute;
    top: 28px;
    right: 20px;
    z-index: 999;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.ud-burger__line {
    display: block;
    width: 40px;
    height: 3px;
    background: #FCFCFC;
    transition: transform .3s, opacity .3s;
}

.ud-header--page .ud-burger__line {
    background: #000;
}

.ud-burger__line + .ud-burger__line {
    margin: 5px 0 0;
}

.ud-burger[aria-expanded="true"] .ud-burger__line:nth-child(1) {
    transform: translateY(8px) rotate(135deg);
}

.ud-burger[aria-expanded="true"] .ud-burger__line:nth-child(2) {
    opacity: 0;
}

.ud-burger[aria-expanded="true"] .ud-burger__line:nth-child(3) {
    transform: translateY(-8px) rotate(-135deg);
}

.ud-drawer {
    position: absolute;
    top: 70px;
    left: 0;
    z-index: 99;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    min-height: 450px;
    background: rgba(0, 0, 0, .3);
    transform: translateX(-100%);
    transition: transform 250ms ease-in-out;
}

.ud-drawer--open {
    transform: translateX(0);
}

/*
 * While the drawer is open the page behind it must not scroll. overflow:hidden
 * alone is ignored by iOS Safari, so the body is taken out of flow and held at
 * the offset it was scrolled to; js/ud-header.js puts that offset in `top` and
 * restores the position on close.
 */
.ud-scroll-locked {
    position: fixed;
    left: 0;
    width: 100%;
    overflow: hidden;
}

.ud-drawer__inner {
    min-height: 100%;
    background: #fff;
}

.ud-drawer__menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

.ud-drawer__item {
    display: flex;
    border-top: 1px solid #D0D0D0;
}

.ud-drawer__link {
    width: 100%;
    padding: 16px 10px;
    color: #000;
    font-size: 20px;
    font-weight: 400;
    line-height: 15px;
    text-align: left;
    text-decoration: none;
}

@media (min-width: 768px) {
    .ud-drawer {
        display: none;
    }
}

/* ============================================================
 * Footer
 * ============================================================ */

.ud-footer {
    padding: 60px 0 20px;
    background:
        radial-gradient(circle at -17% 122%, rgba(70, 110, 255, .55) 11%, rgba(70, 110, 255, .25) 28%, transparent 35%),
        radial-gradient(circle at 109% 155%, rgba(0, 180, 190, .75) 17%, rgba(0, 180, 190, .25) 27%, transparent 40%),
        linear-gradient(180deg, #161c55 30%, #161c55 -29%);
    color: #FCFCFC;
    font-family: "Google Sans", sans-serif;
}

/* The second radial sits closer in on narrow screens */
@media (max-width: 767.98px) {
    .ud-footer {
        background:
            radial-gradient(circle at -17% 122%, rgba(70, 110, 255, .55) 11%, rgba(70, 110, 255, .25) 28%, transparent 35%),
            radial-gradient(circle at 95% 125%, rgba(0, 180, 190, .75) 17%, rgba(0, 180, 190, .25) 27%, transparent 40%),
            linear-gradient(180deg, #161c55 30%, #161c55 -29%);
    }
}

.ud-footer__row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.ud-footer__cell {
    box-sizing: border-box;
    width: 100%;
    padding: 0 10px;
}

/* Distance down to the copyright bar, given by the block above it */
.ud-footer__body {
    padding: 0 0 85px;
}

.ud-footer__about {
    display: flex;
    flex-direction: column;
}

/*
 * 60px: legacy.css carried 30 on the block and another 30 on the link inside.
 * The flex belongs on the link, not on the block — that is what makes the 80%
 * below resolve against the column rather than against the image itself.
 */
.ud-footer__logo {
    padding: 0 0 60px;
}

.ud-footer__logo a {
    display: flex;
}

.ud-footer__logo img {
    width: 80%;
}

.ud-footer__info {
    max-width: 282px;
    padding: 0 0 20px;
    font-size: 17px;
    line-height: 150%;
}

.ud-footer__social {
    display: flex;
}

/* 24px comes from legacy-responsive.css, where it sat outside any media query */
.ud-footer__social-item {
    max-width: 24px;
    margin: 0 20px 0 0;
}

/*
 * The icons are SVGs with no intrinsic size, so they fall back to the default
 * 300x150 and are then held by max-width. Same pair of rules Bootstrap's
 * .img-fluid applied in the previous theme, which is what sized them before.
 */
.ud-footer__social-item img {
    max-width: 100%;
    height: auto;
}

.ud-footer__social-item a {
    display: block;
}

.ud-footer__title {
    padding: 0 0 20px;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: .02em;
    line-height: 26px;
}

.ud-footer__list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.ud-footer__list li {
    margin: 0 0 15px;
}

.ud-footer__link {
    display: inline-flex;
    position: relative;
    border-radius: 8px;
    color: #fff;
    font-size: 17px;
    line-height: 20px;
    text-decoration: none;
    transition: background-color .3s ease, transform .3s ease;
}

.ud-footer__link:hover {
    color: #FCFCFC;
    transform: translateY(-2px);
}

.ud-footer__contacts li {
    margin: 0 0 15px;
    font-size: 17px;
    line-height: 150%;
    color: #FCFCFC;
}

.ud-footer__copyright {
    padding: 12px 0 0;
    border-top: 1px solid #AEAEAE;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    color: #FCFCFC;
}

@media (min-width: 768px) {
    .ud-footer__nav,
    .ud-footer__contact {
        width: 33.3333%;
    }
}

@media (min-width: 992px) {
    .ud-footer__about {
        width: 33.3333%;
    }

    .ud-footer__nav--company {
        width: 16.6667%;
    }

    .ud-footer__nav--partners,
    .ud-footer__contact {
        width: 25%;
    }
}

/*
 * Everything below 992 came from legacy-responsive.css, which loaded after the
 * main stylesheet and therefore won over its own narrow-screen rules.
 */
@media (max-width: 991.98px) {
    .ud-footer__body {
        padding: 0 0 20px;
    }

    .ud-footer__logo img {
        width: 60%;
    }

    .ud-footer__info {
        font-size: 14px;
    }

    .ud-footer__nav {
        padding: 0 10px 25px;
    }

    .ud-footer__nav .ud-footer__title {
        font-size: 20px;
    }

    .ud-footer__copyright {
        padding: 16px 0;
        font-size: 13px;
        text-align: center;
    }
}

@media (max-width: 767.98px) {
    .ud-footer__about {
        align-items: center;
        padding: 0 10px 40px;
    }

    .ud-footer__logo a {
        justify-content: center;
    }

    .ud-footer__info {
        text-align: center;
    }

    .ud-footer__nav {
        width: 50%;
        text-align: center;
    }

    .ud-footer__nav .ud-footer__list {
        padding: 0 0 0 27px;
        text-align: left;
    }

    .ud-footer__contact {
        text-align: center;
    }

    .ud-footer__link,
    .ud-footer__contacts li,
    .ud-footer__contacts li a {
        font-size: 15px;
        line-height: 18px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .ud-footer__about {
        padding: 0 10px 50px;
    }

    .ud-footer__info {
        max-width: 360px;
    }
}
