/* =========================================================
   wasmachen.ch – Startseite: Suche zuerst
   - Such-Hero (eine Eingabe, Ideen-Chips, Filter-Knopf)
   - Filter-Panel als zweite Ebene
   - Ergebnisse: "Verstanden" mit Ort/Umkreis, Top 3 als Karten mit Begründung
   ========================================================= */

/* ---------------- Such-Hero ---------------- */
.search-hero {
  background: var(--primary);
  color: #fff;
  padding: 22px 16px 20px;
}
.search-hero__inner { max-width: 820px; margin: 0 auto; }
.search-hero__title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.8rem, 7vw, 3rem);
  line-height: 1.06;
  letter-spacing: -.01em;
  text-shadow: 0 2px 0 rgba(14, 42, 88, .14);
}
.search-hero__sub {
  display: none;
  margin: 8px auto 0;
  max-width: 48ch;
  text-align: center;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, .92);
}

/* Suchfeld */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 58px;
  margin: 16px auto 0;
  padding: 0 6px 0 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(14, 42, 88, .24);
  transition: box-shadow .15s ease;
}
.search-box:focus-within { box-shadow: 0 0 0 4px rgba(255, 193, 138, .75), 0 14px 34px rgba(14, 42, 88, .24); }
.search-box__icon { flex: none; width: 21px; height: 21px; fill: none; stroke: #8a97ad; stroke-width: 2.3; stroke-linecap: round; }
.search-box input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.06rem;
}
.search-box input::placeholder { color: #8a97ad; opacity: 1; }
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.search-box__clear {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #eef2f8;
  color: #56647a;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.search-box__clear:hover { background: #e2e8f2; }
.search-box__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 3px 0 #b5702f;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
}
.search-box__go svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.search-box__go:hover { filter: brightness(1.06); }
.search-box__go:active { transform: translateY(2px); box-shadow: 0 1px 0 #b5702f; }
.search-box__go:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Filter-Knopf + Ideen-Chips (Handy: eine Zeile zum Wischen, bis an den Rand) */
.search-hero__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px -16px 0 0;
}
/* Alte Regeln aus style.css (#btn-more: order 1, mobil 100% breit) gelten hier nicht */
.search-hero #btn-more { order: 0; width: auto; min-width: 0; }
.idea-chips {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 2px 16px 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.idea-chips::-webkit-scrollbar { display: none; }
.idea-chip,
.hero-filter {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.idea-chip:hover { background: rgba(255, 255, 255, .28); }
.idea-chip:focus-visible,
.hero-filter:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.idea-chip svg,
.hero-filter svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.idea-chip.is-on { background: #fff; border-color: #fff; color: #2f6dc2; }
.idea-chip.is-busy { opacity: .7; cursor: progress; }
.hero-filter { background: #fff; border-color: #fff; color: #0e2a58; }
.hero-filter:hover { background: #f1f6ff; }
.hero-filter[aria-expanded="true"] { background: #0e2a58; border-color: #0e2a58; color: #fff; }
.hero-filter__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
}

/* ---------------- Filter-Panel (zweite Ebene) ---------------- */
.filter-shell .filters-wrap {
  margin: 14px 0 4px;
  box-shadow: 0 14px 40px rgba(14, 42, 88, .12);
}
.filters-head__actions { display: flex; align-items: center; gap: 4px; }
.filters-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef2f8;
  color: #56647a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.filters-close:hover { background: #e2e8f2; }
#filter-panel .filterbar--location { margin-top: 4px; }
#filter-panel #btn-apply { min-width: 240px; }

/* "Aktivität der Woche" macht während einer Suche Platz für die Ergebnisse */
body.ai-mode .hero { display: none; }

/* ---------------- Ergebnisse ---------------- */
.ai-results { margin-top: 22px; }

/* Ladezustand: hüpfende Punkte statt Kasten */
.ai-stepper { margin: 0 0 14px; padding: 0; background: none; border: 0; gap: 12px; }
.ai-dots { display: inline-flex; gap: 6px; }
.ai-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); animation: wmDot 1s ease-in-out infinite; }
.ai-dots i:nth-child(2) { background: var(--accent); animation-delay: .15s; }
.ai-dots i:nth-child(3) { background: var(--highlight); animation-delay: .3s; }
@keyframes wmDot { 0%, 80%, 100% { transform: translateY(0); opacity: .55; } 40% { transform: translateY(-6px); opacity: 1; } }
.ai-stepper__text { color: #0e2a58; font-weight: 700; font-size: 1.02rem; }

/* Verstanden */
.ai-intent { margin: 0 0 6px; padding: 0; background: none; border: 0; border-radius: 0; }
.ai-intent__label {
  display: block;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.ai-intent__summary { margin: 2px 0 10px; color: #0e2a58; font-size: 1.14rem; font-weight: 700; line-height: 1.35; }
.ai-intent__summary:empty { display: none; }
.ai-intent .ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-intent-chip { padding: 6px 12px; }

/* Orts-Chip mit Umkreis-Auswahl */
.ai-geo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 4px 0 11px;
  border: 0;
  border-radius: 999px;
  background: #0e2a58;
  color: #fff;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
}
.ai-geo svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ai-geo__radius {
  appearance: none;
  -webkit-appearance: none;
  height: 26px;
  padding: 0 24px 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ai-geo__radius option { color: var(--text); }
.ai-geo--ask { padding: 0 14px 0 11px; background: var(--accent); cursor: pointer; }

/* Kopf der Top-Treffer */
.ai-results__head { margin: 22px 0 12px; }
.ai-results__head h2 { margin: 0; color: #0e2a58; font-size: clamp(1.4rem, 4.8vw, 1.8rem); }

/* ---------------- Top 3: Karten mit Begründung ---------------- */
.picks { display: grid; gap: 14px; margin: 0 0 10px; }
.picks:empty { display: none; }
.pick {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(14, 42, 88, .08);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pick.card--clickable:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(14, 42, 88, .13); }
.pick.ai-new { border-radius: 18px; } /* "Neu"-Puls soll die Ecken nicht ändern */
.pick:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.pick__media { position: relative; flex: none; background: #e7edf6; }
.pick__media img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pick__tags {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 46px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.pick__tags .badge--highlight,
.pick__tags .badge--deal { position: static; }
.pick__rank {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: #0e2a58;
  font-weight: 700;
  font-size: 1.02rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}
.pick--1 .pick__rank { background: var(--highlight); }
.pick__closed {
  padding: .26rem .7rem;
  border-radius: 999px;
  background: rgba(15, 26, 43, .62);
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.pick .fav-btn { z-index: 4; }
.pick__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 16px; }
.pick__title { margin: 0; color: #0e2a58; font-size: 1.18rem; line-height: 1.2; }
.pick__sub { margin: -2px 0 0; color: var(--muted); font-size: .95rem; line-height: 1.3; }
.pick__meta { display: flex; align-items: center; gap: 5px; margin: 0; color: #4f5d73; font-size: .9rem; font-weight: 700; }
.pick__meta svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pick__why {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff6ea;
  color: #22324d;
  font-size: .97rem;
  line-height: 1.45;
}
.pick__why b { color: #b5702f; }
.pick .pick__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  min-height: 38px;
  margin-top: auto;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
}
.pick__body > .pick__why + .pick__cta,
.pick__body > .pick__meta + .pick__cta { margin-top: 8px; }
.pick .pick__cta svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* Handy: #1 gross, #2/#3 kompakt als Zeile (Bild links) */
@media (max-width: 599px) {
  .picks--2 .pick:not(.pick--1),
  .picks--3 .pick:not(.pick--1) { flex-direction: row; }
  .picks .pick:not(.pick--1) .pick__media { width: 38%; max-width: 150px; }
  .picks .pick:not(.pick--1) .pick__media img { aspect-ratio: auto; min-height: 100%; }
  .picks .pick:not(.pick--1) .pick__body { padding: 11px 12px 12px; gap: 5px; }
  .picks .pick:not(.pick--1) .pick__title { font-size: 1.02rem; }
  .picks .pick:not(.pick--1) .pick__sub,
  .picks .pick:not(.pick--1) .pick__cta { display: none; }
  .picks .pick:not(.pick--1) .pick__why {
    padding: 0;
    background: none;
    font-size: .9rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .picks .pick:not(.pick--1) .pick__tags { right: auto; }
  .picks .pick:not(.pick--1) .badge--highlight,
  .picks .pick:not(.pick--1) .badge--deal,
  .picks .pick:not(.pick--1) .pick__closed { display: none; }
  .picks .pick:not(.pick--1) .fav-btn { display: none; }
  .picks .pick:not(.pick--1) .pick__rank { width: 28px; height: 28px; font-size: .92rem; }
}

/* Tablet: #1 quer über die ganze Breite, #2/#3 nebeneinander */
@media (min-width: 600px) and (max-width: 899px) {
  .picks--2,
  .picks--3 { grid-template-columns: 1fr 1fr; }
  .picks .pick--1 { grid-column: 1 / -1; flex-direction: row; }
  .picks .pick--1 .pick__media { width: 50%; }
  .picks .pick--1 .pick__media img { aspect-ratio: auto; min-height: 100%; }
  .picks--1 .pick--1 { flex-direction: row; }
}

/* Desktop: #1 gross links, #2/#3 rechts übereinander (Bild links, Text rechts) */
@media (min-width: 900px) {
  .picks--3 { grid-template-columns: 1.5fr 1fr; grid-template-rows: auto auto; gap: 18px; }
  .picks--3 .pick--1 { grid-row: 1 / 3; }
  .picks--3 .pick--2,
  .picks--3 .pick--3 { flex-direction: row; }
  .picks--3 .pick--2 .pick__media,
  .picks--3 .pick--3 .pick__media { width: 40%; }
  .picks--3 .pick--2 .pick__media img,
  .picks--3 .pick--3 .pick__media img { aspect-ratio: auto; min-height: 100%; }
  .picks--3 .pick--2 .pick__sub,
  .picks--3 .pick--3 .pick__sub { display: none; }
  .picks--3 .pick--2 .pick__why,
  .picks--3 .pick--3 .pick__why {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .picks--3 .pick--1 .pick__media img { aspect-ratio: 16 / 9; }
  .picks--3 .pick--1 .pick__title { font-size: 1.45rem; }
  .picks--3 .pick--1 .pick__why { font-size: 1.04rem; }
  .picks--2 { grid-template-columns: 1fr 1fr; gap: 18px; }
  .picks--1 .pick--1 { flex-direction: row; }
  .picks--1 .pick--1 .pick__media { width: 55%; }
  .picks--1 .pick--1 .pick__media img { aspect-ratio: auto; min-height: 100%; }
}

/* Platzhalter beim Laden */
.pick--skeleton { cursor: default; box-shadow: none; }
.pick--skeleton .pick__media { min-height: 150px; }
.picks--3 .pick--1.pick--skeleton .pick__media { min-height: 210px; }
.pick--skeleton .pick__media,
.pick--skeleton .sk {
  background: linear-gradient(90deg, #edf1f7 0%, #f7f9fc 45%, #edf1f7 90%);
  background-size: 220% 100%;
  animation: wmShimmer 1.3s linear infinite;
}
.pick--skeleton .sk { display: block; height: 14px; border-radius: 7px; }
.pick--skeleton .sk--title { width: 60%; height: 20px; }
.pick--skeleton .sk--line { width: 92%; }
.pick--skeleton .sk--short { width: 48%; }
@keyframes wmShimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }

/* ---------------- Desktop / Tablet ---------------- */
@media (min-width: 760px) {
  .search-hero { padding: 40px 24px 34px; }
  .search-hero__sub { display: block; }
  .search-box { height: 64px; margin-top: 22px; padding-left: 20px; }
  .search-box input { font-size: 1.12rem; }
  .search-box__go { width: 50px; height: 50px; }
  /* Filter-Knopf + Chips als eine zentrierte, umbrechende Reihe */
  .search-hero__row { flex-wrap: wrap; justify-content: center; margin: 18px 0 0; }
  .idea-chips { display: contents; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-dots i,
  .pick--skeleton .pick__media,
  .pick--skeleton .sk { animation: none; }
  .pick.card--clickable:hover { transform: none; }
}

/* Limit-Hinweis: Marken-Icon statt Emoji */
.ai-modal__icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 14px; }
