/* Colors
Bold Coral:  #F26553
Red: #D92D20
Blue: #2F80ED;
Text: #171415
Grey Text: #727272
Other grey text: #475467
Light grey: #E0E0E0
Lighter grey: #EAECF0
*/

/* Visually hide search form labels */
.site-search label[for*="edit-search-terms"] {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
}

/* Header SearchAPI search form */

header.site-header [role="search"] button[type="submit"] {
    padding: 1rem;
}

header.site-header input[type="search"] {
    min-width: 24ch;
}

@media all and (max-width: 440px) {
    header.site-header form.search-form .form--inline {
        display: block;
    }

    header.site-header form.search-form .form-group,
    header.site-header form.search-form input,
    header.site-header form.search-form button {
        width: 100%;
    }

    header.site-header form.search-form .form-group:not(:last-child) {
        margin-bottom: 0.5rem;
    }
}

/* Search pages */
body.search-results .page--layout-content {
    border-top: 1px solid #D0D5DD;
    padding-top: 3.6rem;
}

@media all and (max-width: 859px) {
    body.dialog-open {
        height: 100vh;
        overflow: hidden;
    }

    h2.facets-open {
        margin-bottom: 4rem;
    }

    .search-filters {
        visibility: hidden;
        position: fixed;
        top: 0;
        left: -100%;
        transition: left 0.5s ease-in-out;
    }

    .search-filters.open {
        visibility: visible;
        background: #fff;
        overflow: scroll;
        left: 0;
        padding: 30px;
        width: 95%;
        height: 100%;
        z-index: 100;
    }

    .search-filters:after {
        content: '';
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        width: 5%;
        height: 100%;
        background-color: #171415;
        opacity: 0;
    }

    .search-filters.open:after {
        opacity: 0.6;
        transition: opacity 0.5s ease-in-out;
    }

    button.button.search-filters--close {
        padding: 0;
    }
}

@media all and (min-width: 860px) {
    body.section-search .page--layout-content {
        display: flex;
    }

    body.section-search .facets-open,
    button.search-filters--close {
        display: none;
    }

    body.section-search .aside-sidebar--first {
        width: 240px;
        flex: 0 0 240px;
        margin-right: 4%;
    }

    body.section-search .page--layout-content-main {
        flex: 1;
        flex-basis: calc(100% - 240px - 4%);
    }
}

/* Search API views exposed form, core search form in main region */
.views-exposed-form.site-search,
.region-highlighted .search-form {
    margin-bottom: 40px;
}

main .views-exposed-form.site-search,
main form.search-form {
    margin-top: 50px;
}

main form.search-form {
    display: flex;
    justify-content: center;
}

main .region-hero form.search-form {
    justify-content: flex-start;
}

main form.search-form .input--wrapper {
    display: flex;
    align-items: center;
    padding: 2px;
}

main .site-search.form--inline {
    border: 1px solid #667085;
    padding: 0.8rem;
    border-radius: 10px;
    box-shadow: 0px 2px 8px -2px rgba(33, 33, 33, 0.06), 0px 4px 32px -2px rgba(33, 33, 33, 0.05);
}

@media all and (max-width: 640px) {
    main form.search-form .form-group,
    main form.search-form .form-actions.form-group:last-child {
        width: 100%;
    }

    main form.search-form .form-item {
        border: 1px solid #667085;
        padding: 0.8rem;
        border-radius: 10px;
    }

    main form.search-form .form-group {
        margin-bottom: 0.8rem;
    }

    main form.search-form .form--inline > * {
        margin-right: 0;
    }
}

main .site-search.form--inline > *:last-child,
main form.search-form > *:last-child {
    margin-right: 0;
}

main .site-search input[type="search"],
main .search-form input[type="search"] {
    border: none;
}

@media all and (min-width: 600px) {
    main .site-search input[type="search"],
    main .search-form input[type="search"] {
        min-width: 36ch;
    }
}

main .site-search button[type="submit"],
main .search-form button[type="submit"] {
    padding: 1.6rem 3rem;
}

*[role="search"] button[value="Search"]:before {
    content: url(../../images/icons/search.svg);
    width: 18px;
    height: 18px;
    margin-right: 1rem;
}

@media all and (max-width: 639px) {
    main .site-search .form--inline > *,
    main form.search-form > * {
        margin-right: 0;
    }

    main .site-search .form--inline > *:not(:last-child),
    main form.search-form > *:not(:last-child) {
        margin-bottom: 1rem;
    }

    main .site-search input.form-control,
    main form.search-form  input.form-control,
    main .site-search button.form-submit,
    main form.search-form button.form-submit {
        width: 100%;
    }
}

/* Facets */
.block-facets,
.block-facets-summary {
    font-size: 1.6rem;
    margin-bottom: 28px;
}

.facets-summary--header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

h2#search-filters--title {
    margin-bottom: 2.6rem;
}

.search-facets-item-list-summary {
    margin-top: -2rem;
}

.facets-skip {
    align-self: flex-end;
}

.facet-summary-item--clear {
    margin: 0.5rem 0 1rem 0;
}

.facet-summary-item--facet,
.facet-summary-item--facet a,
.facet-item__status,
.facet-summary-item--search-string,
.facet-summary-item--search-string a {
    display: inline-flex;
    align-items: center;
}

/* Active search terms */
.active-search-summary {
    margin-bottom: 4.5rem;
}

.facet-summary-item--search-string a,
a.facet-summary-item--search-string {
    background: #F2F4F7;
    border-radius: 6px;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    font-weight: bold;
    color: #344054;
    text-decoration: none;
    font-size: 1.6rem;
}

.facet-summary-item--search-string a:hover,
.facet-summary-item--search-string a:active,
.facet-summary-item--search-string a:focus,
a.facet-summary-item--search-string:hover,
a.facet-summary-item--search-string:active,
a.facet-summary-item--search-string:focus {
    background: #FCD8D4;
}

h3.search-filter--title {
    font-size: 1.85rem;
    margin-bottom: 1.8rem;
}

h3.search-filter--title button,
h3.search-filter--title button.button--transparent:hover,
h3.search-filter--title button.button-transparent:active,
h3.search-filter--title button.button--transparent:focus {
    width: 100%;
    text-align: left;
    justify-content: space-between;
    border-bottom: 1px solid #667085;
    padding-bottom: 0.8rem;
    border-radius: 0;
}

button.search-filter--toggle svg {
    margin-left: 5px;
    margin-right: 5px;
}

button.search-filter--toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.block-facets ul {
    list-style: none;
    padding-left: 0;
}

.block-facets li {
    list-style: none;
    margin-bottom: 1.2rem;
}

.block-facets ul ul {
    padding-left: 32px;
    margin-top: 1.2rem;
}

.block-facets ul ul li {
    margin-left: 0;
}

li.facet-item--expanded {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

li.facet-item--expanded button.search-filter--subcategory-toggle {
    margin-left: auto;
}

li.facet-item--expanded > label {
    flex: 1;
}

li.facet-item--expanded > ul {
    flex: 0 0 100%;
}

li.facet-item--expanded button[aria-expanded="false"] + .search-filter--items {
    display: none;
}

li.facet-item--expanded > input[type="checkbox"] + label {
    font-weight: bold;
}

li.facet-item--expanded button[aria-expanded="false"] + ul {
    display: none;
}

li.facet-item--expanded button[aria-expanded="true"] svg .vert {
    display: none;
}

li.facet-item--expanded button[aria-expanded="true"] {
    color: #D85849;
}

/* Facets searchbox */
label.facets-widget-searchbox--label {
    font-weight: bold;
}

input.facets-widget-searchbox {
    background: #fff url(../../images/icons/search--grey.svg) no-repeat center left 12px;
    padding-left: 38px;
    margin-bottom: 1.8rem;
}

@media all and (max-width: 859px) {
    .facets-skip {
        display: none;
    }
}

/* Search API search results */
.search-result {
    border-bottom: 1px solid #EAECF0;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
}

.search-result h3,
.search-result h4 {
    margin-bottom: 0.8rem;
    font-weight: normal;
}

.search-result h3 a:link,
.search-result h3 a:visited,
.search-result h4 a:link,
.search-result h4 a:visited {
    text-decoration: none;
}

.search-result h3 a:hover,
.search-result h3 a:active,
.search-result h3 a:focus,
.search-result h4 a:hover,
.search-result h4 a:active,
.search-result h4 a:focus {
    text-decoration: underline;
}

.search-result,
.search-result--content {
    color: #475467;
    font-size: 1.6rem;
}

p.search-result--excerpt {
    margin-bottom: 0.5rem;
} 

.search-result--meta {
    font-weight: bold;
    color: #344054;
}

span.search-result--meta-item {
    line-height: 2;
}

span.search-result--meta-item:not(:last-child) {
    padding-right: 1.5rem;
    border-right: 1px solid #344054;
    margin-right: 1.5rem;
}

.search-result--program-videos {
    margin-top: 3rem;
    margin-left: 8%;
    margin-bottom: -2rem;
}

.search-result--program-videos .search-result:last-child {
    border-bottom: none;
}