/* Blog post detail (header + basic body) */
.blog-post-page {
  --post-bg: #FFFFFF;
  --post-hero-bg: #EEF5FF; /* message default */
  --post-accent: #3752C0;
  --post-muted: #6B7280;
  --post-title: #1F2937;
  --post-font: "Zen Maru Gothic", sans-serif;
  --post-pill-bg: #FFFFFF;
  --post-pill-border: rgba(55, 82, 192, 0.3);
  --post-pill-text: #3752C0;
  --post-tag-bg: #FFFFFF;
  --post-tag-border: rgba(55, 82, 192, 0.3);
  --post-tag-text: #3752C0;

  /* サイトガイドライン準拠（レイアウト/タイポ/余白の基準値） */
  --page-max: 1200px;
  --page-x: 64px; /* PC外側余白（他ページに合わせる） */

  --prose-max: 800px; /* 読みやすさを維持する本文最大幅 */

  /* 余白（本文まわり） */
  --p-mb: 60px;    /* pの下余白 */
  --h2-mt: 80px;   /* h2の上 */
  --h2-mb: 60px;   /* h2の下 */
  --h3-mt: 56px;   /* h3の上 */
  --h3-mb: 24px;   /* h3の下 */
  --h4-mt: 40px;   /* h4の上 */
  --h4-mb: 12px;   /* h4の下 */
}

.blog-post-page.blog-post-page--staff {
  --post-hero-bg: #FFFBF0;
  --post-accent: #FFDC00;
  --post-pill-bg: #FFDC00;
  --post-pill-border: rgba(0, 0, 0, 0);
  --post-pill-text: #565656;
  --post-tag-bg: #FFDC00;
  --post-tag-border: rgba(0, 0, 0, 0);
  --post-tag-text: #565656;
}

.blog-post-hero {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 48px 0;
  background: var(--post-hero-bg);
  box-sizing: border-box;
}

.blog-post-hero-inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-x);
  box-sizing: border-box;
  display: flex;
  gap: 48px;
  align-items: center;
}

.blog-post-hero-left {
  flex: 1;
  min-width: 0;
}

.blog-post-hero-right {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.blog-post-breadcrumb {
  margin: 0 0 20px;
  font-family: var(--post-font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4286;
  color: #4B5563;
}

.blog-post-breadcrumb a {
  color: #4B5563;
  text-decoration: none;
}
.blog-post-breadcrumb a:hover { text-decoration: underline; }

.blog-post-breadcrumb-sep {
  margin: 0 8px;
  color: #9CA3AF;
}

.blog-post-category-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--post-pill-bg);
  border: 1px solid var(--post-pill-border);
  color: var(--post-pill-text);
  font-family: var(--post-font);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4286;
  margin-bottom: 16px;
}

.blog-post-title {
  margin: 0 0 16px;
  font-family: var(--post-font);
  font-weight: 700;
  font-size: 44px;
  line-height: 1.75;
  color: var(--post-title);
}

.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin: 0 0 14px;
  color: #4B5563;
  font-family: var(--post-font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4286;
}

.blog-post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4B5563;
}

.blog-post-meta-item svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.blog-post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 18px;
}

.blog-post-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  background: #E5E7EB;
  display: block;
}

.blog-post-author-name {
  font-family: var(--post-font);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4286;
  color: var(--post-title);
}

.blog-post-author-role {
  font-family: var(--post-font);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3333;
  color: var(--post-muted);
}

.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.blog-post-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--post-tag-bg);
  border: 1px solid var(--post-tag-border);
  color: var(--post-tag-text);
  font-family: var(--post-font);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4286;
}

.blog-post-hero-image {
  width: 100%;
  /* Figma: 552 x 320 */
  max-width: 552px;
  aspect-ratio: 552 / 320;
  border-radius: 16px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.blog-post-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Body */
.blog-post-body {
  width: 100%;
  max-width: var(--page-max);
  margin: 60px auto 160px;
  padding: 40px;
  box-sizing: border-box;
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
  color: #374151;
  font-family: var(--post-font);
  font-weight: 500; /* 本文（Medium） */
  font-size: 20px;
  line-height: 1.75;
}

/* Keep Markdown content aligned to the inner width (Figma: 800) */
.blog-post-body :where(h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, pre, table, hr, nav) {
  /* PC/タブレットは他ページに合わせて本文を広く・左揃えにする */
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Paragraph */
.blog-post-body p {
  margin: 0 0 var(--p-mb);
  font-size: 20px;
  line-height: 1.75;
}
.blog-post-body p:last-child { margin-bottom: 0; }

/* Headings (Figma: underline accent on H2) */
.blog-post-body h2 {
  margin: var(--h2-mt) 0 var(--h2-mb);
  padding: 0 0 10px;
  border-bottom: 2px solid var(--post-accent);
  font-family: var(--post-font);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.75;
  color: #1F2937;
}
.blog-post-body h2:first-child { margin-top: 0; }

.blog-post-body h3 {
  margin: var(--h3-mt) 0 var(--h3-mb);
  font-family: var(--post-font);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.75;
  color: #1F2937;
}
.blog-post-body h3:first-child { margin-top: 0; }

.blog-post-body h4 {
  margin: var(--h4-mt) 0 var(--h4-mb);
  font-family: var(--post-font);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.75;
  color: #1F2937;
}
.blog-post-body h4:first-child { margin-top: 0; }

.blog-post-body h5 {
  margin: 16px 0 8px;
  font-family: var(--post-font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
  color: #1F2937;
}

/* Links (Figma uses category theme color for emphasized links) */
.blog-post-body a {
  color: var(--post-accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.blog-post-body a:hover {
  opacity: 0.9;
}

/* スタッフ記事（テーマが黄アクセント）でも、本文リンクは一般的な青に戻す */
.blog-post-page.blog-post-page--staff .blog-post-body a {
  color: #3752C0;
}

/* Images (Figma: radius 8 + shadow) */
.blog-post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* Message: Uマーク（本文先頭のインラインSVG） */
.blog-post-body .u-mark-inline {
  display: inline-block;
  height: 1.6em; /* テキストより少し大きめ */
  width: auto;
  vertical-align: -0.25em;
  margin-right: 0.4em;
  border-radius: 0;
  box-shadow: none;
}

.blog-post-body figure {
  margin: 24px auto;
}

.blog-post-body figcaption {
  margin-top: 8px;
  font-family: var(--post-font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: #6B7280;
  text-align: center;
}

/* Lists (Figma: left padding 16 and custom markers) */
.blog-post-body ul,
.blog-post-body ol {
  margin: 0 0 var(--p-mb);
  font-size: 20px;
  line-height: 1.8;
}

.blog-post-body li {
  margin: 0 0 4px;
}

/* Bullet as small dot */
.blog-post-body ul {
  list-style: none;
  padding-left: 0;
}
.blog-post-body ul > li {
  position: relative;
  padding-left: 18px; /* パラグラフ左端と揃える（ul側の二重インデントを避ける） */
}
.blog-post-body ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--post-accent);
  transform: translateY(-50%);
}

/* Ordered list marker color */
.blog-post-body ol {
  list-style: decimal;
  padding-left: 1.25em;
}
.blog-post-body ol ::marker {
  color: #374151;
  font-weight: 400;
}

/* Blockquote (Figma: light bg + left border accent + radius) */
.blog-post-body blockquote {
  margin: 0 0 24px;
  padding: 8px 0 8px 20px;
  background: #F9FAFB;
  border-left: 4px solid var(--post-accent);
  border-radius: 0 8px 8px 0;
}

.blog-post-body blockquote p {
  margin: 0;
}

.blog-post-body blockquote cite {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4286;
  color: #6B7280;
  font-style: normal;
}

/* Inline emphasis / strong */
.blog-post-body strong {
  font-weight: 700;
}
.blog-post-body em {
  font-style: italic;
}

/* Superscripts should remain readable */
.blog-post-body sup {
  font-size: 0.75em;
  line-height: 0;
}

.blog-post-back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #E5E7EB;
}

.blog-post-back a {
  color: #3752C0;
  text-decoration: none;
  font-weight: 500;
}
.blog-post-back a:hover { text-decoration: underline; }

/* Related posts (関連記事) */
.blog-post-related {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 0;
  box-sizing: border-box;
}

/* Figma: message側は薄い青背景 */
.blog-post-related--message {
  background: rgba(238, 245, 255, 0.3);
}

.blog-post-related-inner {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-x);
  box-sizing: border-box;
}

.blog-post-related-title {
  margin: 0 0 32px;
  font-family: var(--post-font);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.3333;
  text-align: center;
  color: #1F2937;
}

.blog-post-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.blog-post-related-card {
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.blog-post-related-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blog-post-related-card-link:hover {
  opacity: 0.98;
}

.blog-post-related-card-image {
  position: relative;
  width: 100%;
  height: 160px;
  background: #F3F4F6;
  overflow: hidden;
}

.blog-post-related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-post-related-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  border-radius: 9999px;
  font-family: var(--post-font);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.blog-post-related-badge--staff {
  background: #FFDC00;
  color: #565656;
  padding: 4px 12px;
  height: 22px;
}

.blog-post-related-badge--message {
  background: #FFFFFF;
  color: #3752C0;
  border: 1px solid rgba(55, 82, 192, 0.3);
  padding: 5px 13px;
  height: 24px;
}

.blog-post-related-card-body {
  padding: 16px;
}

.blog-post-related-card-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  font-family: var(--post-font);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.3333;
  color: #6B7280;
}

.blog-post-related-card-title {
  margin: 0;
  font-family: var(--post-font);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.7;
  color: #1F2937;
}

@media (max-width: 1023px) {
  .blog-post-page { --page-x: 64px; }
  .blog-post-hero-inner { gap: 40px; }
  .blog-post-title { font-size: 40px; }

  .blog-post-body {
    margin: 80px auto 100px;
    padding: 32px;
  }

  .blog-post-page {
    --p-mb: 32px;
    --h2-mt: 64px;
    --h2-mb: 24px;
    --h3-mt: 40px;
    --h3-mb: 24px;
    --h4-mt: 12px;
    --h4-mb: 8px;
  }

  .blog-post-body h2 { font-size: 32px; }
  .blog-post-body h3 { font-size: 24px; }
  .blog-post-body h4 { font-size: 22px; }
}

@media (max-width: 767px) {
  .blog-post-page {
    --page-x: 20px;
    --prose-max: 100%;
    --p-mb: 24px;
    --h2-mt: 48px;
    --h2-mb: 20px;
    --h3-mt: 32px;
    --h3-mb: 20px;
    --h4-mt: 8px;
    --h4-mb: 8px;
  }

  .blog-post-hero-inner {
    flex-direction: column;
    align-items: stretch;
  }
  /* モバイルは画像を上に */
  .blog-post-hero-right {
    order: -1;
    justify-content: center;
  }
  .blog-post-title { font-size: 28px; }
  /* モバイルは幅に追従（比率はFigma同等） */
  .blog-post-hero-image { max-width: 100%; }

  .blog-post-body {
    width: 100%;
    padding: 24px;
    margin: 60px auto 80px;
    font-size: 20px;
    line-height: 1.75;
  }

  .blog-post-body h2 {
    font-size: 28px;
  }

  .blog-post-body h3 {
    font-size: 22px;
  }

  .blog-post-body h4 {
    font-size: 20px;
  }

  /* Related posts (mobile: 1列, 幅343/左右padding 16相当) */
  .blog-post-related-inner {
    padding: 0 var(--page-x);
  }
  .blog-post-related-grid {
    grid-template-columns: 1fr;
  }
  .blog-post-related-card-title {
    font-size: 14px;
  }
}

