@import './markdown.less';
@import './variables.less';

@s-toc-width: 136px;

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB,
    Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji,
    Segoe UI Symbol;
  font-variant: tabular-nums;
  font-feature-settings: 'tnum';
}

.anna-theme-main {
  background-color: #feffff;
  padding: 140px;
  width: 900px;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0px 1px 10px 0px #eaecee;
}

.anna-theme-feature {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 600px;
  line-height: 300px;
  font-size: 48px;
  font-weight: 500;
  color: #333;
  & > div:nth-child(1) {
    color: #ff7777;
  }
  & > div:nth-child(2) {
    margin: 0 20px;
  }
  & > div:nth-child(3) {
    color: #3375f1;
  }

  &-connector {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #000;
  }
}

.@{prefix}-layout {
  box-sizing: border-box;
  min-height: 100vh;
  padding: 16px (@s-content-margin + @s-toc-width) 50px @s-menu-width + @s-content-margin;

  @media @mobile {
    padding-top: 66px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  &[data-gapless='true'] {
    padding-top: @s-nav-height !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
    padding-bottom: 0;

    @media @mobile {
      padding-top: @s-mobile-nav-height !important;
    }
  }

  &[data-show-sidemenu='false'] {
    padding-left: @s-content-margin;
  }

  &[data-show-slugs='false'] {
    padding-right: @s-content-margin;
  }

  &[data-site-mode='true'] {
    padding-top: 0;

    &[data-show-sidemenu='true'] {
      padding-left: @s-site-menu-width + 50px;
    }

    &[data-show-slugs='true'] {
      padding-right: 160px;
    }

    .@{prefix}-layout-content > .markdown:first-child > *:first-child {
      margin-top: 0;
    }

    .@{prefix}-layout-toc {
      top: 114px;
      max-height: calc(90vh - 144px);
    }
  }

  &-hero {
    height: 100vh;
    margin: 64px -58px 0;
    padding: 40px 100px;
    text-align: center;
    background-color: #fafafa;

    @media @mobile {
      margin: -16px -16px 0;
      padding: 48px 0;
    }

    h1 {
      margin: 0 0 16px;
      font-size: 48px;
      font-weight: 600;
      line-height: 56px;
      letter-spacing: 8px;
      color: #080e29;

      + div {
        margin: 0 0 32px;
        opacity: 0.78;

        .markdown {
          font-size: 16px;
          > p {
            margin: 0;
            font-size: 24px;
            font-weight: 500;
            color: #080e29;
            letter-spacing: 2px;
          }
        }
      }
    }

    button {
      margin-right: 16px;
      padding: 0 32px;
      height: 44px;
      color: @c-primary;
      font-size: 16px;
      background: transparent;
      border: 1px solid @c-primary;
      border-radius: 22px;
      box-sizing: border-box;
      cursor: pointer;
      outline: none;
      transition: all 0.3s;

      &:hover {
        opacity: 0.8;
      }

      &:active {
        opacity: 0.9;
      }
    }

    a:last-child button {
      margin-right: 0;
      color: #fff;
      background: @c-primary;
    }
  }

  &-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-column-gap: 96px;
    grid-row-gap: 56px;
    padding: 72px 0;

    > dl {
      flex: 1;
      margin: 0;
      text-align: center;
      background: no-repeat center top / auto 48px;

      &[style*='background-image'] {
        padding-top: 64px;
      }

      dt {
        margin-bottom: 12px;
        font-size: 20px;
        line-height: 1;
        color: @c-heading;
      }

      dd {
        margin: 0;

        .markdown {
          color: @c-secondary;
          font-size: 14px;
          line-height: 22px;

          > p:first-child {
            margin-top: 0;
          }

          > p:last-child {
            margin-bottom: 0;
          }
        }
      }
    }

    @media @mobile {
      display: block;
      padding: 40px 0;

      > dl {
        text-align: left;
        background-position: left top;

        &[style*='background-image'] {
          padding: 0 0 0 60px;
        }

        + dl {
          margin-top: 32px;
        }
      }
    }
  }

  &-features,
  &-features + &-content,
  &-hero + &-content {
    margin-left: auto;
    margin-right: auto;
    max-width: 960px;
  }

  &-toc {
    list-style: none;
    position: fixed;
    z-index: 10;
    top: 50px;
    right: 0;
    width: @s-toc-width;
    max-height: calc(90vh - 80px);
    margin: 0;
    padding: 0 24px 0 0;
    background-color: #fff;
    box-shadow: 0 0 16px 16px #fff;
    box-sizing: content-box;
    overflow: auto;

    @media @mobile {
      display: none;
    }

    li {
      position: relative;
      margin: 0;
      padding: 4px 0 4px 6px;
      text-indent: 12px;
      font-size: 13px;
      line-height: 1.40625;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;

      a {
        color: @c-text;
        text-decoration: none;

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          bottom: 0;
          display: inline-block;
          width: 2px;
          background: @c-border;
        }

        &:hover {
          color: lighten(@c-primary, 5%);
        }

        &:active {
          color: lighten(@c-primary, 3%);
        }

        &.active {
          color: @c-primary;

          &::before {
            background: @c-primary;
          }
        }
      }
    }
  }

  &-footer-meta {
    height: 100px;
  }
}

.__dumi-default-layout-footer {
  margin: 72px 0 -32px;
  padding-top: 24px;
  border-top: 1px solid @c-border;
  text-align: center;

  .markdown {
    color: #b0b1ba;
  }
}
