/*
 * Search Overlay Styles
 *
 * Fullscreen search of the theme option "Fullscreen search overlay" (IwFoundationThemeSearchOverlay).
 * Colors from the theme tokens; child themes restyle through the iw-search-overlay classes.
 *
 * @package     iw-foundation-theme
 * @subpackage  style/search-overlay
 * @since       1.5.0
 -------------------------------------------------------------- */

.iw-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1003;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--iw-color-background, #fff);
    color: var(--iw-color-text, #333);
    animation: iw-search-overlay-in .25s ease-out;
}

.iw-search-overlay[hidden] {
    display: none;
}

@keyframes iw-search-overlay-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

html.iw-search-overlay-open {
    overflow: hidden;
}

.iw-search-overlay__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px max(24px, env(safe-area-inset-right)) 48px max(24px, env(safe-area-inset-left));
}

.iw-search-overlay__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.iw-search-overlay__title {
    margin: 0;
}

.iw-search-overlay__close,
.iw-search-overlay__submit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.iw-search-overlay__close svg,
.iw-search-overlay__submit svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.iw-search-overlay__form {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid currentColor;
}

.iw-search-overlay__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.43rem;
}

.iw-search-overlay__results {
    margin-top: 32px;
}

.iw-search-overlay__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.iw-search-overlay__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 24px;
    color: inherit;
    text-decoration: none;
}

.iw-search-overlay__link:hover .iw-search-overlay__item-title,
.iw-search-overlay__link:focus-visible .iw-search-overlay__item-title {
    color: var(--iw-color-primary, #EF17EF);
    text-decoration: underline;
}

.iw-search-overlay__type {
    font-size: .86rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.iw-search-overlay__item-title {
    font-weight: 700;
    font-size: 1.14rem;
}

.iw-search-overlay__excerpt {
    margin: 8px 0 0;
}

.iw-search-overlay__all {
    display: inline-block;
    min-height: 24px;
    margin-top: 32px;
    color: inherit;
}

html.iw-a11y-reduce_motion .iw-search-overlay {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    html:not(.iw-a11y-no-reduce_motion) .iw-search-overlay {
        animation: none;
    }
}
