/**
 * @file
 * Botons per copiar enllaços als llistats (js/copy-links.js).
 */

.sb-copy__icon {
  display: inline-flex;
}

.sb-copy__icon svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Botó per fila */
.sb-copy-link {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 0 0 8px;
  padding: 0;
  vertical-align: middle;
  border: 1px solid var(--sb-line-strong, #DCD3E1);
  border-radius: 50%;
  background: var(--sb-surface, #fff);
  color: var(--sb-brand, #A237B5);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

.sb-copy-link:hover {
  border-color: var(--sb-brand, #A237B5);
  background: var(--sb-brand-50, #F6EDF8);
}

.sb-copy-link:focus-visible,
.sb-copy-all__btn:focus-visible {
  outline: none;
  box-shadow: var(--sb-focus, 0 0 0 3px rgba(162, 55, 181, .32));
}

.sb-copy-link.is-copied,
.sb-copy-all__btn.is-copied {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #2e7d32;
}

/* Dins d'una fila flex (llistes sb-people) el botó va al final. */
.sb-people__item > .sb-copy-link {
  margin-left: auto;
  align-self: center;
}

/* Barra «Copia els N enllaços» a sobre del llistat */
.sb-copy-all {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.sb-copy-all__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--sb-line-strong, #DCD3E1);
  border-radius: 999px;
  background: var(--sb-surface, #fff);
  color: var(--sb-brand-700, #7E2390);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

.sb-copy-all__btn:hover {
  border-color: var(--sb-brand, #A237B5);
  background: var(--sb-brand-50, #F6EDF8);
}

/* Al cercador: dins la capçalera, en línia amb «Copia la cerca» i el
 * selector Llista/Mapa (mateixa mida de pastilla). */
.sb-copy-all--inline {
  margin: 0;
  /* La capçalera del cercador ordena amb «order»: recompte (1), botons i
   * selector (2), xips de filtres (3). */
  order: 2;
}

.sb-copy-all--inline .sb-copy-all__btn {
  padding: 5px 14px;
  font-size: 14.5px;
}

/* Panell lateral: la barra ocupa tota l'amplada de la targeta. */
.offcanvas-body .sb-copy-all {
  justify-content: stretch;
}

.offcanvas-body .sb-copy-all__btn {
  width: 100%;
  justify-content: center;
}

/* Missatge breu (compartit amb js/cercador.js) */
.sidbrint-toast {
  position: fixed;
  right: 20px;
  bottom: 70px;
  z-index: 10000;
  max-width: calc(100vw - 40px);
  padding: 10px 18px;
  border-radius: 8px;
  background: #333;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}

.sidbrint-toast.is-visible {
  opacity: 1;
  transform: none;
}

@media print {
  .sb-copy-link,
  .sb-copy-all {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sb-copy-link,
  .sb-copy-all__btn,
  .sidbrint-toast {
    transition: none !important;
  }
}
