/* Site search (includes/search.php): the suggestions under a search box (js/search-suggest.js), the extras on a
   report search (shortcuts, "did you mean", category counts, highlights, places, "matched in") and the site search
   page (pages/search.php). Light and dark themes use the site colour names. */

/* Highlighted words */
mark { padding: 0 1px; border-radius: 3px; background: rgba(245,196,107,.40); color: inherit; }
html[data-theme="dark"] mark { background: rgba(245,196,107,.28); }

/* ── Suggestions while typing ── */
.sg-pop { position: absolute; z-index: 2400; max-height: min(70vh, 480px); overflow-y: auto; padding: 6px; border-radius: 14px;
  background: var(--white); color: var(--text); border: 1px solid var(--line); box-shadow: 0 18px 44px rgba(11,31,58,.20); }
.sg-pop[hidden] { display: none; }
.sg-head { padding: 8px 10px 4px; font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.sg-item:hover, .sg-item.on { background: var(--gray-100); color: var(--text); }
.sg-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; overflow: hidden; border-radius: 8px;
  background: rgba(13,155,138,.10); color: var(--teal); font-size: .82rem; }
.sg-ic img { width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }
.sg-place .sg-ic img { object-fit: cover; padding: 0; }
.sg-txt { display: flex; flex-direction: column; min-width: 0; }
.sg-label { overflow: hidden; font-size: .95rem; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.sg-label b { font-weight: 700; color: var(--navy); }
.sg-txt small { overflow: hidden; font-size: .84rem; color: var(--text-muted); white-space: nowrap; text-overflow: ellipsis; }
.sg-all { margin-top: 4px; padding: 10px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; font-size: .92rem; font-weight: 600; color: var(--teal); }
.sg-all i { width: 30px; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .sg-pop { animation: sg-in .12s ease-out; } }
@keyframes sg-in { from { opacity: 0; transform: translateY(-4px); } }

/* ── Report search extras ── */
/* Pages the words name (a topic, place, category, company or measure) */
.srch-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.srch-shortcuts li { display: flex; flex-direction: column; gap: 6px; }
.srch-short { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--white); color: var(--text);
  border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.srch-short:hover, .srch-short:focus-visible { border-color: var(--teal); box-shadow: 0 10px 24px rgba(11,31,58,.08); color: var(--text); }
.srch-short-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border-radius: 12px;
  background: rgba(13,155,138,.10); color: var(--teal); font-size: 1rem; }
.srch-short-ic img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 4px; background: #fff; border-radius: 8px; }
.srch-short-ic .flag { width: 28px; height: 21px; padding: 0; border-radius: 3px; }
.srch-short strong { display: block; font-size: 1rem; font-weight: 600; line-height: 1.3; color: var(--navy); }
.srch-short small { display: block; margin-top: 2px; font-size: .86rem; line-height: 1.35; color: var(--text-muted); }
.srch-short > .fa-arrow-right { margin-left: auto; color: var(--teal); font-size: .82rem; }
.srch-short-act { align-self: flex-start; margin-left: 6px; font-size: .88rem; font-weight: 600; color: var(--teal); }
.srch-short-act:hover { text-decoration: underline; }
/* "Did you mean" */
.srch-fix { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: rgba(245,196,107,.14); color: var(--text); font-size: 1rem; }
.srch-fix a { color: var(--teal); }
/* Categories in the search, with counts */
.srch-facets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.srch-facets a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy); font-size: .9rem; text-decoration: none; }
.srch-facets a small { font-size: .84rem; font-weight: 700; color: var(--text-muted); }
.srch-facets a:hover, .srch-facets a:focus-visible { border-color: var(--teal); color: var(--teal); }
.srch-facets a[aria-current] { background: var(--teal); border-color: var(--teal); color: #fff; }
.srch-facets a[aria-current] small { color: rgba(255,255,255,.85); }
/* Count, order and grouping on one line */
.result-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; }
.srch-view { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 14px; font-size: .9rem; color: var(--text-muted); }
.srch-view a { color: var(--teal); font-weight: 600; }
.srch-view b { font-weight: 600; color: var(--navy); }
/* The same market in other places, under the card's place tag */
.report-meta .rc-places { font-size: .88rem; }
.rc-places summary { display: inline-flex; align-items: center; padding: 2px 10px; border: 1px dashed var(--gray-200); border-radius: 999px;
  color: var(--teal); font-weight: 600; cursor: pointer; list-style: none; }
.rc-places summary::-webkit-details-marker { display: none; }
.rc-places summary:hover, .rc-places summary:focus-visible { border-color: var(--teal); }
.rc-places[open] { flex-basis: 100%; }
.rc-places[open] summary { border-style: solid; }
.rc-places ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; padding: 10px; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--off-white); }
.rc-places li a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy); font-size: .86rem; text-decoration: none; }
.rc-places li a:hover, .rc-places li a:focus-visible { border-color: var(--teal); color: var(--teal); }
.rc-places .flag { width: 18px; height: 13.5px; border-radius: 2px; }
/* What matched */
.rc-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: .88rem; color: var(--text-muted); }
.rc-why-tag { padding: 2px 10px; border-radius: 999px; background: rgba(13,155,138,.10); color: var(--teal); font-weight: 600; }
html[data-theme="dark"] .rc-why-tag { color: #3FD3BF; }

/* ── Site search page ── */
.srch-hero .kw-search { max-width: 760px; }
.srch-hero h1 { overflow-wrap: anywhere; }
.srch-reps { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.srch-reps a { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; height: 100%; padding: 16px 18px; border-radius: 16px;
  background: var(--white); color: var(--text); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.srch-reps a:hover, .srch-reps a:focus-visible { border-color: var(--teal); box-shadow: 0 12px 28px rgba(11,31,58,.08); color: var(--text); }
.srch-reps strong { font-size: 1rem; font-weight: 600; line-height: 1.35; color: var(--navy); }
.srch-reps small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .88rem; line-height: 1.4; color: var(--text-muted); }
.srch-reps .flag { width: 18px; height: 13.5px; border-radius: 2px; }
.srch-page .tp-chips small { margin-left: 2px; color: var(--text-muted); font-size: .8rem; }
.srch-page .tp-chips .flag { width: 18px; height: 13.5px; border-radius: 2px; }
.srch-more { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; }
.srch-more a { color: var(--teal); font-weight: 600; }
.srch-page .tp-sec { scroll-margin-top: 90px; }
html[data-theme="dark"] .srch-short strong, html[data-theme="dark"] .srch-reps strong, html[data-theme="dark"] .sg-label b,
html[data-theme="dark"] .srch-view b { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .srch-short, .srch-reps a { transition: none; } }
