.p-blog-detail-page .p-blog-contact {
  margin-top: 132px;
}

.p-blog-detail {
  display: grid;
  grid-template-columns: minmax(0, 787px) minmax(240px, 287px);
  gap: clamp(48px, 8vw, 126px);
  align-items: start;
  padding-top: 99px;
}

.p-blog-article {
  color: #000;
}

.p-blog-article__header .p-blog-meta {
  margin: 0 0 5px 25px;
}

.p-blog-article__header h2 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.45;
  margin: 0 0 16px 25px;
}

.p-blog-article__rule {
  width: 100%;
  height: 0;
  border-top: 2px solid #165e83;
  margin-bottom: 38px;
}

.p-blog-article__main-image {
  width: 100%;
  aspect-ratio: 787 / 333;
  margin: 0;
  border-radius: 5px;
  overflow: hidden;
}

.p-blog-article__main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-blog-toc,
.p-blog-author {
  width: calc(100% - 42px);
  margin-left: 21px;
  border-radius: 10px;
  background: #f0f5f7;
}

.p-blog-toc {
  min-height: 188px;
  margin-top: 51px;
  padding: 22px 26px;
}

.p-blog-toc h3,
.p-blog-author h3 {
  color: #165e83;
  font-size: 20px;
  line-height: 1.45;
  margin: 0;
}

.p-blog-toc ol {
  counter-reset: blog-toc-h2;
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.55;
}

.p-blog-toc a {
  display: block;
  color: #000;
}

.p-blog-toc__item {
  position: relative;
  padding-left: 1.4em;
}

.p-blog-toc__item::before {
  position: absolute;
  left: 0;
  color: #165e83;
  font-weight: 700;
}

.p-blog-toc__item--h2 {
  font-size: 17px;
  font-weight: 700;
}

.p-blog-toc__item--h2::before {
  content: counter(blog-toc-h2) ".";
  counter-increment: blog-toc-h2;
}

.p-blog-toc__item--h3 {
  margin-left: 18px;
  font-size: 15px;
}

.p-blog-toc__item--h3::before {
  content: "-";
}

.p-blog-toc__item--h4 {
  margin-left: 36px;
  font-size: 14px;
  color: #444;
}

.p-blog-toc__item--h4::before {
  content: "";
  top: 0.72em;
  width: 6px;
  height: 1px;
  background: #165e83;
}

.p-blog-body {
  margin-top: 34px;
  padding-left: 21px;
  width: 100%;
}

.p-blog-body h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
}
.p-blog-body h1,
.p-blog-body__h1 {
  display: flex;
  align-items: center;
  color: #165e83;
  font-size: 28px;
  font-weight: bold;
  line-height: 1.45;
  margin-top: 50px;
}
.p-blog-body h2,
.p-blog-body__h2 {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 19px;
  border-radius: 5px;
  background: #165e83;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.45;
  margin-top: 50px;
}

.p-blog-body h3,
.p-blog-body .p-blog-body__h3 {
  padding-bottom: 18px;
  border-bottom: 2px solid #165e83;
  color: #000;
  margin-top: 50px;
  font-size: 20px;
  font-weight: bold;
}

.p-blog-body h4,
.p-blog-body .p-blog-body__h4 {
  position: relative;
  min-height: 39px;
  display: flex;
  align-items: center;
  padding-left: 19px;
  font-size: 20px;
  color: #000;
  margin-top: 50px;
}

.p-blog-body h4::before,
.p-blog-body__h4::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 39px;
  border-radius: 5px;
  background: #165e83;
}

.p-blog-body p {
  max-width: 744px;
  width: 100%;
  margin: 28px 0 0;
  font-size: 16px;
  line-height: 1.72;
}

.p-blog-body h2 + p {
  margin-top: 34px;
}

.p-blog-body h4 + p,
.p-blog-body__h4 + p {
  margin-top: 18px;
}

.p-blog-author {
  min-height: 237px;
  margin-top: 88px;
  padding: 20px 26px;
}

.p-blog-author__row {
  display: grid;
  grid-template-columns: 141px 1fr;
  gap: 59px;
  align-items: start;
  margin-top: 27px;
}

.p-blog-author__avatar {
  width: 141px;
  height: 141px;
  border-radius: 50%;
  background: #dedede;
  overflow: hidden;
  margin: 0;
}

.p-blog-author__avatar img,
.p-blog-author__avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.p-blog-author h4 {
  font-size: 18px;
  line-height: 1.45;
  margin: 7px 0 17px;
}

.p-blog-author p {
  font-size: 14px;
  line-height: 20px;
  margin: 0;
}

.p-blog-article-nav {
  display: grid;
  grid-template-columns: 50px minmax(180px, 219px) 50px;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 63px 0 0 8px;
}

.p-blog-article-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #165e83;
  background: #fff;
  color: #165e83;
}

.p-blog-article-nav__prev,
.p-blog-article-nav__next {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  position: relative;
}

.p-blog-article-nav__prev::before,
.p-blog-article-nav__next::before {
  content: "";
  width: 11px;
  height: 11px;
  border-top: 2px solid #165e83;
  border-right: 2px solid #165e83;
}

.p-blog-article-nav__prev::before {
  transform: rotate(-135deg);
}

.p-blog-article-nav__next::before {
  transform: rotate(45deg);
}

.p-blog-article-nav__back {
  width: 219px;
  height: 65px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
}

.p-blog-article-nav__prev {
  grid-column: 1;
}

.p-blog-article-nav__back {
  grid-column: 2;
}

.p-blog-article-nav__next {
  grid-column: 3;
}

.p-blog-detail-sidebar {
  position: sticky;
  top: 120px;
}

.p-blog-detail-sidebar .p-blog-category {
  margin-bottom: 58px;
}

.p-blog-side-popular h2 {
  color: #165e83;
  font-size: 24px;
  line-height: 1.45;
  text-align: center;
  margin: 0 0 21px;
}

.p-blog-side-popular ol {
  display: grid;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-blog-side-popular a {
  display: block;
  color: #000;
}

.p-blog-side-popular figure {
  position: relative;
  width: 100%;
  aspect-ratio: 288 / 191;
  margin: 0;
  overflow: hidden;
}

.p-blog-side-popular img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-blog-side-popular figure span {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 57px;
  border-top-left-radius: 5px;
  border-bottom-right-radius: 28.5px;
  color: #fff;
  font-family: "Noto Serif JP", serif;
  font-size: 24px;
  font-weight: 700;
}

.p-blog-side-popular li:nth-child(1) figure span {
  background: linear-gradient(180deg, #f9f1e0 0%, #eeddbb 9.13%, #d8c094 24.04%, #b39156 100%);
}
.p-blog-side-popular li:nth-child(2) figure span {
  background: linear-gradient(180deg, #e3e3e3 0%, #dedede 9.13%, #d1d1d1 24.04%, #8a8a8a 100%);
}
.p-blog-side-popular li:nth-child(3) figure span {
  background: linear-gradient(180deg, #83541e 0%, #8b571d 9.13%, #a37011 24.04%, #6c4110 100%);
}

.p-blog-side-popular .p-blog-meta {
  gap: 10px;
  margin: 9px 0 9px;
  font-size: 10.4px;
}

.p-blog-side-popular .p-blog-meta span {
  min-width: 76px;
  min-height: 22px;
  border-radius: 4px;
  font-size: 10.4px;
  padding: 1px 8px;
}

.p-blog-side-popular h3 {
  font-size: 14.8px;
  font-weight: 400;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 1023.98px) {
  .p-blog-detail {
    grid-template-columns: 1fr;
    gap: 64px;
  }

  .p-blog-article,
  .p-blog-article__rule,
  .p-blog-article__main-image,
  .p-blog-body,
  .p-blog-body p,
  .p-blog-toc,
  .p-blog-author {
    width: 100%;
    margin-left: 0;
  }

  .p-blog-detail-sidebar {
    position: static;
  }

  .p-blog-side-popular ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .p-blog-side-popular figure {
    width: 100%;
    height: auto;
    aspect-ratio: 288 / 191;
  }
}

@media (max-width: 767.98px) {
  .p-blog-detail-page .p-blog-contact {
    margin-top: 72px;
  }

  .p-blog-detail {
    padding-top: 48px;
  }

  .p-blog-article__header .p-blog-meta,
  .p-blog-article__header h2 {
    margin-left: 0;
  }

  .p-blog-article__main-image {
    aspect-ratio: 787 / 333;
  }

  .p-blog-toc,
  .p-blog-author {
    padding: 20px;
  }

  .p-blog-body {
    padding-left: 0;
  }

  .p-blog-body .p-blog-body__h3 {
    margin-top: 32px;
  }

  .p-blog-body .p-blog-body__h4 {
    margin-top: 24px;
  }

  .p-blog-author {
    margin-top: 48px;
  }

  .p-blog-author__row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 20px;
  }

  .p-blog-author__avatar {
    width: 96px;
    height: 96px;
  }

  .p-blog-article-nav {
    grid-template-columns: 50px 1fr 50px;
    gap: 16px;
    margin-left: 0;
  }

  .p-blog-article-nav__back {
    width: 100%;
  }

  .p-blog-side-popular ol {
    grid-template-columns: 1fr;
  }
}
