/**
 * Search Modal Styles
 *
 * Full-screen search overlay triggered from utility bar.
 * From: scss/template-parts/header/_search-overlay.scss
 *
 * @package Condor
 */

/* Body scroll lock when modal is open */
body.search-modal-open {
    overflow: hidden;
}

/* Modal container - hidden by default */
.search-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-family: var(--wp--preset--font-family--body);

    &.is-open {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Dark overlay */
    .search-modal__overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
    }

    /* Modal content box */
    .search-modal__content {
        position: relative;
        width: calc(100% - 40px);
        max-width: 640px;
        background: var(--wp--preset--color--white);
        border-radius: 6px;
        box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
        padding: 2rem;

        @media screen and (min-width: 768px) {
            padding: 4rem;
        }
    }

    /* Close button */
    .search-modal__close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        color: var(--wp--preset--color--slate);

        &:hover {
            color: var(--wp--preset--color--bright-red);
        }

        svg {
            width: 24px;
            height: 24px;
        }
    }

    /* Search form */
    .search-modal__form {
        width: 100%;
        display: flex;
        align-items: flex-end;
    }

    .search-modal__input-wrapper {
        width: 100%;
        display: flex;
        align-items: stretch;
    }

    /* Search input */
    .search-modal__input {
        flex: 1;
        height: 40px;
        line-height: 40px;
        padding: 0 10px;
        font-size: 0.875rem;
        border: 2px solid var(--wp--preset--color--blue);
        color: var(--wp--preset--color--blue);
        font-weight: bold;
        transition: all 0.2s ease-in;
        appearance: none;
        border-radius: 0;

        &::placeholder {
            color: var(--wp--preset--color--blue);
            opacity: 0.5;
            font-style: italic;
        }

        &:focus,
        &:active {
            outline: 0;
            border-color: var(--wp--preset--color--bright-red);
        }

        @media screen and (min-width: 768px) {
            padding: 0 15px;
            height: 60px;
            font-size: 1.375rem;
        }
    }

    /* Submit button */
    .search-modal__submit {
        display: flex;
        align-items: center;
        justify-content: center;
        text-transform: uppercase;
        font-family: var(--wp--preset--font-family--body);
        letter-spacing: 0.05em;
        border: 2px solid var(--wp--preset--color--bright-red);
        padding: 0 12px;
        font-size: 0.875rem;
        color: var(--wp--preset--color--bright-red);
        background: var(--wp--preset--color--white);
        transition: all 0.2s ease-in;
        font-weight: 600;
        cursor: pointer;
        height: 40px;

        &:hover {
            background: var(--wp--preset--color--bright-red);
            color: var(--wp--preset--color--white);

            svg {
                stroke: var(--wp--preset--color--white);
            }
        }

        &:focus,
        &:active {
            outline: 0;
        }

        svg {
            width: 20px;
            height: 20px;
            stroke: var(--wp--preset--color--bright-red);
            transition: stroke 0.2s ease-in;
        }

        @media screen and (min-width: 768px) {
            font-size: 1rem;
            padding: 0 25px;
            height: 60px;
        }
    }

    /* Common searches section */
    .search-modal__suggestions {
        padding-top: 1.5rem;
        color: var(--wp--preset--color--mid-gray);

        @media screen and (min-width: 768px) {
            padding-left: 1.25rem;
        }
    }

    .search-modal__suggestions-label {
        font-weight: 400;
        font-style: italic;
        padding-bottom: 1rem;
        font-size: 0.875rem;
        margin: 0;

        @media screen and (min-width: 768px) {
            font-size: 1rem;
        }
    }

    .search-modal__suggestions-list {
        list-style-type: disc;
        padding-left: 2.5rem;
        margin: 0;

        li {
            font-size: 0.8125rem;

            @media screen and (min-width: 768px) {
                font-size: 0.875rem;
            }

            & + li {
                padding-top: 0.625rem;
            }
        }

        a {
            color: var(--wp--preset--color--charcoal);
            text-decoration: underline;

            &:hover {
                color: var(--wp--preset--color--bright-red);
            }
        }
    }

    /* Screen reader only text */
    .screen-reader-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}
