html, body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    flex: 1;
}

body {
    padding-top: 0;
    margin-bottom: 0 !important;
}

div.body {
    flex: 1;
}


#footer {
    --backstage-site-footer-position: static;
    z-index: 100;
    margin-top: 14px;
}

.nav-list {
    top: 0;
}

/* The header height changes on smaller screens so we use this variable to calculate the offset required for various elements*/
:root {
    --header-height: 40px;
}

@media (max-width: 992px) {
    :root {
        --header-height: 40px;
    }

    .search-container {
        flex-grow: 1 !important;
    }

    .search-input {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (min-width: 992px) {
    :root {
        --header-height: 88px;
    }

    .search-input {
        width: 250px !important;
    }
}

.toolbar, .nav {
    top: calc(var(--header-height));
    z-index: 101;
}

.toc.sidebar .toc-menu {
    top: calc(var(--header-height) + 2.5rem) !important;
}

.nav-container {
    margin-bottom: -14px; /* The footer adds top margin so we need to offset it here */
    top: calc(var(--header-height));
}

.search-input {
    border-radius: 5px !important;
}

.search-container {
    padding-right: 5px;
}

.search-result-dataset {
    max-height: 75vh !important;
}
