// Also see .search in web-nav-bar

$web-search: true !default;
@if $web-search {

    // Search in nav bar

    #nav {
        .search {
            @include search-box(nav);
        }
    }

    // Search on search page

    .content {
        .search {
            @include search-box(content);
        }
    }

    // Search results

    .search-results {
       ul {
        list-style-type: none;
        margin: $line-height-default 0;
      }
    }

    .search-result-unavailable {
        display: none;
    }

    // Marked search results (with mark.js)
    mark {
        background-color: $color-highlight;
        color: inherit;
        border-radius: $button-border-radius;
    }

    // Unmark
    [data-markjs="unmark"] {

        mark {
            background-color: inherit;
        }
    }

    .search-results-summary {
        margin: $line-height-default 0;
        padding: $line-height-default / 2;
        background-color: $color-notification-low-background;
        border-radius: $box-border-radius;
    }

    .search-page-notice {
        margin: $line-height-default 0;
        padding: $line-height-default / 2;
        background-color: $color-notification-medium-background;
        border-radius: $box-border-radius;
        *:last-child {
            margin-bottom: 0;
        }
    }

    .search-progress-placeholder {
        background-color: $color-notification-low-background;
        border-radius: $box-border-radius;
        color: $color-notification-low-text;
        font-family: $font-text-secondary;
        font-size: $font-size-default * $font-size-smaller;
        margin: $line-height-default 0;
        padding: $line-height-default / 2;
        *:last-child {
            margin-bottom: 0;
        }
    }

    .search-results-nav {

        // Position
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;

        // Stack above .pagination
        z-index: 8;

        // Appearance
        background-color: $color-background;
        box-shadow: 0px 0px 10px $grey-mid;
        font-family: $font-text-secondary;
        font-size: $font-size-default * $font-size-smaller;
        padding: 1rem;

        h2 {
            font-family: $font-text-secondary;
            font-size: $font-size-default;
            font-weight: normal;
            margin: 0 0 1rem 0;
            text-align: left;

            .search-results-nav-term {
                font-weight: bold;
            }
        }

        &[data-hidden="true"] {
            height: 3em;
        }

        .search-results-nav-hide {
            position: absolute;
            top: 1rem;
            right: 3rem;
        }

        .search-results-nav-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
        }

        .search-results-list {
            list-style-type: none;
            margin: 0;
            padding: 0;
            overflow: auto;
            max-height: 40vh;

            li {

                a {
                    text-decoration: none;
                }
            }
        }

    }

} // @if $web-search

@else {
    #nav {
        .search {
            display: none;
        }
    }
}
