/*
Theme Name: 山口会計事務所
Theme URI: https://yamaguchi-accg.com/
Author: 山口会計事務所
Description: 千葉県八千代市の税理士・公認会計士事務所「山口会計事務所」の専用テーマです。HOME・サービス・プロフィール・税務リスク診断は専用テンプレート、ブログとその他の固定ページは管理画面から編集できます。
Version: 1.0.1
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yamaguchi-accg
*/

:root {
  color-scheme: light;
  --navy: #2f6fed;
  --navy-dark: #1f4fcf;
  --teal: #2bb6a3;
  --teal-light: #e3f8f5;
  --gold: #ff8a3d;
  --gray-bg: #f4f8ff;
  --text: #33363d;
  --text-light: #6b7280;
  --white: #ffffff;
  --radius: 16px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.8;
  /* 日本語の禁則処理を厳格にする（行頭に「、」「。」が来ないようにする） */
  line-break: strict;
}

/*
 * 日本語の改行位置を整える。
 * auto-phrase は文節の切れ目で折り返すため、
 * 「経営者の身/近な相談相手」のような不自然な改行を防ぐ。
 * 未対応のブラウザでは従来どおりの折り返しになる。
 */
h1, h2, h3,
.hero p.lead,
.section-sub,
.card p,
.lead-text,
.post-list h3,
.quiz-step h3 {
  word-break: auto-phrase;
}

/*
 * 意味の切れ目でだけ折り返させるための囲み。
 * この中では原則として改行されないので、
 * 「山口会計事務所」のような固有名詞が2行に割れない。
 * auto-phrase に未対応のブラウザ（iPhoneのSafari等）でも効く。
 */
.nw { display: inline-block; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--white);
  color: var(--navy);
  padding: 10px 16px;
  z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
header.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-bar header.site-header { top: 32px; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}
.logo a { color: var(--white); }
.logo a:hover { text-decoration: none; }
.logo small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: #c7d0e0;
  letter-spacing: 0.05em;
}

nav.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
nav.main-nav a { color: var(--white); font-size: 0.95rem; }
nav.main-nav a:hover { color: var(--gold); text-decoration: none; }
nav.main-nav li.current-menu-item > a,
nav.main-nav li.current_page_item > a {
  color: var(--gold);
  font-weight: 700;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: var(--white);
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: var(--white);
  padding: 90px 0 100px;
  text-align: center;
}
.hero.page-hero { padding: 56px 0 64px; }
.hero h1 {
  font-size: 2.1rem;
  margin: 0 0 18px;
  font-weight: 700;
  text-wrap: balance;
}
.hero.page-hero h1 { font-size: 1.6rem; }
.hero p.lead {
  font-size: 1.15rem;
  color: #d7deea;
  max-width: 640px;
  margin: 0 auto 36px;
}
.hero.page-hero p.lead { font-size: 1rem; margin-bottom: 0; }
.hero .badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.85rem;
  margin-bottom: 22px;
  letter-spacing: 0.05em;
}

.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 999px;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--white);
  color: var(--white);
  margin-left: 14px;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; }
section.block.alt { background: var(--gray-bg); }

.section-title {
  text-align: center;
  margin: 0 0 12px;
  font-size: 1.6rem;
  color: var(--navy);
  text-wrap: balance;
}
.section-sub {
  text-align: center;
  color: var(--text-light);
  margin: 0 0 48px;
}
.lead-text {
  max-width: 760px;
  margin: 0 auto 40px;
  color: var(--text-light);
}

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border: 1px solid #e7e9ed;
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: 0 2px 10px rgba(20,30,60,0.04);
}
.card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--teal-light);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card .icon svg { width: 26px; height: 26px; display: block; }
.card h3 { margin: 0 0 10px; font-size: 1.1rem; color: var(--navy); }
.card p { margin: 0; color: var(--text-light); font-size: 0.95rem; }

.promo-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 40px;
}
.promo-card h2 { color: var(--navy); margin-top: 0; }
.promo-card p { color: var(--text-light); }

/* ---------- Profile ---------- */
.profile-block { display: flex; gap: 40px; align-items: flex-start; }
.profile-photo-img {
  width: 220px;
  flex-shrink: 0;
  border-radius: var(--radius);
  aspect-ratio: 1/1;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 4px 16px rgba(20,30,60,0.10);
}
.profile-caption {
  width: 220px;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 10px;
  line-height: 1.6;
}
.profile-caption strong { color: var(--navy); font-size: 0.95rem; }

.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 640px; border-left: 2px solid var(--teal-light); }
.timeline li { position: relative; padding: 0 0 22px 24px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--teal);
}

.credentials {
  background: var(--gray-bg);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 640px;
  margin: 0 auto;
}
.credentials dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px 16px;
  margin: 0;
  font-size: 0.95rem;
}
.credentials dt { color: var(--text-light); font-weight: 500; }
.credentials dd { margin: 0; }
.credentials .note { color: var(--text-light); font-size: 0.85rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.price-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(20,30,60,0.05);
  font-variant-numeric: tabular-nums;
}
.price-table th, .price-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #edeff2;
  text-align: left;
}
.price-table th { background: var(--navy); color: var(--white); font-weight: 500; }
.price-table tr:last-child td { border-bottom: none; }
.price-note { color: var(--text-light); font-size: 0.85rem; margin-top: 10px; }

.plan-heading {
  font-size: 1.15rem;
  color: var(--navy);
  margin: 40px 0 16px;
  border-left: 4px solid var(--gold);
  padding-left: 12px;
}

/* ---------- Contact ---------- */
.info-box {
  background: var(--white);
  border: 1px solid #e7e9ed;
  border-radius: var(--radius);
  padding: 32px;
}
.info-box dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px 16px;
  margin: 0;
}
.info-box dt { color: var(--text-light); font-weight: 500; }
.info-box dd { margin: 0; }
.form-note { font-size: 0.8rem; color: var(--text-light); margin: 0; }

/* Contact Form 7 */
.wpcf7 form.wpcf7-form p { margin: 0 0 18px; }
.wpcf7 label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea,
.wpcf7 select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d6d9de;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}
.wpcf7 input[type="checkbox"] { accent-color: var(--teal); width: 18px; height: 18px; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 input[type="submit"] {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 999px;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.wpcf7 input[type="submit"]:hover { transform: translateY(-2px); }
.wpcf7 .required-mark {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.wpcf7 .consent-box {
  display: block;
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
}
.wpcf7-not-valid-tip { color: #c9302c; font-size: 0.85rem; }
.wpcf7 form .wpcf7-response-output {
  border-radius: 10px;
  border-width: 1.5px;
  padding: 14px 18px;
  margin: 18px 0 0;
}

/* ---------- CTA ---------- */
.cta-band {
  background: var(--teal);
  color: var(--white);
  text-align: center;
  padding: 56px 0;
}
.cta-band h2 { margin: 0 0 10px; font-size: 1.4rem; }
.cta-band p { margin: 0 0 26px; color: #e5f6f6; }
.cta-band .btn { background: var(--white); color: var(--teal); }
.cta-band .btn:hover { color: var(--teal); }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--navy-dark);
  color: #aab3c5;
  padding: 40px 0 28px;
  font-size: 0.85rem;
}
footer.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
footer.site-footer a { color: #d7deea; }
footer.site-footer .copyright { width: 100%; margin-top: 20px; color: #6b7592; }

/* ---------- Quiz ---------- */
.quiz-box {
  background: var(--white);
  border: 1px solid #e7e9ed;
  border-radius: var(--radius);
  padding: 40px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 2px 14px rgba(20,30,60,0.05);
}
.quiz-progress { height: 6px; background: var(--gray-bg); border-radius: 999px; overflow: hidden; margin-bottom: 28px; }
.quiz-progress-bar { height: 100%; background: var(--teal); width: 0%; transition: width 0.25s ease; }
.quiz-step { display: none; }
.quiz-step.active { display: block; }
.quiz-step .q-label { font-size: 0.85rem; color: var(--text-light); margin-bottom: 6px; }
.quiz-step h3 { color: var(--navy); font-size: 1.15rem; margin: 0 0 22px; }
.quiz-options { display: grid; gap: 12px; margin-bottom: 28px; }
.quiz-options label {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid #d9dee6;
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-options label:hover { border-color: var(--teal); background: var(--teal-light); }
.quiz-options input[type="radio"] { accent-color: var(--teal); width: 18px; height: 18px; }
.quiz-options label.selected { border-color: var(--teal); background: var(--teal-light); }
.quiz-nav { display: flex; justify-content: space-between; }
.quiz-nav button { border: none; cursor: pointer; font-family: inherit; }
.quiz-btn-next {
  background: var(--gold);
  color: var(--white);
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 999px;
  font-size: 0.95rem;
}
.quiz-btn-next:disabled { background: #d9dee6; cursor: not-allowed; }
.quiz-btn-back { background: transparent; color: var(--text-light); padding: 12px 10px; font-size: 0.95rem; }
.quiz-result { text-align: center; }
.quiz-result .level {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.quiz-result .level.low { background: var(--teal-light); color: #1d8577; }
.quiz-result .level.mid { background: #fff3e6; color: #c25e12; }
.quiz-result .level.high { background: #ffe5e5; color: #c9302c; }
.quiz-result h3 { color: var(--navy); font-size: 1.3rem; margin: 0 0 16px; }
.quiz-result p { color: var(--text-light); text-align: left; }
.quiz-disclaimer {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 24px;
  text-align: left;
  background: var(--gray-bg);
  padding: 14px 18px;
  border-radius: 10px;
}

/* ---------- Blog ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid #e7e9ed; padding: 20px 0; display: flex; gap: 20px; }
.post-date { color: var(--text-light); font-size: 0.85rem; width: 110px; flex-shrink: 0; }
.post-list h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--navy); }
.post-list p { margin: 0; color: var(--text-light); }

.entry { max-width: 780px; margin: 0 auto; }
.entry h2 { color: var(--navy); margin-top: 40px; font-size: 1.25rem; }
.entry h3 { color: var(--navy); margin-top: 32px; font-size: 1.1rem; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: 6px; }
.entry img { border-radius: 10px; margin: 24px auto; }
.entry table { width: 100%; border-collapse: collapse; }
.entry table th, .entry table td { border: 1px solid #e7e9ed; padding: 10px 14px; }
.entry blockquote {
  border-left: 4px solid var(--teal-light);
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  color: var(--text-light);
}
.entry .wp-block-table { overflow-x: auto; }

.pagination { display: flex; gap: 10px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e7e9ed;
  color: var(--navy);
}
.pagination .page-numbers.current { background: var(--navy); color: var(--white); border-color: var(--navy); }

.back-link { text-align: right; margin-top: 40px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  nav.main-nav { width: 100%; }
  nav.main-nav ul { display: none; flex-direction: column; gap: 0; padding-top: 8px; }
  nav.main-nav ul.open { display: flex; }
  nav.main-nav li { border-top: 1px solid rgba(255,255,255,0.18); }
  nav.main-nav a { display: block; padding: 12px 2px; }
  .header-inner { flex-wrap: wrap; }
  .grid, .grid.cols-2 { grid-template-columns: 1fr; }
  .profile-block { flex-direction: column; }
  .profile-photo-img, .profile-caption { width: 160px; }
  .credentials dl { grid-template-columns: 1fr; gap: 4px 0; }
  .credentials dt { margin-top: 10px; }
  footer.site-footer .container { flex-direction: column; }
  .hero { padding: 60px 0 68px; }
  .hero h1 { font-size: 1.6rem; }
  /* パソコン向けに入れた固定の改行を、狭い画面では無効にする */
  .hero h1 br { display: none; }
  .section-sub, .hero p.lead { text-wrap: pretty; }
  .btn-outline { margin-left: 0; margin-top: 12px; }
  .quiz-box { padding: 24px; }
  .post-list li { flex-direction: column; gap: 4px; }
  .post-date { width: auto; }
}
