/* CH-514 ブログ（記事の詳細・一覧）とプロフィール（fsc-blog-single.php・fsc-blog-list.php・fsc-profile.php）。
   assets/css/fsc-home.css（トップと同じ色・字・ヘッダー・フッター）のあとに読む。案は #6767 の Article・Blog・Profile。
   CH-978 段 2 システマに複製した（fs-create-cocoon-child の master）。字・余白・横幅は fs-create の値のまま。
   - 色は assets/css/fsc-site-colors.css の変数にした（緑は青・#fff は --fsh-on-ink・札・画像の地・コード・囲みの色は見本の mock.css の変数）。
   - プロフィール（.fsp-*）と、fs-create の古い記事だけの形（ワンポイントの枠・concept-box・.mred・.mblue）は持ってこない。
   - システマで足した所（本文の直書きの色の上書き・表の左 30%）はいちばん後ろ。 */

/* ---- 共通 ---- */
.fsc .fsc-nav a[aria-current="page"] {
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--fsh-blue);
}

/* 下の線は内側の影で描き、高さに足さない（CH-987：どのページもトップと同じ 87px・線の位置も同じに。fs-create.net の fsc-blog.css と同じ形） */
.fsc-header {
  box-shadow: inset 0 -1px 0 var(--fsh-line);
}

.fsb-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--fsh-blue);
}

.fsb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--fsh-mute);
}

.fsb-tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--fsb-tag-bg, var(--tag-news-bg));
  color: var(--fsb-tag-fg, var(--tag-news-fg));
  font-weight: 700;
}

.fsb-thumb {
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--fsh-thumb);
}

/* 正方形に近い画像（WordPress のロゴ 200×200 など）は切らずに真ん中に収める。小さい画像は引き伸ばさない（scale-down）・CH-514 */
.fsb-thumb--fit {
  object-fit: scale-down;
  padding: 16px;
  background: var(--fsh-card);
}

.fsb-box {
  background: var(--fsh-white);
  border: 1px solid var(--fsh-line);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fsb-box--blue {
  background: var(--fsh-tint);
  border-color: var(--fsh-tint);
}

.fsb-box__title {
  font-weight: 700;
}

.fsb-box__text {
  font-size: 14px;
  color: var(--fsh-text);
}

.fsc .fsb-box__link {
  font-size: 14px;
  font-weight: 700;
}

/* ---- 記事の詳細 ---- */
.fsb-single {
  padding-top: 40px;
  padding-bottom: 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: start;
}

.fsb-article {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.fsb-crumbs {
  font-size: 13px;
  color: var(--fsh-mute);
}

.fsc .fsb-crumbs a {
  color: var(--fsh-mute);
}

.fsb-article__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fsb-article__title {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.45;
  font-weight: 900;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.fsb-article__lead {
  font-size: 16px;
  color: var(--fsh-text);
}

.fsb-article__eyecatch {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
}

.fsb-toc {
  background: var(--fsh-white);
  border: 1px solid var(--fsh-line);
  border-radius: 18px;
  padding: 24px 28px;
}

.fsb-toc__title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}

.fsb-toc ol {
  margin: 0;
  padding-left: 1.4em;
  font-size: 15px;
  color: var(--fsh-text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fsc .fsb-toc a {
  color: var(--fsh-ink);
}

/* 本文（古い記事の HTML をそのまま出す。見出し・コード・ポイントの枠の形をそろえる） */
.fsb-body {
  font-size: 17px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.fsb-body > * + * {
  margin-top: 20px;
}

.fsb-body :where(h2, h3) {
  font-weight: 900;
  line-height: 1.5;
  padding-top: 12px;
  border-top: 2px solid var(--fsh-ink);
  margin-top: 40px;
  scroll-margin-top: 16px;
}

.fsb-body h2 {
  font-size: 24px;
}

.fsb-body h3 {
  font-size: 21px;
}

.fsb-body h4 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 28px;
}

.fsb-body :where(ul, ol) {
  padding-left: 1.4em;
}

.fsb-body pre {
  background: var(--fsh-pre-bg);
  color: var(--fsh-pre-fg);
  border: 1px solid var(--fsh-pre-line);
  border-radius: 14px;
  padding: 20px 22px;
  font-family: var(--fsh-mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
}

.fsb-body :not(pre) > code {
  font-family: var(--fsh-mono);
  font-size: 0.9em;
  background: var(--fsh-code-inline);
  padding: 1px 6px;
  border-radius: 6px;
}

.fsb-body blockquote,
.fsb-body .memo,
.fsb-body .box16 {
  background: var(--fsh-quote);
  border: 0;
  border-radius: 14px;
  padding: 18px 22px;
  font-size: 15px;
}

.fsb-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.fsb-body :where(th, td) {
  border: 1px solid var(--fsh-line);
  padding: 8px 12px;
}

.fsb-body img {
  border-radius: 10px;
}

/* 寄せ方を決めていない画像のブロックと、真ん中に寄せた画像は真ん中に出す（CH-909）。
   記事のページは Cocoon の CSS を外しているので、block-library の figure.aligncenter（display:table・左右の余白 0）が左に寄っていた。
   alignleft・alignright、表の中の画像、p の中に直に置いた img（クラスのないもの）は今のまま */
.fsb-body .wp-block-image:not(.alignleft):not(.alignright),
.fsb-body figure.aligncenter {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.fsb-body .wp-block-image:not(.alignleft):not(.alignright) img,
.fsb-body figure.aligncenter img,
.fsb-body img.aligncenter,
.fsb-body img.alignnone {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* キャプション。古い記事の figcaption はクラス（wp-element-caption）がないので、画像のブロックの中の figcaption も同じにする */
.fsb-body .wp-element-caption,
.fsb-body .wp-block-image figcaption,
.fsb-body figure.aligncenter figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--fsh-mute);
  margin-top: 6px;
}

.fsb-author {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--fsh-white);
  border: 1px solid var(--fsh-line);
  border-radius: 18px;
  padding: 22px 24px;
}

.fsb-author__photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--fsh-thumb);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 丸の中のロゴのマーク（ヘッダーと同じ・40px で丸に収まる・CH-862） */
.fsb-author__mark {
  display: block;
  flex: none;
}

.fsb-author__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fsb-author__label {
  font-size: 13px;
  color: var(--fsh-mute);
}

.fsb-author__name {
  font-weight: 700;
}

.fsb-author__desc {
  font-size: 14px;
  color: var(--fsh-sub);
}

.fsb-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fsc a.fsb-pager__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--fsh-line);
  border-radius: 14px;
  background: var(--fsh-white);
  color: var(--fsh-ink);
  text-decoration: none;
}

.fsb-pager__item--next {
  text-align: right;
}

.fsb-pager__label {
  font-size: 13px;
  color: var(--fsh-mute);
}

.fsb-pager__title {
  font-weight: 700;
  font-size: 15px;
}

.fsb-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fsb-cats,
.fsb-popular {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

.fsc .fsb-cats a,
.fsb-cats__item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  color: var(--fsh-ink);
  text-decoration: none;
}

.fsb-cats li + li {
  border-top: 1px dashed var(--fsh-line);
}

.fsb-cats .fsc-mono {
  color: var(--fsh-mute);
}

.fsb-popular {
  gap: 14px;
}

.fsc .fsb-popular a {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fsh-ink);
  text-decoration: none;
}

.fsc .fsb-popular a:hover,
.fsc .fsb-cats a:hover {
  color: var(--fsh-blue);
}

/* ---- ブログの一覧 ---- */
.fsb-list {
  padding-top: 48px;
  padding-bottom: 88px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.fsb-list__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
}

.fsb-list__title {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.35;
  font-weight: 900;
}

.fsb-list__desc {
  font-size: 16px;
  color: var(--fsh-text);
}

.fsb-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fsc .fsb-filter a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1.5px solid var(--fsh-dash);
  background: var(--fsh-white);
  color: var(--fsh-ink);
  font-size: 15px;
  text-decoration: none;
}

.fsc .fsb-filter a[aria-current="page"] {
  border-color: var(--fsh-ink);
  background: var(--fsh-ink);
  color: var(--fsh-on-ink);
  font-weight: 700;
}

.fsb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}

.fsc a.fsb-card {
  display: flex;
  flex-direction: column;
  background: var(--fsh-white);
  border: 1px solid var(--fsh-line);
  border-radius: 18px;
  overflow: hidden;
  color: var(--fsh-ink);
  text-decoration: none;
}

.fsc a.fsb-card:hover .fsb-card__title {
  color: var(--fsh-blue);
}

.fsb-card__img {
  aspect-ratio: 16 / 9;
}

.fsb-card__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fsb-card .fsb-meta {
  font-size: 12px;
}

.fsb-card .fsb-tag {
  padding: 3px 10px;
}

.fsb-card__title {
  font-size: 17px;
  line-height: 1.6;
  font-weight: 700;
}

/* 大きいカードは、カードの中の幅が 840px（420px × 2）からは画像と文が横に並び、それより狭いと画像が上・文が下の 2 行になる。
   container-type で、カードの中の幅を下の @container で見る（CH-860）。 */
.fsc a.fsb-card--big {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  border-radius: 22px;
  container-type: inline-size;
}

.fsb-card--big .fsb-card__img {
  aspect-ratio: 16 / 10;
}

/* 横に並ぶときだけ、画像を文の高さまで伸ばす。
   2 行のとき（スマホ）に height: 100% があると、iPhone の Safari では画像がカード全体の高さになり、文の後ろに重なる（CH-860）。 */
@container (min-width: 840px) {
  .fsb-card--big .fsb-card__img {
    height: 100%;
  }
}

.fsb-card--big .fsb-card__body {
  padding: clamp(24px, 3vw, 40px);
  gap: 14px;
  justify-content: center;
}

.fsb-card--big .fsb-meta {
  font-size: 13px;
}

.fsb-card--big .fsb-card__title {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.5;
  font-weight: 900;
}

.fsb-card__lead {
  font-size: 15px;
  color: var(--fsh-sub);
}

.fsb-card__more {
  font-weight: 700;
  color: var(--fsh-blue);
}

.fsb-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.fsb-pages .page-numbers {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--fsh-white);
  border: 1px solid var(--fsh-line);
  color: var(--fsh-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.fsb-pages .page-numbers.current {
  background: var(--fsh-ink);
  border-color: var(--fsh-ink);
  color: var(--fsh-on-ink);
  font-weight: 700;
}

.fsb-pages .page-numbers.dots {
  border: 0;
  background: none;
}

.fsb-empty {
  color: var(--fsh-mute);
}

/* 相談の枠（フッターのすぐ上・CH-837）：ブログは本文の下の余白があるので、枠の上の余白は付けない */
.fsb-single + .fsc-contact,
.fsb-list + .fsc-contact {
  padding-top: 0;
}

/* ---- 幅が狭いとき ---- */
@media (max-width: 960px) {
  .fsb-single {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .fsb-single,
  .fsb-list {
    padding-top: 28px;
    padding-bottom: 64px;
  }

  .fsb-body {
    font-size: 16px;
  }

  .fsb-toc {
    padding: 20px;
  }

  .fsb-pager {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ======================================================================
   CH-978 システマで足した所（fs-create にない所・見本 tools/mock-sistema/mock.css の値）
   ====================================================================== */

/* 本文の字の色（黒の地）と、表の見出しは左に寄せる（見本のとおり） */
.fsb-body {
  color: var(--fsh-ink);
}

.fsb-body th {
  text-align: left;
}

/* 本文に直に書いた灰色（表の「扱い：」「理由：」の style="color:#777"・画像の説明の style="color:#666"）は、
   白い地のための色で、黒の地では読みにくい。記事の DB は変えずに、ここで見本の --fsh-mute にそろえる */
.fsb-body [style*="color:#777"],
.fsb-body [style*="color: #777"],
.fsb-body [style*="color:#666"],
.fsb-body [style*="color: #666"] {
  color: var(--fsh-mute) !important;
}

/* 2 列の表の左を 30% に（ブログ 90・CH-810 で子テーマの style.css に置いたもの。
   新しいデザインのページでは style.css を読まないので、ここにも置く） */
.fsb-body .wp-block-table.sm-col1-30 tr > :first-child {
  width: 30%;
}

/* 分類の札の色（data-cat・inc/fsc-blog.php の fsc_blog_tag()。fs-create は札の style に色を直に書いていた） */
.fsb-tag[data-cat="news"]  { --fsb-tag-bg: var(--tag-news-bg);  --fsb-tag-fg: var(--tag-news-fg); }
.fsb-tag[data-cat="siteb"] { --fsb-tag-bg: var(--tag-siteb-bg); --fsb-tag-fg: var(--tag-siteb-fg); }
.fsb-tag[data-cat="azit"]  { --fsb-tag-bg: var(--tag-azit-bg);  --fsb-tag-fg: var(--tag-azit-fg); }
.fsb-tag[data-cat="howto"] { --fsb-tag-bg: var(--tag-howto-bg); --fsb-tag-fg: var(--tag-howto-fg); }

/* 検索の結果の検索の欄（fsc-blog-list.php・CH-989）。形は分類の絞り込みの札にそろえる */
.fsb-search {
  display: flex;
  gap: 8px;
  max-width: 520px;
}

.fsc .fsb-search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--fsh-dash);
  background: var(--fsh-white);
  color: var(--fsh-ink);
  font: inherit;
  font-size: 15px;
}

.fsc .fsb-search__input:focus {
  outline: 2px solid var(--fsh-blue);
  outline-offset: 2px;
}

.fsc .fsb-search__btn {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1.5px solid var(--fsh-ink);
  background: var(--fsh-ink);
  color: var(--fsh-on-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* 404（fsc-blog-404.php・CH-989）：案内とボタンだけなので、下の余白を一覧より広めに */
.fsb-404 {
  padding-bottom: 120px;
}

/* 固定ページ（fsc-blog-page.php・CH-990）は、記事と同じ .fsb-single の枠（本文＋横の列 300）で出す。
   CH-998 前は 1 列・幅 760 で真ん中に寄せていて、一覧・記事より狭く見えていたので、.fsb-page だけの幅の指定は置かない */

/* 記事の中のブログカード（Cocoon の .blogcard・外部 .external-blogcard と内部 .internal-blogcard・CH-992）。
   新しいデザインのページは Cocoon のブログカードの CSS も Font Awesome も読まないので、画像・タイトル・説明・アイコン・ドメインが 1 行ずつ縦に並んでいた。
   HTML は Cocoon のまま（lib/blogcard-in.php・blogcard-out.php）で、ここで 1 枚の札にする：左に小さい画像、右にタイトルと説明（2 行）、その下の 1 行にアイコン＋ドメイン。
   枠と角の丸みは「この記事を書いた人」（.fsb-author）と同じ。ラベル（.blogcard-label の fa の四角）は出さない。
   hp17（cocoon-child-master）と fs-create-cocoon-child に同じ形で置く（違うのは差し色の変数だけ）。 */
.fsc .fsb-body a.blogcard-wrap {
  display: block;
  color: inherit;
  text-decoration: none;
}

.fsb-body .blogcard {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  grid-template-areas:
    "thumb content"
    "thumb footer";
  grid-template-rows: auto 1fr;
  gap: 6px 18px;
  background: var(--fsh-white);
  border: 1px solid var(--fsh-line);
  border-radius: 18px;
  padding: 16px 20px;
  line-height: 1.6;
  transition: border-color 0.15s;
}

/* 画像がないカードは文だけの 1 列 */
.fsb-body .blogcard:has(.blogcard-thumbnail:empty) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "content"
    "footer";
}

.fsb-body .blogcard-label,
.fsb-body .blogcard-thumbnail:empty {
  display: none;
}

.fsb-body .blogcard-thumbnail {
  grid-area: thumb;
  margin: 0;
  align-self: start;
}

.fsb-body .blogcard-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: var(--fsh-line);
}

.fsb-body .blogcard-content {
  grid-area: content;
  min-width: 0;
}

.fsb-body .blogcard-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--fsh-ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.fsb-body .blogcard-snippet {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fsh-sub);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.fsb-body .blogcard-snippet:empty {
  display: none;
}

.fsb-body .blogcard-footer {
  grid-area: footer;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 12px;
  color: var(--fsh-mute);
}

.fsb-body .blogcard-site {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fsb-body .blogcard-favicon {
  flex: none;
  display: flex;
}

.fsb-body .blogcard-favicon img {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 0;
}

.fsb-body .blogcard-domain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fsc .fsb-body a.blogcard-wrap:hover .blogcard {
  border-color: var(--fsh-blue);
}

.fsc .fsb-body a.blogcard-wrap:hover .blogcard-title {
  color: var(--fsh-blue);
}

.fsc .fsb-body a.blogcard-wrap:focus-visible {
  outline: 2px solid var(--fsh-blue);
  outline-offset: 2px;
  border-radius: 18px;
}

/* スマホ：横並びのまま画像を小さく、余白を詰める（はみ出さないように） */
@media (max-width: 600px) {
  .fsb-body .blogcard {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 4px 12px;
    padding: 14px;
  }

  .fsb-body .blogcard-title {
    font-size: 15px;
  }
}
