/* ============================================================
   CARD ARROW — the round ↗ in a link card's corner (CardArrow.astro), from live bir.ch /how-to-choose-birch-ai-tools
   (.arrow-card-wrap, 13.11.2026). Live: a 3rem Surface-muted circle, the arrow 21 in it; on the card's hover the
   circle turns black, the arrow white and rotates 45°; phones 2.1rem with the arrow 0.92rem (here Spacing MD, 2rem).
   Sizes: m (the default, as live) and s — 32 everywhere (.card-arrow--s, CardArrow `size="s"`).
   The trigger is the link around it (any a / button, hover or keyboard focus) or the arrow itself.
   Timing: the system's hover character (live 0.2 s ease), through --motion-* so the review tool's Motion panel tunes it.
   ============================================================ */
.card-arrow {
  --card-arrow-size: var(--space-lg);
  flex: none; display: grid; place-items: center; /* no position of its own: the card places it (`class`) */
  width: var(--card-arrow-size); height: var(--card-arrow-size);
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted); color: var(--color-text-inverted);
  --motion-dur: var(--duration-hover); --motion-ease: var(--ease-hover);
  transition: background-color var(--motion-dur) var(--motion-ease), color var(--motion-dur) var(--motion-ease);
}
.card-arrow::before {
  content: "";
  width: calc(var(--card-arrow-size) * 0.4375); height: calc(var(--card-arrow-size) * 0.4375); /* 21 in 48, as live */
  background: currentColor; mask: url("../icons/arrow-link.svg") center / contain no-repeat;
  transition: rotate var(--motion-dur) var(--motion-ease);
}
:where(a, button):is(:hover, :focus-visible) .card-arrow, .card-arrow:hover { background: var(--color-bg); color: var(--color-text); }
:where(a, button):is(:hover, :focus-visible) .card-arrow::before, .card-arrow:hover::before { rotate: 45deg; }
/* dark pages: a black circle would merge with a dark card — CTA Grey, white on hover */
.theme-dark .card-arrow { background: var(--color-bg-cta-grey); color: var(--color-text); }
.theme-dark :where(a, button):is(:hover, :focus-visible) .card-arrow, .theme-dark .card-arrow:hover { background: var(--color-bg-white); color: var(--color-text-inverted); }
@media (max-width: 47.9375rem) { .card-arrow { --card-arrow-size: var(--space-md); } }
/* s: 32 at every width (the class doubled so it holds over the phone size), for a small card (/routines templates; 24
   read too small on the fluid root, Liliya 18.11.2026) */
.card-arrow.card-arrow--s { --card-arrow-size: var(--space-md); }
@media (prefers-reduced-motion: reduce) { .card-arrow, .card-arrow::before { transition: none; } }
