/* Local Fractional — sitewide search overlay */

/* Trigger button in the nav */
.lf-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  color: #4a5568;
  background: transparent;
  border: 1px solid #e2e8f0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  font-size: 0.85rem;
}
.lf-search-trigger:hover {
  color: #2b6cb0;
  background: #f7fafc;
  border-color: #2b6cb0;
}
.lf-search-trigger svg { width: 18px; height: 18px; }
.lf-search-trigger-label { display: none; }
@media (min-width: 1024px) {
  .lf-search-trigger-label { display: inline; color: #a0aec0; }
}
.lf-search-trigger kbd {
  display: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #475569; /* slate-600 — 7:1 on #f1f5f9 (was #718096 = 3.66:1, failed AA) */
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 5px;
  line-height: 1;
}
@media (min-width: 1024px) { .lf-search-trigger kbd { display: inline-block; } }

/* Lock body scroll when open */
html.lf-search-open, html.lf-search-open body { overflow: hidden; }

/* Outer container — JS toggles [hidden]. */
#lf-search-overlay { position: fixed; inset: 0; z-index: 200; }
#lf-search-overlay[hidden] { display: none; }

.lf-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lf-search-panel {
  position: absolute;
  left: 50%;
  top: 8vh;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 680px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  overflow: hidden;
  font-family: inherit;
  animation: lf-search-in 0.15s ease-out;
}
@keyframes lf-search-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@media (max-width: 640px) {
  .lf-search-panel {
    inset: 0;
    top: 0;
    transform: none;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}

.lf-search-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #edf2f7;
}
.lf-search-head .lf-search-icon {
  width: 20px; height: 20px; color: #718096; flex-shrink: 0;
}
.lf-search-input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 1.05rem;
  color: #1a2332;
  background: transparent;
  font-family: inherit;
}
.lf-search-input::placeholder { color: #a0aec0; }
.lf-search-close {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #718096;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-family: inherit;
}
.lf-search-close:hover { background: #f7fafc; color: #2d3748; }

.lf-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #edf2f7;
  background: #fafbfc;
}
.lf-chip {
  font-size: 0.78rem;
  font-weight: 500;
  color: #4a5568;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.lf-chip:hover { border-color: #2b6cb0; color: #2b6cb0; }
.lf-chip.is-active {
  background: #1a2332;
  color: #fff;
  border-color: #1a2332;
}

.lf-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0 1rem;
}

.lf-search-hint {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #718096;
  font-size: 0.9rem;
  line-height: 1.5;
}
.lf-search-hint p { margin: 0 0 0.5rem 0; }
.lf-search-hint .lf-search-kbd { font-size: 0.8rem; color: #a0aec0; }
.lf-search-hint kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  color: #4a5568;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1px 5px;
}

.lf-search-loading,
.lf-search-empty {
  text-align: center;
  color: #718096;
  font-size: 0.9rem;
  padding: 2rem 1.5rem;
  line-height: 1.5;
}
.lf-search-empty p { margin: 0 0 0.4rem; }
.lf-search-empty a { color: #2b6cb0; text-decoration: underline; }

.lf-search-group-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d69e2e;
  padding: 0.9rem 1.25rem 0.4rem;
}
.lf-search-group-label.lf-muted { color: #718096; }
.lf-search-group-label svg { width: 14px; height: 14px; }

.lf-result {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.lf-result:hover {
  background: #f7fafc;
  border-left-color: #2b6cb0;
}
.lf-result.lf-pinned { border-left-color: #d69e2e; }
.lf-result.lf-pinned:hover { background: #fffbeb; }

.lf-result-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ebf4ff;
  color: #2b6cb0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lf-result-icon svg { width: 18px; height: 18px; }
.lf-result-icon[data-type="Service"]     { background: #e6fffa; color: #2c7a7b; }
.lf-result-icon[data-type="Industry"]    { background: #fef5e7; color: #b7791f; }
.lf-result-icon[data-type="Location"]    { background: #fed7d7; color: #9b2c2c; }
.lf-result-icon[data-type="Tool"]        { background: #e9d8fd; color: #553c9a; }
.lf-result-icon[data-type="Guide"]       { background: #c6f6d5; color: #276749; }
.lf-result-icon[data-type="Comparison"]  { background: #bee3f8; color: #2c5282; }
.lf-result-icon[data-type="Glossary"]    { background: #edf2f7; color: #2d3748; }
.lf-result-icon[data-type="Newsletter"]  { background: #fed7e2; color: #97266d; }
.lf-result-icon[data-type="Field Notes"] { background: #fefcbf; color: #744210; }

.lf-result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.lf-result-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin-bottom: 0.15rem;
}
.lf-result-title {
  font-weight: 600;
  color: #1a2332;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}
.lf-result-excerpt {
  color: #4a5568;
  font-size: 0.85rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lf-result-excerpt mark {
  background: #fefcbf;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}
.lf-result-arrow {
  flex-shrink: 0;
  color: #cbd5e0;
  align-self: center;
  font-size: 1.1rem;
}
.lf-result:hover .lf-result-arrow { color: #2b6cb0; }
