Given a list of reading items, each item has an integer id, a string title, a string author, and a boolean isSaved. Implement a function that supports a small app flow: filter items by a case-insensitive search query on title or author, optionally keep only saved items, sort the visible results by title, and return both the visible list and the currently selected item if its id is still visible. If the selected item is no longer visible after filtering, return null for the selection.
def filter_navigation_state(items, query, saved_only, selected_id):