/**
 * Hand-written UI styles.
 *
 * assets/css/site.css is generated Tailwind output and is replaced wholesale by
 * a rebuild, so anything written by hand lives here instead. Loaded after
 * site.css, and it reuses the theme variables site.css already defines.
 */

/* Share control, to the right of the Human/Avatar switch.
   align-self: stretch takes the height from the switch beside it, and
   aspect-ratio squares it, so the circle tracks the switch with no magic
   number to keep in sync. */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  aspect-ratio: 1;
  min-width: 1.75rem;
  padding: 0;
  border: 1px solid var(--color-rule);
  border-radius: 9999px;
  background: transparent;
  color: var(--color-ink-faint);
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s,
    opacity 0.15s;
}

.share-btn:hover {
  opacity: 0.7;
}

.share-btn:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

.share-btn svg {
  display: block;
}

/* Held briefly after the link is copied. */
.share-btn[data-state="done"] {
  color: var(--color-ink);
}

body[data-view="avatar"] .share-btn {
  border-color: var(--color-machine-rule);
  color: var(--color-machine-dim);
}

body[data-view="avatar"] .share-btn:focus-visible {
  outline-color: var(--color-machine-ink);
}

body[data-view="avatar"] .share-btn[data-state="done"] {
  color: var(--color-machine-ink);
}

/* Announced by screen readers, invisible on screen. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .share-btn {
    transition: none;
  }
}
