@layer cinder.tokens, cinder.foundation, cinder.components, cinder.utilities;
@layer cinder.components {
  .cinder-capability-gate {
    display: flex;
    flex-direction: column;
    gap: var(--cinder-space-2);
    padding: var(--cinder-space-3);
    border-radius: var(--cinder-radius-md);
    border: var(--cinder-border-width) solid var(--cinder-border);
    background-color: var(--cinder-surface);
    color: var(--cinder-text-default);
  }

  /* Variant-based color theming */
  .cinder-capability-gate[data-cinder-variant='error'] {
    border-color: var(--cinder-status-danger-border);
    background-color: var(--cinder-status-danger-background);
  }

  .cinder-capability-gate[data-cinder-variant='warning'] {
    border-color: var(--cinder-status-warning-border);
    background-color: var(--cinder-status-warning-background);
  }

  .cinder-capability-gate[data-cinder-variant='success'] {
    border-color: var(--cinder-status-success-border);
    background-color: var(--cinder-status-success-background);
  }

  /* Banner presentation — full width, less rounding */
  .cinder-capability-gate[data-cinder-presentation='banner'] {
    border-radius: var(--cinder-radius-sm);
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .cinder-capability-gate__status {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: var(--cinder-space-2);
    flex: 1;
  }

  /*
   * CIN-109: the three text tiers are feature (label), status text (annotation),
   * and this content block (body copy). They are differentiated as:
   *
   *   feature      base / semibold / --cinder-text-default   via .cinder-_label-text
   *   status text  sm   / normal   / --cinder-text-muted     via .cinder-_value-text
   *   content      sm   / normal   / --cinder-text-default   here
   *
   * Status text and content differ by colour alone, which is deliberate: they sit in
   * structurally separate regions (the __status row versus this block), so type is not
   * the only thing telling them apart.
   *
   * Do not "fix" that by adding font-weight: var(--cinder-font-medium) here. That was
   * tried and reverted — system-ui has no distinct 500 face in the canonical Ubuntu
   * Jammy Playwright environment, so 500 renders identically to the inherited 400 and
   * the regenerated baselines came back byte-for-byte unchanged. It looks like a
   * hierarchy fix in the diff and is a no-op on screen.
   */
  .cinder-capability-gate__content {
    font-size: var(--cinder-text-sm);
    line-height: var(--cinder-leading-normal);
    color: var(--cinder-text-default);
  }

  /* The actions are Cinder Buttons (and Links) the page passes in: the gate lays them out and
   * never restyles them, so the grant action is a real primary Button and cannot drift from it. */
  .cinder-capability-gate__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cinder-space-2);
    align-items: center;
  }
}
