/*
 * Copyright (c) 2026, Salesforce, Inc.,
 * All rights reserved.
 * For full license text, see the LICENSE.txt file
 */

/* Cosmos theme: icon hook assignments */

@layer theme {
  .slds-icon_container {
    --slds-c-icon-radius-border: var(--slds-g-radius-border-circle);
  }

  .slds-icon_container_circle {
    --slds-c-icon-radius-border: var(--slds-g-radius-border-circle);
    --slds-c-icon-spacing-block: var(--slds-g-spacing-2);
    --slds-c-icon-spacing-inline: var(--slds-g-spacing-2);
  }

  .slds-icon {
    --slds-c-icon-size: var(--slds-g-sizing-9);
    --slds-c-icon-color-foreground: var(--slds-g-color-neutral-base-100);
  }

  /* Size modifiers */
  .slds-icon_xxx-small {
    --slds-c-icon-size: var(--slds-g-sizing-3);
  }

  .slds-icon_xx-small {
    --slds-c-icon-size: calc(var(--slds-g-sizing-1) + var(--slds-g-sizing-4));
  }

  .slds-icon_x-small {
    --slds-c-icon-size: var(--slds-g-sizing-5);
  }

  .slds-icon_small {
    --slds-c-icon-size: var(--slds-g-sizing-7);
  }

  .slds-icon_large {
    --slds-c-icon-size: var(--slds-g-sizing-10);
  }

  /* Text-color modifiers */
  .slds-icon-text-warning {
    --slds-c-icon-color-foreground: var(--slds-g-color-warning-1);
  }

  .slds-icon-text-success {
    --slds-c-icon-color-foreground: var(--slds-g-color-success-1);
  }

  .slds-icon-text-error {
    --slds-c-icon-color-foreground: var(--slds-g-color-error-1);
  }

  .slds-icon-text-light {
    --slds-c-icon-color-foreground: var(--slds-g-color-neutral-base-70);
  }

  .slds-icon-text-default {
    --slds-c-icon-color-foreground: var(--slds-s-icon-color-foreground);
  }

  .slds-icon-text-default.slds-is-disabled {
    --slds-c-icon-color-foreground: var(--slds-g-color-disabled-1);
  }
}
