/* =========================================================
   blog.css — ブログ（一覧・記事・カテゴリー・404・その他の固定ページ）
   下層ページ（detail-b.css）と同じ言語で組む。
     - 冒頭は page-hero.css のヒーロー＋パンくず（記事タイトルは長くなるので折り返す）
     - カードにしない：枠・白い紙の面・影は使わない。生成り地に直接組む
     - 区切りは天罫（墨1px）と一点鎖線の折り線（--fold / --fold-v）だけ。写真は枠なし
     - 本文は Noto Sans JP、見出しは Zen Old Mincho、英字ラベル・日付は Bodoni Moda
   トークン（色・書体・余白・折り線）は base.css / detail-b.css のものを使う。
   ========================================================= */

/* =========================================================
   ヒーロー：記事タイトル（長い文字列は折り返す。輪郭英字の位置は --h1 に連動）
   ========================================================= */
.page-hero.page-hero--post { --h1: clamp(2.25rem, 4vw, 3.5rem); }

.page-hero--post .page-hero__title {
  max-width: 22em;
  line-height: 1.32;
  letter-spacing: -.02em;
  white-space: normal;
  word-break: auto-phrase;
  text-wrap: balance;
}

/* =========================================================
   一覧（ブログ・カテゴリー）
   ========================================================= */
.paper-blog .blog-index__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

/* h2 だが見た目は英字ラベル（.fg-label と同じ） */
.paper-blog .blog-index__label {
  margin: 0;
  color: var(--ink);
  font-family: var(--bodoni);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .24em;
}

.blog-cats__list {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-cats__list a {
  display: inline-block;
  padding: .3rem 0;
  color: var(--sub);
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 1px no-repeat;
  font-size: .8125rem;
  letter-spacing: .06em;
  line-height: 1.5;
  transition: color .2s ease, background-size .25s ease;
}

.blog-cats__list a:hover,
.blog-cats__list a:focus-visible,
.blog-cats__list a[aria-current="page"] {
  color: var(--ink);
  background-size: 100% 1px;
}

/* 天罫から始め、記事と記事の間は一点鎖線の折り線 */
.blog-list { border-top: 1px solid var(--ink); }

.blog-item {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--cg);
  align-items: start;
  padding-block: 2rem 2.25rem;
  color: var(--text);
}

.blog-item + .blog-item::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--fold) 0 0 / 19px 1px repeat-x;
  content: "";
  pointer-events: none;
}

/* 日付の列と本文の間に縦の折り線 */
.blog-item::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((100% - 11 * var(--cg)) / 12 * 2 + 1.5 * var(--cg));
  width: 1px;
  background: var(--fold-v) 0 0 / 1px 19px repeat-y;
  content: "";
  pointer-events: none;
}

.blog-item__meta { grid-column: 1 / 3; padding-top: .3rem; }
.blog-item__body { grid-column: 3 / 9; min-width: 0; }
.blog-item:not(.has-thumb) .blog-item__body { grid-column: 3 / 11; }
.blog-item__thumb { grid-column: 9 / 13; }

.blog-item__date {
  display: block;
  color: var(--ink);
  font-family: var(--bodoni);
  font-size: 1.125rem;
  font-weight: 500;
  font-variant-numeric: lining-nums;
  letter-spacing: .04em;
  line-height: 1.2;
}

.blog-item__cat {
  display: block;
  margin-top: .6rem;
  color: var(--sub);
  font-size: .75rem;
  letter-spacing: .08em;
  line-height: 1.5;
}

.paper-blog .blog-item__title {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1.5;
}

/* 項目全体をリンク範囲に（トップの事業紹介と同じ） */
.blog-item__title a::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
}

.blog-item__title a:focus-visible { outline: none; }
.blog-item:has(a:focus-visible) { outline: 2px solid var(--ink); outline-offset: .5rem; }

.blog-item__excerpt {
  margin: .75rem 0 0;
  font-size: .9375rem;
  line-height: 1.85;
}

/* 「続きを読む」：下線リンク（hover で下線が2pxに、矢印が進む。浮かせない） */
.blog-item__more {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-bottom: .3rem;
  color: var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1px no-repeat;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.6;
  transition: background-size .25s ease;
}

.blog-item__more span { transition: transform .25s ease; }
.blog-item:hover .blog-item__more { background-size: 100% 2px; }
.blog-item:hover .blog-item__more span { transform: translateX(.25rem); }

/* 写真：枠なし。16:9（比率の違う写真は中央を基準に切り取る）。hover で切り抜きの中で寄る */
.blog-item__thumb {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #e8e6df;
}

.blog-item__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.blog-item:hover .blog-item__thumb img { transform: scale(1.03); }

.blog-empty {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
  font-size: .9375rem;
}

/* ---------- ページ送り ---------- */
.blog-pager {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding-top: 1.75rem;
}

.blog-pager::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--fold) 0 0 / 19px 1px repeat-x;
  content: "";
}

.blog-pager__prev { justify-self: start; }
.blog-pager__next { justify-self: end; }
.blog-pager__prev span { transition: transform .25s ease; }
.fg-link.blog-pager__prev:hover span,
.fg-link.blog-pager__prev:focus-visible span { transform: translateX(-.25rem); }

.blog-pager__list {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--bodoni);
  font-size: 1.125rem;
  font-variant-numeric: lining-nums;
}

.blog-pager__list a,
.blog-pager__list span {
  display: grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.5rem;
  color: var(--ink);
}

.blog-pager__list a:hover,
.blog-pager__list a:focus-visible { text-decoration: underline; text-underline-offset: .3em; }
.blog-pager__list [aria-current="page"] { background: linear-gradient(var(--ink), var(--ink)) 50% 85% / 1.1rem 1px no-repeat; }
.blog-pager__list .dots { color: var(--sub); }

/* =========================================================
   記事・その他の固定ページ
   ========================================================= */
.blog-article__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--fold-gap);
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.blog-article__meta { grid-column: 1 / 4; }
.blog-article__body { position: relative; grid-column: 4 / 12; min-width: 0; max-width: 46rem; }

/* 情報の列と本文の間に縦の折り線 */
.blog-article__meta + .blog-article__body::before {
  position: absolute;
  top: -1.5rem;
  bottom: 0;
  left: calc(var(--fold-gap) / -2);
  width: 1px;
  background: var(--fold-v) 0 0 / 1px 19px repeat-y;
  content: "";
  pointer-events: none;
}

.blog-article--page .blog-article__body { grid-column: 1 / 10; }

/* 記事の情報（日付・カテゴリー）：本文を読み進めても見える位置に */
.blog-meta {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: grid;
  gap: 1.25rem;
  margin: 0;
}

.blog-meta div { display: grid; gap: .35rem; }

.blog-meta dt {
  color: var(--sub);
  font-family: var(--bodoni);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .2em;
  line-height: 1.2;
}

.blog-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.6;
}

.blog-meta time {
  font-family: var(--bodoni);
  font-size: 1.125rem;
  font-variant-numeric: lining-nums;
  letter-spacing: .04em;
}

.blog-meta a {
  text-decoration: underline;
  text-decoration-color: rgba(17, 17, 16, .35);
  text-underline-offset: .25em;
}

.blog-meta a:hover,
.blog-meta a:focus-visible { text-decoration-color: var(--ink); }

/* アイキャッチ：枠なし。16:9（比率の違う写真は中央を基準に切り取る） */
.blog-article__eyecatch { margin: 0 0 2.75rem; overflow: hidden; aspect-ratio: 16 / 9; background: #e8e6df; }
.blog-article__eyecatch img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- 本文（ブロックエディタの見出し・段落・画像・リスト・引用・リンク） ---------- */
.blog-content {
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 2;
  overflow-wrap: break-word;
}

.blog-content > :first-child { margin-top: 0; }
.blog-content > :last-child { margin-bottom: 0; }

.paper-blog .blog-content p { margin: 0 0 1.75em; }

.paper-blog .blog-content h2 {
  margin: 3.5rem 0 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ink);    /* 天罫 */
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  line-height: 1.45;
}

.paper-blog .blog-content h3 {
  margin: 2.75rem 0 1rem;
  font-size: clamp(1.25rem, 1.7vw, 1.4375rem);
  line-height: 1.5;
}

.paper-blog .blog-content h4 {
  margin: 2.25rem 0 .75rem;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
}

/* 本文の先頭が見出しのときは、記事の天罫と二重にしない */
.paper-blog .blog-content > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* リンク */
.blog-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  transition: text-decoration-thickness .2s ease;
}

.blog-content a:hover,
.blog-content a:focus-visible { text-decoration-thickness: 2px; }

.blog-content strong { color: var(--ink); font-weight: 700; }

/* 箇条書き：墨の短い横線（下層ページの .fg-list と同じ） */
.paper-blog .blog-content ul,
.paper-blog .blog-content ol {
  margin: 0 0 1.75em;
  padding: 0;
  list-style: none;
}

.paper-blog .blog-content li { position: relative; }
.paper-blog .blog-content li + li { margin-top: .45em; }
.paper-blog .blog-content ul > li { padding-left: 1.25rem; }

.paper-blog .blog-content ul > li::before {
  position: absolute;
  top: 1em;
  left: 0;
  width: .5rem;
  height: 1px;
  background: var(--ink);
  content: "";
}

/* 番号付き：Bodoni の 01, 02 … */
.paper-blog .blog-content ol { counter-reset: stpers-ol; }
.paper-blog .blog-content ol > li { padding-left: 2.25rem; counter-increment: stpers-ol; }

.paper-blog .blog-content ol > li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--ink);
  font-family: var(--bodoni);
  font-size: .9375rem;
  font-variant-numeric: lining-nums;
  content: counter(stpers-ol, decimal-leading-zero);
}

.paper-blog .blog-content li > ul,
.paper-blog .blog-content li > ol { margin: .45em 0 0; }

/* 引用：左に縦の折り線（一点鎖線）。面や枠は付けない */
.paper-blog .blog-content blockquote {
  position: relative;
  margin: 2.75rem 0;
  padding: .25rem 0 .25rem 1.75rem;
  color: var(--ink);
  font-family: var(--mincho);
  font-size: 1.1875rem;
  font-weight: 500;
  line-height: 1.9;
}

.paper-blog .blog-content blockquote::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--fold-v) 0 0 / 1px 19px repeat-y;
  content: "";
}

.paper-blog .blog-content blockquote p { margin: 0 0 .75em; }
.paper-blog .blog-content blockquote p:last-of-type { margin-bottom: 0; }

.paper-blog .blog-content blockquote cite {
  display: block;
  margin-top: 1rem;
  color: var(--sub);
  font-family: var(--sans);
  font-size: .8125rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: .04em;
}

.paper-blog .blog-content blockquote cite::before { content: "— "; }

/* 画像：枠なし。キャプションは小さく左寄せ */
.paper-blog .blog-content figure { margin: 2.75rem 0; }
.paper-blog .blog-content img { max-width: 100%; height: auto; }

.paper-blog .blog-content figcaption,
.paper-blog .blog-content .wp-element-caption {
  margin: .75rem 0 0;
  color: var(--sub);
  font-size: .8125rem;
  line-height: 1.7;
  text-align: left;
}

.paper-blog .blog-content .aligncenter { margin-inline: auto; }
.paper-blog .blog-content .alignleft { float: left; max-width: 50%; margin: .5rem 1.5rem 1rem 0; }
.paper-blog .blog-content .alignright { float: right; max-width: 50%; margin: .5rem 0 1rem 1.5rem; }

/* 区切り線：一点鎖線の折り線 */
.paper-blog .blog-content hr {
  height: 1px;
  margin: 3rem 0;
  border: 0;
  background: var(--fold) 0 0 / 19px 1px repeat-x;
}

/* 表：罫線だけ */
.paper-blog .blog-content table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.paper-blog .blog-content th,
.paper-blog .blog-content td { padding: .75rem 1rem .75rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.paper-blog .blog-content thead th { border-bottom-color: var(--ink); font-weight: 500; }

.paper-blog .blog-content code { padding: .1em .3em; background: rgba(17, 17, 16, .06); font-size: .9em; }
.paper-blog .blog-content pre { overflow-x: auto; padding: 1rem 0; border-block: 1px solid var(--rule); font-size: .875rem; line-height: 1.7; }
.paper-blog .blog-content pre code { padding: 0; background: none; }

.blog-pages { display: flex; gap: .75rem; margin-top: 2rem; font-family: var(--bodoni); }

/* ---------- 前後の記事 ---------- */
.blog-postnav__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--fold-gap);
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.blog-postnav__item { position: relative; min-width: 0; }

.blog-postnav__item + .blog-postnav__item::before {
  position: absolute;
  top: -1.5rem;
  bottom: 0;
  left: calc(var(--fold-gap) / -2);
  width: 1px;
  background: var(--fold-v) 0 0 / 1px 19px repeat-y;
  content: "";
}

.blog-postnav__item--next { text-align: right; }
.blog-postnav__item a { display: grid; gap: .5rem; }

.blog-postnav__label {
  color: var(--sub);
  font-family: var(--bodoni);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .2em;
  line-height: 1.2;
}

.blog-postnav__title {
  color: var(--ink);
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.5;
  word-break: auto-phrase;
}

.blog-postnav__date {
  color: var(--sub);
  font-family: var(--bodoni);
  font-size: .875rem;
  font-variant-numeric: lining-nums;
}

.blog-postnav__item a:hover .blog-postnav__title,
.blog-postnav__item a:focus-visible .blog-postnav__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
}

.blog-postnav__back { margin-top: 2.5rem; }

/* =========================================================
   404
   ========================================================= */
.notfound__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--cg);
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
}

.notfound__head { grid-column: 1 / 5; }
.paper-blog .notfound__head h2 { font-size: clamp(1.5rem, 2.2vw, 1.875rem); }

.notfound__links {
  grid-column: 6 / 13;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notfound__links li { position: relative; }

.notfound__links li + li::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--fold) 0 0 / 19px 1px repeat-x;
  content: "";
}

.notfound__links a {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 0;
  color: var(--ink);
  font-size: .9375rem;
  line-height: 1.6;
}

.notfound__links a span { transition: transform .25s ease; }
.notfound__links a:hover span,
.notfound__links a:focus-visible span { transform: translateX(.25rem); }
.notfound__links li:first-child a { padding-top: 0; }

/* =========================================================
   ≤900：タブレット
   ========================================================= */
@media (max-width: 900px) {
  .blog-article__meta,
  .blog-article__body,
  .blog-article--page .blog-article__body { grid-column: 1 / -1; }
  .blog-article__meta + .blog-article__body { margin-top: 2rem; }
  .blog-article__meta + .blog-article__body::before { content: none; }

  .blog-meta {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2.5rem;
  }

  .notfound__head,
  .notfound__links { grid-column: 1 / -1; }
  .notfound__links { margin-top: 2rem; }
}

/* =========================================================
   ≤700：スマートフォン（写真→日付・カテゴリー→タイトル→抜粋の1列）
   ========================================================= */
@media (max-width: 700px) {
  .page-hero.page-hero--post { --h1: clamp(1.75rem, 7.4vw, 2.25rem); }

  .blog-item {
    grid-template-columns: minmax(0, 1fr);
    row-gap: .9rem;
    padding-block: 1.75rem 2rem;
  }

  .blog-item::after { content: none; }

  .blog-item__thumb { order: -1; }

  .blog-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem 1rem;
    padding-top: 0;
  }

  .blog-item__meta,
  .blog-item__body,
  .blog-item:not(.has-thumb) .blog-item__body,
  .blog-item__thumb { grid-column: 1; }

  .blog-item__cat { margin-top: 0; }

  .blog-pager { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 1.25rem; }
  .blog-pager__list { grid-column: 1 / -1; grid-row: 1; justify-content: center; }

  .blog-postnav__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--fold-gap); }

  .blog-postnav__item + .blog-postnav__item::before {
    top: calc(var(--fold-gap) / -2);
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 1px;
    background: var(--fold) 0 0 / 19px 1px repeat-x;
  }

  .blog-postnav__item--next { text-align: left; }
  .blog-postnav__item:empty { display: none; }
  .blog-postnav__item:empty + .blog-postnav__item::before { content: none; }

  .paper-blog .blog-content h2 { margin-top: 3rem; }
  .paper-blog .blog-content blockquote { font-size: 1.0625rem; }
  .paper-blog .blog-content .alignleft,
  .paper-blog .blog-content .alignright { float: none; max-width: 100%; margin: 2rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-item:hover .blog-item__thumb img { transform: none; }
}
