﻿/* ============================================================
 *  searchbox.css — Peerless Search Overlay / SearchBox skin
 *  Handoff target page: the global search overlay (as seen on
 *  the homepage, e.g. playground/PeerlessLighting2.html).
 *
 *  Purpose: map the Peerless SearchBox design onto the legacy
 *  search-overlay markup AND the dynamic Coveo search-box DOM
 *  (.magic-box / .CoveoSearchbox) so the live Coveo input matches
 *  the Astro reference build.
 *
 *  Self-contained: the :root block below shims the design tokens
 *  this file consumes. If main.css is already loaded on the page,
 *  these values simply match it and can be omitted.
 * ============================================================ */

:root {
    /* spacing */
    --space-4: 1rem;
    --space-6: 1.5rem;
    /* type */
    --font-mono: 'Space Mono', monospace;
    /* color */
    --color-structural-black-400: #202938;
    --color-structural-cream-50: #FEFCFA;
    --color-structural-cream-400: #F6F3EA;
    --color-structural-cream-600: #EDE8DF;
    --color-playleaf-500: #C6DC19;
}

/* Map current Peerless SearchBox styling onto legacy overlay + dynamic Coveo DOM. */
.search-overlay__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: calc(var(--header-size, 70px) + 12px);
    padding: 1px 1px 1px 16px;
    border: 1px solid var(--color-structural-black-400, #0F121D);
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 9999;
}

    .search-overlay__bar:focus-within {
        border-color: var(--color-playleaf-500, #C6DC19);
    }

.search-overlay:has(.search-overlay__toggle-radio--assist:checked) .search-overlay__bar {
    backdrop-filter: none;
    background: var(--color-structural-cream-400, #F7F5F0);
    border-color: var(--color-structural-cream-600, #DFDCD7);
}

.search-overlay__input-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    cursor: text;
    padding: 0;
    transition: opacity 0.3s ease;
}

.search-overlay:has(.search-overlay__toggle-radio--assist:checked) .search-overlay__input-wrap {
    opacity: 0.1;
    cursor: not-allowed;
}

.search-overlay__input-icon {
    font-size: 1rem;
    color: var(--color-structural-black-400, #0F121D);
    flex-shrink: 0;
}

.search-overlay__input-wrap > [data-search-interface-id] {
    flex: 1;
    min-width: 0;
}

    .search-overlay__input-wrap > [data-search-interface-id],
    .search-overlay__input-wrap > [data-search-interface-id] > .coveo-search-section,
    .search-overlay__input-wrap > [data-search-interface-id] .CoveoSearchInterface,
    .search-overlay__input-wrap > [data-search-interface-id] .CoveoSearchbox,
    .search-overlay__input-wrap > [data-search-interface-id] .CoveoOmnibox,
    .search-overlay__input-wrap > [data-search-interface-id] .magic-box,
    .search-overlay__input-wrap > [data-search-interface-id] .magic-box-input {
        height: 100%;
    }

        .search-overlay__input-wrap > [data-search-interface-id] .CoveoSearchInterface,
        .search-overlay__input-wrap > [data-search-interface-id] .CoveoSearchbox,
        .search-overlay__input-wrap > [data-search-interface-id] .CoveoOmnibox,
        .search-overlay__input-wrap > [data-search-interface-id] .magic-box,
        .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-input {
            width: 100% !important;
            min-width: 0 !important;
            max-width: none !important;
            border: none !important;
            background: transparent !important;
            box-shadow: none !important;
        }

            .search-overlay__input-wrap > [data-search-interface-id] .CoveoOmnibox,
            .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-input {
                display: flex;
                align-items: center;
            }

                .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-input > input {
                    flex: 1;
                    width: 100%;
                    min-width: 0;
                    padding: 0;
                    border: none !important;
                    background: none !important;
                    outline: none;
                    box-shadow: none !important;
                    font-family: var(--font-mono, "Space Mono", monospace);
                    font-size: 1.125rem;
                    font-weight: 400;
                    color: var(--color-structural-black-400, #0F121D);
                    caret-color: var(--color-structural-black-400, #0F121D);
                    text-transform: uppercase;
                }

                    .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-input > input::placeholder {
                        color: var(--color-structural-black-400, #0F121D);
                        opacity: 0.35;
                        text-transform: uppercase;
                    }

            .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-underlay {
                display: none;
            }

            .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-clear {
                color: var(--color-structural-black-400, #0F121D);
            }

            .search-overlay__input-wrap > [data-search-interface-id] .magic-box.magic-box-notEmpty .magic-box-clear {
                width: 48px;
                visibility: hidden;
            }

            .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-suggestions {
                clear: both;
                position: absolute;
                top: calc(100% + 35px);
                left: -53px;
                right: -1px;
                overflow: visible;
                background: #fff;
                z-index: 1;
                display: none;
                font-family: arial, sans-serif;
                width: calc(100% + 254px);
                min-height: 100vh;
            }

                .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-suggestions .coveo-suggestion-container {
                    display: flex;
                    width: 100%;
                    gap: var(--space-16);
                }

                .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-suggestions .coveo-magicbox-suggestions {
                    flex: 0 0 220px;
                    width: 220px;
                    min-width: 220px;
                    max-width: 220px;
                }

                .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-suggestions .coveo-preview-container {
                    flex: 1;
                    position: relative;
                }

            .search-overlay__input-wrap > [data-search-interface-id] .magic-box.magic-box-hasFocus .magic-box-suggestions.magic-box-hasSuggestion {
                display: block;
            }

        .search-overlay__input-wrap > [data-search-interface-id] .CoveoSearchButton {
            display: none;
        }

.search-overlay__toggle {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 199px;
    height: 54px;
    padding: 4px;
    background: transparent;
    overflow: hidden;
    transition: background 0.3s ease;
}

.search-overlay:has(.search-overlay__toggle-radio--assist:checked) .search-overlay__toggle {
    background: var(--color-structural-cream-50, #FFFFFF);
}

.search-overlay__toggle-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.search-overlay__toggle-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 4px;
    width: calc(50% - 4px);
    border: 1px solid var(--color-structural-black-400, #0F121D);
    background: linear-gradient(-82.2deg, #C6DC19 0.43775%, #EDF4B8 118.77%);
    pointer-events: none;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.35s ease;
}

.search-overlay__toggle-radio--assist:checked ~ .search-overlay__toggle-indicator {
    left: 50%;
    background: linear-gradient(-82.3deg, #FF5C00 0.43775%, #FF9254 118.77%);
}

.search-overlay__toggle-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-mono, "Space Mono", monospace);
    font-size: 1.125rem;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--color-structural-black-400, #0F121D);
    opacity: 0.3;
    transition: opacity 0.35s ease;
}

    .search-overlay__toggle-btn i {
        display: none;
    }

.search-overlay__toggle-radio--search:checked ~ .search-overlay__toggle-btn--search,
.search-overlay__toggle-radio--assist:checked ~ .search-overlay__toggle-btn--assist {
    opacity: 1;
}

.search-overlay__assist-iframe {
    display: none;
    width: 100%;
    margin-top: var(--space-6, 1.5rem);
}

    .search-overlay__assist-iframe iframe {
        display: block;
        width: 100%;
        min-height: 65vh;
        border: 0;
    }

/* Force editorial cards to match compact bottom-overlay behavior in this snapshot. */
.search-overlay__editorial-row .content-card {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 16 / 12;
    overflow: hidden;
}

    .search-overlay__editorial-row .content-card .content-card__media {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .search-overlay__editorial-row .content-card .content-card__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .search-overlay__editorial-row .content-card .content-card__gradient {
        position: absolute;
        inset: 0;
        background: linear-gradient( to top, rgba(15, 18, 29, 0.78) 0%, rgba(15, 18, 29, 0.4) 42%, rgba(15, 18, 29, 0) 74% );
        pointer-events: none;
    }

    .search-overlay__editorial-row .content-card .content-card__body {
        position: absolute;
        left: var(--space-4, 1rem);
        right: var(--space-4, 1rem);
        bottom: var(--space-4, 1rem);
        z-index: 2;
        margin-top: 0;
        padding: 0;
    }

    .search-overlay__editorial-row .content-card .content-card__title,
    .search-overlay__editorial-row .content-card .content-card__title-text,
    .search-overlay__editorial-row .content-card .content-card__arrow {
        color: #FFFFFF;
    }

.search-overlay:has(.search-overlay__toggle-radio--assist:checked) .search-overlay__body--idle {
    display: none;
}

.search-overlay:has(.search-overlay__toggle-radio--assist:checked) .search-overlay__assist-iframe {
    display: block;
}

.search-overlay__suggested .search-overlay__trending-item.coveo-facet-value.coveo-with-hover:hover {
    background-color: transparent;
}

@media (max-width: 480px) {
    .search-overlay__bar {
        padding: 1px 1px 1px 5px;
    }

    .search-overlay__input-wrap {
        gap: 12px;
    }

        .search-overlay__input-wrap > [data-search-interface-id] .magic-box .magic-box-input > input {
            font-size: var(--font-size-text-2xl, 1.125rem);
        }

    .search-overlay__toggle {
        width: 100%;
    }

    .search-overlay__toggle-btn {
        font-size: var(--font-size-text-2xl, 1.125rem);
        padding: 8px;
    }
}

.magic-box.magic-box-hasFocus .magic-box-suggestions.magic-box-hasSuggestion .coveo-suggestion-container {
    border: none;
}

.coveo-suggestion-container .coveo-preview-container {
    border: none;
    background: #fff;
    flex-basis: 100%;
    max-width: 100%;
}

    .coveo-suggestion-container .coveo-preview-container .coveo-preview-results .coveo-preview-layout {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        width: calc(33.333% - var(--space-8, 2rem) * 2 / 3);
    }

    .coveo-suggestion-container .coveo-preview-container .coveo-preview-results {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        gap: var(--space-8, 2rem);
        overflow: visible;
    }

.magic-box .magic-box-suggestions .magic-box-suggestion {
    cursor: pointer;
    line-height: 24px;
    padding: 12px;
    font-size: var(--font-size-text-xl, 1rem);
    background: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: none;
    color: #212121;
    font-family: var(--font-mono);
    font-weight: revert;
}

    .magic-box .magic-box-suggestions .magic-box-suggestion:hover {
        background: transparent;
        color: var(--bg-blue-alliance);
    }

    .magic-box .magic-box-suggestions .magic-box-suggestion:before {
        content: "\f0c8";
        font-family: "Font Awesome 7 Sharp";
        font-weight: 900;
        margin-right: 10px;
        font-size: var(--font-size-text-base, 1rem);
    }


.magic-box.magic-box-hasFocus .magic-box-suggestions.magic-box-hasSuggestion .coveo-magicbox-suggestions,
.magic-box.magic-box-hasFocus .magic-box-suggestions.magic-box-hasSuggestion .coveo-suggestion-container {
    border: none;
}
