/* Molecule: search — collapsible search filter in the toolbar */

.search-container {
    display: flex;
    align-items: center;
    gap: var(--bn-space-sm);
    margin-right: auto;
}

.search-toggle {
    background: none;
    border: none;
    padding: 0.3rem;
    cursor: pointer;
    color: var(--bn-colour-muted);
    line-height: 1;
    transition: color var(--bn-transition-fast);
    flex-shrink: 0;
}

.search-toggle:hover {
    color: var(--bn-colour-accent);
}

.search-toggle svg {
    display: block;
    width: 15px;
    height: 15px;
}

.search-field {
    display: none;
    position: relative;
}

.search-container.expanded .search-field {
    display: block;
}

.search-input {
    font-family: var(--bn-font-body);
    font-size: 0.875rem;
    padding: 0.3rem 1.6rem 0.3rem 0.5rem;
    border: 1px solid var(--bn-colour-border);
    border-radius: var(--bn-radius-md);
    background: var(--bn-colour-bg);
    color: var(--bn-colour-text);
    outline: none;
    width: 14rem;
    transition: border-color var(--bn-transition-fast);
}

.search-input:focus {
    border-color: var(--bn-colour-accent);
}

.search-input::placeholder {
    color: var(--bn-colour-muted);
    font-style: italic;
}

.search-clear {
    display: none;
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--bn-colour-muted);
    line-height: 1;
    transition: color var(--bn-transition-fast);
}

.search-clear:hover {
    color: var(--bn-colour-accent);
}

.search-clear svg {
    display: block;
}

.search-container.has-query .search-clear {
    display: block;
}

.search-mark {
    background: var(--bn-colour-highlight);
    border-radius: 2px;
    padding: 0 1px;
}
