/* search-bar.css – Suchleiste Wo · Wann · Wer (includes/search-bar.php, script/js/search-bar.js)
   Genutzt in: search.php (Suchseite), blog.php (Reiseblog-Übersicht)
   Ergänzt style.css (Farben, Kalender .cal-*). Die kompakte Leiste beim Scrollen (.search-top.is-compact) steht in search.css. */

/* ---------- Suchleiste (Wo · Wann · Wer) ---------- */
.sbar { position: relative; display: flex; align-items: center; width: 100%; max-width: 860px; height: 66px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 3px 12px rgba(58,51,48,.10); transition: height .25s ease; }
.sbar.is-active { background: color-mix(in srgb, var(--border) 45%, var(--surface)); }
.sbar-seg { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: center; border-radius: 999px; min-width: 0; }
.sbar-where { flex: 1.35; padding: 0 24px 0 32px; cursor: text; }
.sbar-when { flex: 1.1; }
.sbar-who { flex: 1.25; flex-direction: row; align-items: center; padding-right: 8px; }
.sbar-seg:hover { background: color-mix(in srgb, var(--border) 55%, var(--surface)); }
.sbar-seg.is-open { background: var(--surface); box-shadow: 0 6px 20px rgba(58,51,48,.16); z-index: 2; }
.sbar-sep { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }
.sbar-seg:hover + .sbar-sep, .sbar-sep:has(+ .sbar-seg:hover), .sbar-seg.is-open + .sbar-sep, .sbar-sep:has(+ .sbar-seg.is-open) { background: transparent; }

.sbar-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text); margin: 0; line-height: 1.2; transition: font-size .25s ease; }
.sbar .sbar-input { width: 100%; border: none; padding: 2px 0 0; background: transparent; font-size: 14px; color: var(--text); box-shadow: none; border-radius: 0; text-overflow: ellipsis; }
.sbar .sbar-input:focus { box-shadow: none; outline: none; }
.sbar .sbar-input::placeholder { color: var(--muted); }
.sbar-btn { flex: 1; height: 100%; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; padding: 0 24px; background: none; border: none; border-radius: 999px; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.sbar-btn:focus-visible { outline: 2px solid var(--sea); outline-offset: -4px; }
.sbar-value { display: block; max-width: 100%; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbar-value.is-set { color: var(--text); font-weight: 500; }

/* Such-Button: rund, Akzentfarbe; Text erscheint nur auf dem Handy */
.sbar-go { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 50px; height: 50px; padding: 0; border: none; border-radius: 999px; background: var(--accent); color: var(--on-accent); cursor: pointer; font: inherit; font-weight: 700; transition: background .15s, width .25s ease, height .25s ease; }
.sbar-go:hover { background: var(--accent-hover); }
.sbar-go:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.sbar-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.sbar-go span { display: none; }

/* Aufklappfenster unter der Suchleiste */
.sbar-pop { position: absolute; top: calc(100% + 12px); z-index: 40; background: var(--surface); border-radius: 24px; box-shadow: 0 10px 36px rgba(58,51,48,.20); border: 1px solid var(--border); }
.sbar-pop[hidden] { display: none; }

/* Ortsvorschläge */
.ac-list { left: 0; width: min(420px, 92vw); list-style: none; margin: 0; padding: 12px 0; max-height: 380px; overflow-y: auto; }
.ac-head { padding: 4px 24px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ac-item { display: flex; align-items: center; gap: 14px; padding: 9px 24px; cursor: pointer; }
.ac-item:hover, .ac-item.is-active { background: color-mix(in srgb, var(--border) 50%, var(--surface)); }
.ac-icon { flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; background: color-mix(in srgb, var(--border) 60%, var(--surface)); display: flex; align-items: center; justify-content: center; }
.ac-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ac-text { min-width: 0; line-height: 1.35; }
.ac-name { display: block; font-size: 15px; color: var(--text); }
.ac-name mark { background: none; color: inherit; font-weight: 700; }
.ac-meta { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-empty { padding: 10px 24px; color: var(--muted); font-size: 14px; }

/* Kalender (nutzt die .cal-* Klassen aus style.css) */
.pop-cal { left: 50%; transform: translateX(-50%); width: min(760px, 96vw); padding: 24px 28px 18px; }
.pop-cal .cal-nav { top: 22px; left: 24px; right: 24px; }
.pop-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.pop-done { background: var(--text); color: #fff; border: none; border-radius: 10px; padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer; }
.pop-done:hover { background: color-mix(in srgb, var(--text) 85%, #000); }

/* Gäste */
.pop-who { right: 0; width: min(360px, 92vw); padding: 20px 24px; }
.who-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.who-row strong { display: block; font-size: 16px; }
.who-row small { display: block; color: var(--muted); font-size: 13px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper output { min-width: 22px; text-align: center; font-weight: 600; }
.step-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--muted) 55%, transparent); background: var(--surface); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.step-btn:hover:not(:disabled) { border-color: var(--text); }
.step-btn:disabled { opacity: .3; cursor: default; }

.sbar-noscript { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.sbar-noscript label { display: flex; align-items: center; gap: 8px; margin: 0; }
.sbar-noscript input { width: auto; }

@media (max-width: 760px) {
    /* Suchleiste wird zur Karte mit drei Zeilen */
    .sbar { flex-direction: column; height: auto; border-radius: 22px; align-items: stretch; padding: 6px; }
    .sbar-sep { width: auto; height: 1px; margin: 0 16px; }
    .sbar-seg { border-radius: 16px; }
    .sbar-where { padding: 12px 16px; }
    .sbar-btn { padding: 12px 16px; }
    .sbar-who { flex-direction: column; align-items: stretch; padding: 0; }
    .sbar-go { width: 100%; height: 48px; margin-top: 6px; border-radius: 14px; }
    .sbar-go span { display: inline; }
    .sbar-pop, .ac-list, .pop-cal, .pop-who { position: absolute; left: 0; right: 0; width: auto; transform: none; top: calc(100% + 8px); }
    .pop-cal { padding: 20px 16px 14px; }
    .pop-cal .cal-nav { left: 12px; right: 12px; top: 16px; }
}
