@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
@layer cinder.components {
  /* ========================================
 * EMPTY STATE
 * ======================================== */

  /* One layout wherever the state sits, a page, a tab, a section or a panel (owner report,
   * 2026-11-19): the parts stacked and centred across, but top-aligned at one offset under
   * whatever is above them rather than centred in the height, so a state never floats in the
   * middle of a tall window. It is never boxed, and the words hold a reading measure of about 60
   * characters however wide the region is. */
  .cinder-empty-state {
    /* Prose, in the interface's own face, whatever it is placed inside: a state set in a
     * monospace well (a JSON or source viewer) would otherwise inherit that font. */
    font-family: var(--cinder-font-sans);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    inline-size: 100%;
    min-block-size: 0;
    box-sizing: border-box;
    text-align: center;
    padding-block: var(--cinder-space-12);
    padding-inline: 0;
    gap: var(--cinder-space-1);
  }

  /* The glyph sits in a 48px tinted disc. The disc is neutral by default (a filtered or
   * not-found state), accented for a first-use state that invites an action, success-tinted once
   * everything is done, and amber for a blocked state the person can recover from. A disabled state
   * (a setting the person chose) keeps the neutral disc, because it is not a warning. */
  .cinder-empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    inline-size: var(--cinder-space-12);
    block-size: var(--cinder-space-12);
    margin-block-end: var(--cinder-space-2-5);
    border-radius: var(--cinder-radius-full);
    background: var(--cinder-surface-inset);
    color: var(--cinder-text-muted);
  }

  .cinder-empty-state-icon > svg {
    inline-size: 1.375rem;
    block-size: 1.375rem;
  }

  /* An illustration stands in for the disc: a picture the caller sizes, kept to the width of the
   * region and centred above the title. */
  .cinder-empty-state-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-inline-size: 100%;
    margin-block-end: var(--cinder-space-3);
    color: var(--cinder-text-muted);
  }

  .cinder-empty-state-illustration > svg,
  .cinder-empty-state-illustration > img {
    max-inline-size: 100%;
    block-size: auto;
  }

  .cinder-empty-state[data-cinder-kind='first-use'] .cinder-empty-state-icon {
    background: var(--cinder-accent-background);
    color: var(--cinder-accent-text);
  }

  .cinder-empty-state[data-cinder-kind='done'] .cinder-empty-state-icon {
    background: var(--cinder-status-success-background);
    color: var(--cinder-status-success-text);
  }

  .cinder-empty-state[data-cinder-kind='blocked'] .cinder-empty-state-icon {
    background: var(--cinder-status-warning-background);
    color: var(--cinder-status-warning-text);
  }

  /* The title is 16px semibold: it says what is missing or what happened. */
  /* A title or sentence that names a record carries its name, and a name can be one unbroken
   * identifier longer than the region is wide: it breaks inside rather than overflowing. */
  .cinder-empty-state-title {
    max-inline-size: 60ch;
    font-size: var(--cinder-text-lg);
    font-weight: var(--cinder-font-semibold);
    line-height: var(--cinder-leading-snug);
    color: var(--cinder-text-default);
    margin: 0;
    overflow-wrap: anywhere;
  }

  .cinder-empty-state-description {
    max-inline-size: 60ch;
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    color: var(--cinder-text-muted);
    margin: 0;
    overflow-wrap: anywhere;
  }

  .cinder-empty-state-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    inline-size: 100%;
    max-inline-size: 60ch;
    gap: var(--cinder-space-2);
    margin-block-start: var(--cinder-space-3);
  }

  /* Supporting content under the action, such as the steps of a manual set-up, at the words'
   * measure. The text inherits the centring, and the block draws no border or background. */
  .cinder-empty-state-details {
    inline-size: 100%;
    max-inline-size: 60ch;
    min-inline-size: 0;
    margin-block-start: var(--cinder-space-4);
    overflow-wrap: anywhere;
  }

  @media (forced-colors: active) {
    .cinder-empty-state-icon {
      border: 1px solid CanvasText;
    }
  }
}
