/* ---------------------------------------------------------------------------
   Top-bar search
   Values are the drawer's: the same greys, the same orange focus ring, the same
   card recipe. The box sits in the layout, so it is the one control every page
   shares -- it should not look like it came from somewhere else.
   --------------------------------------------------------------------------- */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 420px;
    padding: 8px 12px;
    margin: 0;
    border: 1px solid var(--tpt-border-strong);
    border-radius: 8px;
    background: var(--tpt-surface);
    color: var(--tpt-text-faint);
    box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: 'Mulish', sans-serif;
}

.search-box:focus-within {
    border-color: var(--tpt-accent);
    box-shadow: 0 0 0 3px rgba(255, 108, 8, 0.15);
}

.search-box input[type="search"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: 'Mulish', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tpt-text);
}

.search-box input[type="search"]::placeholder {
    color: var(--tpt-text-faint);
    font-weight: 500;
}

/* Safari draws its own clear button, which sits on top of the shortcut hint. */
.search-box input[type="search"]::-webkit-search-decoration,
.search-box input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-shortcut {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--tpt-text-faint);
    border: 1px solid var(--tpt-border);
    border-radius: 4px;
    padding: 1px 5px;
    line-height: 1.5;
}

/* --- the dropdown --------------------------------------------------------- */

.gs-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 900;
    background: var(--tpt-surface);
    border: 1px solid var(--tpt-border);
    border-radius: 12px;
    box-shadow: 0px 12px 32px -8px rgba(16, 24, 40, 0.18);
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px;
}

.gs-panel[hidden] {
    display: none;
}

.gs-note {
    padding: 16px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tpt-text-muted);
    line-height: 1.5;
}

.gs-note strong {
    color: var(--tpt-text);
}

.gs-note-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--tpt-text-faint);
}

.gs-group + .gs-group {
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--tpt-surface-muted);
}

.gs-group-title {
    margin: 0;
    padding: 8px 10px 6px;
    font-family: 'Mulish', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tpt-text-subtle);
}

.gs-hit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.gs-hit:hover,
.gs-hit--active {
    background: var(--tpt-accent-tint);
}

.gs-hit:focus-visible,
.gs-group-more:focus-visible {
    outline: 2px solid var(--tpt-accent);
    outline-offset: -2px;
}

.gs-avatar,
.gs-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    background: var(--tpt-surface-muted);
    color: var(--tpt-text-muted);
}

.gs-avatar {
    border-radius: 50%;
}

.gs-icon i {
    font-size: 0.8rem;
    color: var(--tpt-text-subtle);
}

.gs-hit-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gs-hit-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--tpt-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-hit-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tpt-text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-group-more {
    display: block;
    padding: 6px 10px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tpt-accent);
    text-decoration: none;
    border-radius: 8px;
}

.gs-group-more:hover {
    background: var(--tpt-accent-tint);
}

/* --- the full results page ------------------------------------------------ */

.gs-page {
    background: var(--tpt-surface);
    border: 1px solid var(--tpt-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    padding: 8px;
    max-width: 760px;
}

.gs-page .gs-hit-title {
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .search-box {
        max-width: none;
    }

    .search-shortcut {
        display: none;
    }
}
