.blog {
  --blogcolor-gray50: rgba(108, 117, 125, 0.5);
  --blogcolor-gray25: rgba(108, 117, 125, 0.25);
  --blogcolor-gray15: rgba(108, 117, 125, 0.15);
  --bloglistspace: 16px;
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
  &:has(.blogdetail + .bloglist) {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    max-width: 1600px;
    > .bloglist {
      width: 25%;
      @media (max-width: 767px) {
        width: 100%;
      }
      > .bloglisttitle {
        margin-bottom: var(--bloglistspace);
        padding-bottom: var(--bloglistspace);
        border-bottom: 3px solid #7964ff;
        font-size: 1.4em;
        font-weight: normal;
      }
      > .blogitem {
        > a {
          flex-direction: column;
          > :where(.blogdate, .blogtitle) {
            align-self: flex-start;
          }
          > .blogtitle {
            font-size: 1em;
          }
        }
      }
    }
    > .blogdetail {
      width: 73%;
      @media (max-width: 767px) {
        width: 100%;
      }
    }
  }
  a {
    color: #232323;
  }
  .bloglist {
    > .blogitem {
      margin-bottom: var(--bloglistspace);
      padding-bottom: var(--bloglistspace);
      &:not(:last-child) {
        border-bottom: 1px solid var(--blogcolor-gray25);
      }
      > a {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        @media (max-width: 767px) {
          flex-direction: column;
          gap: 4px;
        }
        > .blogdate {
          flex-shrink: 0;
          align-self: center;
          width: 9em;
          font-size: 0.8em;
          @media (max-width: 767px) {
            align-self: flex-start;
          }
        }
        > .blogtitle {
          font-size: 1.2em;
          @media (max-width: 767px) {
            font-size: 1em;
          }
        }
      }
    }
  }
  .blogdetail {
    container-type: inline-size;
    margin-bottom: 3em;
    > * {
      line-height: 1.7;
    }
    > .blogtitle {
      margin-bottom: 0.5em;
      padding-bottom: 0.5em;
      border-bottom: 1px solid var(--blogcolor-gray25);
      font-size: 32px;
      line-height: 1.5;
    }
    > .blogdate {
      display: block;
      margin-bottom: 1em;
      text-align: right;
    }
    :where(h3, h4, h5, h6) {
      margin-top: 2em;
      margin-bottom: 1em;
      padding-left: 0.5em;
      border-left: 0.5em solid var(--blogcolor-gray15);
      font-size: 1.8em !important;
    }
    h2 {
      margin-top: 2em;
      margin-bottom: 0.5em;
      font-size: 32px;
      & + h3 {
        margin-top: 1em;
      }
    }
    :where(figure) {
      margin: unset;
    }
    :where(p, ul, ol, dl, table, figure) {
      font-size: clamp(16px, 3cqw, 22px);
      margin-bottom: 0.8em;
      text-wrap: pretty;
      @media (max-width: 767px) {
        text-wrap: unset;
      }
    }

    /* list */
    :where(ul, ol, dl) {
      margin-block: 2em;
      padding-left: 2em;
      dt {
        margin-bottom: 1em;
        text-indent: -2em;
      }
      :where(li, dd) {
        display: list-item;
        font-size: 1em;
        &:not(:last-child) {
          margin-bottom: 1em;
        }
      }
    }
    :where(ul) {
      list-style-type: disc;
    }
    :where(ol) {
      list-style-type: decimal-leading-zero;
    }
    :where(dl) {
      list-style-type: circle;
    }
    /* table */
    table {
      border: 1px solid var(--blogcolor-gray25);
      :where(th, td) {
        all: unset;
        display: table-cell;
        padding: 4px 8px;
        border: 1px solid var(--blogcolor-gray25);
      }
      :where(th) {
        background-color: var(--blogcolor-gray15);
      }
    }

    figure {
      img {
        display: block;
        line-height: 1;
      }
    }
    a {
      text-decoration: unset !important;
      border-bottom: 1px solid blue;
      &:hover {
        border-bottom: 1px solid rgba(78, 78, 209, 1);
      }
    }
    strong {
      background: linear-gradient(to top, white, white 6%, rgba(255, 203, 46, 0.3) 6%, rgba(255, 203, 46, 0.3) 35%, white 35%, white);
    }
    .author {
      display: flex;
      justify-content: flex-end;
      padding: 4px 8px;
      border: 2px solid #ddd;
      border-radius: 4px;
    }
  }
}

.container {
  &:has(.blog) {
    max-width: unset;
  }
}
