/* ---------- Search results (search.html) ----------
 * ADR 0019 of hirhanyo-pro: the results page of the full-text search (?q=). The query in a large
 * field with its syntax; the counts by type; the dossiers, topics and sources whose name matches;
 * the matching stories; then the news by rank (title first, then the lead), the matched words
 * marked, with the lead and the story of the news. The side: the results by week and by source
 * (a click filters), the search tips. An empty result offers a correction and what to loosen.
 * Builds on lists.css, news-list.css, news-page.css, story-widgets.css, pager.css, select.css. */

.sr-page mark { padding: 0 1px; border-radius: 2px; background: color-mix(in srgb, var(--color-primary) 22%, transparent); color: inherit; }
.sr-query { color: var(--color-primary); }

/* The query: a field and a button, the syntax below */
.sr-form { display: flex; gap: 0; max-width: 680px; }
.sr-field { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 0 12px; border: 1px solid var(--line-bright); border-right: 0; background: var(--panel); }
.sr-field:focus-within { border-color: var(--color-primary); }
.sr-field .icon { color: var(--color-primary); font-size: 18px; }
.sr-field input { flex: 1 1 auto; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 600; outline: none; }
.sr-submit { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.sr-submit:hover { background: var(--color-primary-hover); color: var(--accent-ink); }
.ls-intro > p.sr-syntax:not(.st-crumbs) { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.sr-page code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); color: var(--text); font-family: var(--font-mono); font-size: .95em; }

/* Counts by type: the chips of the list pages, as links between the types */
.sr-scopes .ls-chips button { padding: 7px 12px; }

/* Dossiers, topics and sources whose name matches */
.sr-section { display: grid; gap: 0; }
.sr-entities { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.sr-entity { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; color: var(--text); }
.sr-entity .panel-icon { width: 38px; height: 38px; }
.sr-entity .panel-icon .icon { font-size: 19px; }
.sr-entity:hover { border-color: var(--color-primary); }
.sr-entity:hover .sr-entity-name { color: var(--color-primary); }
.sr-entity-body { display: grid; gap: 3px; min-width: 0; }
.sr-entity-kind { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.sr-entity-name { display: -webkit-box; overflow: hidden; font-family: var(--font-heading); font-size: 16px; font-weight: 600; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sr-entity-desc { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sr-entity-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); font-size: 9px; }
.sr-entity-facts strong { color: var(--text); }
.sr-entity-go { color: var(--muted); font-size: 16px; }

/* Stories: the story rows of the list pages, inside a panel */
.sr-stories .ds-stories { padding: 0 18px; }

/* A news result: title, the lead with the matched words, source, date and its story */
.sr-list .sr-item { align-items: flex-start; }
.sr-lead { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sr-story { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--color-primary); }
.sr-story span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-story:hover { color: var(--color-primary-hover); }

/* By week: one bar a week */
.sr-time { display: grid; gap: 4px; }
.sr-bars { display: grid; grid-template-columns: repeat(var(--weeks, 9), minmax(0, 1fr)); gap: 4px; align-items: end; height: 64px; border-bottom: 1px solid var(--line); }
.sr-bars i { display: block; min-height: 2px; height: calc(var(--n) / var(--max) * 100%); border-radius: 2px 2px 0 0; background: color-mix(in oklab, var(--color-primary) 55%, var(--track)); }
.sr-bars i:last-child { background: var(--color-primary); }
.sr-bars i:hover { filter: brightness(1.2); }
.sr-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }

/* Tips */
.sr-tips { display: grid; gap: 8px; margin: 0; }
.sr-tips div { display: grid; gap: 2px; }
.sr-tips dt { font-size: 12px; }
.sr-tips dd { margin: 0; color: var(--muted); font-size: 12px; }

/* No result */
.sr-empty { display: grid; justify-items: start; gap: 10px; padding: 22px 24px; }
.sr-empty .panel-icon { width: 40px; height: 40px; }
.sr-empty .panel-icon .icon { font-size: 20px; }
.sr-empty h2 { margin: 0; font-size: 20px; font-weight: 600; }
.sr-did { margin: 0; font-size: 14px; }
.sr-did a { color: var(--color-primary); font-weight: 600; }
.sr-did .mono { color: var(--muted); font-size: 9px; }
.sr-empty ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sr-empty-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; }
.sr-empty-links a { padding: 5px 10px; border: 1px solid var(--line); color: var(--text); font-size: 10px; letter-spacing: .05em; }
.sr-empty-links a:hover { border-color: var(--color-primary); color: var(--color-primary); }

@media (max-width: 560px) {
  .sr-submit { padding: 0 12px; }
  .sr-submit .icon { display: none; }
  .sr-entities { grid-template-columns: minmax(0, 1fr); }
  /* The story link gets its own line, so the source name is not cut to a letter */
  .sr-item .news-list-meta { flex-wrap: wrap; row-gap: 4px; }
  .sr-story { flex-basis: 100%; }
}
