/*
 * 21X site search — header pill + command-palette overlay (v2.0, R21 2026-09)
 * Tokens follow the R20 consistency layer: ink #1A1A2E · text #4B5563 ·
 * CI #2B5CA8 → #2278C0 · light #1DACE4 · border #DFE3EA · radius 12px · Grandview.
 * Motion: 240ms enter / 170ms exit, staggered rows; all disabled for reduced motion.
 */

/* ============================== header pill ============================== */
.tox-search-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.55rem !important;
    height: 40px !important;
    min-width: 150px !important;
    margin: 0 16px 0 8px !important;
    padding: 0 0.8rem 0 0.95rem !important;
    border: 1px solid #DFE3EA !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    background-image: none !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
    color: #4B5563 !important;
    font-family: "Grandview", "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
    flex: 0 0 auto !important;
}
.tox-search-toggle__label { display: inline-block; color: inherit; white-space: nowrap; margin-right: auto; }
.tox-search-toggle svg {
    display: block; width: 18px !important; height: 18px !important;
    fill: none !important; stroke: currentColor !important; stroke-width: 2 !important;
    stroke-linecap: round; stroke-linejoin: round; filter: none !important; flex: 0 0 auto;
}
.tox-search-toggle__kbd {
    font: 600 10.5px/1 "Grandview", ui-monospace, monospace;
    letter-spacing: .02em;
    color: #6B7280;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 3px 5px;
    white-space: nowrap;
}
.tox-search-toggle:hover {
    color: #1A1A2E !important;
    border-color: rgba(34, 120, 192, 0.55) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
    background: #ffffff !important;
}
.tox-search-toggle:focus-visible { outline: 2px solid #1DACE4 !important; outline-offset: 2px; }
#tox-search-toggle + .elementor-element-inv_btn1,
.elementor-element-3e73a56 .elementor-element-inv_btn1 { flex: 0 0 auto !important; margin-left: 8px !important; }

/* compact island (scrolled) */
.elementor-location-header.nav-scrolled .tox-search-toggle { height: 28px !important; min-width: 0 !important; font-size: 13px !important; padding: 0 0.7rem !important; }
.elementor-location-header.nav-scrolled .tox-search-toggle__kbd { display: none; }

@media (max-width: 1024px) { .tox-search-toggle__kbd { display: none; } }
@media (max-width: 1024px) {
    /* search.js moves the pill out of the (hidden) main menu, next to the burger */
    .tox-search-toggle.is-mobile-placed { margin: 0 10px 0 0 !important; height: 40px !important; min-width: 0 !important; width: 40px !important; padding: 0 !important; }
    .tox-search-toggle.is-mobile-placed .tox-search-toggle__label { display: none; }
    /* Elementor stacks the nav widget's container vertically (the dropdown menu
       lives below the burger) — force the pill + burger onto one row. */
    .elementor-element-3e73a56 .elementor-widget-container:has(> .elementor-menu-toggle) {
        display: flex !important; flex-direction: row !important; flex-wrap: wrap !important;
        align-items: center !important; justify-content: flex-end !important; gap: 10px;
    }
    .elementor-element-3e73a56 .elementor-widget-container:has(> .elementor-menu-toggle) > .elementor-nav-menu--dropdown { flex: 0 0 100%; }
    .tox-search-toggle.is-mobile-placed { margin: 0 !important; height: 44px !important; width: 44px !important; }
}
@media (max-width: 640px) {
    .tox-search-toggle { min-width: 0 !important; width: 40px !important; padding: 0 !important; }
    .tox-search-toggle__label { display: none; }
}

/* ================================ overlay ================================ */
html.tox-search-lock, html.tox-search-lock body { overflow: hidden !important; }

.tox-search-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; justify-content: center; align-items: flex-start;
    padding: 10vh 1rem 1rem;
    background: rgba(10, 14, 24, 0.55);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.tox-search-overlay[hidden] { display: none; }
.tox-search-overlay.is-open { opacity: 1; }
.tox-search-overlay.is-closing { opacity: 0; transition-duration: 0.17s; }

.tox-search-box {
    width: 100%; max-width: 720px;
    display: flex; flex-direction: column;
    max-height: 78vh;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 30px 80px rgba(5, 8, 13, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    font-family: "Grandview", "Helvetica Neue", Arial, sans-serif;
    color: #1A1A2E;
    opacity: 0; transform: translateY(-14px) scale(0.985);
    transition: opacity 0.24s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tox-search-overlay.is-open .tox-search-box { opacity: 1; transform: none; }
.tox-search-overlay.is-closing .tox-search-box { opacity: 0; transform: translateY(-8px) scale(0.99); transition-duration: 0.17s; }

/* ---- input row ---- */
.tox-search-field {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.95rem 1.1rem 0.95rem 1.25rem;
    border-bottom: 1px solid #EEF1F5;
}
.tox-search-field__icon { display: flex; color: #2278C0; flex: 0 0 auto; }
.tox-search-field svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tox-search-input {
    flex: 1 1 auto; min-width: 0;
    border: 0 !important; outline: 0 !important; box-shadow: none !important;
    background: transparent !important;
    font: 500 1.15rem/1.3 "Grandview", "Helvetica Neue", Arial, sans-serif !important;
    color: #1A1A2E !important;
    padding: 0 !important; margin: 0 !important;
}
.tox-search-input::placeholder { color: #9CA3AF; font-weight: 400; }
.tox-search-input::-webkit-search-cancel-button { display: none; }
/* Elementor's kit styles every <button> (blue fill, border, padding) — reset hard. */
.tox-search-box .tox-search-clear, .tox-search-box .tox-search-close, .tox-search-box .tox-search-forget {
    border: 0 !important; background: transparent !important; background-image: none !important;
    box-shadow: none !important; color: #9CA3AF !important; padding: 4px !important; margin: 0 !important;
    min-height: 0 !important; height: auto !important; width: auto !important; line-height: 1 !important;
    border-radius: 8px !important; cursor: pointer; font: inherit !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    transition: color 0.15s ease, background 0.15s ease !important;
}
.tox-search-box .tox-search-clear[hidden] { display: none !important; }
.tox-search-clear svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.tox-search-box .tox-search-clear:hover, .tox-search-box .tox-search-close:hover { color: #1A1A2E !important; background: #F3F4F6 !important; }
.tox-search-box .tox-search-clear:focus-visible, .tox-search-box .tox-search-close:focus-visible { outline: 2px solid #1DACE4 !important; outline-offset: 1px; }
.tox-search-box .tox-search-close { font-size: 1.5rem !important; width: 32px !important; height: 32px !important; display: none !important; }
.tox-search-box .tox-search-forget { color: #9CA3AF !important; padding: 0 !important; border-radius: 0 !important; font-size: 11px !important; letter-spacing: 0 !important; text-transform: none !important; }
.tox-search-box .tox-search-chip { min-height: 0 !important; height: auto !important; box-shadow: none !important; }
.tox-search-esc, .tox-search-foot kbd {
    font: 600 10.5px/1 "Grandview", ui-monospace, monospace;
    color: #6B7280; background: #F3F4F6; border: 1px solid #E5E7EB; border-bottom-width: 2px;
    border-radius: 5px; padding: 3px 5px; letter-spacing: .02em;
}

/* ---- indeterminate progress under the input ---- */
.tox-search-progress { height: 2px; background: transparent; overflow: hidden; position: relative; margin-top: -1px; }
.tox-search-progress span {
    position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
    background: linear-gradient(90deg, #2B5CA8, #1DACE4);
    border-radius: 2px; opacity: 0;
}
.tox-search-box.is-loading .tox-search-progress span { opacity: 1; animation: tox-sp 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes tox-sp { from { left: -40%; } to { left: 100%; } }

/* ---- body ---- */
.tox-search-body { overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem 0 0.5rem; scrollbar-width: thin; }
.tox-search-group { padding: 0.35rem 0 0.25rem; }
.tox-search-group__h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.45rem 1.25rem 0.35rem;
    font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: #2278C0;
}
.tox-search-forget:hover { color: #1A1A2E; text-decoration: underline; }

/* result row */
.tox-sr {
    position: relative;
    display: flex; align-items: flex-start; gap: 0.85rem;
    margin: 0 0.5rem; padding: 0.7rem 0.85rem 0.7rem 0.75rem;
    border-radius: 10px;
    text-decoration: none !important; color: inherit;
    transition: background 0.12s ease;
}
.tox-sr::before {
    content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
    background: linear-gradient(180deg, #2B5CA8, #1DACE4); opacity: 0; transition: opacity 0.12s ease;
}
.tox-sr.is-active { background: rgba(34, 120, 192, 0.07); }
.tox-sr.is-active::before { opacity: 1; }
.tox-sr__ic {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: #F3F6FA; color: #2278C0;
}
.tox-sr__ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tox-sr__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tox-sr__t { font-size: 15.3px; font-weight: 700; line-height: 1.3; color: #1A1A2E; }
.tox-sr__s { font-size: 13.5px; line-height: 1.45; color: #4B5563; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tox-sr__d { font-size: 11.5px; color: #9CA3AF; margin-top: 2px; }
.tox-sr mark { background: rgba(29, 172, 228, 0.22); color: inherit; border-radius: 3px; padding: 0 1px; }
.tox-sr__go { flex: 0 0 auto; align-self: center; color: #2278C0; opacity: 0; transform: translateX(-4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.tox-sr__go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tox-sr.is-active .tox-sr__go { opacity: 1; transform: none; }

/* "view all" */
.tox-search-all {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    margin: 0.5rem 0.5rem 0; padding: 0.75rem;
    border-top: 1px solid #EEF1F5; border-radius: 0 0 8px 8px;
    font-size: 13.5px; font-weight: 700; color: #2278C0; text-decoration: none !important;
}
.tox-search-all svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s ease; }
.tox-search-all.is-active, .tox-search-all:hover { background: rgba(34, 120, 192, 0.07); }
.tox-search-all.is-active svg { transform: translateX(3px); }

/* quick links (empty state) */
.tox-search-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.15rem 1.25rem 0.5rem; }
.tox-search-quick a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.75rem; border-radius: 10px;
    border: 1px solid #EEF1F5; background: #FAFBFC;
    font-size: 13.5px; font-weight: 600; color: #1A1A2E; text-decoration: none !important;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.tox-search-quick a.is-active, .tox-search-quick a:hover { border-color: rgba(34, 120, 192, 0.45); background: #ffffff; transform: translateY(-1px); }
.tox-search-quick__ic { display: flex; color: #2278C0; }
.tox-search-quick__ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* chips (recent / no-results next steps) */
.tox-search-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0.1rem 1.25rem 0.4rem; }
.tox-search-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.42rem 0.7rem; border-radius: 999px;
    border: 1px solid #DFE3EA; background: #ffffff;
    font: 600 13px/1 "Grandview", "Helvetica Neue", Arial, sans-serif; color: #1A1A2E;
    text-decoration: none !important; cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.tox-search-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: #2278C0; }
.tox-search-chip.is-active, .tox-search-chip:hover { border-color: rgba(34, 120, 192, 0.55); background: rgba(34, 120, 192, 0.06); }

/* no results / error */
.tox-search-none { padding: 1.6rem 1.25rem 1.1rem; text-align: center; }
.tox-search-none__ic { display: inline-flex; width: 44px; height: 44px; border-radius: 12px; background: #F3F6FA; color: #2278C0; align-items: center; justify-content: center; margin-bottom: 0.6rem; }
.tox-search-none__ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tox-search-none__t { margin: 0 0 0.25rem; font-size: 15.3px; font-weight: 700; color: #1A1A2E; }
.tox-search-none__s { margin: 0 0 0.8rem; font-size: 13.5px; color: #4B5563; }
.tox-search-none .tox-search-chips { justify-content: center; }

/* footer */
.tox-search-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 1.25rem;
    border-top: 1px solid #EEF1F5; background: #FAFBFC;
    font-size: 12px; color: #6B7280;
}
.tox-search-foot__keys { display: inline-flex; align-items: center; gap: 0.35rem; }
.tox-search-foot__keys kbd { margin-right: 0.1rem; }
.tox-search-foot__status { font-weight: 600; color: #4B5563; }

/* ---- entrance stagger ---- */
.tox-sr, .tox-search-quick a, .tox-search-chip, .tox-search-all, .tox-search-none {
    animation: tox-sr-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes tox-sr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- mobile: full-height sheet ---- */
@media (max-width: 640px) {
    .tox-search-overlay { padding: 0; align-items: stretch; }
    .tox-search-box { max-width: none; max-height: none; height: 100dvh; border-radius: 0; border: 0; transform: translateY(12px); }
    .tox-search-input { font-size: 17px !important; }   /* ≥16px: no iOS zoom */
    .tox-search-esc { display: none; }
    .tox-search-box .tox-search-close { display: inline-flex !important; }
    .tox-search-quick { grid-template-columns: repeat(2, 1fr); }
    .tox-search-foot__keys { display: none; }
    .tox-sr__s { -webkit-line-clamp: 3; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .tox-search-overlay, .tox-search-box, .tox-sr, .tox-search-quick a, .tox-search-chip, .tox-search-all, .tox-search-none, .tox-sr__go, .tox-search-progress span {
        transition: none !important; animation: none !important; transform: none !important;
    }
    .tox-search-box.is-loading .tox-search-progress span { opacity: 1; left: 0; width: 100%; }
}
