/**
 * Highlight-to-act affordance (#15844)
 *
 * Every rule here serves the issue's design position — "restraint is the
 * feature" — so the visual weight is deliberately low. This is a small bar
 * beside a selection, not a card competing with the page.
 *
 * Colours come from theme tokens only (no literals), so the affordance follows
 * light/dark with the rest of the site. #15616 shipped near-black text on a
 * dark surface for ~a month because a hardcoded colour was invisible to every
 * gate; Check 92 exists for that class and this file stays inside it.
 */

.selection-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--color-surface, #fff);
  color: var(--color-text-primary, #1E293B);
  border: 1px solid var(--color-border, #E2E8F0);
  border-radius: 8px;
  /* Low, not dramatic — this sits beside body copy a student is reading. */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  line-height: 1.2;
  /* Never wider than a phone: a bar that wraps over the selected passage
     defeats the "beside, never over" rule the JS positioning enforces. */
  max-width: min(92vw, 320px);
}

/* "Save this" leads. The student selected a passage because it matters to
   them; helping them keep it is the honest response, and the commercial half
   is deliberately the quieter of the two (#15844). */
.selection-cta__save {
  font-weight: 600;
  color: var(--color-primary, #1C3070);
  text-decoration: none;
  white-space: nowrap;
}

.selection-cta__buy {
  color: var(--color-text-secondary, #475569);
  text-decoration: none;
  white-space: nowrap;
}

.selection-cta__save:hover,
.selection-cta__buy:hover,
.selection-cta__save:focus-visible,
.selection-cta__buy:focus-visible {
  text-decoration: underline;
}

.selection-cta__dismiss {
  /* 44px hit area on touch without a 44px visual box — a dismiss control that
     is hard to hit is how a "quiet" affordance becomes a trap. */
  min-width: 44px;
  min-height: 44px;
  margin: -0.6rem -0.4rem -0.6rem 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--color-text-secondary, #475569);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.selection-cta__dismiss:focus-visible {
  outline: 2px solid var(--color-primary, #1C3070);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .selection-cta {
    animation: selection-cta-in 120ms ease-out;
  }
}

@keyframes selection-cta-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: none; }
}
