/*
 * The site's footer (KMK-595, design 1a): templates/kontramarka/footer.tpl.
 *
 * Its own file because the theme stylesheet is a build whose source is not in
 * this repository. Loaded after it, so a rule here wins over the theme's at
 * equal specificity.
 *
 * Two departures from the design's values. For contrast (4.5:1 for text),
 * the field's placeholder was #8a8a8a, 3.4:1 on white, and is the muted grey,
 * 4.6:1. And the design's weight 600 is 500 here: the theme registers Source
 * Sans Pro's Semibold at 500, so 600 would fall through to Bold.
 */

.km-footer {
    --km-blue: #00398c;
    --km-blue-dark: #002a69;
    --km-blue-soft: #c9d6ee;
    --km-yellow: #ffcc00;
    --km-text: #1a1a1a;
    --km-text-2: #4d4d4d;
    --km-muted: #757575;
    --km-icon-grey: #808080;
    --km-line: #ebebeb;
    --km-border: #d9d9d9;
    --km-pad: 56px;
    /* The four groups of links, 1px up from the design's 14px and 16px
       (KMK-595). Nothing else in the footer changes size with them. */
    --km-col-heading: 15px;
    --km-col-link: 17px;
    background: #fff;
    color: var(--km-text);
    font-family: "Source Sans Pro", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
}

.km-footer *,
.km-footer *::before,
.km-footer *::after {
    box-sizing: border-box;
}

.km-footer a {
    color: var(--km-blue);
    text-decoration: none;
}

.km-footer a:hover {
    color: var(--km-blue-dark);
    text-decoration: underline;
}

.km-footer a:focus-visible,
.km-footer button:focus-visible,
.km-footer input:focus-visible {
    outline: 2px solid var(--km-blue);
    outline-offset: 2px;
}

.km-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding-left: var(--km-pad);
    padding-right: var(--km-pad);
}

.km-icon {
    display: inline-block;
    flex: none;
    height: 1em;
    overflow: visible;
}

/* Newsletter */
.km-footer__news {
    background: var(--km-blue);
    color: #fff;
}

.km-footer__news .km-footer__inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.km-footer__news-title {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    color: #fff;
    white-space: nowrap;
}

.km-footer__news-form {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: 560px;
    margin: 0 0 0 auto;
}

.km-footer__news-input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 6px 0 0 6px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 400;
    color: var(--km-text);
    background: #fff;
}

.km-footer__news-input::placeholder {
    color: var(--km-muted);
    opacity: 1;
}

.km-footer__news-btn {
    height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 0 6px 6px 0;
    background: var(--km-yellow);
    color: var(--km-text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.km-footer__news-btn:hover {
    filter: brightness(.95);
}

.km-footer__news-btn:disabled {
    cursor: wait;
    filter: brightness(.9);
}

.km-footer__news .km-footer__news-input:focus-visible,
.km-footer__news .km-footer__news-btn:focus-visible {
    outline-color: var(--km-yellow);
}

.km-footer__news-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--km-blue-soft);
    white-space: nowrap;
}

/* Logo, social links, the four groups */
.km-footer__main {
    display: grid;
    grid-template-columns: 240px repeat(4, minmax(0, 1fr));
    gap: 32px;
    padding-top: 44px;
    padding-bottom: 36px;
}

.km-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.km-footer__logo {
    display: block;
    width: auto;
    height: 44px;
}


.km-footer__social {
    display: flex;
    gap: 10px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.km-footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--km-blue-soft);
    border-radius: 50%;
    color: var(--km-blue);
    font-size: 17px;
}

.km-footer__social a:hover {
    border-color: var(--km-blue);
    background: var(--km-blue);
    color: #fff;
    text-decoration: none;
}

.km-footer__col h2 {
    margin: 0 0 16px;
    font-size: var(--km-col-heading);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--km-muted);
}

.km-footer__col ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--km-col-link);
    line-height: 1.3;
}

/* Bottom row */
.km-footer__bottom {
    border-top: 1px solid var(--km-line);
}

.km-footer__bottom .km-footer__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-top: 18px;
    padding-bottom: 18px;
    font-size: 15px;
}

/* The legal names run longer outside German (KMK-595: «Выходные данные |
   Impressum»). When the row is short of room, the links wrap within their
   column and the copyright stays on one line. */
.km-footer__copy {
    flex: none;
    color: var(--km-muted);
    white-space: nowrap;
}

.km-footer__legal {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.km-footer__legal a,
.km-footer__legal button {
    color: var(--km-text-2);
}

.km-footer__legal button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.km-footer__legal button:hover {
    color: var(--km-blue-dark);
    text-decoration: underline;
}

/* Language picker: opens upwards */
.km-lang {
    position: relative;
    flex: none;
    margin-left: auto;
}

.km-lang__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--km-border);
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    color: var(--km-text);
    cursor: pointer;
}

.km-lang__btn .km-icon {
    color: var(--km-icon-grey);
}

.km-lang__btn .km-lang__chevron {
    font-size: 11px;
    transition: transform .15s;
}

.km-lang__btn[aria-expanded="true"] .km-lang__chevron {
    transform: rotate(180deg);
}

.km-lang__list {
    position: absolute;
    right: 0;
    bottom: 44px;
    z-index: 10;
    width: 180px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}

.km-lang__list[hidden] {
    display: none;
}

.km-lang__list a {
    display: block;
    padding: 11px 16px;
    border-bottom: 1px solid var(--km-line);
    font-size: 15px;
    color: var(--km-text-2);
}

.km-lang__list a[aria-current="true"] {
    color: var(--km-blue);
    font-weight: 500;
}

.km-lang__list li:last-child a {
    border-bottom: 0;
}

/* Tablet */
@media (max-width: 1100px) {
    .km-footer {
        --km-pad: 32px;
    }

    .km-footer__news .km-footer__inner {
        flex-wrap: wrap;
    }

    .km-footer__news-form {
        flex-basis: 100%;
        order: 3;
        max-width: none;
        margin-left: 0;
    }

    .km-footer__main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px 24px;
    }

    .km-footer__brand {
        grid-column: 1 / -1;
    }
}

/* Phone */
@media (max-width: 640px) {
    .km-footer {
        --km-pad: 20px;
    }

    .km-footer__news-title {
        font-size: 20px;
        white-space: normal;
    }

    /* Two lines rather than a squeezed field: in German the label is
       "Newsletter abonnieren", which on one line left the field 123px. */
    .km-footer__news-btn {
        max-width: 50%;
        padding: 0 16px;
        line-height: 1.15;
        white-space: normal;
    }

    .km-footer__main {
        grid-template-columns: 1fr 1fr;
        gap: 28px 16px;
        padding-top: 32px;
    }

    .km-footer__bottom .km-footer__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .km-footer__legal {
        flex: none;
    }

    .km-lang {
        margin-left: 0;
    }

    .km-lang__list {
        left: 0;
        right: auto;
    }
}
