/* ────────────────────────────────────────────
   Search bar — footer trigger + inline form
   ──────────────────────────────────────────── */

/* ── SEARCH [K] button (idle state) ── */

.search-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3125rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(var(--nc) / 0.65);
  transition: color 150ms ease, background 150ms ease;
}

.search-bar__btn:hover {
  color: oklch(var(--nc));
  background: oklch(var(--nc) / 0.1);
}

.search-bar__btn kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3125rem;
  height: 1.3125rem;
  border: 1px solid oklch(var(--nc) / 0.3);
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

/* ── Inline search row (active state, lives inside footer bar) ── */
/* Hidden by default; JS shows when opened. Inline style overrides this. */
.search-bar__search-row {
  display: none;
  align-items: center;
  gap: 1rem;
  width: min(50%, 600px);
  margin-inline: auto;
}

@media (max-width: 640px) {
  .search-bar__search-row {
    width: calc(100% - 2rem);
  }

  .search-bar__results-panel {
    width: calc(100vw - 2rem);
  }
}

.search-bar__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: oklch(var(--nc) / 0.75);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-bar__form {
  flex: 1;
  display: flex;
}

.search-bar__input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid oklch(var(--nc) / 0.22);
  color: oklch(var(--nc));
  font-size: 0.875rem;
  padding: 0.125rem 0;
  outline: none;
  transition: border-color 150ms ease;
}

.search-bar__input:focus {
  border-bottom-color: oklch(var(--nc) / 0.5);
  outline: none;
  box-shadow: none;
}

.search-bar__input::placeholder {
  color: oklch(var(--nc) / 0.35);
}

.search-bar__close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: oklch(var(--nc) / 0.45);
  font-size: 0.9375rem;
  padding: 0.25rem;
  flex-shrink: 0;
  line-height: 1;
  transition: color 120ms ease;
}

.search-bar__close-btn:hover {
  color: oklch(var(--nc));
}

/* ── Results panel: floats above the footer ── */
/* Hidden by default; JS shows when search is submitted. Inline style overrides this. */
.search-bar__results-panel {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0.5rem;
  width: min(50vw, 600px);
  background: oklch(var(--b1));
  border-radius: 1rem;
  box-shadow:
    0 -2px 16px oklch(0 0 0 / 0.10),
    0 8px 32px oklch(0 0 0 / 0.12),
    0 0 0 1px oklch(0 0 0 / 0.06);
  max-height: 65dvh;
  overflow-y: auto;
}

/* ── Results content ── */

.search-results {
  padding: 1rem 1.125rem 1.25rem;
}

.search-results__hint {
  font-size: 0.8125rem;
  color: oklch(var(--bc) / 0.4);
  text-align: center;
  padding: 1.25rem 0 0.75rem;
}

.search-section-title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(var(--bc) / 0.4);
  margin-bottom: 0.375rem;
}

.search-section-title.mt-4 {
  margin-top: 1.25rem;
}

.search-results__list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: oklch(var(--bc));
  transition: background 100ms ease;
}

.search-result-item:hover {
  background: oklch(var(--b2));
}

.search-result-item__icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.search-result-item__name {
  font-size: 0.875rem;
  font-weight: 600;
}

.search-result-item__meta {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.45);
  margin-left: auto;
}

.search-result-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.search-result-item__excerpt {
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
