.spruce-search__form {
    display: flex;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.spruce-search__form:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.spruce-search__input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-sizing: border-box;
    line-height: 1.4;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.spruce-search__input::placeholder {
    color: currentColor;
    opacity: 0.55;
}

.spruce-search__button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
}

.spruce-search__icon {
    width: 1em;
    height: 1em;
    display: block;
}

.spruce-search__results {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 24rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.spruce-search__results[hidden] {
    display: none !important;
}

.spruce-search__result {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.spruce-search__main {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.spruce-search__thumb {
    flex: 0 0 auto;
    order: 0;
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}

.spruce-search__result:hover,
.spruce-search__result:focus {
    background: rgba(0, 0, 0, 0.04);
}

.spruce-search__title {
    flex: 1 1 auto;
}

.spruce-search__type {
    flex: 0 0 auto;
    margin-left: auto;
    opacity: 0.7;
}

.spruce-search__status {
    margin: 0;
    padding: 10px 14px;
}

.spruce-search--icon {
    display: flex;
    justify-content: flex-end;
}

.spruce-search--icon .spruce-search__form {
    width: max-content;
    max-width: 100%;
    margin-left: auto;
    transition: width 0.2s ease;
    interpolate-size: allow-keywords;
}

.spruce-search--icon:not(.is-open) .spruce-search__form {
    overflow: hidden;
}

.spruce-search--icon:not(.is-open) .spruce-search__input {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
}

.spruce-search--icon.is-open .spruce-search__form,
.spruce-search--canvas.spruce-search--icon .spruce-search__form {
    width: 100%;
}

/*
 * In a header the icon often shares a row with the menu and is shifted
 * right so it sits beside the hamburger. That shift also caps the open
 * field, so it never reaches the left edge. While open, drop the shift
 * and let the field fill the row up to the menu.
 */
.et-l--header .et_pb_column:has(.spruce-search--icon.is-open) > .spruce_search_bar {
    position: relative !important;
    inset: auto !important;
    left: 0 !important;
    right: auto !important;
    width: auto !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    z-index: 3;
}

.et-l--header .et_pb_column:has(.spruce-search--icon.is-open) > .et_pb_menu {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
}

.spruce-search--canvas.spruce-search--icon .spruce-search__input {
    width: 100%;
    opacity: 1;
    pointer-events: none;
}
