/* ── APPLE-STYLE FULL-WIDTH SEARCH PANEL — v2.5.3.8 ─────────────────────
 * Clicking the search icon opens a full-width panel fixed below the nav.
 * Nav items are completely untouched — no overlap, no crowding possible.
 * Panel lives OUTSIDE <nav> in the HTML so the nav's backdrop-filter does
 * not create a containing block that traps position:fixed children.
 *
 * Open:  #lc-fp-search-panel.active  +  #lc-fp-search-overlay.active
 * Close: remove .active from both (ESC / Cancel / overlay click)
 * ─────────────────────────────────────────────────────────────────────── */

/* ── Panel container ─────────────────────────────────────────────────── */
.lc-fp-search-panel {
    position: fixed;
    top: var(--lc-nav-h);
    left: 0;
    right: 0;
    z-index: 100000;
    background: rgba(15, 15, 18, 0.97);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-6px);
    opacity: 0;
    /* visibility:hidden is required on iOS Safari: backdrop-filter promotes the
     * element onto a GPU compositing layer that is painted even when opacity:0,
     * causing the panel to bleed through on page load on real iPhones.
     * visibility respects GPU layers; opacity alone does not on WebKit.
     * Transition: delay the hide until after the 0.22s fade-out completes;
     * show immediately (0s delay) when opening. */
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0.18, 1),
                opacity   0.18s ease,
                visibility 0s linear 0.22s;
}
.lc-fp-search-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0.18, 1),
                opacity   0.18s ease,
                visibility 0s linear 0s;
}

/* ── Centred inner layout ─────────────────────────────────────────────── */
.lc-fp-search-panel-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 22px 40px 28px;
}

/* ── Input row: search icon + input + clear button + Cancel ──────────── */
.lc-fp-search-panel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    padding-bottom: 2px;
    margin-bottom: 22px;
}
.lc-fp-search-panel-icon {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
}

/* Input — important overrides beat Enfold's high-specificity #top rules */
.lc-fp-search-input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 21px !important;
    font-weight: 300 !important;
    font-family: var(--lc-nav-font, inherit) !important;
    line-height: 1.4 !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    letter-spacing: -0.3px;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-shadow: none !important;
    border-radius: 0 !important;
    width: auto !important;
}
#top .lc-fp-search-input { color: rgba(255, 255, 255, 0.9) !important; }
.lc-fp-search-input::placeholder,
#top .lc-fp-search-input::placeholder { color: rgba(255, 255, 255, 0.3) !important; }

/* Clear (×) button — shown only when there is text */
.lc-fp-search-clear {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.15s, color 0.15s;
    padding: 0;
}
.lc-fp-search-clear:hover { background: rgba(255,255,255,0.24); color: #fff; }
.lc-fp-search-panel.has-text .lc-fp-search-clear { display: inline-flex; }

/* Cancel button */
.lc-fp-search-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-family: var(--lc-nav-font, inherit);
    cursor: pointer;
    padding: 6px 4px;
    transition: color 0.15s;
    white-space: nowrap;
}
.lc-fp-search-close:hover { color: #fff; }

/* ── Quick Links (shown when panel is open but nothing typed yet) ──────── */
.lc-fp-search-quick-links { display: block; }
.lc-fp-search-panel.has-results .lc-fp-search-quick-links { display: none; }

.lc-fp-search-ql-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.7px;
    text-transform: uppercase;
    margin: 0 0 10px;
    padding: 0;
}
.lc-fp-search-ql-item {
    display: flex !important; /* !important beats Enfold's #top a{display:inline} on iOS Safari */
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.78) !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.12s;
}
.lc-fp-search-ql-item::before {
    content: "→";
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    flex-shrink: 0;
    transition: color 0.12s, transform 0.12s;
}
.lc-fp-search-ql-item:hover { color: #fff !important; text-decoration: none !important; }
.lc-fp-search-ql-item:hover::before { color: var(--lc-nav-amber, #ff9500); transform: translateX(3px); }
.lc-fp-search-ql-item:last-child { border-bottom: none; }

/* ── Live results dropdown ────────────────────────────────────────────── */
.lc-fp-search-results { display: none; flex-direction: column; gap: 1px; }
.lc-fp-search-results.visible { display: flex; }

/* front-page.css carries an old expanding-bar variant that sets
 * position:absolute / right:0 / width:480px on .lc-fp-search-results.
 * The higher specificity here (0,2,0 vs 0,1,0) guarantees in-flow
 * positioning inside the full-width panel regardless of load order. */
.lc-fp-search-panel .lc-fp-search-results {
    position: static !important;
    width: auto !important;
    max-width: none !important;
    right: auto !important;
    top: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    animation: none !important;
    z-index: auto !important;
}

.lc-fp-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.12s;
}
.lc-fp-search-result:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; }

.lc-fp-search-result-thumb,
.lc-fp-search-no-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    display: block;
    object-fit: cover;
}
.lc-fp-search-no-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
}

.lc-fp-search-result-body { display: flex; flex-direction: column; min-width: 0; }
.lc-fp-search-result-title {
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lc-fp-search-result-type {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    letter-spacing: 0.4px;
}
.lc-fp-search-status {
    padding: 12px 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.lc-fp-search-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
    padding-top: 4px;
}
.lc-fp-search-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75) !important;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.12s, color 0.12s;
}
.lc-fp-search-footer a:hover {
    background: rgba(255, 149, 0, 0.12);
    color: #ffb84d !important;
}

/* ── Dim overlay — sits between nav and page content ─────────────────── */
.lc-fp-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    transition: background 0.22s ease;
}
.lc-fp-search-overlay.active {
    background: rgba(0, 0, 0, 0.28);
    pointer-events: auto;
}

/* ── Light nav = light panel (matches Apple's behaviour) ─────────────── */
.lc-fp-search-panel.lc-nav-light {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-panel-row {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-panel-icon {
    color: rgba(0, 0, 0, 0.4);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-input,
#top .lc-fp-search-panel.lc-nav-light .lc-fp-search-input {
    color: rgba(0, 0, 0, 0.85) !important;
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-input::placeholder,
#top .lc-fp-search-panel.lc-nav-light .lc-fp-search-input::placeholder {
    color: rgba(0, 0, 0, 0.3) !important;
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-clear {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.6);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-clear:hover {
    background: rgba(0, 0, 0, 0.14);
    color: rgba(0, 0, 0, 0.9);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-close {
    color: rgba(0, 0, 0, 0.5);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-close:hover { color: #000; }
.lc-fp-search-panel.lc-nav-light .lc-fp-search-ql-label {
    color: rgba(0, 0, 0, 0.4);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-ql-item {
    color: rgba(0, 0, 0, 0.75) !important;
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-ql-item::before {
    color: rgba(0, 0, 0, 0.25);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-ql-item:hover { color: #000 !important; }
.lc-fp-search-panel.lc-nav-light .lc-fp-search-result:hover {
    background: rgba(0, 0, 0, 0.04);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-result-thumb,
.lc-fp-search-panel.lc-nav-light .lc-fp-search-no-thumb {
    background: rgba(0, 0, 0, 0.06);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-no-thumb { color: rgba(0,0,0,0.3); }
.lc-fp-search-panel.lc-nav-light .lc-fp-search-result-title {
    color: rgba(0, 0, 0, 0.9);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-result-type {
    color: rgba(0, 0, 0, 0.45);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-status {
    color: rgba(0, 0, 0, 0.45);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-footer {
    border-top-color: rgba(0, 0, 0, 0.08);
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-footer a {
    color: rgba(0, 0, 0, 0.65) !important;
}
.lc-fp-search-panel.lc-nav-light .lc-fp-search-footer a:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #000 !important;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .lc-fp-search-panel-inner { padding: 16px 20px 22px; }
    .lc-fp-search-input { font-size: 18px !important; }
    .lc-fp-search-close { font-size: 13px; }
}
@media (max-width: 480px) {
    .lc-fp-search-input { font-size: 16px !important; }
}
