/* ==========================================================================
   Custom Search – Autocomplete Dropdown
   ========================================================================== */

.search-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.custom-search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.custom-search-input:focus {
  border-color: #1a4fcf;
  box-shadow: 0 0 0 3px rgba(26, 79, 207, 0.15);
}

.custom-search-form button[type="submit"] {
  padding: 10px 20px;
  font-size: 1rem;
  background: #1a4fcf;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.custom-search-form button[type="submit"]:hover {
  background: #1340a8;
}

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

.search-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-height: 380px;
  overflow-y: auto;
}

/* Gruppen-Header */
.search-autocomplete-group {
  padding: 8px 14px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  border-top: 1px solid #f0f0f0;
  cursor: default;
  user-select: none;
}

.search-autocomplete-group:first-child {
  border-top: none;
}

/* Ergebnis-Item */
.search-autocomplete-item a {
  display: block;
  padding: 9px 14px;
  color: #222;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s, color 0.1s;
}

.search-autocomplete-item.is-active a,
.search-autocomplete-item a:hover {
  background: #eef2ff;
  color: #1a4fcf;
}

/* --------------------------------------------------------------------------
   Suchergebnisseite
   -------------------------------------------------------------------------- */

.search-results-page {
  margin: 2rem 0;
  padding: 0;
}

.search-results-page__headline {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #111;
}

.search-results-page__empty {
  color: #666;
  font-style: italic;
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-result-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  transition: box-shadow 0.15s;
}

.search-result-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-result-item__badge {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eef2ff;
  color: #1a4fcf;
}

.search-result-item__link {
  font-size: 1rem;
  color: #1a4fcf;
  text-decoration: none;
}

.search-result-item__link:hover {
  text-decoration: underline;
}

.search-result-item__url {
  display: block;
  padding: 2px 12px 0;
  font-size: 0.8rem;
  font-style: italic;
  color: #618c82;
}

.search-result-item__excerpt {
  margin: 4px 12px 8px;
  font-size: 0.875rem;
  color: #444;
  line-height: 1.6;
}

.search-result-item__excerpt strong {
  color: #2b7a4e;
  font-weight: 700;
  background: rgba(95, 195, 134, 0.2);
  padding: 0 2px;
  border-radius: 2px;
}

/* ==========================================================================
   Suchergebnisseite – überarbeitetes Layout
   ========================================================================== */

.search-results-page {
  margin: 2rem 0;
  padding: 0;
}

.search-results-page .custom-search-form {
  margin-bottom: 2rem;
}

.search-results-page__count {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1.5rem;
}

/* Gruppen */
.search-results-group {
  margin-bottom: 2rem;
}

.search-results-group__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

/* Ergebnisliste */
.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item {
  border-radius: 6px;
  transition: background 0.1s;
}

.search-result-item:hover {
  background: #f5f7ff;
}

.search-result-item__link {
  display: block;
  padding: 10px 12px;
  color: #1a4fcf;
  text-decoration: none;
  font-size: 1rem;
}

.search-result-item__link:hover {
  text-decoration: underline;
}

.search-result-item__url {
  display: block;
  padding: 2px 12px 0;
  font-size: 0.8rem;
  font-style: italic;
  color: #618c82;
}

.search-result-item__excerpt {
  margin: 4px 12px 8px;
  font-size: 0.875rem;
  color: #444;
  line-height: 1.6;
}

.search-result-item__excerpt strong {
  color: #2b7a4e;
  font-weight: 700;
  background: rgba(95, 195, 134, 0.2);
  padding: 0 2px;
  border-radius: 2px;
}

/* Leerer Zustand */
.search-results-page__empty {
  margin-top: 2rem;
  padding: 2rem;
  background: #f9f9f9;
  border-radius: 8px;
  text-align: center;
  color: #555;
}

.search-results-page__hint {
  font-size: 0.875rem;
  color: #999;
  margin-top: 0.5rem;
}
