html {
  scroll-behavior: smooth;
}

.main {
  background: #F1F1F1;
}

/* 記事一覧 */
.column-wrap {
  padding: 7.5rem min(2.7778%, 2.5rem);

  @media screen and (width <= 768px) {
    padding: 5rem 0;
  }
}

.column-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.87rem;

  & .item {
    width: calc((100% - (1.87rem*2))/3);
  }

  @media screen and (width <= 768px) {
    flex-direction: column;
    gap: 2.5rem;

    & .item {
      width: 100%;
    }
  }
}

/* 記事詳細 */
.article {
  padding: 3.75rem min(2.7778%, 2.5rem);

  & h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--gray-scale-12);
    margin: 0 0 3.75rem;
  }

  @media screen and (width <= 768px) {
    padding: 3.75rem 0;

    & h1 {
      font-size: 1.875rem;
      margin: 0 0 2.25rem;
    }
  }
}

.article-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4.5rem;
}

.article-body {
  width: 42.5rem;
  font-size: 1.125rem;

  & > * {
    margin-bottom: 2.5rem;
  }

  & p {
    line-height: 2.2;

    &:last-child {
      margin-bottom: 0;
    }
  }

  & :where(h2, h3, h4, h5, h6) {
    font-weight: 700;
    line-height: 1.5;
    color: var(--gray-scale-12);
    margin-bottom: 2.5rem;
  }

  & h2 {
    font-size: 2rem;
    padding: 0 0 1.25rem;
    margin-top: 3.25rem;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid var(--color-primary);
  }

  & h3 {
    font-size: 1.75rem;
    padding: 0 0 0 1.25rem;
    margin-bottom: 2.5rem;
    border-left: 5px solid var(--color-primary);
  }

  & h4 {
    font-size: 1.5rem;
    color: var(--color-primary);
  }

  & h5 {
    font-size: 1.5rem;
  }

  & h6 {
    font-size: 1.25rem;
  }

  & ul {
    & li {
      padding: 0 0 0 1.25rem;
      line-height: 1.8;
      position: relative;

      &::before {
        content: "";
        display: block;
        width: 0.25rem;
        height: 0.25rem;
        background: var(--color-primary);
        border-radius: 50%;
        position: absolute;
        left: .5rem;
        top: .8125rem;
      }
    }
  }

  & ol {
    padding: 0 0 0 1.5rem;

    & li {
      list-style-type: decimal;
      line-height: 1.8;
    }
  }

  & .profile {
    margin-top: 5rem;

    & dt {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      height: 2.75rem;
      background: var(--color-primary);
      border-radius: 0.5rem 0.5rem 0 0;
      color: #fff;
    }

    & dd {
      padding: 1.75rem 2rem;
      background: #fff;
      border-radius: 0 0 0.5rem 0.5rem;

      & p {
        font-size: 1rem;
      }
    }


    & .name {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--gray-scale-12);
      margin: 0 0 .75rem;
    }
  }

  & cite {
    font-style: normal;
  }

  & a {
    color: var(--color-primary);
    text-decoration: underline;
  }

  & blockquote {
    font-size: 1rem;
    padding: 1.25rem;
    background: #fff;

    & p {
      margin-bottom: 1.25rem;
      line-height: 1.8;
    }

    & figcaption {
      font-size: .875rem;
    }

    & code {
      background-color: #eee;
      border-radius: 3px;
      padding: 5px;
      font-size: .875rem;
    }

    & ul,
    & ol {
      margin-bottom: 1.25rem;
    }
  }

  & table {
    font-size: 1rem;

    & th {
      width: 12.5rem;
    }

    & td {
      &:last-child {
        width: 30rem;
      }
    }
  }

  & .date {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-scale-11);
    text-align: right;
  }

  @media screen and (width <= 768px) {
    width: 100%;
    font-size: 1rem;

    & > * {
      margin-bottom: 2rem;
    }

    & :where(h2, h3, h4, h5) {
      margin-bottom: 2rem;
    }

    & h2 {
      font-size: 1.75rem;
      margin-top: 3.75rem;
      margin-bottom: 2rem;
    }

    & h3 {
      font-size: 1.5rem;
      margin-bottom: 2rem;
    }

    & h4 {
      font-size: 1.25rem;
      margin-bottom: 1.75rem;
    }

    & h5 {
      font-size: 1.125rem;
      margin-bottom: 1.5rem;
    }
  }
}

.article-side {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 13rem;
  position: sticky;
  top: 2rem;

  & .toc {
    width: 100%;
    box-shadow: 0 8px 16px 0 rgb(193 200 222 / 30%);

    & dt {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      height: 2rem;
      background: var(--color-primary);
      border-radius: 0.5rem 0.5rem 0 0;
      color: #fff;
    }

    & dd {
      background: #fff;
      border-radius: 0 0 0.5rem 0.5rem;
    }
  }

  & .toc-list {
    & li {
      border-bottom: 1px dashed var(--gray-scale-3);

      &:last-child {
        border: none;
      }

      & a {
        display: block;
        padding: 0.5rem 1.25rem;
        position: relative;
        font-size: 0.8125rem;
        color: var(--gray-scale-12);

        &::before {
          content: "";
          display: block;
          width: 0.25rem;
          height: 0.25rem;
          background: var(--color-primary);
          border-radius: 50%;
          position: absolute;
          top: 1rem;
          left: .56rem;
        }
      }
    }
  }

  @media screen and (width <= 768px) {
    display: none;
  }
}

.related-service {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  text-align: center;
  margin: 4.5rem 0 0;

  & .link {
    display: flex;
    align-items: center;
    background: #fff;
    box-shadow: 0 8px 16px 0 rgb(193 200 222 / 30%);
    border-radius: 0.5rem;
    color: var(--gray-scale-11);
    text-align: left;
  }

  & .logo {
    width: 18rem;
    flex-shrink: 0;
    line-height: 0;
  }

  & .text {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1.25rem;
    padding: .75rem 5rem .75rem 1.5rem;
    position: relative;

    &::after {
      content: "";
      display: block;
      width: 1.25rem;
      height: 1.25rem;
      background: url('data:image/svg+xml;charset=UTF-8,<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.39136 8.15107L5.69473 11.9036C5.50418 12.0768 5.21835 12.0768 5.04686 11.9036L4.6086 11.461C4.43711 11.2878 4.43711 10.9992 4.6086 10.8067L7.54304 7.82392L4.6086 4.86035C4.43711 4.66791 4.43711 4.37925 4.6086 4.20605L5.04686 3.76344C5.21835 3.59025 5.50418 3.59025 5.69473 3.76344L9.39136 7.51602C9.56285 7.68921 9.56285 7.97787 9.39136 8.15107Z" fill="%23e4e4e4"/></svg>') no-repeat center center;
      background-size: 100% 100%;
      position: absolute;
      top: 0;
      bottom: 0;
      right: 2rem;
      margin: auto;
    }
  }

  & .title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-scale-12);
    line-height: 1;
  }

  & .lead {
    font-size: 1rem;
    line-height: 1.8;
  }

  @media screen and (width <= 768px) {
    & .link {
      flex-direction: column;
    }

    & .text {
      padding-right: 3rem;

      &::after {
        right: 1rem;
      }
    }
  }
}