.site-header__start { display: flex; align-items: center; gap: 20px; width: 240px; flex: none; }
.site-header__start .brand { width: auto; }
.search-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 999px; border: 1px solid var(--line-200); background: #fff; color: var(--ink-900); cursor: pointer; transition: background .2s, color .2s; }
.search-btn:hover { background: var(--surface-3); color: var(--blue-500); }
html.js:not(.reduce-motion) .site-header__bar .search-btn { animation: hdrIn 1s var(--ease-out) backwards; animation-delay: .1s; }
html:not(.js) .search-btn, html:not(.js) .mobile-menu__search { display: none; }
.mobile-menu__search { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; margin: 8px 0 6px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-200); background: #fff; color: var(--ink-400); font-size: 16px; text-align: left; cursor: pointer; }
.mobile-menu__search .i { color: var(--ink-900); }

.search { width: min(680px, calc(100% - 32px)); max-width: none; max-height: min(640px, calc(100dvh - 24vh)); margin: 12vh auto auto; padding: 0; border: 0; border-radius: 26px; background: #fff; color: var(--ink-900); box-shadow: 0 30px 80px rgba(16, 17, 28, .18); overflow: hidden; }
.search[open] { display: flex; animation: searchIn .35s var(--ease-out); }
.search::backdrop { background: rgba(16, 17, 28, .38); animation: fadeIn .3s cubic-bezier(.22, 1, .36, 1); }
@keyframes searchIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.reduce-motion .search[open], .reduce-motion .search::backdrop { animation: none; }
.search__panel { display: flex; flex-direction: column; width: 100%; min-height: 0; }

.search__field { display: flex; align-items: center; gap: 12px; flex: none; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line-100); }
.search__field > .i { color: var(--ink-400); transition: color .2s; }
.search.is-loading .search__field > .i { color: var(--blue-500); animation: searchPulse 1s ease-in-out infinite; }
@keyframes searchPulse { 50% { opacity: .35; } }
.search__input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 18px; letter-spacing: -0.01em; color: var(--ink-900); }
.search__input::placeholder { color: var(--ink-300); }
.search__input:focus, .search__input:focus-visible { outline: none; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search__close { flex: none; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-200); background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; }
.search__close:hover { background: var(--surface-3); }

.search__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px 12px; }
.search__label { padding: 10px 12px 6px; font-size: 13px; color: var(--ink-500); }
.search__label[hidden] { display: none; }
.search__item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; color: var(--ink-900); scroll-margin: 8px; }
.search__item:hover { color: var(--ink-900); }
.search__item[aria-selected="true"] { background: var(--surface-2); }
.search__item[aria-selected="true"] .tile--glow { color: color-mix(in srgb, var(--h, var(--blue-500)) 82%, #10111c); }
.search__item .tile { flex: none; }
.search__text { flex: 1; min-width: 0; }
.search__title { display: block; font-size: 16px; line-height: 22px; letter-spacing: -0.015em; }
.search__desc { display: -webkit-box; margin-top: 2px; font-size: 13.5px; line-height: 19px; color: var(--ink-500); -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search__in { color: var(--ink-800); font-weight: 500; }
.search__in::after { content: " ·"; color: var(--ink-300); font-weight: 400; }
.search__type { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12px; line-height: 14px; color: var(--ink-500); white-space: nowrap; }
.search mark { padding: 0 1px; border-radius: 3px; background: var(--blue-100); color: inherit; }
.search__title mark { color: var(--ink-900); }

.search__empty { padding: 28px 16px 18px; text-align: center; }
.search__msg { font-size: 17px; letter-spacing: -0.015em; color: var(--ink-900); overflow-wrap: anywhere; }
.search__help p { margin: 6px 0 18px; font-size: 14px; color: var(--ink-500); }
.search__help[hidden] { display: none; }
.search__help .btn { margin: 4px; }
.btn--sm { gap: 8px; height: 40px; padding: 0 16px; font-size: 14.5px; }

.search__foot { display: flex; gap: 18px; flex: none; padding: 10px 22px; border-top: 1px solid var(--line-100); font-size: 12.5px; color: var(--ink-400); }
.search__foot span { display: inline-flex; align-items: center; gap: 4px; }
.search__foot kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border: 1px solid var(--line-200); border-bottom-width: 2px; border-radius: 6px; background: #fff; font: inherit; font-size: 11.5px; color: var(--ink-600); }
.search__foot kbd + kbd { margin-left: -1px; }
.search__foot span kbd:last-of-type { margin-right: 3px; }
@media (hover: none) { .search__foot { display: none; } }

@media (max-width: 1280px) {
  .site-header__start { width: auto; }
}
@media (max-width: 720px) {
  .site-header__bar .search-btn { display: none; }
  .search { width: calc(100% - 16px); max-height: calc(100dvh - 16px); margin-top: 8px; border-radius: 20px; }
  .search__field { padding: 10px 10px 10px 16px; }
  .search__input { font-size: 17px; }
  .search__type { display: none; }
}

/* German compounds ("Gemeindeveranstaltung") can be wider than a heading on phones: let the browser hyphenate
   long words there. Only German pages, only small screens, only words of 12+ letters. */
@media (max-width: 720px) {
  html[lang="de"] :is(h1, h2, h3, h4) { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 12 5 5; }
}
