/* ============================================================
   ask-section.css — Ask. Intelligente FAQ-Suche | Marcher Lab.
   Version: 1.0 | 2026-06-17

   Verwendung:
     <section class="ml-ask" id="faq"
              data-eyebrow="ASK."
              data-title="Deine Fragen"
              data-lead="Einfach eintippen — wir finden die Antwort.">
     </section>
     <script>window.FAQ_DATA = [{q:'...', a:'...'}, ...];</script>
     <script src="/shared/ask-renderer.js?v=1" defer></script>
   ============================================================ */

/* ── SECTION ───────────────────────────────────────────────── */
.ml-ask {
  background: var(--white);
  padding: 5.5rem 0;
  border-top: 1px solid var(--border);
  position: relative;
}

/* ── INNER WRAPPER ─────────────────────────────────────────── */
.ml-ask-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2rem;
  box-sizing: border-box;
  width: 100%;
}

/* ── HEAD ──────────────────────────────────────────────────── */
.ml-ask-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.6rem;
}

.ml-ask-title {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 0.75rem;
}

.ml-ask-title-dot {
  color: var(--gold);
}

.ml-ask-lead {
  margin: 0 0 2.25rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 520px;
}

/* ── SUCHFELD ──────────────────────────────────────────────── */
.ml-ask-search-wrap {
  position: relative;
  margin-bottom: 2rem;
}

.ml-ask-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s;
}

.ml-ask-input {
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 3rem 1rem 3rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.ml-ask-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.ml-ask-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15), var(--shadow-sm);
}

.ml-ask-search-wrap:focus-within .ml-ask-search-icon {
  color: var(--gold-dark);
}

/* Clear-Button */
.ml-ask-clear {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.ml-ask-clear:hover {
  background: var(--gold-light);
  color: var(--navy);
}

.ml-ask-clear.is-visible {
  display: flex;
}

/* ── VORSCHLÄGE (Top-3 beim Fokus) ────────────────────────── */
.ml-ask-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  animation: askFadeIn 0.2s ease;
}

.ml-ask-suggestions.is-visible {
  display: flex;
}

.ml-ask-suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}

.ml-ask-suggestion-pill:hover {
  border-color: var(--gold);
  background: var(--gold-light);
  color: var(--navy);
}

.ml-ask-suggestion-pill svg {
  color: var(--gold-dark);
  flex-shrink: 0;
}

/* ── ERGEBNISLISTE ─────────────────────────────────────────── */
.ml-ask-results {
  display: none;
}

.ml-ask-results.is-visible {
  display: block;
  animation: askFadeIn 0.18s ease;
}

.ml-ask-result-count {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.ml-ask-result-count span {
  color: var(--gold-dark);
}

/* ── FAQ LIST (default / gefiltert) ───────────────────────── */
.ml-ask-list {
  border-top: 1px solid var(--border);
}

.ml-ask-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  transition: background 0.2s;
}

.ml-ask-item[open] {
  background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  border-radius: 4px;
}

.ml-ask-q {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: color 0.2s;
}

.ml-ask-q:hover {
  color: var(--gold-dark);
}

.ml-ask-q::-webkit-details-marker {
  display: none;
}

.ml-ask-q-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.25s ease, color 0.2s;
}

.ml-ask-item[open] .ml-ask-q-icon {
  transform: rotate(180deg);
  color: var(--gold-dark);
}

.ml-ask-q:hover .ml-ask-q-icon {
  color: var(--gold-dark);
}

/* Highlight für Suchtreffer */
.ml-ask-highlight {
  background: rgba(245, 197, 24, 0.25);
  border-radius: 2px;
  padding: 0 2px;
}

.ml-ask-a {
  margin-top: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.94rem;
}

.ml-ask-a a {
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

.ml-ask-a a:hover {
  color: var(--gold-dark);
}

.ml-ask-a strong {
  color: var(--text);
  font-weight: 700;
}

/* ── KEIN ERGEBNIS / MEINTEST DU ──────────────────────────── */
.ml-ask-empty {
  display: none;
  padding: 2.5rem 0;
  text-align: center;
  animation: askFadeIn 0.2s ease;
}

.ml-ask-empty.is-visible {
  display: block;
}

.ml-ask-empty-icon {
  width: 48px;
  height: 48px;
  background: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--gold-dark);
}

.ml-ask-empty-text {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.ml-ask-empty-text strong {
  color: var(--navy);
}

.ml-ask-related-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.75rem;
}

.ml-ask-related-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ml-ask-related-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.ml-ask-related-pill:hover {
  border-color: var(--gold);
  background: var(--gold-light);
}

/* ── BRANDING ──────────────────────────────────────────────── */
.ml-ask-brand {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ml-ask-brand-text {
  letter-spacing: 0.08em;
}

.ml-ask-brand-dot {
  color: var(--gold);
  letter-spacing: 0;
}

.ml-ask-brand-word {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  letter-spacing: 0;
}

.ml-ask-brand-word::after {
  content: '.';
  color: var(--gold);
  letter-spacing: 0;
}

/* ── ANIMATION ─────────────────────────────────────────────── */
@keyframes askFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MOBILE ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ml-ask {
    padding: 4rem 0;
  }
  .ml-ask-inner {
    padding: 0 1.25rem;
  }
  .ml-ask-q {
    font-size: 0.95rem;
  }
  .ml-ask-a {
    font-size: 0.9rem;
  }
  .ml-ask-suggestion-pill {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
  }
}

/* ── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ml-ask-input,
  .ml-ask-q-icon,
  .ml-ask-suggestion-pill,
  .ml-ask-related-pill {
    transition: none;
  }
  @keyframes askFadeIn { from { opacity: 1; } }
}
