/* hub-fluide.css · recherche et filtres des pages listes (/etudes, /veille)
 *
 * Une seule source pour les deux pages. Les composants existants
 * (.filter-btn, .filter-decade-btn) codent leurs couleurs en dur pour le fond
 * sombre et ne survivent au thème clair que parce qu'ils sont posés dans le
 * bandeau sombre. Ces composants-ci sont posés en pleine page, ils doivent
 * donc suivre le thème. D'où les deux jeux de valeurs.
 */

.hub-recherche {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 21, 35, .6);
  border: 1px solid rgba(167, 139, 250, .18);
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.hub-recherche:focus-within {
  border-color: rgba(167, 139, 250, .55);
  background: rgba(15, 21, 35, .82);
}
.hub-recherche iconify-icon { color: var(--cool-500); flex: none; }
.hub-recherche input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: none;
  color: var(--cool-50);
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 14px;
}
.hub-recherche input::placeholder { color: var(--cool-500); }
.hub-recherche input::-webkit-search-cancel-button { filter: invert(.6); cursor: pointer; }

.hub-compteur {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-purple);
  white-space: nowrap;
  opacity: 0; transition: opacity .2s;
}
.hub-compteur:not(:empty) { opacity: 1; }
.hub-compteur.vide { color: #E05252; }

/* Boutons de filtre posés en pleine page (niveau de preuve, flux de veille).
   Même gabarit que .filter-decade-btn, mais indépendants du thème. */
.filter-niveau-btn,
.filter-flux-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(15, 21, 35, .5);
  border: 1px solid rgba(255, 255, 255, .10);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--cool-400);
  cursor: pointer;
  transition: color .22s, border-color .22s, background .22s;
}
.filter-niveau-btn i,
.filter-flux-btn i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--n, var(--cool-500)); display: block; flex: none;
}
.filter-niveau-btn:hover,
.filter-flux-btn:hover { color: var(--cool-200); border-color: rgba(255, 255, 255, .24); }
.filter-niveau-btn.active,
.filter-flux-btn.active {
  color: var(--cool-50);
  border-color: color-mix(in srgb, var(--n, var(--accent-purple)) 60%, transparent);
  background: color-mix(in srgb, var(--n, var(--accent-purple)) 15%, transparent);
}

.veille-outils { display: flex; flex-direction: column; gap: 12px; }
[data-veille].hidden { display: none; }
.veille-vide {
  display: none; padding: 34px 0; text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .8rem; color: var(--cool-500);
}
.veille-vide.on { display: block; }

/* ───────────────────────── thème clair ───────────────────────── */
html[data-theme="light"] .hub-recherche {
  background: #FFFFFF;
  border-color: rgba(15, 21, 48, .12);
  box-shadow: 0 1px 2px rgba(15, 21, 48, .04);
}
html[data-theme="light"] .hub-recherche:focus-within {
  background: #FFFFFF;
  border-color: rgba(124, 92, 240, .55);
  box-shadow: 0 0 0 3px rgba(124, 92, 240, .10);
}
html[data-theme="light"] .hub-recherche input::-webkit-search-cancel-button { filter: none; }

html[data-theme="light"] .filter-niveau-btn,
html[data-theme="light"] .filter-flux-btn {
  background: #FFFFFF;
  border-color: rgba(15, 21, 48, .12);
  color: #5a6390;
}
html[data-theme="light"] .filter-niveau-btn:hover,
html[data-theme="light"] .filter-flux-btn:hover {
  color: #222a4d;
  border-color: rgba(15, 21, 48, .26);
}
html[data-theme="light"] .filter-niveau-btn.active,
html[data-theme="light"] .filter-flux-btn.active {
  color: #0f1530;
  border-color: color-mix(in srgb, var(--n, #7c5cf0) 65%, transparent);
  background: color-mix(in srgb, var(--n, #7c5cf0) 12%, #FFFFFF);
}

@media (prefers-reduced-motion: reduce) {
  .hub-recherche, .hub-compteur, .filter-niveau-btn, .filter-flux-btn { transition: none; }
}

/* ── Vue par signal de la page Veille ────────────────────────────────────
 *
 * Le filtre par flux masquait des semaines. Comme chaque veille couvre les
 * trois flux, trois boutons sur quatre ne masquaient rien : le lecteur
 * cliquait et la page ne bougeait pas. On bascule désormais sur la liste des
 * signaux de ce flux, groupés par semaine, ce qui est la question réelle.
 */
.veille-signaux { display: none; }
.veille-signaux.on { display: block; }

.vs-semaine { margin-bottom: 26px; }
.vs-entete {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px 2px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}
.vs-entete b { font-weight: 700; letter-spacing: .1em; }
.vs-entete a { text-decoration: none; }

.vs-signal {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px 16px; margin-bottom: 7px;
  border-radius: 12px; text-decoration: none;
  border: 1px solid transparent;
  transition: border-color .22s, background .22s, transform .22s;
}
.vs-signal:hover { transform: translateX(3px); }
.vs-puce {
  width: 7px; height: 7px; border-radius: 50%;
  margin-top: 7px; flex-shrink: 0; background: var(--n, #A78BFA);
}
.vs-titre { font-size: 14.5px; line-height: 1.5; }
.vs-type {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  margin-top: 3px; display: block;
}

html:not([data-theme="light"]) .vs-entete { color: var(--cool-500); }
html:not([data-theme="light"]) .vs-entete b { color: var(--cool-300); }
html:not([data-theme="light"]) .vs-signal { background: rgba(255, 255, 255, .022); }
html:not([data-theme="light"]) .vs-signal:hover { background: rgba(255, 255, 255, .05); border-color: rgba(167, 139, 250, .26); }
html:not([data-theme="light"]) .vs-titre { color: var(--cool-200); }
html:not([data-theme="light"]) .vs-type { color: var(--cool-500); }

html[data-theme="light"] .vs-entete { color: #6b7280; }
html[data-theme="light"] .vs-entete b { color: #1f2937; }
html[data-theme="light"] .vs-signal { background: rgba(15, 21, 48, .028); }
html[data-theme="light"] .vs-signal:hover { background: rgba(15, 21, 48, .055); border-color: rgba(109, 78, 214, .26); }
html[data-theme="light"] .vs-titre { color: #1f2937; }
html[data-theme="light"] .vs-type { color: #6b7280; }

@media (prefers-reduced-motion: reduce) {
  .vs-signal, .vs-signal:hover { transition: none; transform: none; }
}
