/* =========================================================================
 * Furex — Global site search styles (v1.19.0).
 *
 * Floating always-on trigger (bottom inline-start corner — the back-to-top
 * control owns the opposite corner) + the glass command palette. Palette
 * tokens come from the dynamic light/dark scheme, so dark mode is automatic.
 * ========================================================================= */

/* ----- 1. Floating trigger -------------------------------------------- */
.fx-search-fab {
    position: fixed;
    bottom: 22px;
    inset-inline-start: 22px;
    z-index: 940;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--radius-md);
    background: var(--glass-back_to_top-bg, var(--glass-bg));
    color: var(--accent);
    cursor: pointer;
    box-shadow: var(--glass-back_to_top-shadow, var(--glass-shadow));
    backdrop-filter: blur(var(--glass-back_to_top-blur, var(--glass-blur))) saturate(var(--glass-back_to_top-saturation, 205%));
    -webkit-backdrop-filter: blur(var(--glass-back_to_top-blur, var(--glass-blur))) saturate(var(--glass-back_to_top-saturation, 205%));
    transition: transform 0.25s ease, filter 0.25s ease, color 0.25s ease;
}
.fx-search-fab svg { width: 20px; height: 20px; display: block; }
.fx-search-fab:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}
.fx-search-fab:active { transform: scale(0.94); }
.fx-search-fab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
@media (max-width: 640px) {
    .fx-search-fab { bottom: 16px; inset-inline-start: 16px; width: 42px; height: 42px; }
}

/* ----- 2. Overlay + panel --------------------------------------------- */
.fx-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 9vh 16px 16px;
    /* Crystal-clear non-backdrop-root dim so .fx-search-panel refracts the real page underneath */
    background: rgba(12, 16, 26, 0.12);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
/* the UA [hidden] sheet would otherwise lose to display:flex (v1.8.0 class) */
.fx-search-overlay[hidden] { display: none; }

.fx-search-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(620px, 100%);
    max-height: 68vh;
    overflow: hidden;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--glass-site_header-bg, var(--glass-bg));
    backdrop-filter: blur(var(--glass-site_header-blur, var(--glass-blur))) saturate(var(--glass-site_header-saturation, 205%));
    -webkit-backdrop-filter: blur(var(--glass-site_header-blur, var(--glass-blur))) saturate(var(--glass-site_header-saturation, 205%));
    box-shadow: var(--glass-site_header-shadow, var(--glass-shadow));
}
@keyframes fx-search-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ----- 3. Input row ----------------------------------------------------- */
.fx-search-input-row {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.fx-search-ico {
    flex: none;
    width: 19px;
    height: 19px;
    color: var(--muted);
    transition: color 0.25s;
}
.fx-search-input-row:focus-within .fx-search-ico { color: var(--accent); }
.fx-search-input-row input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
}
.fx-search-input-row input::placeholder { color: var(--muted); font-weight: 500; }
.fx-search-clear {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.fx-search-clear svg { width: 13px; height: 13px; display: block; }
.fx-search-clear:hover { color: var(--text); border-color: var(--text); }
.fx-search-clear[hidden] { display: none; }
.fx-search-kbd {
    flex: none;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
}
@media (max-width: 1023px) { .fx-search-kbd { display: none; } }

/* ----- 4. Body: results + preview -------------------------------------- */
.fx-search-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.fx-search-main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}
.fx-search-status {
    margin: 0;
    padding: 8px 20px 2px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}
.fx-search-group {
    padding: 10px 20px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.fx-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 14px;
    margin: 0 6px 2px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    text-align: start;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}
.fx-search-item-ico {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.fx-search-item-ico svg { width: 16px; height: 16px; }
.fx-search-item-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.fx-search-item-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fx-search-item-meta {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fx-search-item:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.fx-search-item[data-active="true"] {
    background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.fx-search-none {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 34px 20px;
    color: var(--muted);
}
.fx-search-none svg { width: 30px; height: 30px; opacity: 0.6; }
.fx-search-none p { margin: 0; font-size: 13px; font-weight: 600; }

/* ----- 5. Preview pane (desktop only) ----------------------------------- */
.fx-search-preview {
    display: none;
}
@media (min-width: 1024px) {
    .fx-search-panel { width: min(920px, 100%); }
    .fx-search-body {
        flex-direction: row;
    }
    .fx-search-main {
        flex: 1;
        min-width: 0;
    }
    .fx-search-preview {
        display: block;
        width: 280px;
        flex: none;
        overflow-y: auto;
        padding: 16px 14px;
        border-inline-start: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.04);
    }
}
.fx-search-pv-card { animation: fx-search-pv-in 0.24s both; }
@keyframes fx-search-pv-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fx-search-pv-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.fx-search-pv-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fx-search-pv-card:hover .fx-search-pv-img img { transform: scale(1.05); }
.fx-search-pv-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}
.fx-search-pv-ico svg { width: 30px; height: 30px; }
.fx-search-pv-title {
    margin: 12px 2px 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.7;
}
.fx-search-pv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.fx-search-pv-chip {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}
.fx-search-pv-chip.is-brand {
    border-color: transparent;
    background: var(--accent);
    color: var(--surface);
}
.fx-search-pv-open {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}
.fx-search-pv-open svg { width: 13px; height: 13px; flex: none; }

/* ----- 6. Footer hints ---------------------------------------------------- */
.fx-search-foot {
    flex: none;
    display: none;
    gap: 18px;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
}
@media (min-width: 640px) { .fx-search-foot { display: flex; } }
.fx-search-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}
.fx-search-hint b {
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 10px;
}

/* ----- 7. Small screens + reduced motion ---------------------------------- */
@media (max-width: 640px) {
    .fx-search-overlay { padding: 4vh 12px 12px; }
    .fx-search-panel { max-height: 84vh; }
}
@media (prefers-reduced-motion: reduce) {
    .fx-search-overlay,
    .fx-search-panel,
    .fx-search-pv-card,
    .fx-search-pv-img img { animation: none; transition: none; }
    .fx-search-fab { transition: none; }
    .fx-search-fab:hover { transform: none; }
}

