/* 新テーマ（H-B のデザイン）のフォームのページ（お問い合わせ・無料診断）。組み替えは inc/v2/form.php。
   フォームの中は Contact Form 7 の出力（プレビューでは送信できない表示専用の複製）。縦積みが土台で、html.is-hscroll のときだけ
   横の帯（見出しのマス → フォームのマス）にする。フォームのマスは、項目を画面の高さの段に流して右へ並べる（段組み） */

/* --------------------------------------------------------------------------
   縦積み
   -------------------------------------------------------------------------- */
:is(#page-contact, #page-free-consultation) .mv-area { display: none; }
:is(#page-contact, #page-free-consultation) > .container { max-width: 46rem; }
:is(#page-contact, #page-free-consultation) h1 {
  margin: 12px 0 0;
  font-family: var(--h-font-display);
  /* 「FREE CONSULTATION」の長い単語も画面の幅に収まる大きさ（縦積みは画面の幅、横の帯はマスの高さに合わせる） */
  font-size: min(clamp(56px, 2rem + 7vw, 160px), 12.5vw);
  font-stretch: 75%;
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
:is(#page-contact, #page-free-consultation) > .container > .text { margin-top: 24px; max-width: 36em; font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem); line-height: 1.95; }
.contact-form-area { max-width: 46rem; margin-top: clamp(32px, 5vw, 56px); }

/* フォームの項目。文字の大きさは rem（ブラウザーの文字の大きさの設定で、フォームの文字も大きくなる。計画の「200% の拡大」） */
.contact-form { display: grid; gap: 22px; }
.contact-row p { margin: 0; }
.contact-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.875rem; font-weight: 700; }
.contact-label br,
.contact-privacy-text > br:first-child { display: none; }
.contact-label + br { display: none; }
.required {
  padding: 2px 7px;
  background: var(--h-ink);
  color: var(--h-bg);
  font-family: var(--h-font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.contact-sub-label { display: block; margin-top: 4px; color: var(--h-muted); font-size: 0.8125rem; font-weight: 400; }
:is(.contact-form, .document-body .wpcf7-form) :is(input[type="text"], input[type="email"], input[type="url"], input[type="tel"], select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--h-ink);
  border-radius: 0;
  background: #fff;
  color: var(--h-ink);
  font: inherit;
  font-size: 1rem; /* スマホで入力時に拡大されない大きさ（16px） */
}
.contact-form textarea { min-height: 180px; line-height: 1.8; resize: vertical; }
.contact-form ::placeholder { color: var(--h-muted); opacity: 1; }
.contact-form input[type="file"] { max-width: 100%; font-size: 0.875rem; }
:is(.contact-form, .document-body .wpcf7-form) :is(input, select, textarea):focus-visible { outline: 3px solid var(--h-focus); outline-offset: 2px; box-shadow: 0 0 0 7px var(--h-focus-halo); }
.contact-privacy-text { font-size: 0.875rem; line-height: 1.8; }
.contact-privacy-text a { text-decoration: underline; text-underline-offset: 3px; }
.contact-label-inline .wpcf7-list-item { margin: 0; }
.contact-label-inline label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.9375rem; font-weight: 700; cursor: pointer; }
.contact-label-inline input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--h-ink); } /* 押せる範囲 24px 以上（WCAG 2.5.8） */
:is(.contact-submit, .document-body .wpcf7-submit) {
  min-width: 220px;
  min-height: 56px;
  padding: 0 32px;
  border: 1px solid var(--h-ink);
  background: var(--h-ink);
  color: var(--h-bg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.35s var(--h-ease), color 0.35s var(--h-ease);
}
:is(.contact-submit, .document-body .wpcf7-submit):hover { background: var(--h-bg); color: var(--h-ink); }
/* 入力の誤りの文言（Contact Form 7 の赤 #dc3232 は、白と約4.6:1 で AAA に届かないので、濃い赤にする） */
:is(.contact-form, .document-body .wpcf7-form) .wpcf7-not-valid-tip { display: block; margin-top: 6px; color: #9e1b32; font-size: 0.8125rem; font-weight: 700; }
.contact-form .wpcf7-not-valid { border-color: #9e1b32; }
.wpcf7 form .wpcf7-response-output { margin: 20px 0 0; padding: 12px 16px; border: 2px solid var(--h-ink); font-size: 0.875rem; }
/* Contact Form 7 の隠し項目の入れ物（fieldset の既定の枠が、最初の入力欄の上に空の枠として出ていた。点検の低1） */
.contact-form-area fieldset.hidden-fields-container { margin: 0; padding: 0; border: 0; }
/* プレビューの表示専用の複製（inert）: 入力欄と送信のボタンを、使えない状態の見た目にする（押せそうに見えていた。点検の低2） */
.contact-form-area [data-tn-preview-form] :is(input:not([type="submit"]):not([type="checkbox"]), select, textarea) { border-style: dashed; background: var(--h-bg-2); }
.contact-form-area [data-tn-preview-form] :is(input[type="submit"], input[type="checkbox"]) { opacity: 0.45; }
/* 選択欄の最初の選択肢（「--- お問い合わせ種別を選択してください ---」）が、狭い幅（320px など）で途中で切れていた（点検の追加）。
   選んだ文字を欄の中で折り返せる表示（Chrome の customizable select。対応しないブラウザーは今までの表示のまま）にする。
   文字の大きさは 16px のまま（スマホで入力時に拡大されない大きさ） */
@media (max-width: 479px) { @supports selector(::picker(select)) {
  :is(.contact-form, .document-body .wpcf7-form) select,
  :is(.contact-form, .document-body .wpcf7-form) select::picker(select) { appearance: base-select; }
  :is(.contact-form, .document-body .wpcf7-form) select { white-space: normal; line-height: 1.6; }
  :is(.contact-form, .document-body .wpcf7-form) select::picker(select) { border: 1px solid var(--h-ink); background: #fff; }
  :is(.contact-form, .document-body .wpcf7-form) select option { padding: 10px 14px; white-space: normal; }
} }


/* --------------------------------------------------------------------------
   横の帯（html.is-hscroll）: 見出しのマス → フォームのマス
   -------------------------------------------------------------------------- */
html.is-hscroll .h-track > section:is(#page-contact, #page-free-consultation) { display: flex; padding: 0; }
html.is-hscroll :is(#page-contact, #page-free-consultation) > .container {
  flex: none;
  width: calc(var(--H) * 1.05);
  max-width: none;
  height: 100%;
  display: grid;
  align-content: end;
  padding: 40px clamp(28px, 3vw, 48px) var(--h-cell-bottom, 40px);
}
html.is-hscroll :is(#page-contact, #page-free-consultation) h1 { font-size: min(160px, calc(var(--H) * 0.13)); }
html.is-hscroll .contact-form-area {
  flex: none;
  max-width: none;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 40px clamp(28px, 3vw, 48px) var(--h-cell-bottom, 40px);
}
/* プレビューの案内文（「プレビューでは送信されません。」）の分を除いた高さで、フォームを段に流す */
html.is-hscroll .contact-form-area > .tn-preview-form__note { flex: none; margin: 0 0 16px; }
/* フォームは、画面の高さの段に項目を流して右へ並べる（記事の本文と同じ段組み。段の数に合わせた幅は site.js の setupColumns）。
   マスの中をスクロールさせないので、Tab で移った項目は帯の横の動きだけで見える */
html.is-hscroll .contact-form-area > .wpcf7 { flex: 1; min-height: 0; }
html.is-hscroll .contact-form-area > .wpcf7 > :is(form, [data-tn-preview-form]) {
  height: 100%;
  column-width: 21rem; /* 文字の大きさの設定に合わせて段も広がる */
  column-gap: 48px;
  column-fill: auto;
  column-rule: 1px solid var(--h-line);
}
html.is-hscroll .contact-form { display: contents; }
html.is-hscroll .contact-row { break-inside: avoid; margin-bottom: 1.25rem; }
html.is-hscroll .contact-form textarea { min-height: 140px; resize: none; }


/* ==========================================================================
   送信完了（page-thanks）と資料請求（page-documents）
   ========================================================================== */
/* 縦積み */
:is(#page-thanks, #page-documents) .mv-area { display: none; }
:is(#page-thanks, #page-documents) h1 {
  margin: 12px 0 0;
  font-family: var(--h-font-display);
  font-size: min(clamp(48px, 1.6rem + 6vw, 136px), 12.5vw);
  font-stretch: 75%;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
:is(.h-thanks-head, .h-doc-head) .text { margin-top: 24px; max-width: 36em; font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.0625rem); line-height: 1.95; }
#page-thanks > .container { display: grid; gap: clamp(32px, 5vw, 56px); }
.thanks-line { padding: 24px; border: 1px solid var(--h-ink); }
.thanks-line__lead { font-size: 0.9375rem; line-height: 1.9; }
.thanks-line__button { margin-top: 16px; }
.thanks-next__title { font-size: clamp(1.25rem, 1rem + 0.8vw, 1.625rem); font-weight: 700; line-height: 1.4; }
.thanks-next__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn-secondary { background: var(--h-bg); color: var(--h-ink); }
.document-layout { display: grid; gap: clamp(32px, 5vw, 56px); }
.document-visual img { width: 100%; height: auto; }
.document-body .contact-form-area { margin-top: clamp(28px, 4vw, 48px); }
/* 資料請求のフォーム（Contact Form 7 の標準の並び: p > label + 入力欄）。文字の大きさは rem */
.document-body .wpcf7-form > p { margin: 0 0 22px; }
.document-body .wpcf7-form label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 700; }

/* 横の帯 */
html.is-hscroll .h-track > section:is(#page-thanks, #page-documents) { display: flex; padding: 0; }
html.is-hscroll :is(#page-thanks, #page-documents) > .container { display: flex; gap: 0; height: 100%; max-width: none; margin: 0; padding: 0; }
html.is-hscroll :is(#page-thanks, #page-documents) h1 { font-size: min(136px, calc(var(--H) * 0.12)); }
html.is-hscroll :is(.h-thanks-head, .h-doc-head, .thanks-line, .thanks-next) {
  flex: none;
  height: 100%;
  display: grid;
  align-content: end;
  padding: 40px clamp(28px, 3vw, 48px) var(--h-cell-bottom, 40px);
}
html.is-hscroll :is(.h-thanks-head, .h-doc-head) { width: calc(var(--H) * 1.05); }
html.is-hscroll .thanks-line { width: calc(var(--H) * 0.62); border: 0; }
html.is-hscroll .thanks-next { width: calc(var(--H) * 0.72); }
html.is-hscroll .document-layout,
html.is-hscroll .document-body { display: flex; gap: 0; height: 100%; }
/* 資料の表紙（横長の画像。表紙の上部に資料名）: 画面の高さのマスいっぱいに切り抜くと資料名が切れていたので（点検の中5、2026-09-26）、
   マスの幅の中に全体を収め、上下の中央に置く。表紙の白い地と帯の地の境目に細い罫線 */
html.is-hscroll .document-visual { flex: none; display: flex; align-items: center; width: calc(var(--H) * 0.9); height: 100%; padding: 0 clamp(28px, 3vw, 48px); }
html.is-hscroll .document-visual img { width: 100%; height: auto; max-height: 100%; object-fit: contain; border: 1px solid var(--h-line); }
html.is-hscroll .document-body .contact-form-area { margin: 0; }
@media (max-height: 820px) {
  html.is-hscroll :is(.h-thanks-head, .h-doc-head) { width: calc(var(--H) * 1.3); }
  html.is-hscroll .thanks-line { width: calc(var(--H) * 0.8); }
  html.is-hscroll .thanks-next { width: calc(var(--H) * 0.9); }
}
