.blog-detail {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.blog-detail .blog-detail__inner {
  max-width: 1180px;
}

.blog-detail .blog-detail__article {
  overflow: visible;
  padding: 0;
  border: 1px solid #e4edf5;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(31, 72, 112, 0.1);
}

.blog-detail__header {
  padding: 48px 56px 0;
}

.blog-detail .blog-detail__title {
  max-width: 880px;
  margin: 0 auto 22px;
  color: #172b42;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
  white-space: pre-line;
  text-wrap: balance;
}

.blog-detail .blog-detail__meta {
  justify-content: right;
  margin-bottom: 30px;
}

.blog-detail .blog-img {
  width: 100%;
  max-height: 560px;
  margin: 0;
  border-radius: 18px;
  object-fit: cover;
}

.article-flow {
  max-width: 872px;
  margin: 0 auto;
  padding: 52px 56px 64px;
}

.article-toc {
  margin: 0 0 46px;
  padding: 26px 30px;
  border: 1px solid #dce9f5;
  border-radius: 16px;
  background: #f7fbff;
}

.article-toc__title {
  margin: 0 0 14px;
  color: #1a5f9e;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.article-toc__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-toc__item {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

.article-toc__item--level-3 {
  padding-left: 20px;
  font-size: 0.9rem;
}

.article-toc__item a {
  display: block;
  padding-left: 11px;
  border-left: 2px solid #b7d4eb;
  color: #41566b;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-toc__item a:hover,
.article-toc__item a:focus-visible {
  border-color: #f59e3d;
  color: #1673bd;
}

.article-content {
  min-width: 0;
  color: #2a3d50;
  font-size: 1rem;
  line-height: 2;
  overflow-wrap: anywhere;
}

.blog-detail .article-content p {
  margin: 0 0 1.45em;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  scroll-margin-top: 110px;
  color: #17324d;
  line-height: 1.55;
}

.blog-detail .article-content h2,
.markdown-preview .article-content h2 {
  position: relative;
  margin: 2.8em 0 1.15em;
  padding: 18px 22px 18px 26px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e7f4ff 0%, #f5fbff 100%);
  color: #184f7d;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 800;
}

.article-content h2::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: 10px 0 0 10px;
  background: linear-gradient(180deg, #3688d6, #2fae36);
}

.blog-detail .article-content h3,
.markdown-preview .article-content h3 {
  margin: 2.1em 0 0.9em;
  padding: 0 0 10px;
  border-bottom: 2px solid #d9e9f5;
  color: #244b6c;
  font-size: clamp(1.12rem, 1.8vw, 1.35rem);
  font-weight: 800;
}

.article-content h3::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-bottom: -12px;
  background: #f59e3d;
}

.article-content ul,
.article-content ol {
  display: grid;
  gap: 0.55em;
  margin: 1.25em 0 1.7em;
  padding: 20px 24px 20px 46px;
  border-radius: 12px;
  background: #f8fbfd;
}

.article-content li::marker {
  color: #2fae36;
  font-weight: 800;
}

.article-content blockquote {
  margin: 1.7em 0;
  padding: 18px 22px;
  border-left: 5px solid #f59e3d;
  border-radius: 0 12px 12px 0;
  background: #fff9f0;
  color: #4f5963;
}

.article-content hr {
  width: 80px;
  height: 4px;
  margin: 48px auto;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3688d6, #2fae36, #f59e3d);
}

.article-content a {
  color: #1673bd;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-table-wrap {
  max-width: 100%;
  margin: 1.8em 0 2.2em;
  overflow-x: auto;
  border: 1px solid #cfdeea;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(38, 78, 115, 0.08);
  -webkit-overflow-scrolling: touch;
}

.article-content table {
  width: 100%;
  min-width: 620px;
  border: 0;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.65;
}

.article-content th,
.article-content td {
  padding: 15px 17px;
  border: 0;
  border-right: 1px solid #dce7ef;
  border-bottom: 1px solid #dce7ef;
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
  border-right: 0;
}

.article-content tr:last-child td {
  border-bottom: 0;
}

.article-content thead th {
  background: #246fae;
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.article-content tbody tr:nth-child(even) {
  background: #f3f8fc;
}

.youtube-embed,
.instagram-embed {
  display: flex;
  justify-content: center;
  max-width: 100%;
  margin: 2em auto;
}

.youtube-embed iframe,
.instagram-embed iframe {
  max-width: 100%;
  border-radius: 14px;
}

@media (max-width: 900px) {
  .blog-detail__header {
    padding: 38px 34px 0;
  }

  .article-flow {
    padding: 38px 34px 48px;
  }
}

@media (max-width: 560px) {
  .blog-detail .blog-detail__article {
    border-radius: 16px;
  }

  .blog-detail__header {
    padding: 28px 18px 0;
  }

  .blog-detail .blog-detail__title {
    font-size: 1.45rem;
    text-align: left;
  }

  .blog-detail .blog-detail__meta {
    justify-content: flex-start;
  }

  .blog-detail .blog-img {
    border-radius: 12px;
  }

  .article-flow {
    padding: 28px 18px 38px;
  }

  .article-toc {
    margin-bottom: 32px;
    padding: 20px 18px;
  }

  .article-content {
    font-size: 0.95rem;
    line-height: 1.9;
  }

  .blog-detail .article-content h2,
  .markdown-preview .article-content h2 {
    padding: 15px 16px 15px 20px;
  }

  .article-content ul,
  .article-content ol {
    padding: 16px 16px 16px 38px;
  }
}

/* Public article typography: the site root uses 1rem = 10px. */
.blog-detail .blog-detail__title {
  font-size: 3rem;
}
.blog-detail .blog-detail__body.article-content {
  font-size: 18px;
  line-height: 2;
}
.blog-detail .article-intro { margin-bottom: 32px; }
.blog-detail .article-toc__title { font-size: 18px; }
.blog-detail .article-toc__item { font-size: 16px; overflow-wrap: anywhere; }
.blog-detail .article-content h2 { font-size: clamp(24px, 2.2vw, 28px); }
.blog-detail .article-content h3 { font-size: clamp(20px, 1.8vw, 22px); }
.blog-detail .article-content table { font-size: 16px; }
@media (max-width: 560px) {
  .blog-detail .blog-detail__title { font-size: 24px; }
  .blog-detail .blog-detail__body.article-content { font-size: 16px; line-height: 1.9; }
}

/* Introductions are separate from the body and its table of contents. */
.blog-detail .article-content .article-intro__heading {
  margin-top: 0;
}
.blog-detail .article-content hr { display: none; }
