/* 記事本文の体裁。ページのスコープド CSS から切り出したもの。
 *
 * なぜ public/ の固定パスなのか: UMP のプレビューがこのCSSを読んで、入稿前に
 * 本番と同じ体裁で見せるため。Astro がバンドルするとファイル名にハッシュが付き、
 * ビルドのたびに URL が変わって参照できない。
 *
 * ここに入れてよいのは記事本文まわりだけ。ページ周りのクラス（.bread .cats .sep
 * .badge-pr .sec-h など）は他ページでも使っていて、いまはスコープが衝突を防いでいる。
 * 移すと他ページの見た目が変わる。
 */

.article {
  max-width: 720px;
}

.article-title {
  font-size: 30px; font-weight: 900; line-height: 1.45;
  letter-spacing: -0.015em; margin: 0 0 16px;
}

.article-meta {
  font-size: 12px; color: var(--slate);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.meta-dates {
  display: inline-flex; gap: 10px; align-items: center; margin-left: auto;
  font-size: 10.5px; color: var(--slate); opacity: 0.55;
  font-weight: 500; letter-spacing: 0.02em;
}
.meta-date { font-style: normal; }

.article-body { font-size: 16px; line-height: 1.9; }
.article-body h2 {
  font-size: 20px; font-weight: 900; margin: 36px 0 14px;
  padding-top: 10px;
}
.article-body h3 {
  font-size: 16px; font-weight: 800; margin: 24px 0 10px;
}
.article-body p { margin-bottom: 16px; }
.article-body p:has(> img) {
  text-align: center;
  margin: 18px 0;
}
.article-body img {
  max-width: min(560px, 100%);
  max-height: 460px;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
}
/* figure 化 ( JS で <p><img></p> から変換 ) */
.article-body .article-figure {
  text-align: center;
  margin: 16px 0;
}
.article-body .article-figure img {
  max-width: min(560px, 100%);
  max-height: 460px;
  width: auto;
  height: auto;
  display: inline-block;
  border-radius: 4px;
}
.article-body .article-figure figcaption {
  display: block;
  font-size: 11px; color: var(--slate);
  font-weight: 600; text-align: center;
  margin-top: 6px;
}
/* 2件/3件横並び */
.article-body .img-row {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}
.article-body .img-row-2 { grid-template-columns: 1fr 1fr; }
.article-body .img-row-3 { grid-template-columns: 1fr 1fr 1fr; }
/* 画像とキャプションを縦に積む。以前は img に height:100% を当てていて、
   画像だけで枠の高さを使い切り、キャプションが枠の外へ出ていた
   （2026-09-08 実測: figure が158pxなのにキャプションの下端が202px）。
   1行に収まっているうちは下に余白があるので気づけず、狭い画面で
   キャプションが2行になったときだけ、次の要素と重なっていた。 */
.article-body .img-row .article-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.article-body .img-row .article-figure img {
  width: 100%;
  /* 残りの高さを取る。height:100% だと文字のぶんが外へ出る。 */
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-width: none;
  max-height: 240px;
  object-fit: cover;
}
.article-body .img-row .article-figure figcaption {
  font-size: 10.5px;
  margin-top: 4px;
}
@media (max-width: 640px) {
  .article-body .img-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .article-body img {
    max-width: 100%;
    max-height: 380px;
  }
}
.article-body em {
  display: block; font-size: 11px; color: var(--slate);
  font-style: normal; font-weight: 600; text-align: center;
  margin-top: 6px;
}
.article-body blockquote {
  border-left: 3px solid var(--moss);
  background: var(--paper); padding: 12px 18px;
  margin: 16px 0; color: var(--slate); font-size: 14px;
}
.article-body a {
  color: var(--moss); border-bottom: 1px dotted var(--moss);
}
.article-body a:hover { border-bottom-style: solid; }
.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0; font-size: 13px;
}
.article-body th,
.article-body td {
  border-bottom: 1px solid var(--line); padding: 10px 12px;
  text-align: left; vertical-align: top;
}
.article-body th {
  background: var(--paper); font-weight: 800;
}
