@layer components {
  /* Base
  /* -------------------------------------------------------------------------- */

  /* The shared surface behind rows, dashboard tiles, panels and blank slates.
     Its edge is the low elevation's hairline ring, not a border, so it sits
     as quietly on the page as the tables do. */
  .card {
    background-color: var(--card-background, var(--color-surface));
    border: 0;
    border-radius: var(--card-border-radius, var(--border-radius-large));
    box-shadow: var(--card-shadow, var(--shadow-small));
    color: var(--color-ink);
    display: flex;
    flex-direction: column;
    gap: var(--card-gap, var(--block-space-half));
    padding: var(--card-padding, var(--block-space));
    position: relative;
    transition: background-color var(--duration) ease-in-out,
      box-shadow var(--duration) ease-in-out;
  }

  /* Variants
  /* -------------------------------------------------------------------------- */

  /* Lifts on hover to signal the whole card is clickable */
  .card--raisable {
    @media (any-hover: hover) {
      &:hover {
        --card-shadow: var(--shadow);
      }
    }
  }

  /* No inner padding: the child (a table, a list) owns its own spacing */
  .card--flush {
    --card-padding: 0;
    --card-gap: 0;

    overflow: hidden;
  }

  .card--centered {
    align-items: center;
    text-align: center;
  }

  /* For actions that can't be undone: a red ring. Mixed with transparent,
     not the bluish border grey, so the hue stays red rather than purple */
  .card--danger {
    --card-shadow: 0 0 0 1px color-mix(in oklch, var(--color-negative) 50%, transparent), var(--shadow-small);
  }
}
