/* ==========================================================================
   Site search — results page, matched to the Universal Investment (Sitecore)
   design. Values taken from the Sitecore theme:
   - dark blue #043152, light blue #72badc, lime #e8fd7d / pale #f6fecb
   - inactive grey #9badba, dropdown grey #cdd6dc, suggest panel #c7e3f1
   ========================================================================== */

/* --- Page section -------------------------------------------------------- */
.search-results-section {
    background: #72badc; /* partner site (page-theme-p) */
    padding-bottom: 80px;
}

/* --- Per-site theme: the mainpage (page-theme-b) uses a dark navy search
   section (its page title is white there). Recolour the controls that sit
   directly on the background so they stay readable; cards/inputs are already
   light. Partner (page-theme-p) keeps the #72badc above. -------------------- */
.page-theme-b .search-results-section {
    background: #043152;
}

.page-theme-b .search-results-title {
    color: #fff;
}

.page-theme-b .search-filter-label {
    color: #fff;
}

.page-theme-b .search-results-submit {
    border-color: #fff;
    color: #fff;
}

.page-theme-b .search-results-submit:hover {
    background: #fff;
    color: #043152;
}

.page-theme-b .search-page-selector .page-selector-list a {
    color: #fff;
}

/* Keep the active page distinct on the navy theme (the white rule above would
   otherwise hide the lime active colour). */
.page-theme-b .search-page-selector .page-selector-list .active {
    color: #e8fd7d;
}

.search-results-page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 8px 16px 0;
}

.search-results-title {
    color: #043152;
    font-size: 44px;
    line-height: 1.1;
    font-weight: 700;
    margin: 16px 0 28px;
}

/* --- Search box ---------------------------------------------------------- */
.search-results-header {
    margin-bottom: 18px;
}

.search-box-row {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.search-box-field {
    position: relative;
    flex: 1 1 auto;
}

.search-box-input-inner {
    position: relative;
}

.search-box-input-inner .icon {
    position: absolute;
    left: 28px;
    top: 4px;
    bottom: 0;
    display: flex;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.search-box-input-inner .icon i {
    display: block;
    font-size: 36px;
    line-height: 1;
    color: #043152;
}

.search-box-field .search-box-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: 0;
    box-shadow: none;
    background-color: #fff;
    border-radius: 21px;
    height: 42px;
    padding: 7px 0 10px 70px;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: .2px;
    font-weight: 400;
    color: #043152;
}

.search-box-field .search-box-input::placeholder {
    color: #6b7a86;
}

/* Search button — outlined navy pill, bold label */
.search-results-submit {
    flex: 0 0 auto;
    margin-top: 4px;
    background: transparent;
    border: 1.5px solid #043152;
    color: #043152;
    padding: 9px 28px;
    border-radius: 40px;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: .2px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.search-results-submit:hover {
    background: #043152;
    color: #fff;
}

/* --- Inline autosuggest panel (under the input) -------------------------- */
/* Shared by the results-page search box and the header overlay so both render
   the same light-blue panel tucked under the rounded input. */
.search-box-field .search-suggestions,
#search-box .search-suggestions {
    list-style: none;
    margin: -12px 0 0;
    padding: 18px 0 8px;
    background: #c7e3f1;
    border-bottom-left-radius: 21px;
    border-bottom-right-radius: 21px;
}

.search-box-field .search-suggestions[hidden],
#search-box .search-suggestions[hidden] {
    display: none;
}

.search-box-field .search-suggestions li a,
#search-box .search-suggestions li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 28px;
    color: #043152;
    text-decoration: none;
}

.search-box-field .search-suggestions li a:hover,
#search-box .search-suggestions li a:hover {
    background: rgba(255, 255, 255, .4);
}

.search-box-field .search-suggestions li a i,
#search-box .search-suggestions li a i {
    font-size: .95rem;
    opacity: .7;
}

/* --- Result count -------------------------------------------------------- */
.search-results-count {
    margin-bottom: 40px;
    padding: 0;
}

.search-results-count .component-content {
    padding: 0;
}

.search-results-count .results-count {
    display: block; /* override the theme's ported `.results-count { display: none }` */
    color: #fff;
    font-size: 16px;
    line-height: 24px;
    letter-spacing: .2px;
    font-weight: 400;
}

/* --- Filter label + row -------------------------------------------------- */
.search-filter-label {
    color: #043152;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
}

.search-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    margin-bottom: 40px;
    border-bottom: 2px solid #e8fd7d;
}

/* --- Topic-category facet: grey tag-cloud chips after "Filter" (Sitecore
   .filter-tag-cloud-ui design — grey pill, navy label, fixed height). -------- */
.search-results-section .search-filter-categories {
    margin-bottom: 28px;
}

.search-results-section .search-filter-categories .facet-value {
    box-sizing: border-box;
    display: inline-block;
    margin: 0 20px 20px 0;
    border: 0 none;
    border-radius: 8px;
    padding: 5px 20px 0 20px;
    min-width: 100px;
    height: 32px;
    background-color: #cdd6dc;
    color: #043152;
    font-size: 12px;
    line-height: 20px;
    letter-spacing: .2px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
}

.search-results-section .search-filter-categories .facet-value input {
    display: none; /* chip toggles via click; JS keeps the checkbox state */
}

.search-results-section .search-filter-categories .facet-value label {
    margin: 0;
    color: #043152;
    font-size: 12px;
    line-height: 20px;
    letter-spacing: .2px;
    font-weight: 600;
    cursor: pointer;
}

/* Selected chip — pale lime fill, navy label */
.search-results-section .search-filter-categories .facet-value.active-facet {
    background-color: #f6fecb;
}

.search-results-section .search-filter-categories .facet-value.active-facet label {
    color: #043152;
}

/* Facet dropdown (page type) — visual styling comes from the theme's
   .filter-dropdown-ui (grey collapsed box, checkbox list, "Filter" button).
   Reset the listing-page margins so it sits neatly in the filter row. */
.search-filter-type .component-content,
.search-filter-tag .component-content {
    padding: 0;
}

.search-filter-type .dropdown-box,
.search-filter-tag .dropdown-box {
    margin-bottom: 0;
}

/* Keep pagination on the left, push the facet dropdown to the right. */
.search-filter-pagination {
    margin-right: auto;
}

/* --- Pagination — scoped to OUR .search-page-selector so these rules never
   override the news listing's own .page-selector. Top (left) + bottom (centred). */
.search-page-selector {
    padding: 0;
}

.search-page-selector .page-selector-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.search-page-selector .page-selector-list li {
    margin: 0 3px;
    display: inline-flex;
}

.search-page-selector .page-selector-list a {
    color: #043152;
    text-decoration: none;
    font-size: 18px;
    line-height: 18px;
    padding: 2px 9px;
}

.search-page-selector .page-selector-list .active,
.search-page-selector .page-selector-list a:hover {
    color: #e8fd7d;
    font-weight: 700;
}

.search-page-selector .page-selector-list .inactive a {
    color: #9badba;
    pointer-events: none;
    cursor: default;
}

.search-bottom-pagination {
    margin-top: 40px;
}

.search-bottom-pagination .search-page-selector .page-selector-list {
    justify-content: center;
}

/* --- Result list --------------------------------------------------------- */
.search-result-list.search-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.search-result-list .search-result-item {
    display: block;
    padding: 0 0 48px;
}

/* News results: themed white card, centred and narrow (4/12 cols ~ 380px) */
.search-result-list .search-result-item.is-news {
    max-width: 380px;
    margin: 0 auto;
}

/* News "More information" button — readable in every state */
.search-result-list .news-teaser-item-body .btn-primary,
.search-result-list .news-teaser-item-body .btn-primary:visited {
    background-color: #043152 !important;
    border-color: #043152 !important;
    color: #fff !important;
}

.search-result-list .news-teaser-item-body .btn-primary:hover,
.search-result-list .news-teaser-item-body .btn-primary:focus {
    background-color: #72badc !important;
    border-color: #72badc !important;
    color: #fff !important;
}

/* --- Page result card: horizontal, image LEFT, full width on the blue bg -
   All teaser rules below are scoped under .search-results-section because the
   .page-teaser-item-body / .field-teaser-* / .news-teaser-field-container class
   names are shared with the news listing + theme — keep search styling local. */
.search-results-section .page-teaser-item-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
}

.search-results-section .page-teaser-item-body img {
    flex: 0 0 auto;
    max-width: 50%;
    height: 227px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, .2);
}

.search-results-section .page-teaser-field-container {
    flex: 1 1 auto;
    min-width: 0;
}

.search-results-section .page-teaser-item-body .field-teaser-type {
    color: #043152;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.search-results-section .page-teaser-item-body .field-teaser-title {
    color: #043152;
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.search-results-section .page-teaser-item-body .field-teaser-text,
.search-results-section .page-teaser-item-body .field-teaser-text p {
    color: #043152;
    font-size: 18px;
    line-height: 28px;
    margin: 0 0 20px;
}

/* Page card "Read more" — lime text link (on the blue background) */
.search-results-section .page-teaser-item-body .search-read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e8fd7d;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.search-results-section .page-teaser-item-body .search-read-more:hover,
.search-results-section .page-teaser-item-body .search-read-more:focus {
    color: #f6fecb;
}

.search-results-section .page-teaser-item-body .search-read-more i {
    font-size: 1.1em;
}

/* --- Contact result card: portrait LEFT, name + position + phone + email --
   Scoped under .search-results-section (shared teaser class names). */
.search-results-section .contact-teaser-item-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
}

.search-results-section .contact-teaser-item-body img {
    flex: 0 0 auto;
    width: 166px;
    height: 166px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, .2);
}

.search-results-section .contact-teaser-item-body .news-teaser-field-container {
    flex: 1 1 auto;
    min-width: 0;
}

.search-results-section .contact-teaser-item-body .field-teaser-title {
    color: #043152;
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    margin-bottom: 6px;
}

.search-results-section .contact-teaser-item-body .field-teaser-sub-title {
    color: #043152;
    font-size: 18px;
    line-height: 28px;
    margin-bottom: 12px;
}

.search-results-section .contact-teaser-item-body .field-teaser-text {
    margin: 0 0 6px;
}

.search-results-section .contact-teaser-item-body a {
    color: #043152;
    font-size: 18px;
    line-height: 28px;
    font-weight: 600;
    text-decoration: none;
}

.search-results-section .contact-teaser-item-body a:hover,
.search-results-section .contact-teaser-item-body a:focus {
    text-decoration: underline;
}

/* --- States -------------------------------------------------------------- */
#search-results-container {
    position: relative;
}

/* Loading indicator shown during filter / pagination / re-search AJAX
   (the JS toggles .is-loading on this container). */
#search-results-container.is-loading {
    pointer-events: none;
    min-height: 200px;
}

#search-results-container.is-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(114, 186, 220, .6);
    z-index: 10;
}

#search-results-container.is-loading::after {
    content: "";
    position: absolute;
    top: 70px;
    left: 50%;
    width: 44px;
    height: 44px;
    margin-left: -22px;
    border: 4px solid rgba(4, 49, 82, .25);
    border-top-color: #043152;
    border-radius: 50%;
    animation: search-spin .8s linear infinite;
    z-index: 11;
}

@keyframes search-spin {
    to { transform: rotate(360deg); }
}

.search-results-page .no-results {
    padding: 32px 0;
    font-size: 1.1rem;
    color: #043152;
}

/* --- Small screens ------------------------------------------------------- */
@media only screen and (max-width: 786px) {
    .search-box-row {
        flex-direction: column;
    }

    .search-results-submit {
        width: 100%;
        margin-top: 0;
    }

    .search-result-list .search-result-item.is-news {
        max-width: 100%;
    }

    .search-results-section .page-teaser-item-body {
        flex-direction: column;
    }

    .search-results-section .page-teaser-item-body img {
        max-width: 100%;
        height: auto;
        margin-bottom: 16px;
    }

    .search-filter-row {
        flex-wrap: wrap;
    }
}
