/**
 * @file
 * Visual styles for progress bar.
 *
 * @see progress.js
 */

:root {
  --progress-bar-bg-color: var(--admin-color-primary);
  --progress-bar-border-color: var(--admin-color-primary);
  --progress-bar-label-font-size: var(--admin-font-size-m);
  --progress-bar-small-label-font-size: var(--admin-font-size-label);
  --progress-bar-default-size: calc(var(--admin-space-m) - (2 * var(--progress-bar-border-size)));
  --progress-bar-default-size-radius: var(--admin-space-m);
}

.progress::after {
  display: table;
  clear: both;
  content: "";
}

.progress--small {
  & .progress__track {
    height: var(--progress-bar-small-size);
  }

  & .progress__bar {
    width: var(--progress-bar-small-size);
    min-width: var(--progress-bar-small-size);
    height: var(--progress-bar-small-size);
  }

  & .progress__label {
    font-size: var(--progress-bar-small-label-font-size);
  }
}

.progress__track {
  height: var(--progress-bar-default-size);
  margin-block-start: 0;
  padding: var(--admin-space-xs);
  border: var(--progress-bar-border-size) var(--admin-color-border) solid;
  border-radius: var(--progress-bar-default-size-radius);
  background-color: var(--admin-color-bg-raised);
}

.progress__bar {
  width: var(--progress-bar-default-size);
  min-width: var(--progress-bar-default-size);
  height: var(--progress-bar-default-size);
  margin-block-start: calc(var(--progress-bar-border-size) * -1);
  margin-inline-start: calc(var(--progress-bar-border-size) * -1);
  transition: var(--progress-bar-transition);
  border: var(--progress-bar-border-size) var(--progress-bar-border-color) solid;
  border-radius: var(--progress-bar-default-size-radius);
  background-color: var(--progress-bar-bg-color);
  box-shadow:
    0 0.125em 0.25em var(--admin-color-primary-soft),
    1.25em 0.9375em 2em var(--admin-color-primary-soft);

  @media screen and (prefers-reduced-motion: reduce) {
    transition: none;
  }

  @media (forced-colors: active) {
    background-color: canvastext;
  }
}

.progress__label {
  margin-block-end: var(--progress-bar-spacing-size);
  font-size: var(--progress-bar-label-font-size);
  font-weight: bold;
}

.progress__description,
.progress__percentage {
  overflow: hidden;
  margin-block-start: var(--progress-bar-spacing-size);
  color: var(--admin-color-text);
  font-size: var(--progress-bar-description-font-size);
}
