/* ============================================================
   JC High Technology — WordPress / Contact Form 7 用の上書き
   ------------------------------------------------------------
   assets/css/style.css（デザイン本体）の後に読み込まれます。
   デザイン本体は静的版と同一に保ち、WP が出力するマークアップ
   （CF7・エディタ本文・WP コアのクラス）の調整だけをここで行います。
   ============================================================ */

/* ------------------------------------------------------------
   1. Contact Form 7
   ------------------------------------------------------------ */

/* CF7 は入力欄を <span class="wpcf7-form-control-wrap"> で包む。
   .cf-row のグリッド（必須バッジ / ラベル / 入力欄）では、この span が
   3 カラム目そのものになるようブロック化する。 */
.cf-row .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
  min-width: 0;
}

/* テキストエリア行。height:100% にするとエラーメッセージが枠外に
   はみ出すため、内容に合わせて伸びるようにしておく。 */
.cf-row--area .wpcf7-form-control-wrap { align-self: center; }

/* input / textarea は inline-block のままだと行ボックス分（約 8px）背が伸び、
   静的版より下に余白が出る。ブロック化して静的版と同じ高さにそろえる。 */
.cf-row .wpcf7-form-control-wrap > .cf-input,
.cf-row .wpcf7-form-control-wrap > .cf-textarea { display: block; }

/* 入力エラーの吹き出し */
.wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: #d00b0b;
}

.cf-input.wpcf7-not-valid,
.cf-textarea.wpcf7-not-valid { border-color: #d00b0b; }

/* 送信結果メッセージ */
.wpcf7 form .wpcf7-response-output {
  width: 873px;
  max-width: 100%;
  margin: 40px 0 0 105px;
  padding: 16px 20px;
  border-width: 1px;
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
}

.wpcf7-spinner { margin: 0 0 0 12px; }

/* 同意チェックボックス : CF7 の [acceptance] 出力をデザインに合わせる。
   ラッパー自体は静的版と同じ .cf-agree を使うので、余白・文字サイズと
   そのレスポンシブ指定は style.css 側がそのまま効く。ここでは CF7 が
   増やす入れ子（span > span > span > label）だけを整える。 */
.cf-agree .wpcf7-form-control-wrap,
.cf-agree .wpcf7-acceptance,
.cf-agree .wpcf7-list-item { display: block; margin: 0; }

.cf-agree label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 37px;
  cursor: pointer;
}

.cf-agree input[type="checkbox"] { margin: 0; border-radius: 0; }

/* [submit] を使った場合のフォールバック（通常は [jc_submit] を推奨） */
.cf-submit input.wpcf7-submit {
  border: none;
  cursor: pointer;
  width: 377px;
  max-width: 100%;
  height: 81px;
  padding: 0;
  background: var(--c-navy);
  color: var(--c-white);
  font-family: var(--ff-jp-sans);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.05em;
  transition: background 0.25s ease, transform 0.25s ease;
}

.cf-submit input.wpcf7-submit:hover {
  background: var(--c-blue-accent);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  /* SP では入力欄がラベルの下に回り込む。style.css は .cf-row の直下子
     （.cf-input / .cf-textarea）を対象にしているが、CF7 では間に
     .wpcf7-form-control-wrap が入るので、こちらを 1 カラム全幅にする。 */
  .cf-row > .wpcf7-form-control-wrap { grid-column: 1 / -1; }

  .wpcf7 form .wpcf7-response-output { margin-left: 0; }
  .cf-agree label { gap: 14px; }
}

/* ------------------------------------------------------------
   2. お知らせ本文（エディタ出力）
   ------------------------------------------------------------
   style.css は h1-h4 / p の margin と ul の list-style を
   リセットしているため、本文内だけ通常の見え方に戻す。 */

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 2em 0 0.8em;
  font-family: var(--ff-jp-serif);
  font-weight: 600;
  line-height: 1.6;
  color: var(--c-navy);
}

.article-body h2 { font-size: 22px; }
.article-body h3 { font-size: 19px; }
.article-body h4 { font-size: 17px; }

.article-body > *:first-child { margin-top: 0; }

.article-body ul,
.article-body ol {
  margin: 1.4em 0;
  padding-left: 1.6em;
  list-style: disc;
}

.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.4em; }

.article-body a {
  color: var(--c-blue-accent);
  text-decoration: underline;
}

.article-body a:hover { text-decoration: none; }

.article-body img {
  height: auto;
  margin: 1.6em 0;
}

.article-body blockquote {
  margin: 1.6em 0;
  padding: 16px 24px;
  border-left: 3px solid var(--c-navy);
  background: var(--c-bg-3);
}

.article-body table {
  width: 100%;
  margin: 1.6em 0;
  border-collapse: collapse;
}

.article-body th,
.article-body td {
  padding: 12px 16px;
  border: 1px solid #e6e6e6;
  text-align: left;
}

.article-body th { background: #f6fbfe; font-weight: 600; }

.article-body hr {
  margin: 2.4em 0;
  border: none;
  border-top: 1px solid #e3e3e3;
}

.page-links {
  margin-top: 2em;
  font-family: var(--ff-en-sans);
  letter-spacing: 0.1em;
}

/* ------------------------------------------------------------
   3. WP コアのクラス
   ------------------------------------------------------------ */

.alignleft {
  float: left;
  margin: 0 1.5em 1em 0;
}

.alignright {
  float: right;
  margin: 0 0 1em 1.5em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignwide,
.alignfull { max-width: 100%; }

.wp-caption { max-width: 100%; }

.wp-caption-text,
.wp-element-caption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--c-gray);
  text-align: center;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .alignleft,
  .alignright {
    float: none;
    margin: 1.6em auto;
  }
}

/* ------------------------------------------------------------
   4. テーマ追加ページ（汎用固定ページ / 404 / 検索結果）
   ------------------------------------------------------------ */

.sub-hero {
  background: var(--c-navy);
  color: var(--c-white);
  padding: calc(var(--header-h) + 72px) 0 64px;
}

.sub-hero__title {
  font-family: var(--ff-jp-serif);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.news-empty {
  padding: 40px 0;
  text-align: center;
  font-size: 16px;
  color: var(--c-gray);
}

.error-404 {
  text-align: center;
  font-size: 16px;
  line-height: 2;
}

.error-404 .btn { margin-top: 40px; }

@media (max-width: 768px) {
  .sub-hero { padding: calc(var(--header-h) + 40px) 0 40px; }
}

/* ------------------------------------------------------------
   5. 管理者だけに出る設定案内
   ------------------------------------------------------------ */

.jc-admin-notice {
  max-width: 760px;
  margin: 80px auto 0;
  padding: 20px 24px;
  border: 1px dashed var(--c-blue-accent);
  background: #f6fbfe;
  font-size: 15px;
  line-height: 1.9;
  color: var(--c-text);
  text-align: center;
}

.jc-admin-notice a {
  color: var(--c-blue-accent);
  text-decoration: underline;
}

/* 管理バー表示時に固定ヘッダーが隠れないようにする */
body.admin-bar .site-header { top: 32px; }

@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
