/**
 * header.css
 *
 * Kopfzeile mit Seitentitel und Suchfeld samt Vorschlags-Dropdown
 * (siehe assets/js/autocomplete.js für das Verhalten).
 */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-bg-panel), var(--color-bg));
  position: sticky;
  top: 0;
  z-index: 30;
}

.site-header__bar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.site-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 19px;
  white-space: nowrap;
}

.site-title__mark {
  color: var(--color-brass);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.site-title__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-title__text small {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
  font-size: 11px;
  color: var(--color-text-faint);
}

/* --- Suchfeld --- */

.search {
  position: relative;
  width: 100%;
  max-width: 420px;
}

.search__field {
  position: relative;
  display: flex;
  align-items: center;
}

.search__icon {
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  color: var(--color-text-faint);
  pointer-events: none;
  transition: color 0.15s ease;
}

.search__input {
  width: 100%;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px var(--space-3) 10px 38px;
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search__input::placeholder {
  color: var(--color-text-faint);
}

.search__input:focus {
  border-color: var(--color-brass);
  box-shadow: 0 0 0 3px rgba(201, 151, 79, 0.15);
}

.search__input:focus ~ .search__icon,
.search__field:focus-within .search__icon {
  color: var(--color-brass-bright);
}

/* Signatur: dezenter Radar-Sweep-Ring, nur bei Fokus, sehr zurückhaltend */
.search__field::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(from 0deg, rgba(232, 183, 104, 0.55), transparent 30%);
  transition: opacity 0.2s ease;
}

.search__field:focus-within::after {
  opacity: 1;
  animation: search-sweep 2.4s linear infinite;
}

@keyframes search-sweep {
  to { transform: rotate(360deg); }
}

/* --- Vorschlags-Dropdown --- */

.search__suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-bg-panel-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  max-height: 280px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: var(--space-1) 0;
  z-index: 40;
}

.search__suggestions[hidden] {
  display: none;
}

.search__suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  cursor: pointer;
  color: var(--color-text-dim);
  font-size: 14px;
}

.search__suggestion mark {
  background: none;
  color: var(--color-brass-bright);
  font-weight: 600;
}

.search__suggestion .search__suggestion-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
}

.search__suggestion:hover,
.search__suggestion[aria-selected="true"] {
  background: rgba(201, 151, 79, 0.12);
  color: var(--color-text);
}

.search__suggestion-empty {
  padding: var(--space-3);
  color: var(--color-text-faint);
  font-size: 13px;
}

@media (max-width: 720px) {
  .site-title__text small { display: none; }
  .site-header__bar { gap: var(--space-3); }
}
