/* member_text.css — 会員画面の文字(書体・大きさ・太さ)・日本語の折り返し・選択肢カード(40 提案 v1_0 2026-10-09・YUKARI の承認前)
 *
 * ★ このファイルは make_css.py が member_text.css を作る元。body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) = 会員画面の本体 + 詳しさを上げる印(下の make_css.py が展開する)。
 *
 * 対象 = 会員画面すべて: アプリの画面(<body class="fv-light …">)とマイページ(<body class="fv-mypage …">)。公開 HP には入れない。
 * 置き場 = `web/static/css/member_text.css` の 1 本。`base.html` と `mypage/_layout.html` の **最後の `<link rel="stylesheet">`**(= 既存の CSS より後ろ)で読む。
 * 既存の CSS が構造的なセレクタ(`body.fv-light .relative.z-10 > header.text-center > h1` など)と !important で大きさを決めているため、
 * 役割の規則は **詳しさを上げ + !important**(書体・大きさ・太さ・行の高さだけ)にしている。画面ごとの個別のクラスを外し終えたら !important は外せる。
 * 書体は Noto Sans JP(本文・欄・ボタン)と Noto Serif JP(画面の題・結果の主役)の 2 つだけ。太さは 500 / 600 だけ(読み込む太さも 400・500・600 だけ =
 * 700 を指定されても 600 の字で出る)。大きさは **px**(アプリの画面は 1rem = 18 px・マイページは 16 px で食い違うため。`html { font-size: 112.5% }` は変えない)。
 *
 * ┌ 役割 ───────────────┬ 書体 ───────┬ PC ─┬ スマホ ┬ 太さ ┬ 行の高さ ┐
 * │ 画面の題 h1            │ Noto Serif JP │ 28  │ 23     │ 500  │ 1.3      │
 * │ 見出し h2(欄・カード)  │ Noto Sans JP  │ 18  │ 18     │ 600  │ 1.45     │
 * │ 小見出し h3 h4         │ Noto Sans JP  │ 16  │ 16     │ 600  │ 1.5      │
 * │ 本文 p li              │ Noto Sans JP  │ 16  │ 16     │ 500  │ 1.75     │
 * │ 欄の名前 label legend  │ Noto Sans JP  │ 16  │ 16     │ 600  │ 1.6      │
 * │ 行の名前 dt th         │ Noto Sans JP  │ 16  │ 16     │ 600  │ 1.6      │
 * │ 行の値 dd td           │ Noto Sans JP  │ 16  │ 16     │ 500  │ 1.6      │
 * │ ボタン                 │ Noto Sans JP  │ 16  │ 16     │ 600  │ 1.4      │
 * │ 注記                   │ Noto Sans JP  │ 14  │ 14     │ 500  │ 1.6      │
 * │ 結果の数字・名前       │ Noto Sans JP  │ 20  │ 20     │ 600  │ 1.4      │
 * │ 結果の主役(干支・方位)│ Noto Serif JP │ 24  │ 24     │ 600  │ 1.3      │
 * └─────────────────────┴─────────────┴─────┴────────┴──────┴──────────┘
 * 色は変えない(薄い灰色にしない)。文字の opacity だけ 1 に戻す。上の帯(site_band.css)は変えない。 */

body:is(.fv-light, .fv-mypage) {
  --m-sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --m-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --m-h1: 28px; --m-h2: 18px; --m-body: 16px; --m-note: 14px; --m-result: 20px; --m-hero: 24px;
}
@media (max-width: 640px) {
  body:is(.fv-light, .fv-mypage) { --m-h1: 23px; }
}

/* ── 1. 土台(本文) ───────────────────────────── */
body:is(.fv-light, .fv-mypage) {
  font-family: var(--m-sans); font-size: var(--m-body); font-weight: 500; line-height: 1.75;
}

/* ── 2. 役割ごと(要素) ─────────────────────────── */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) h1 {
  font-family: var(--m-serif) !important; font-size: var(--m-h1) !important; font-weight: 500 !important; line-height: 1.3 !important; letter-spacing: 0 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) h2 {
  font-family: var(--m-sans) !important; font-size: var(--m-h2) !important; font-weight: 600 !important; line-height: 1.45 !important; letter-spacing: 0 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(h3, h4, h5) {
  font-family: var(--m-sans) !important; font-size: var(--m-body) !important; font-weight: 600 !important; line-height: 1.5 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(p, li, figcaption, summary, blockquote) {
  font-family: var(--m-sans) !important; font-size: var(--m-body) !important; font-weight: 500 !important; line-height: 1.75 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(label, legend, dt, th) {
  font-family: var(--m-sans) !important; font-size: var(--m-body) !important; font-weight: 600 !important; line-height: 1.6 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(dd, td) {
  font-family: var(--m-sans) !important; font-size: var(--m-body) !important; font-weight: 500 !important; line-height: 1.6 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(button, [type="submit"], [type="button"], .mystic-button) {
  font-family: var(--m-sans) !important; font-size: var(--m-body) !important; font-weight: 600 !important; line-height: 1.4 !important;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(input, select, textarea) {
  font-family: var(--m-sans) !important; font-size: var(--m-body) !important; font-weight: 500 !important;
}
/* 注記(小さい文) */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(small, .fv-hint, .text-xs, .text-sm):not(h1, h2, h3, h4, h5, th, dt, label, legend, button, input, select, textarea) {
  font-family: var(--m-sans) !important; font-size: var(--m-note) !important; font-weight: 500 !important; line-height: 1.6 !important;
}
/* 文字の opacity で薄くしない(色は変えない) */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, p, div, small, li, a, td, th, dd, dt, label, em, i):is(.opacity-50, .opacity-60, .opacity-70, .opacity-75, .opacity-80) { opacity: 1 !important; }
/* 太さは 500 / 600 だけ(700 以上・300 以下を作らない) */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(b, strong, .font-bold, .font-semibold, .font-extrabold) { font-weight: 600 !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(.font-normal, .font-light) { font-weight: 500 !important; }
/* 700 を直接書いている既存のクラス(測定で残ったもの。置き換え終えたら外せる) */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(.fv-mptabs__link, .fv-mpcrumb__here, .fv-mpacc__link, .fv-mpacc__head, .fv-attribute-art, .fv-bc__edit, .fv-bc-save__title, .fv-used__value, .fv-regsteps__item, .fv-place-steps a, .fv-notice-btn, .fv-slot__btn, .fv-slot__badge) { font-weight: 600 !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-slot__badge { font-size: var(--m-note) !important; }

/* 上の帯(site_band.css)は変えない: ログアウトのボタンも帯の指定(font: inherit)のまま */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-siteband button { font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important; line-height: 1 !important; }

/* マイページの左のメニュー・上のタブ(15 px / 13 px だった)・基本の要素の行・節の飾りも決まりの大きさへ */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(.fv-mptabs__link, .fv-mpacc__head, .fv-mpacc__link) { font-size: var(--m-body) !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-attribute-art { font-size: var(--m-body) !important; font-weight: 600 !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-attribute-label { font-weight: 500 !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(.section-spark, .icon-badge) { font-size: var(--m-h2) !important; line-height: 1 !important; }
@media (max-width: 640px) {
  body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-mptabs__link { font-size: var(--m-note) !important; }
}

/* ── 3. 役割の外(span / div / a に直接付いた Tailwind の大きさ・書体)を同じ値へ ─── */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a, em, b, strong, i):is(.text-xs, .text-sm) { font-size: var(--m-note) !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a, em, b, strong, i):is(.text-base) { font-size: var(--m-body) !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a, em, b, strong, i):is(.text-lg, .text-xl) { font-size: var(--m-h2) !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a, em, b, strong, i):is(.text-2xl) { font-size: var(--m-result) !important; font-weight: 600 !important; word-break: keep-all; overflow-wrap: anywhere; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a, em, b, strong, i):is(.text-3xl, .text-4xl, .text-5xl, .text-6xl) {
  font-family: var(--m-serif) !important; font-size: var(--m-hero) !important; font-weight: 600 !important; line-height: 1.3 !important; white-space: nowrap;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a, em, b, strong, i):is(.font-elegant, .font-serif, .font-display, .font-mystical) { font-family: var(--m-sans) !important; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(span, div, a):is(.text-3xl, .text-4xl, .text-5xl, .text-6xl):is(.font-mystical) { font-family: var(--m-serif) !important; }

/* ── 4. 日本語の折り返し ─────────────────────────────
 *   短い文(見出し・欄の名前・選択肢・ボタン・表の名前)= 文節で折り返す(対応しないブラウザは句読点・空白でだけ)
 *   本文の段落 = 文節で折り返す(対応しないブラウザは今のまま)。1 行に入らない長い語(メール・URL)は最後に折る。 */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(h1, h2, h3, h4, legend, label, button, dt, th, .mystic-button):lang(ja) {
  word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(p, li, dd, td, figcaption, summary):lang(ja) {
  word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(h1, h2, h3, h4, legend) { text-wrap: balance; }
/* 表の見出し・行の名前(短い語): 狭い列でも語の途中で割らない(「日|時」「ご質|問」)。長いときは空白・かっこで折る */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(dt, th):lang(ja) { overflow-wrap: normal; word-break: keep-all; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(p, li, dd) { text-wrap: pretty; }
/* 数字と単位・かっこの内側で折り返さない(「6 か月」「10月8日」「(JP)」)= 日時の <time> と .nobr */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) :is(.nobr, time) { white-space: nowrap; }

/* ── 5. 選択肢カード(ラジオ + 名前 + 説明)= 名前の下に説明 ─────────────────── */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) fieldset label:has(> input[type="radio"]):has(> :is(span, small, p, div)) {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .5rem; row-gap: 0; align-items: start;
}
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) fieldset label:has(> input[type="radio"]):has(> :is(span, small, p, div)) > input { grid-row: 1 / span 2; margin-top: .3rem; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) fieldset label:has(> input[type="radio"]):has(> :is(span, small, p, div)) > :is(span, small, p, div) { grid-column: 2; margin-left: 0; }
/* 説明(2 つ目以降の文字)は注記と同じ大きさ。名前は 16 px・600 */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) fieldset label:has(> input[type="radio"]) > :is(span, small, p, div) ~ :is(span, small, p, div) {
  font-size: var(--m-note) !important; font-weight: 500 !important; line-height: 1.6 !important;
}

/* ── 6. 画面ごとの直し(語の途中の折り返しが残った所) ───────────────────── */
/* 会員登録の手順(3 つ並び): どの幅でも 1 列の縦並びにして、手順の名前を語の途中で折り返させない(PC 幅でも 1 列 150 px しか無い) */
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-regsteps__list { flex-direction: column; gap: 4px; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-regsteps__item { flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; }
body:is(.fv-light, .fv-mypage):not(._a):not(._b):not(._c) .fv-regsteps__label { white-space: normal; }
