/* An icon, if there is one, takes the first column; the title and description the second. */
[data-slot='alert'] {
  position: relative;
  display: grid;
  grid-template-columns: 0 1fr;
  align-items: start;
  row-gap: 0.125rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--card-foreground);
  font-size: 0.875rem;

  &:has(> svg) {
    grid-template-columns: 1rem 1fr;
    column-gap: 0.75rem;
  }
  & > svg {
    width: 1rem;
    height: 1rem;
    translate: 0 0.125rem;
    color: currentColor;
  }
  &[data-variant='destructive'] {
    color: var(--destructive);
  }
  &[data-variant='destructive'] [data-slot='alert-description'] {
    color: color-mix(in oklch, var(--destructive) 90%, transparent);
  }
}

[data-slot='alert-title'] {
  grid-column-start: 2;
  min-height: 1rem;
  overflow: hidden;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-slot='alert-description'] {
  display: grid;
  grid-column-start: 2;
  justify-items: start;
  gap: 0.25rem;
  color: var(--muted-foreground);

  & p {
    margin: 0;
    line-height: 1.625;
  }
}
