.header {
    position: fixed;
    z-index: 99;
    top: 32px;
    left: 160px;
    width: calc(100% - 160px);
    box-sizing: border-box;
    padding: 0 30px;
    background-color: $white_color;
    border-bottom: 1px solid #e7e9ef;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    @media only screen and (max-width: 960px) {
        left: 36px;
        width: calc(100% - 36px);
    }
    @media only screen and (max-width: 782px) {
        left: 0px;
        width: 100%;
        top: 46px;
    }
    @media only screen and (max-width: 600px) {
        position: sticky;
        top: 0;
        padding: 0 16px;
    }

    .top {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 16px;
        min-height: 64px;
        padding: 8px 0;
        box-sizing: border-box;
        border-bottom: 1px solid #f0f1f4;
    }

    .brand {
        display: flex;
        align-items: center;
        gap: 12px;
        img {
            width: 40px;
            height: 40px;
            border-radius: 11px;
            box-shadow: 0 4px 12px rgba(49, 100, 228, 0.25);
        }
    }
    .wordmark {
        display: flex;
        flex-direction: column;
        gap: 3px;
        strong {
            font-size: 18px;
            font-weight: 800;
            letter-spacing: -0.01em;
            line-height: 1.1;
            color: #0b1a4a;
            white-space: nowrap;
        }
        span {
            font-size: 11px;
            font-weight: 600;
            line-height: 1;
            color: $secondary_color;
            a {
                color: inherit;
                text-decoration: none;
                &:hover,
                &:focus {
                    text-decoration: underline;
                }
            }
        }
    }

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

    .version {
        padding: 6px 11px;
        border-radius: 999px;
        background-color: #f3f4f6;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        color: #50575e;
        white-space: nowrap;
        &.proVersion {
            background-color: rgba($secondary_color, 0.09);
            color: $secondary_color;
        }
    }

    .bottom {
        display: flex;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 0 16px;
        min-height: 50px;
    }

    .nav {
        display: flex;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 0 6px;
        margin-left: -12px;
        a {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 50px;
            padding: 0 12px;
            box-sizing: border-box;
            font-size: 14px;
            font-weight: 600;
            line-height: 1;
            color: #50575e;
            text-decoration: none;
            transition: 0.2s ease color, 0.2s ease box-shadow;
            .external {
                opacity: 0.6;
            }
            // Beats WP core's a:focus ring without a :focus rule.
            outline: none !important;
            box-shadow: none;
            border-radius: 0;
            &:focus {
                border-radius: 0;
            }
            &:hover {
                color: #1d2327;
                box-shadow: inset 0 -2px 0 #dcdfe6;
            }
            &.active {
                color: $secondary_color;
                box-shadow: inset 0 -2px 0 $secondary_color;
            }
        }
    }
}

// Phones: one menu row that scrolls sideways instead of wrapping.
@media only screen and (max-width: 600px) {
    .header {
        .nav {
            flex: 1 1 auto;
            min-width: 0;
            flex-wrap: nowrap;
            overflow-x: auto;
            &.fadeEnd {
                mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
            }
            &.fadeStart {
                mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
            }
            &.fadeStart.fadeEnd {
                mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
            }
            scrollbar-width: none;
            &::-webkit-scrollbar {
                display: none;
            }
            a {
                white-space: nowrap;
                flex: 0 0 auto;
            }
        }
    }
}
