@layer components {
  .button {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    border: 0;
    font-family: inherit;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: inherit;
    text-decoration: none;
    cursor: pointer;
  }

  .button--light {
    align-self: flex-start;
    background: var(--color-bg);
    color: var(--color-ink);
    &:hover { background: var(--color-accent-soft); color: var(--color-ink); }
  }
  .button--hover-gold:hover { background: var(--color-accent-light); color: var(--color-ink); } /* ink su oro vivo = 3.35:1, su oro chiaro 5.06 */

  /* --button-dark-bg / --button-dark-fg: colori regolabili dal contenitore (es. header su fondo scuro) */
  .button--dark {
    align-self: flex-start;
    background: var(--button-dark-bg, var(--color-ink));
    color: var(--button-dark-fg, var(--color-bg));
    transition: background-color 0.3s, color 0.3s;
    &:hover { background: var(--color-accent-text); color: var(--color-bg); }
  }

  /* Contorno chiaro su fondo scuro, testo e freccia ai due estremi */
  .button--outline {
    justify-content: space-between;
    padding: 16px 20px;
    background: none; /* anche su <button>, che ha lo sfondo del browser */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    color: #fff;
    &:hover { color: var(--color-accent-light); }
  }

  /* Profilo social (badge "in" + etichetta) su fondo scuro */
  .button--social {
    gap: 10px;
    padding: 16px 24px;
    background: none; /* anche su <button>, che ha lo sfondo del browser */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    color: #fff;
    &:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
  }
  .button__badge {
    width: 22px; height: 22px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--color-ink); font-size: 12px;
  }

  .button--sm { padding: 12px 24px; white-space: nowrap; }
  .button--compact { padding: 14px 24px; }

  .button.is-current,
  .button.is-current:hover { background: var(--color-accent-text); cursor: default; } /* testo bianco: 5.15:1 (sull'oro vivo 3.23) */

  @media (max-width: 767px) {
    .button--block-mobile { align-self: stretch; justify-content: space-between; padding: 16px 20px; }
    .button--social { padding: 14px 20px; }
  }
}
