:host(:not(:is([hydrated], .hydrated))) {
  @apply not-hydrated;
}


mds-tree-item {
  &:not(:is([hydrated], .hydrated)) {
    @apply not-hydrated;
  }
}


/**
 * @prop --mds-tree-actions-border-radius: Sets the border-radius of the wrapper container of the actions.
 * @prop --mds-tree-actions-gap: Sets the gap between the actions.
 * @prop --mds-tree-label-icon-default-color: Sets the default text color of the icon used at the near right of the label.
 * @prop --mds-tree-label-icon-hover-color: Sets the text color of the icon used at the near right of the label when the mouse is over the item.
 * @prop --mds-tree-label-default-background: Sets the default text color of the icon used at the near right of the label.
 * @prop --mds-tree-label-hover-background: Sets the background-color of the label when the mouse is over the item.
 * @prop --mds-tree-line-clamp: Public. Sets the number of lines to show before truncating the text, it only works when attribute `truncate` is set to `all`.
 * @prop --mds-tree-branch-border-color: Sets the border color of the tree branch.
 * @prop --mds-tree-branch-use-rounded-border: Sets the tree branch has rounded connectors or not, use it as a boolean value `true` or `false`.
 * @prop --mds-tree-branch-border-size: Sets the border size of the tree branch.
 * @prop --mds-tree-branch-dot-default-color: Sets the default color of the tree branch dot.
 * @prop --mds-tree-branch-dot-expanded-color: Sets the color of the tree branch dot when the item is expanded.
 * @prop --mds-tree-toggle-gap: Sets the gap between the toggle icon and the label.
 * @prop --mds-tree-toggle-icon-async-background: Sets the background-color of the icon when the attribute `async` is set.
 * @prop --mds-tree-toggle-icon-async-color: Sets the text color of the icon when the attribute `async` is set.
 * @prop --mds-tree-toggle-icon-chevron-default-background: Sets the background-color of the chevron icon when the item is collapsed.
 * @prop --mds-tree-toggle-icon-chevron-default-color: Sets the text color of the chevron icon when the item is collapsed.
 * @prop --mds-tree-toggle-icon-chevron-expanded-background: Sets the background-color of the chevron icon when the item is expanded.
 * @prop --mds-tree-toggle-icon-chevron-expanded-color: Sets the text color of the chevron icon when the item is expanded.
 * @prop --mds-tree-toggle-icon-folder-default-background: Sets the background-color of the folder icon when the item is collapsed.
 * @prop --mds-tree-toggle-icon-folder-default-color: Sets the text color of the folder icon when the item is collapsed.
 * @prop --mds-tree-toggle-icon-folder-expanded-color: Sets the text color of the folder icon when the item is expanded.
 * @prop --mds-tree-toggle-icon-position-right-default-background: Sets the background-color of the icon when the attribute `toggle-position` is set to `right`.
 * @prop --mds-tree-toggle-icon-position-right-default-color: Sets the text color of the icon when the attribute `toggle-position` is set to `right`.
 * @prop --mds-tree-toggle-icon-position-right-expanded-background: Sets the background-color of the icon when the attribute `toggle-position` is set to `right` and the item is expanded.
 * @prop --mds-tree-toggle-icon-position-right-expanded-color: Sets the text color of the icon when the attribute `toggle-position` is set to `right` and the item is expanded.
 * @prop --mds-tree-transition-duration: Sets the duration of the transition effect.
 * @prop --mds-tree-transition-timing-function: Sets the timing function of the transition effect.
 */

/* ❌ Not supported

@property --mds-tree-transition-timing-function {
  inherits: false;
  initial-value: var(--ease-in-out-expo);
  syntax: "<timing-function>";
}
*/

:host {
  --mds-tree-actions-border-radius: var(--magma-radius-lg, var(--radius-squircle-lg, 28px));
  --mds-tree-actions-gap: --spacing(50);
  --mds-tree-label-default-background: transparent;
  --mds-tree-label-hover-background: rgb(var(--magma-wash-soft, var(--tone-neutral-10, 237 237 237)));
  --mds-tree-label-icon-default-color: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-tree-label-icon-hover-color: var(--mds-tree-label-icon-default-color);
  --mds-tree-line-clamp: 2;
  --mds-tree-branch-border-color: rgb(var(--magma-border-default, var(--border-neutral-default, 183 183 183)));
  --mds-tree-branch-use-rounded-border: true;
  --mds-tree-branch-border-size: --spacing(50);
  --mds-tree-branch-dot-default-color: rgb(var(--magma-border-default, var(--border-neutral-default, 183 183 183)));
  --mds-tree-branch-dot-expanded-color: rgb(var(--magma-border-strong, var(--border-neutral-strong, 140 140 140)));
  --mds-tree-toggle-gap: --spacing(100);
  --mds-tree-toggle-icon-async-background: rgb(var(--magma-wash-base, var(--tone-neutral-09, 225 225 225)));
  --mds-tree-toggle-icon-async-color: rgb(var(--magma-accent-fg, var(--variant-primary-03, 0 73 211)));
  --mds-tree-toggle-icon-chevron-default-background: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-tree-toggle-icon-chevron-default-color: rgb(var(--magma-text-on-emphasis, var(--tone-neutral-seed, 255 255 255)));
  --mds-tree-toggle-icon-chevron-expanded-background: var(
    --mds-tree-toggle-icon-chevron-default-background
  );
  --mds-tree-toggle-icon-chevron-expanded-color: var(--mds-tree-toggle-icon-chevron-default-color);
  --mds-tree-toggle-icon-folder-default-background: rgb(var(--magma-wash-strong, var(--tone-neutral-08, 208 208 208)));
  --mds-tree-toggle-icon-folder-default-color: rgb(var(--magma-accent-emphasis, var(--variant-primary-04, 11 96 255)));
  --mds-tree-toggle-icon-folder-expanded-color: var(--mds-tree-toggle-icon-folder-default-color);
  --mds-tree-toggle-icon-position-right-default-background: transparent;
  --mds-tree-toggle-icon-position-right-default-color: rgb(var(--magma-text-subtle, var(--text-neutral-subtle, 99 99 99)));
  --mds-tree-toggle-icon-position-right-expanded-background: transparent;
  --mds-tree-toggle-icon-position-right-expanded-color: rgb(var(--magma-text-subtle, var(--text-neutral-subtle, 99 99 99)));
  --mds-tree-transition-duration: var(--duration-300, 300ms);
  --mds-tree-transition-timing-function: var(--ease-in-out-expo, cubic-bezier(1, 0, 0, 1));

  /* private */
  --mds-tree-toggle-border-radius: var(--magma-radius-lg, var(--radius-squircle-lg, 28px));

  /* private */
  --mds-tree-toggle-size: --spacing(900);

  @apply ease-out;

  border-radius: var(--magma-radius-sm, var(--radius-squircle-sm, 16px));
  corner-shape: var(--magma-corner-shape, squircle);
  display: grid;
  padding: --spacing(50);
  transition-duration: var(--duration-200, 200ms);
  transition-property: background-color;
}
