/* components.css — pill-btn, estats de càrrega/error, targetes d'índex.
 * Depèn de tokens.css. */

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 20px;
  border: 1px solid var(--line); font-size: 14.3px; font-weight: 600;
  color: var(--muted); background: var(--card); transition: .12s;
  white-space: nowrap; text-decoration: none;
}
.pill-btn:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.pill-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.pill-btn.accent { border-color: var(--blue); color: var(--blue); }
.pill-btn.accent:hover { background: var(--blue); color: #fff; }

/* ── Estats (carregant / error) ───────────────────────────────────────
 * Es mostren mentre es carreguen els fitxers data-*.json, o si un fetch falla
 * (per exemple si la pàgina s'obre amb file:// en lloc d'un servidor HTTP). */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 80px 20px; text-align: center; color: var(--muted);
}
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state.err { color: #a02848; }
.state.err .state-box {
  background: rgba(160, 40, 72, .06); border: 1px solid rgba(160, 40, 72, .18);
  border-radius: var(--radius); padding: 18px 22px; max-width: 560px;
  text-align: left; line-height: 1.55; color: var(--ink); font-size: 14.5px;
}
.state.err code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: rgba(0, 0, 0, .05); padding: 1px 5px; border-radius: 5px; font-size: 13px;
}

/* ── Badge petit (comptador, etiqueta curta) ──────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--muted); background: var(--line-2);
  padding: 2px 7px; border-radius: 20px;
}

/* ── Tooltip minimalista via atribut title natiu millorat visualment ──── */
.info-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  font-size: 10px; font-weight: 700; color: var(--hint);
  border: 1px solid var(--line); cursor: help; flex-shrink: 0;
}
