/* SiftingSignal share component
   --------------------------------
   Reusable share-button widget. Brand-correct per docs/BRAND_GUIDE.md:
     - signal-teal hover border, hairline default border
     - 6px radius (4px chip-style icon buttons)
     - mono small-caps SHARE label
     - Inter sans-serif throughout
     - 16px geometric stroke SVG icons (no external lib)
   Assumes the host page has defined :root tokens (--ink, --signal, etc.)
   from docs/BRAND_GUIDE.md §3. If not, the component falls back to
   reasonable defaults via the var(--token, fallback) pattern.
*/

.ss-share {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
}

.ss-share__label {
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted, #64748B);
  user-select: none;
}

.ss-share__buttons {
  display: flex;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
}

.ss-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  background: var(--surface, #FFFFFF);
  color: var(--ink-2, #334155);
  border: 1px solid var(--border, #E4E4E7);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms ease-out, color 150ms ease-out, background 150ms ease-out;
  -webkit-appearance: none;
  appearance: none;
}

.ss-share__btn:hover,
.ss-share__btn:focus-visible {
  border-color: var(--signal, #14B8A6);
  color: var(--ink, #0F172A);
  outline: none;
}

.ss-share__btn:focus-visible {
  outline: 2px solid var(--signal-2, #0F766E);
  outline-offset: 2px;
}

.ss-share__btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ss-share__icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: block;
}

.ss-share__name {
  color: inherit;
}

/* Compact: icon-only buttons (per-card mini-share) */
.ss-share.is-compact {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.ss-share.is-compact .ss-share__label {
  margin-right: 2px;
}

.ss-share.is-compact .ss-share__btn {
  min-width: 32px;
  padding: 6px 8px;
}

.ss-share.is-compact .ss-share__btn .ss-share__name {
  display: none;
}

/* Mobile: stack buttons vertically */
@media (max-width: 600px) {
  .ss-share:not(.is-compact) .ss-share__buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .ss-share:not(.is-compact) .ss-share__btn {
    justify-content: flex-start;
    padding: 10px 12px;
    min-height: 44px;
  }
}

/* Toast — slate bg, off-white text, fixed bottom-center, auto-dismiss */
.ss-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink, #0F172A);
  color: var(--bg, #FAFAFA);
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
  z-index: 9999;
}

.ss-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .ss-toast,
  .ss-share__btn {
    transition: none;
  }
}
