/* WordPress 固有の補正のみ。デザイン本体は style.css / content.css / analog-design.css */

/* ログイン中の管理バー分、固定ヘッダーとページ内ナビをずらす */
.admin-bar .site-header { top: 32px; }
.admin-bar .page-nav { top: calc(var(--header-h) + 32px); }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .admin-bar .page-nav { top: calc(var(--header-h) + 46px); }
}
@media (max-width: 600px) {
  /* WP標準で管理バーがスクロールと一緒に流れる幅 */
  .admin-bar .site-header { top: 0; }
  .admin-bar .page-nav { top: var(--header-h); }
}

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

/* ブロックエディタで入れた画像・リストが本文幅に収まるように */
.article-body img { height: auto; }
.article-body .wp-block-image { margin-block: 28px; }
.article-body .wp-block-image figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; }
.article-body .aligncenter { margin-inline: auto; }

/* 固定ページ（汎用テンプレート page.php）・404 の本文 */
.wp-page-body { padding-block: 0 var(--section-y); }
.wp-page-body .article-body { max-width: 820px; }

/* ブロックエディタで残りがちな空段落 */
.article-body p:empty { display: none; }

/* =========================
 * お問い合わせフォーム（Contact Form 7）の汎用スタイル
 * CF7標準のマークアップ（<label>項目名<br>[text …]</label>）のフォーム向け。
 * :where() で詳細度を下げ、cf7/form.html（.sih-form）用の下のスタイルを常に優先させる
 * ========================= */
:where(.wpcf7-form) p { margin: 0 0 24px; color: var(--ink); }
/* setup.php でCF7の自動整形（<p>挿入）を止めているので、項目ごとの間隔は label 側で取る */
:where(.wpcf7-form) > label { margin: 0 0 24px; }
:where(.wpcf7-form) label { display: block; font-size: 14px; font-weight: 600; line-height: 1.7; }
:where(.wpcf7-form) label br { display: none; }
:where(.wpcf7-form) .wpcf7-form-control-wrap { display: block; margin-top: 8px; }
:where(.wpcf7-form) input[type="text"],
:where(.wpcf7-form) input[type="email"],
:where(.wpcf7-form) input[type="tel"],
:where(.wpcf7-form) input[type="url"],
:where(.wpcf7-form) input[type="number"],
:where(.wpcf7-form) input[type="date"],
:where(.wpcf7-form) select,
:where(.wpcf7-form) textarea {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  font: 400 16px/1.6 var(--jp); /* 16px未満だとiPhoneで入力時に拡大される */
  transition: border-color .2s, box-shadow .2s;
}
:where(.wpcf7-form) textarea { min-height: 200px; resize: vertical; }
:where(.wpcf7-form) select {
  appearance: none;
  padding-right: 48px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23242824' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 18px center;
  cursor: pointer;
}
:where(.wpcf7-form) input:focus,
:where(.wpcf7-form) select:focus,
:where(.wpcf7-form) textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
:where(.wpcf7-form) input[type="checkbox"],
:where(.wpcf7-form) input[type="radio"] { width: 18px; height: 18px; margin: 0 8px 0 0; accent-color: var(--night); vertical-align: -3px; }
:where(.wpcf7-form) .wpcf7-list-item { margin: 0 20px 0 0; font-weight: 400; }

:where(.wpcf7-form) .wpcf7-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  min-height: 58px;
  margin-top: 8px;
  padding: 14px 40px;
  border: 1px solid var(--accent);
  border-radius: 0;
  color: var(--ink);
  background: var(--accent);
  font: 700 14px/1.4 var(--jp);
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s;
}
:where(.wpcf7-form) .wpcf7-submit:hover { transform: translateY(-1px); }
:where(.wpcf7-form) .wpcf7-submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
:where(.wpcf7-form) .wpcf7-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.wpcf7-form .wpcf7-spinner { vertical-align: middle; }

.wpcf7 .hidden-fields-container { display: none; }

/* 入力エラー・送信結果 */
.wpcf7-form .wpcf7-form-control.wpcf7-not-valid { border-color: #b3261e; }
.wpcf7-not-valid-tip { display: block; margin-top: 6px; color: #b3261e; font-size: 13px; font-weight: 500; }
.wpcf7 form .wpcf7-response-output { margin: 24px 0 0; padding: 16px 20px; border: 1px solid var(--line); background: var(--white); font-size: 14px; }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output { border-color: #b3261e; color: #b3261e; }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--sage-deep); background: var(--fog); }

@media (max-width: 760px) {
  :where(.wpcf7-form) .wpcf7-submit { width: 100%; }
}

/* 一覧のページ送り */
.cc-pagination { margin-top: 48px; }
.cc-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--line); background: var(--white); font-family: var(--latin); }
.cc-pagination .page-numbers.current { border-color: var(--ink); background: var(--accent); }
.cc-empty { padding: 32px; border: 1px solid var(--line); background: var(--white); }

/* お問い合わせ（page-contact.php ＋ Contact Form 7。フォームの中身は cf7/form.html） */
.contact-page-hero { max-width: 760px; }
.contact-form-layout { display: grid; grid-template-columns: .42fr 1fr; gap: 72px; align-items: start; }
.contact-form-aside { position: sticky; top: calc(var(--header-h) + 32px); }
.contact-form-aside h2 { margin-bottom: 24px; font-size: clamp(1.75rem, 2.6vw, 2.25rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.55; }
.contact-form-aside p { color: var(--muted); font-size: .9375rem; }
.contact-form-aside .text-link { margin-top: 8px; color: var(--ink); }

.sih-form { border-top: 1px solid var(--line); }
.sih-form-row { display: grid; grid-template-columns: 200px 1fr; gap: 32px; margin: 0; padding: 28px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.sih-form-label { display: flex; flex-wrap: wrap; align-items: center; align-self: start; gap: 10px; margin: 0; padding: 14px 0 0; font-weight: 600; line-height: 1.6; }
.sih-form-req, .sih-form-opt { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700; line-height: 1.6; letter-spacing: .04em; }
.sih-form-req { color: var(--ink); background: var(--accent); }
.sih-form-opt { color: var(--muted); background: var(--fog); }
.contact-form-aside .sih-form-req { margin-inline: 4px; vertical-align: 1px; }
.sih-form-note { margin: 12px 0 14px; color: var(--muted); font-size: .875rem; }
.sih-form-field .wpcf7-form-control-wrap { display: block; }

.sih-form input[type="text"], .sih-form input[type="email"], .sih-form input[type="tel"], .sih-form textarea {
  width: 100%; min-height: 56px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--white); font: inherit; font-size: 1rem; line-height: 1.7;
  transition: border-color .2s, box-shadow .2s;
}
.sih-form textarea { min-height: 220px; resize: vertical; }
.sih-form ::placeholder { color: #9ba19b; }
.sih-form input:focus, .sih-form textarea:focus { border-color: var(--ink); outline: 0; box-shadow: 0 0 0 3px var(--accent); }
.sih-form .wpcf7-not-valid { border-color: #b3261e; }

/* ご相談内容（チェックボックス） */
.sih-form-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sih-form-choices .wpcf7-list-item { margin: 0; }
.sih-form-choices label { display: flex; align-items: flex-start; gap: 12px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); background: var(--white); font-size: .9375rem; line-height: 1.6; cursor: pointer; transition: border-color .2s, background-color .2s; }
.sih-form-choices label:hover { border-color: var(--ink); }
.sih-form-choices label:has(input:checked) { border-color: var(--ink); background: var(--accent-soft); }
.sih-form-choice-sub { display: block; }
.sih-form-choices input, .sih-form-agree input { flex: 0 0 auto; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); }

/* 同意・送信 */
.sih-form-footer { display: grid; justify-items: start; gap: 28px; margin-top: 40px; }
.sih-form-agree label { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.sih-form-agree .wpcf7-list-item { margin: 0; }
.sih-form-agree a { border-bottom: 1px solid currentColor; }
.sih-form-submit { width: min(100%, 360px); min-height: 72px; padding: 18px 24px; border: 0; border-radius: 0; color: var(--ink); background: var(--accent); font: inherit; font-size: .9375rem; font-weight: 700; letter-spacing: .04em; cursor: pointer; transition: color .2s, background-color .2s; }
.sih-form-submit:hover:not(:disabled) { color: #fff; background: var(--night); }
.sih-form-submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sih-form-submit:disabled { opacity: .45; cursor: not-allowed; }
.contact-form-body .wpcf7-spinner { margin: 0 0 0 16px; vertical-align: middle; }

/* CF7 のエラー・送信結果 */
.contact-form-body .wpcf7-not-valid-tip { margin-top: 8px; color: #b3261e; font-size: .875rem; }
.contact-form-body .wpcf7 form .wpcf7-response-output { margin: 32px 0 0; padding: 18px 20px; border: 1px solid var(--line); background: var(--white); font-size: .9375rem; }
.contact-form-body .wpcf7 form.sent .wpcf7-response-output { border-color: var(--ink); background: var(--accent-soft); }
.contact-form-body .wpcf7 form.invalid .wpcf7-response-output,
.contact-form-body .wpcf7 form.unaccepted .wpcf7-response-output,
.contact-form-body .wpcf7 form.failed .wpcf7-response-output,
.contact-form-body .wpcf7 form.spam .wpcf7-response-output { border-color: #b3261e; color: #b3261e; }

@media (max-width: 1024px) {
  .contact-form-layout { grid-template-columns: 1fr; gap: 40px; }
  .contact-form-aside { position: static; }
}
@media (max-width: 760px) {
  .sih-form-row { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .sih-form-label { padding-top: 0; }
  .sih-form-choices { grid-template-columns: 1fr; }
  .sih-form-submit { width: 100%; }
}
