/* Card — the kit's general container, kit-first 2026-10-09 (onboarding
   track; Corey's ask). Card is only the container: surface, padding,
   radius, shadow, link behaviour. What's inside (bento content, a tool, a
   subscription, a form) is its own layer, a child of the Card, so any
   content can sit in any Card (Santiago, 2026-10-09; revisit once the kit
   is fuller). SubscriptionCard, the bento / metric cards and Classroom's
   schedule + cumulative cards are built this way.

     Size      the content inset: XS 6 · S 16 · M 24 · L 32. Only the
               padding changes (radius stays 8). XS is a thin frame around
               a full-bleed block (What's New's illustrations); it was a
               padding="XS" override until 2026-10-15.
     Surface   raised  n0 + Shadow 0 (sits on n15)
               sunken  neutralTint10, no shadow (a grouped panel; was Tint25 until 2026-10-22)
     Hover     every raised card lifts Shadow 0 → 1, link or not, any size
               (Santiago, 2026-10-09).
     Link      the whole card is the link (<a class="card card--link">):
               sunken lightens toward n0 on hover;
               a trailing arrow-r Button inside nudges 2px (data-nudge).
               A card with its own Buttons can't be an <a> (no controls
               inside links): it's <div class="card card--link"> and its
               title is the link (.card-link), whose ::after stretches over
               the whole card; Buttons sit above it.
     Fill/Hug  fills its container's width (default); --hug fits content.
     Clip      --clip hides what crosses the rounded edge (full-bleed
               charts, illustrations). Card anchors absolute layers. */

@layer components {
  .card {
    position: relative;
    display: flex; flex-direction: column;
    box-sizing: border-box;
    min-width: 0;
    border-radius: var(--card-radius, var(--radius-8));
    background-color: var(--n0);
    box-shadow: var(--shadow-0);
    color: inherit;
    transition: box-shadow var(--dur-320) var(--ease-fade), background-color var(--dur-160) var(--ease-fade); /* shadow changes always animate, --dur-320 */
  }
  .card:not(.card--sunken).is-hover { box-shadow: var(--shadow-1); }
  @media (hover: hover) { .card:not(.card--sunken):hover { box-shadow: var(--shadow-1); } }
  .card--s { padding: var(--space-16); }
  .card.card--s.card--sunken { padding: var(--space-24); } /* sunken S gets more room (Santiago's cart, 2026-11-11) */
  .card--m { padding: var(--space-24); }
  .card--l { padding: var(--space-32); }

  /* XS insets its content (a preview, an illustration), so the inset gets
     concentric corners: inner = outer − padding (Santiago, 2026-10-17: keep
     the card at --radius-8, inset --radius-8 − --space-6 = 2px). Inset
     pieces use var(--card-inset-radius). */
  .card--xs { padding: var(--space-6); --card-inset-radius: var(--radius-2); }

  .card--hug { width: fit-content; max-width: 100%; }
  .card--clip { overflow: hidden; }
  .card > * { min-width: 0; }

  .card--sunken { background-color: var(--neutralTint10); box-shadow: none; } /* Tint10 (Santiago, 2026-10-22): a neutral Icon Box (Tint25) inside still reads */

  .card--link { text-decoration: none; cursor: pointer; }
  .card--sunken.card--link.is-hover { box-shadow: none; background-color: color-mix(in srgb, var(--neutralTint10), var(--n0) 55%); }
  @media (hover: hover) { .card--sunken.card--link:hover { box-shadow: none; background-color: color-mix(in srgb, var(--neutralTint25), var(--n0) 55%); } }
  .card--link:focus-visible, .card--link.is-focus { outline: 2px solid transparent; box-shadow: var(--shadow-0), 0 0 0 2px var(--n0), 0 0 0 4px var(--blue100); }
  .card--sunken.card--link:focus-visible, .card--sunken.card--link.is-focus { box-shadow: 0 0 0 2px var(--n0), 0 0 0 4px var(--blue100); }

  .card-link { color: inherit; text-decoration: none; outline: none; }
  .card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
  .card--link :is(button, a:not(.card-link), input, select, textarea) { position: relative; z-index: 1; }
  .card--link:has(.card-link:focus-visible) { outline: 2px solid transparent; box-shadow: var(--shadow-0), 0 0 0 2px var(--n0), 0 0 0 4px var(--blue100); }
  .card--sunken.card--link:has(.card-link:focus-visible) { box-shadow: 0 0 0 2px var(--n0), 0 0 0 4px var(--blue100); }
}
