@charset "UTF-8";
/* ==========================================================================
   Suggestions pendant la frappe (assets/js/search-suggest.js) — accueil
   (dans l'encadré .search-panel, liste #suggestions) et page de résultats
   (liste flottante .results-suggestions sous la barre de recherche).
   Les <li> gardent la base .suggestions li de style.css (padding, survol).
   ========================================================================== */

.sg-item {
  min-width: 0;
}
.sg-item .suggestion-icon {
  width: 20px;
  height: 20px;
}
.sg-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sg-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.sg-label strong {
  font-weight: 700;
}
.sg-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.sg-media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}
.sg-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sg-media-site img {
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
}
.sg-media-matic,
.sg-media-channel {
  border-radius: 50%;
}
.sg-type {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}
/* Un peu d'air entre les recherches (haut de liste) et les accès directs. */
.sg-item-query + .sg-item:not(.sg-item-query):not(.sg-item-history),
.sg-item-history + .sg-item:not(.sg-item-query):not(.sg-item-history) {
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* Champ vide : titres des groupes (récentes, favoris, tendances). */
.suggestions li.sg-heading {
  padding: 10px 20px 4px;
  cursor: default;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none !important;
}
.suggestions li.sg-heading:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.sg-media-favorite img {
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}

/* Page de résultats : liste flottante sous la barre de recherche. */
.results-search-form {
  position: relative;
}
.results-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: 0 12px 32px -12px var(--shadow);
}
.results-suggestions.hidden {
  display: none;
}

/* Correction d'orthographe ("Résultats pour … / Rechercher plutôt …"),
   alignée sur .results-stats (158px à gauche sur grand écran). */
.results-spelling {
  margin: 10px 0 0;
  padding: 0 24px 0 158px;
}
.results-spelling.hidden {
  display: none;
}
.results-spelling p {
  margin: 0 0 2px;
  font-size: 18px;
  color: var(--text);
}
.results-spelling-main a {
  font-size: inherit;
  color: var(--link);
}
.results-spelling-main strong {
  font-style: italic;
}
.results-spelling p.results-spelling-alt {
  font-size: 14px;
  color: var(--text-muted);
}
.results-spelling-alt a {
  color: var(--link);
}

/* Page sans résultat : recherches associées, second lien de référencement
   et pagination masqués (results.js, renderRelatedSearches). */
.related-searches.hidden,
.results-submit-site.hidden,
#results-tous-extra .pagination.hidden {
  display: none;
}

/* Bandeau « Voir dans l'annuaire » (results.js, renderDirectoryBanner). */
.results-directory {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 652px;
  margin: 4px 0 22px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.results-directory:hover {
  background: var(--link-tint);
  border-color: var(--border-hover);
}
.results-directory-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--rd-color) 14%, transparent);
  color: var(--rd-color);
}
.results-directory-icon svg {
  width: 20px;
  height: 20px;
}
.results-directory-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
}
.results-directory-text span {
  font-size: 13px;
  color: var(--text-muted);
}
.results-directory-arrow {
  font-size: 22px;
  color: var(--text-muted);
}

/* ---- Réponses directes (results.js, renderAnswers ; includes/search/answers.php) ---- */
.ans-card {
  box-sizing: border-box;
  max-width: 652px;
  margin: 4px 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
.ans-card a { color: var(--link); }
.ans-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.ans-kicker img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.ans-kicker strong { color: var(--text); font-weight: 600; }
.ans-kicker .ans-more { margin-left: auto; white-space: nowrap; font-weight: 500; }
.ans-cp-title { margin: 0 0 10px; font-size: 20px; font-weight: 500; line-height: 1.3; }
.ans-cp-title a { text-decoration: none; }
.ans-cp-title a:hover { text-decoration: underline; }
.ans-cp-title span { color: var(--text-muted); font-size: 14px; font-weight: 400; }
.ans-pens { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.ans-pen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--btn-bg);
}
.ans-pen-what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ans-pen-label { color: var(--text-muted); font-size: 13px; }
.ans-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb, #5f6368 16%, transparent);
  color: var(--text);
}
.ans-tag-crime { background: color-mix(in srgb, #d93025 16%, transparent); color: #c5221f; }
.ans-tag-delit { background: color-mix(in srgb, #e37400 18%, transparent); color: #b06000; }
.ans-tag-contravention { background: color-mix(in srgb, #1a73e8 14%, transparent); color: #1967d2; }
.ans-pen-vals { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ans-pen-vals b {
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--border);
}
.ans-pen-vals b.ans-fine { color: #137333; border-color: color-mix(in srgb, #137333 35%, transparent); background: color-mix(in srgb, #137333 8%, var(--bg)); }
.ans-pen-agg { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-muted); }
.ans-text { margin: 0 0 12px; color: var(--text-muted); }
.ans-also { margin: 0 0 12px; padding: 10px 0 0; border-top: 1px solid var(--border); list-style: none; }
.ans-also-title { margin: 0 0 4px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.ans-also li { display: flex; gap: 10px; justify-content: space-between; padding: 3px 0; }
.ans-also li a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-also li span { flex: none; color: #137333; font-weight: 600; font-size: 13px; }
.ans-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ans-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.ans-actions a:hover { background: var(--link-tint); border-color: var(--border-hover); }
.ans-actions a.is-primary { background: var(--link); border-color: var(--link); color: #fff; }
.ans-actions a.is-primary:hover { filter: brightness(1.08); background: var(--link); }

.ans-ev-list { margin: 0; padding: 0; list-style: none; }
.ans-ev-list li + li { border-top: 1px solid var(--border); }
.ans-ev-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--text) !important; text-decoration: none !important; }
.ans-ev-item:hover strong { text-decoration: underline; }
.ans-ev-thumb {
  flex: none;
  width: 56px;
  height: 42px;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--ev, #607d8b), color-mix(in srgb, var(--ev, #607d8b) 50%, #1c2733));
}
.ans-ev-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ans-ev-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ans-ev-text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-ev-text span { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ans-ev-rel { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--btn-bg); font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.ans-ev-rel.is-live { background: color-mix(in srgb, #d93025 14%, transparent); color: #d93025; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ans-tag-crime { color: #f28b82; }
  :root:not([data-theme="light"]) .ans-tag-delit { color: #fdd663; }
  :root:not([data-theme="light"]) .ans-tag-contravention { color: #8ab4f8; }
  :root:not([data-theme="light"]) .ans-pen-vals b.ans-fine,
  :root:not([data-theme="light"]) .ans-also li span { color: #81c995; }
}
:root[data-theme="dark"] .ans-tag-crime { color: #f28b82; }
:root[data-theme="dark"] .ans-tag-delit { color: #fdd663; }
:root[data-theme="dark"] .ans-tag-contravention { color: #8ab4f8; }
:root[data-theme="dark"] .ans-pen-vals b.ans-fine,
:root[data-theme="dark"] .ans-also li span { color: #81c995; }

@media (max-width: 640px) {
  .ans-card { padding: 14px; }
  .ans-pen { grid-template-columns: minmax(0, 1fr); }
  .ans-pen-vals { justify-content: flex-start; }
  .ans-ev-rel { display: none; }
}

/* Résultats partiels : mots manquants barrés (façon Google). */
.results-missing s {
  color: var(--text-muted);
}

/* Aucun résultat : pistes pour rebondir (assets/js/results.js, buildEmptyState) */
.results-empty {
  padding: 8px 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  max-width: 620px;
}
.results-empty p {
  margin: 0;
}
.results-empty .re-title {
  font-size: 20px;
  line-height: 1.4;
}
.results-empty .re-sub {
  margin-top: 4px;
  color: var(--text-muted);
}
.results-empty .re-block {
  margin-top: 24px;
}
.results-empty .re-label {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.results-empty .re-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.results-empty a.re-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.results-empty a.re-chip:hover {
  background: var(--link-tint);
  border-color: var(--border-hover);
}
.results-empty a.re-chip-strong {
  color: var(--link);
  font-weight: 500;
}
.results-empty .re-alert-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--link);
  border-radius: 999px;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.results-empty .re-alert-btn:hover {
  background: var(--link-tint);
}
.results-empty .re-alert-btn.is-active {
  border-color: var(--border);
  color: var(--text-muted);
  cursor: default;
  background: transparent;
}
.results-empty .re-cta {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.results-empty a {
  font-size: inherit;
  color: var(--link);
}

@media (max-width: 700px) {
  .results-spelling {
    padding: 0 16px 0 24px;
  }
  .results-spelling p {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .sg-type {
    display: none;
  }
  .suggestions li.sg-item {
    padding: 9px 16px;
    gap: 12px;
    font-size: 14.5px;
  }
}
