/* live-suggest.css — dropdown z podpowiedziami pod inputem wyszukiwarki.
   Wszystkie kolory z własnym tokenem `--ls-*` z jawnym fallbackiem,
   żeby portal nie dziedziczył z globalnego `a {color: var(--forest)}`. */

:root {
  --ls-bg:         #ffffff;
  --ls-bg-alt:     #F3F6F2;
  --ls-border:     #DDE4E8;
  --ls-text:       #1B2733;
  --ls-text-muted: #607D8B;
  --ls-accent:     #1B5E20;
  --ls-mark:       #FFF59D;
  --ls-shadow:     0 24px 48px -16px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.06);
}

/* Portal przełącza się na dark przez localStorage → html.dark. Media-query nie
   stosujemy, bo portal nie reaguje na prefers-color-scheme, a jego tło zostaje
   jasne — nie chcemy nasz dropdown dark-mode'ować wbrew reszcie strony. */
html.dark {
  --ls-bg:         #16222b;
  --ls-bg-alt:     #1F2E39;
  --ls-border:     #2A3B47;
  --ls-text:       #E7EEF4;
  --ls-text-muted: #90A4AE;
  --ls-shadow:     0 24px 48px -16px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.4);
}

/* Panel jest montowany w <body> i pozycjonowany przez JS (fixed, top/left/width).
   CSS tylko wygląd — pozycja i wymiary nadchodzą z JS, żeby żaden stacking-context
   nagłówka ani forma nie przycinały panelu. */

.live-suggest {
  position: fixed;
  top: 0;
  left: 0;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ls-bg);
  border: 1px solid var(--ls-border);
  border-radius: 14px;
  box-shadow: var(--ls-shadow);
  z-index: 2147483000;         /* nad CMP i wszelkimi overlay'ami portalu */
  padding: .25rem 0 .4rem;
  font-size: 14.5px;
  color: var(--ls-text);
}
.live-suggest[hidden] { display: none; }

.ls-group { padding: .25rem 0; }
.ls-group + .ls-group { border-top: 1px solid var(--ls-border); }
.ls-group-h {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem .2rem;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ls-text-muted);
}
.ls-group-label { font-weight: 700; font-size: 12px; letter-spacing: .05em; }
.ls-count {
  margin-left: auto;
  background: var(--ls-bg-alt);
  color: var(--ls-text-muted);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.ls-ico {
  width: 15px;
  height: 15px;
  flex: none;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ls-items { list-style: none; margin: 0; padding: 0; }
.ls-item a,
.ls-item a:visited {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: .7rem;
  align-items: center;
  padding: .55rem .9rem;
  color: var(--ls-text);          /* nadpisanie globalnego `a` */
  text-decoration: none;
  transition: background-color .12s;
}
.ls-item a:hover,
.ls-item.is-active a { background: var(--ls-bg-alt); }

.ls-pic {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ls-bg-alt);
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--ls-border);
}
.ls-pic.ls-pic-ico {
  /* ciemniejsze tło + wyrazistsza ikona (w razie braku image_url obiektu) */
  background: var(--ls-bg-alt);
  border-color: currentColor;    /* currentColor = kind.color z inline-style */
}
.ls-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ls-pic.ls-pic-ico svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ls-text { min-width: 0; }
.ls-title {
  display: block;
  font-weight: 700;
  color: var(--ls-text);          /* jawnie — nie dziedzicz z <a> */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}
.ls-title mark { background: var(--ls-mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.ls-sub {
  display: block;
  color: var(--ls-text-muted);
  font-size: 12.5px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-footer {
  padding: .4rem .9rem .3rem;
  border-top: 1px dashed var(--ls-border);
  margin-top: .2rem;
}
.ls-all,
.ls-all:visited {
  display: block;
  text-align: center;
  padding: .5rem .6rem;
  border-radius: 8px;
  color: var(--ls-accent);
  font-weight: 700;
  text-decoration: none;
}
.ls-all:hover { background: var(--ls-bg-alt); }

.ls-empty {
  padding: 1.2rem .9rem;
  color: var(--ls-text-muted);
  text-align: center;
}
.ls-empty a { color: var(--ls-accent); font-weight: 600; }

/* Mobile: panel ma głębszy max-height, pozycja i tak z JS */
@media (max-width: 720px) {
  .live-suggest { max-height: calc(100vh - 90px); }
}

/* ============================================================
   STRONA /szukaj/  — grupy jako sekcje, karty z kolorowymi ikonami
   ============================================================ */

.search-groups { display: flex; flex-direction: column; gap: 1.6rem; margin-top: 1rem; }
.search-group h2 {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.1rem;
  margin: 0 0 .75rem;
  color: var(--ls-text);
}
.search-group h2 .ls-ico { width: 20px; height: 20px; color: var(--ls-accent); }
.search-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .7rem;
  list-style: none;
  margin: 0; padding: 0;
}
.search-card a,
.search-card a:visited {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: .75rem;
  align-items: center;
  padding: .6rem .75rem;
  border: 1px solid var(--ls-border);
  border-radius: 12px;
  color: var(--ls-text);          /* nadpisanie globalnego `a {color:forest}` */
  text-decoration: none;
  background: var(--ls-bg);
  transition: box-shadow .12s, transform .12s, border-color .12s;
}
.search-card a:hover {
  box-shadow: 0 10px 22px -14px rgba(0,0,0,.25);
  transform: translateY(-1px);
  border-color: var(--ls-accent);
}
.search-card .ls-pic { width: 72px; height: 72px; border-radius: 10px; }
.search-card .ls-title { color: var(--ls-text); font-size: 1rem; }
.search-card .ls-sub   { color: var(--ls-text-muted); font-size: 12.5px; }
