@use 'functions/color' as *;
@use 'functions/get-var' as *;
@use 'variables' as *;

// Steps
.step {
  display: flex;
  flex-wrap: nowrap;
  list-style: none;
  // margin: $unit-1 0; // old spectre.css
  margin: get-var('unit-1') 0;
  width: 100%;

  .step-item {
    flex: 1 1 0;
    margin-top: 0;
    min-height: 1rem;
    text-align: center;
    position: relative;

    &:not(:first-child)::before {
      // background: $primary-color; // old spectre.css
      background: color('primary-color');
      content: '';
      height: 2px;
      left: -50%;
      position: absolute;
      top: 9px;
      width: 100%;
    }

    a {
      // color: $primary-color; // old spectre.css
      color: color('primary-color');
      display: inline-block;
      padding: 20px 10px 0;
      text-decoration: none;

      &::before {
        // background: $primary-color; // old spectre.css
        background: color('primary-color');
        // border: $border-width-lg solid $light-color; // old spectre.css
        border: get-var('border-width', $suffix: 'lg') solid color('light-color');
        border-radius: 50%;
        content: '';
        display: block;
        // height: $unit-3; // old spectre.css
        height: get-var('unit-3');
        left: 50%;
        position: absolute;
        // top: $unit-1; // old spectre.css
        top: get-var('unit-1');
        transform: translateX(-50%);
        // width: $unit-3; // old spectre.css
        width: get-var('unit-3');
        // z-index: $zindex-0; // old spectre.css
        z-index: get-var('z-index-0');
      }
    }

    &.active {
      a {
        &::before {
          // background: $light-color; // old spectre.css
          background: color('light-color');
          // border: $border-width-lg solid $primary-color; // old spectre.css
          border: get-var('border-width', $suffix: 'lg') solid color('primary-color');
        }
      }

      & ~ .step-item {
        &::before {
          // background: $border-color; // old spectre.css
          background: color('border-color');
        }

        a {
          // color: $gray-color; // old spectre.css
          color: color('gray-color');

          &::before {
            // background: $border-color; // old spectre.css
            background: color('border-color');
          }
        }
      }
    }
  }
}
