@use 'variables';
@use 'mixins';

@include mixins.parent {
  @if variables.$enable-compact-lists {
    p {
      & + dl,
      & + ol,
      & + ul {
        margin-top: -(variables.$margin);
      }
    }
  }

  ol,
  ul,
  dd {
    margin-left: variables.$margin;

    @if variables.$enable-multiline-wrap {
      & > * {
        box-decoration-break: clone;
      }
    }
  }

  ol,
  ul {
    list-style-position: outside;
  }

  ol {
    list-style-type: decimal;

    ol {
      list-style-type: lower-alpha;

      ol {
        list-style-type: lower-roman;

        ol {
          list-style-type: lower-greek;

          ol {
            list-style-type: decimal;

            ol {
              list-style-type: lower-alpha;
            }
          }
        }
      }
    }
  }

  ul {
    list-style-type: disc;

    ul {
      list-style-type: circle;

      ul {
        list-style-type: square;

        ul {
          list-style-type: circle;

          ul {
            list-style-type: disc;

            ul {
              list-style-type: circle;
            }
          }
        }
      }
    }
  }

  li {
    p,
    dl,
    ol,
    ul,
    blockquote,
    pre,
    table {
      margin-bottom: variables.$margin * 0.4;
    }

    & > p:only-of-type {
      margin-bottom: 0;
    }

    & > ul,
    & > ol,
    & > dl {
      margin-top: variables.$margin * 0.4;
    }
  }

  dt {
    font-weight: variables.$weight-bold;
  }
  
  @if not variables.$enable-compact-lists {
    li,
    dd {
      margin-bottom: variables.$margin * 0.4;
    }
  }
}
