/* Callout
 *
 * An inline message attached to the thing it is about. Four tones:
 *   info     neutral context
 *   success  something completed
 *   warning  something needs attention soon
 *   danger   something is wrong or destructive
 *
 * Plus one product-specific use that earns its own variant:
 *   .callout--upgrade   the plan-limit prompt (pricing.md)
 *
 * Tone is never carried by colour alone — every variant has an icon glyph and
 * the message text states the situation. A colour-blind user, a greyscale
 * screenshot, and a screen reader all get the same information.
 *
 * Live announcements: use role="status" for info/success, role="alert" for
 * warning/danger. Do not put role="alert" on something rendered on page load —
 * it interrupts. Only on content that appears in response to an action.
 */

.callout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);

  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-inline-start: var(--border-width-accent) solid var(--color-text-muted);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-sunken);

  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
}

/* The glyph. aria-hidden in markup — the text carries the meaning. */
.callout__icon {
  flex: none;
  inline-size: 1.25rem;
  block-size: 1.25rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1.25rem;
  text-align: center;
  color: var(--color-surface);
  background-color: var(--color-text-muted);
}

.callout__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-inline-size: 0; /* lets long words wrap instead of forcing overflow */
}

.callout__title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.callout__body {
  margin: 0;
  max-inline-size: var(--measure);
  overflow-wrap: anywhere;
}

.callout__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: var(--space-1);
}

/* ---- tones ------------------------------------------------------------- */

.callout--info {
  border-inline-start-color: var(--color-accent);
}
.callout--info .callout__icon {
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
}

.callout--success {
  border-inline-start-color: var(--color-success);
}
.callout--success .callout__icon {
  background-color: var(--color-success);
  color: var(--color-surface);
}

.callout--warning {
  border-inline-start-color: var(--color-warning);
}
.callout--warning .callout__icon {
  background-color: var(--color-warning);
  color: var(--color-surface);
}

.callout--danger {
  border-inline-start-color: var(--color-danger);
}
.callout--danger .callout__icon {
  background-color: var(--color-danger);
  color: var(--color-surface);
}

/* ---- upgrade prompt ---------------------------------------------------- */

/* pricing.md: hitting a plan limit must teach, not scold. This is deliberately
 * the calmest variant — accent-tinted, no alarm glyph, action-led. It replaces
 * what would otherwise be an error message when a Free organisation tries to
 * invite someone or create a second active event. */
.callout--upgrade {
  border-inline-start-color: var(--color-accent);
  background-color: var(--color-surface-raised);
  border-color: var(--color-border-strong);
}
.callout--upgrade .callout__icon {
  background-color: var(--color-accent);
  color: var(--color-text-on-accent);
}

/* Usage-against-limit line. Text, not just a bar — a bar alone is unreadable
 * to a screen reader and meaningless in greyscale. */
.callout__meter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.callout__meter-track {
  flex: 1;
  block-size: var(--space-2);
  min-inline-size: 4rem;
  border-radius: var(--radius-full);
  background-color: var(--color-surface-sunken);
  overflow: hidden;
}

.callout__meter-fill {
  display: block;
  block-size: 100%;
  background-color: var(--color-accent);
  border-radius: var(--radius-full);
}

.callout__meter-fill--full {
  background-color: var(--color-warning);
}

/* ---- dismissible ------------------------------------------------------- */

.callout__dismiss {
  flex: none;
  margin-inline-start: auto;
  min-inline-size: var(--target-min);
  min-block-size: var(--target-min);
  display: flex;
  align-items: center;
  justify-content: center;

  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}

.callout__dismiss:hover {
  color: var(--color-text);
  background-color: var(--color-surface-sunken);
}

.callout__dismiss:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: var(--focus-ring-offset);
}
