/* jp.css — 日本語組版契約CSS（profile=media・長文読み物型）【正本】
 * 出典: jp-ui-contracts（MITライセンス） https://github.com/hirokaji/jp-ui-contracts
 *       解説記事: https://note.com/tasty_dunlin998/n/nf1b04ebc7600
 * 契約書: content/design/JP_TYPOGRAPHY.md（本CSSと1対1。片方だけの変更禁止）
 * 数値トークン: config/site.config.json design（唯一の正）
 * 配布: sites/<site>/assets/css/jp.css へ複製（scripts/css_lint.py が同期を検査）
 */

/* ── recipe: ja-text + mixed-script（本文の基本契約・和欧混植） ── */
html:lang(ja) {
  line-break: strict;       /* 行頭に句読点・小書き文字を置かない */
  word-break: normal;       /* break-all の全体適用は契約で禁止 */
  overflow-wrap: anywhere;  /* 長いURL・英単語だけ最終手段で折る */
  font-kerning: auto;
  text-autospace: normal;   /* 和文と英数の間のアキ（対応ブラウザのみ・保険つき） */
}

body {
  /* 和文フォールバック明示（ブラウザ任せ禁止・JP_TYPOGRAPHY C-3） */
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1rem;          /* UI基準16px（ボタン・表・フォームはこのまま） */
  line-height: 1.6;
  letter-spacing: normal;   /* 本文への字間追加は禁止（契約C-1） */
  color: #3C4435;           /* config: text_body */
  background: #FAFAED;      /* config: bg_main */
}

/* 記事本文 — profile=media（18px・行間1.85。2026-06-11契約改定C-5） */
.article-body {
  font-size: 1.125rem;      /* config: type_scale.article_body */
  line-height: 1.85;        /* 契約レンジ1.75〜2.0内 */
  letter-spacing: normal;
}
.article-body p { margin: 0 0 1.5em; }

/* ── recipe: headings（見出し契約。折り返しは見出しだけの責務） ── */
h1, h2 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  color: #2C3327;           /* config: text_title */
  font-weight: 600;
}
h1 { font-size: 2.25rem; line-height: 1.4; letter-spacing: 0.08em; } /* config: type_scale.h1 */
h2 { font-size: 1.75rem; line-height: 1.5; letter-spacing: 0.06em; } /* config: type_scale.h2 */
h3 {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1.25rem; line-height: 1.6; letter-spacing: 0.04em;      /* config: type_scale.h3 */
  color: #2C3327;
  font-weight: 700;
}
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 {
  word-break: auto-phrase;  /* 文節折り返し。非対応ブラウザでは無視される＝保険つき */
}

/* 欧文装飾見出し（本文使用禁止・DESIGN.md） */
.en-display {
  font-family: "Cormorant Garamond", serif; /* css-lint: latin-only */
}

/* ── recipe: forms（表・フォームは本文契約を継承しない別契約） ── */
input, textarea, select, button {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1rem;          /* UI部品は16px維持（契約C-4・C-5） */
  line-height: 1.5;
  letter-spacing: normal;
}
table {
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: normal;
}
.form-help, .form-error { overflow-wrap: anywhere; }

/* 字詰め(palt)は本文全体適用禁止。見出し・ロゴ等の限定クラスのみ（契約C-3） */
.tracking-display { font-feature-settings: "palt"; }
