@keyframes focus-bounce {
  0%,
  75%,
  100% {
    outline-offset: var(--magma-outline-focus-offset, 2px);
  }

  50% {
    outline-offset: var(--magma-outline-blur-offset, 6px);
  }
}

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


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


/**
 * @prop --mds-help-tooltip-width: Public. The width of the tooltip element.
 * @prop --mds-help-tooltip-max-width: Public. The maximum allowed width of the tooltip.
 * @prop --mds-help-tooltip-min-width: Public. The minimum allowed width of the tooltip.
 * @prop --mds-help-tooltip-delay: Public. The delay before the tooltip becomes visible.
 */

/* ❌ Not supported: 'fit-content' is not allowed in <length>. Requires <size> syntax, which @property does not support.
@property --mds-help-tooltip-width {
  inherits: false;
  syntax: "<length>";
  initial-value: fit-content;
}
*/

:host {
  --mds-help-tooltip-width: fit-content;
  --mds-help-tooltip-max-width: --spacing(7500);
  --mds-help-tooltip-min-width: --spacing(5000);

  /* stylelint-disable-next-line magma/token-values -- 250ms no --duration-* step says it */
  --mds-help-tooltip-delay: 0.25s;

  color: rgb(var(--magma-text-muted, var(--text-neutral-muted, 73 73 73)));
  cursor: help;
  display: inline-flex;
  fill: currentcolor;
  height: --spacing(400);
  justify-content: flex-start;
  margin-left: --spacing(100);
  overflow: visible;
  position: relative;
  width: --spacing(400);
}

i {
  @apply svg;
}

mds-tooltip {
  --mds-tooltip-delay: var(--mds-help-tooltip-delay, 0.25s);

  max-width: var(--mds-help-tooltip-max-width, --spacing(7500));
  min-width: var(--mds-help-tooltip-min-width, --spacing(5000));
}

mds-tooltip::part(text) {
  max-width: var(--mds-help-tooltip-max-width, --spacing(7500));
  min-width: var(--mds-help-tooltip-width);
  width: var(--mds-help-tooltip-width);
}

mds-icon,
i {
  fill: inherit;
  height: inherit;
  width: inherit;
}

.icon {
  @apply focus-bounce;

  border-radius: var(--radius-full, 1000px);
}

.icon:focus-visible {
  @apply focus-bounce--focused;
}
