/* 共通コンポーネント（全ページで1回だけ定義。ページ固有は pages/*.css） */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: var(--sp-3) var(--sp-6);
  border: 1px solid transparent; border-radius: var(--radius-btn);
  font-size: var(--fs-small); font-weight: 700; line-height: 1.4; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn--primary { background: var(--c-text); color: #fff; }
.btn--primary:hover { background: #2a2a30; }
.btn--ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn--ghost:hover { border-color: var(--c-text); }
.btn--sm { min-height: 44px; padding: var(--sp-2) var(--sp-5); }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: wait; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--c-border-soft);
  font-family: var(--font-base); font-size: var(--fs-body); line-height: var(--lh-base); /* body継承でブレない */
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--sp-6);
  max-width: var(--w-container); margin: 0 auto;
  min-height: var(--header-h); padding: 0 var(--gutter);
}
.brand { display: inline-flex; align-items: baseline; gap: var(--sp-3); text-decoration: none; color: var(--c-text); white-space: nowrap; }
.brand__mark { align-self: center; width: 10px; height: 10px; background: var(--c-red); }
.brand__name { font-size: 22px; font-weight: 700; letter-spacing: .12em; }
.brand__tag { font-size: var(--fs-caption); color: var(--c-text-sub); }

.gnav { display: flex; align-items: center; gap: var(--sp-6); margin-left: auto; }
.gnav__list { display: flex; align-items: center; gap: var(--sp-5); }
.gnav__cta { white-space: nowrap; }
.gnav__list a {
  position: relative; display: inline-block; padding: var(--sp-2) 0;
  font-size: var(--fs-small); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.gnav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--c-text); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.gnav__list a:hover::after, .gnav__list a[aria-current="page"]::after { transform: scaleX(1); }

/* 料金ポップオーバー（hover / キーボードフォーカスで表示。色変化なし・影なしの既存トーンに合わせる） */
.gnav__list li { position: relative; }
.gnav__tip {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60;
  width: 320px; padding: var(--sp-4) var(--sp-5);
  background: var(--c-bg); border: 1px solid var(--c-border); border-top: 3px solid var(--c-beige);
  color: var(--c-text); font-weight: 400; text-align: left; white-space: normal;
}
.gnav__list li.has-tip:hover > .gnav__tip,
.gnav__list li.has-tip:focus-within > .gnav__tip { display: block; }
.gnav__tip-title { font-size: var(--fs-small); font-weight: 700; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--c-border-soft); }
.gnav__tip-list { margin-top: var(--sp-3); font-size: var(--fs-small); line-height: 1.6; }
.gnav__tip-list > div + div { margin-top: var(--sp-2); }
.gnav__tip-list dt { font-size: var(--fs-caption); color: var(--c-text-sub); }
.gnav__tip-list dd { margin: 0; }
.gnav__tip-more { margin-top: var(--sp-3); font-size: var(--fs-caption); }
.gnav__tip-more a { display: inline; padding: 0; font-size: var(--fs-caption); text-decoration: underline; }
.gnav__tip-more a::after { display: none; }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  border: 0; background: transparent; cursor: pointer; position: relative;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 11px; width: 22px; height: 2px; background: var(--c-text);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle__bars { top: 21px; }
.nav-toggle__bars::before { left: 0; top: -7px; }
.nav-toggle__bars::after { left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) { .brand__tag { display: none; } }
@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .gnav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-4) var(--sp-6);
    background: #fff; border-bottom: 1px solid var(--c-border-soft);
  }
  .gnav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .gnav__list a { display: block; padding: var(--sp-4) 0; border-bottom: 1px solid var(--c-border-soft); }
  .gnav__list a::after { display: none; }
  .gnav__tip { display: block; position: static; width: auto; margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--c-bg-sub); border: 0; border-left: 3px solid var(--c-beige); }
  .gnav__list .gnav__tip-more a { padding: 0; border-bottom: 0; display: inline; }
  .gnav__cta { width: 100%; }
  html.js .gnav { display: none; }
  html.js .gnav.is-open { display: flex; }
  /* メニュー展開中は背面のページをスクロールさせない。メニュー自体は画面内で縦スクロールでき、端でも背面へ連鎖しない */
  html.nav-open { overflow: hidden; }
  html.js .gnav {
    max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h));
    overflow-y: auto; overscroll-behavior: contain;
  }
}

/* ---------- Page head / breadcrumb ---------- */
.page-head { background: var(--c-kinari); }
.page-head__inner { max-width: var(--w-container); margin: 0 auto; padding: var(--sp-7) var(--gutter) var(--sp-9); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-caption); color: var(--c-text-sub); }
.crumbs li + li::before { content: "/"; margin-right: var(--sp-2); color: var(--c-text-disabled); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head__title { margin-top: var(--sp-6); font-size: var(--fs-h1); line-height: var(--lh-heading); font-weight: 700; max-width: 28em; }

/* ---------- Sections / prose ---------- */
.sec { padding: clamp(48px, 7vw, 104px) var(--gutter); }
/* 偶数番目の機械的な縞は廃止（I-5）。背景のリズムは surfaces.css が役割・種類で決める */
.sec__inner { max-width: var(--w-container); margin: 0 auto; }
.prose { line-height: var(--lh-prose); }
.prose > * + * { margin-top: var(--sp-5); }
.prose h2 { margin-top: 0; font-size: var(--fs-h2); line-height: var(--lh-heading); font-weight: 700; }
.prose h2 .h-num { display: block; margin-bottom: var(--sp-1); font-size: var(--fs-caption); font-weight: 400; letter-spacing: .2em; color: var(--c-text-mute); }
.prose h2 + * { margin-top: var(--sp-6); }
.prose h3 { margin-top: var(--sp-9); font-size: var(--fs-h3); line-height: 1.5; font-weight: 700; padding-bottom: var(--sp-2); border-bottom: 1px solid var(--c-border); }
.prose h3 .h-num { margin-right: var(--sp-2); font-size: var(--fs-small); font-weight: 400; color: var(--c-text-mute); }
.prose h3 + * { margin-top: var(--sp-4); }
.prose strong { font-weight: 700; }
.prose a:not(.btn):not(.more) { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--c-border); }
.prose a:not(.btn):not(.more):hover { text-decoration-color: var(--c-text); }
.prose ul { padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.4em; }
.prose ul > li + li { margin-top: var(--sp-2); }
.prose ul > li::before { content: ""; position: absolute; left: .3em; top: .95em; width: 5px; height: 5px; background: var(--c-red); }
.prose ol { list-style: decimal; padding-left: 1.6em; }
.prose ol > li + li { margin-top: var(--sp-2); }
.prose blockquote { padding: var(--sp-4) var(--sp-5); background: var(--c-bg-sub); border-left: 3px solid var(--c-beige); color: var(--c-text-sub); }
.prose pre { padding: var(--sp-4); background: var(--c-bg-sub); border: 1px solid var(--c-border-soft); overflow-x: auto; font-size: var(--fs-small); line-height: 1.7; white-space: pre-wrap; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .92em; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; min-width: 520px; font-size: var(--fs-small); line-height: 1.7; background: #fff; }
.tbl th, .tbl td { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.tbl thead th { background: var(--c-kinari); font-weight: 700; white-space: nowrap; }
.tbl tbody td:first-child { background: var(--c-bg-sub); font-weight: 700; white-space: nowrap; }
.tbl tbody td:first-child:only-child { white-space: normal; }

/* ---------- CTA ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.cta-row .btn { flex: 0 1 auto; text-align: left; justify-content: flex-start; line-height: 1.5; }
.more-row { line-height: 1.8; }
.more { display: inline-block; font-size: var(--fs-small); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--c-text); padding-bottom: 2px; }
.more:hover { opacity: .65; }
@media (max-width: 767px) { .cta-row .btn { flex: 1 1 100%; } }

/* ---------- FAQ (details) ---------- */
.qa { border-bottom: 1px solid var(--c-border); }
.qa:first-of-type { border-top: 1px solid var(--c-border); }
.qa summary { display: flex; align-items: baseline; gap: var(--sp-3); padding: var(--sp-5) var(--sp-8) var(--sp-5) 0; cursor: pointer; list-style: none; position: relative; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; position: absolute; right: var(--sp-2); top: var(--sp-5); font-size: 22px; line-height: 1; color: var(--c-text-sub); }
.qa[open] summary::after { content: "−"; }
.prose .qa__q { margin: 0; padding: 0; border: 0; font-size: 17px; line-height: 1.6; }
.qa__q .h-label { margin-right: var(--sp-2); color: var(--c-red); font-weight: 700; }
.qa__a { padding: 0 0 var(--sp-6); }
.qa__a > * + * { margin-top: var(--sp-4); }
.prose .qa + h3, .prose .qa + h2 { margin-top: var(--sp-9); }
.prose h3 + .qa { margin-top: var(--sp-4); }

/* ---------- Steps（ご利用の流れ） ---------- */
.sec--step { position: relative; }
.sec--step .sec__inner { position: relative; padding-left: var(--sp-10); }
.sec--step .sec__inner::before {
  content: attr(data-step); position: absolute; left: 0; top: 2px;
  width: 32px; height: 32px; border: 1px solid var(--c-beige); background: var(--c-kinari); color: var(--c-red);
  font-family: var(--font-display); font-size: 13px; font-weight: 700; line-height: 30px; text-align: center;
}
@media (max-width: 767px) { .sec--step .sec__inner { padding-left: var(--sp-9); } }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--sp-12); background: var(--c-kinari); font-size: var(--fs-small); line-height: var(--lh-base); }
.site-footer__inner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-8) var(--sp-7);
  max-width: var(--w-container); margin: 0 auto; padding: var(--sp-11) var(--gutter) var(--sp-8);
}
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__lead { margin-top: var(--sp-2); color: var(--c-text-sub); }
.site-footer__title { margin-bottom: var(--sp-3); font-weight: 700; font-size: var(--fs-small); letter-spacing: .08em; }
.site-footer__col li + li { margin-top: var(--sp-2); }
.site-footer__col a { display: inline-block; padding: var(--sp-1) 0; text-decoration: none; }
.site-footer__col a:hover { text-decoration: underline; }
.site-footer__copy { max-width: var(--w-container); margin: 0 auto; padding: var(--sp-5) var(--gutter) var(--sp-7); border-top: 1px solid var(--c-beige); color: var(--c-text-sub); }
@media (max-width: 767px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- Forms（部品。画面レイアウトは pages/form.css） ---------- */
/* ハニーポット（人間には見えない。お問い合わせフォームと右下メッセージの両方で使う） */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field { margin-top: var(--sp-7); }
.field__label, .fieldset__legend { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); font-size: var(--fs-small); font-weight: 700; }
.badge { display: inline-block; padding: 0 var(--sp-2); font-size: 11px; font-weight: 700; line-height: 20px; border-radius: 2px; }
.badge--req { background: var(--c-red); color: #fff; }
.badge--opt { background: var(--c-bg-sub); color: var(--c-text-sub); }
.field__hint { margin-bottom: var(--sp-2); font-size: var(--fs-caption); color: var(--c-text-sub); line-height: 1.6; }

.input, .select, .textarea {
  display: block; width: 100%; min-height: 48px;
  padding: var(--sp-3); background: #fff;
  border: 1px solid var(--c-border); border-radius: var(--radius-input);
  font-size: 16px;                      /* iOS の自動ズーム防止 */
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 176px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-text-disabled); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--c-text); box-shadow: 0 0 0 3px rgba(60, 60, 67, .15); }
.is-invalid, .field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--c-danger); background: #fff8f8; }

.choices { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; min-height: 48px; padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--c-border); background: #fff; font-size: var(--fs-small); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.choice span:hover { border-color: var(--c-text-disabled); }
.choice input:checked + span { border-color: var(--c-text); background: var(--c-kinari); font-weight: 700; }
.choice input:focus-visible + span { outline: 2px solid var(--c-text); outline-offset: 2px; }
.field.has-error .choice span { border-color: var(--c-danger); }

.check { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; line-height: 1.7; }
.check input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--c-text); }

.field__error { margin-top: var(--sp-2); color: var(--c-danger); font-size: var(--fs-small); font-weight: 700; line-height: 1.6; }
.field__error::before { content: "！"; margin-right: 2px; }

.alert { padding: var(--sp-5); border: 1px solid var(--c-danger); background: #fff8f8; }
.alert__title { font-weight: 700; color: var(--c-danger); }
.alert ul { margin-top: var(--sp-3); }
.alert li + li { margin-top: var(--sp-1); }
.alert a { color: var(--c-danger); }

/* ---------- 講師プロフィール（ヒーロー） ---------- */
.profile-hero { display: flex; align-items: center; gap: var(--sp-7); margin-top: var(--sp-7); }
.profile-hero__photo { flex: none; width: 160px; height: 160px; margin: 0; overflow: hidden; border: 1px solid var(--c-border); background: var(--c-bg); }
.profile-hero__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-hero__role { font-size: var(--fs-small); color: var(--c-text-sub); letter-spacing: .1em; }
.profile-hero__name { margin-top: var(--sp-1); font-size: var(--fs-h3); font-weight: 700; line-height: 1.5; }
.profile-hero__lead { margin-top: var(--sp-2); font-size: var(--fs-small); color: var(--c-text-sub); }
@media (max-width: 600px) {
  .profile-hero { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
}

@media (min-width: 768px) {
  .profile-hero__photo { width: 240px; height: 240px; }
  .profile-hero__name { font-size: clamp(22px, 2.6vw, 32px); }
}
@media (min-width: 1280px) { .profile-hero__photo { width: 320px; height: 320px; } .profile-hero { gap: var(--sp-9); } }
