@import "vars";

// sitemap-list
// ===========================================

// the first level menu list
.sitemap-list {
  padding: 0;
  margin-bottom: 30px;
  list-style-type: none;
  
  a {
    color: $color-blue-grey-500;
  }

  // sitemap-list item
  > li {
    // set the fist item as title
    &:first-child {
      margin-bottom: 25px;
    }
     &.is-single{
      margin-bottom: 10px;
    }
    // set other items as secondary menus
    > a {
      display: block;
      padding: 14px 15px;
      border-radius: 5px;
      border: 1px solid $color-blue-grey-200;
      line-height: 1;
      text-decoration: none;
    }
    
    // set the child list of secondary menu as third menu list
    > ul {
      position: relative;
      list-style-type: none;
      margin: 0;
      padding: 10px 10px 20px 40px;

      a:hover {
        color: $color-blue-600;
      }

      // the vertical line before third menu list
      &::before {
        position: absolute;
        left: 20px;
        top: 0;
        height: 100%;
        width: 1px;
        content: " ";
        background: $color-blue-grey-200;
      }

      // third menu item
      > li > a {
        position: relative;
        display: block;
        min-width: 220px;
        padding: 10px;
        margin-bottom: 5px;
        border: 1px solid $color-blue-grey-200;
        line-height: 1;
        text-decoration: none;

        &::before,&::after {
          position: absolute;
          top: 50%;
          content: " ";
          background: $color-blue-grey-200;
        }

        // the horizontal line before third menu item
        &::before {
          left: -20px;
          width: 20px;
          height: 1px;
          margin-top: -1px;
        }

        // the circle line before third menu item
        &::after {
          left: -23px;
          height: 5px;
          width: 5px;
          margin-top: -3px;
          border-radius: 50%;
        }
      }
    }
  }
}

// sitemap-list-sub
// ==================================================

// the fourth menu list
.sitemap-list-sub {
  position: relative;
  padding: 5px 0 9px 40px;
  margin-top: -5px;
  list-style-type: none;

  // the vertical line before sitemap-list-sub
  &::before {
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 1px;
    content: " ";
    background:  $color-blue-grey-200;
  }

  // the fourth menu item
  > li {
    position: relative;
    line-height: 30px;
    
    &::before,&::after {
      position: absolute;
      left: -22px;
      top: 50%;
      content: " ";
      background: $color-blue-grey-200;
    }

    // the horizontal line before the fourth menu item
    &::before {
      height: 1px;
      width: 15px;
      margin-top: -1px;
    }

    // the circle point before the fourth menu item
    &::after {
      width: 5px;
      height: 5px;
      margin-top: -3px;
      border-radius: 50%;
    }
  }
}

// responsive
// ================================================

@include media-breakpoint-down(xs) {
  
  .sitemap-list {
    padding-left: 40px;
    list-style-type: disc;
    
    //hidden the icon of second list
    .icon {
      display: none;
    }

    > li {
      // title
      &:first-child {
        margin-bottom: 20px;
        list-style-type: none;
        margin-left: -16px;
      }
      
      // menu item
      > a {
        display: inline;
        padding: 10px;
        border: none;

        // hidden the icon of third list
        i {
          display: none;
        }
      }

      // third menu list
      > ul {
        list-style-type: circle;
        padding: 5px 0 5px 26px;

        // the vertical line before the child list of second menu
        &::before {
          display: none;
        }

        // third menu item
        > li > a {
          display: inline;
          border: none;
          padding: 10px 0;

          &::before,&::after {
            display: none;
          }
        }
      }
    }
  }

  // sitemap-list-sub
  .sitemap-list-sub {
    padding: 5px 0 5px 20px;
    list-style-type: square;

    // the vertical line before the fourth menu list
    &::before {
      display: none;
    }

    // the fourth menu item
    > li {
      line-height: normal;
      
      // hidden the horizontal line and circle
      &::before,&::after {
        display: none;
      }
    }
  }
}