/* =========================================================
   .MITAS. v2 — ベース（リセット／組版／縦書き／共通部品／a11y）
   レスポンシブの上書きは必ず @media の内側に書く（v1 の hero 崩壊の再発防止）。
   ========================================================= */

/* ---------- リセット ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* sticky を使うため、祖先に overflow:hidden/auto を置かない。横はみ出しは clip で防ぐ */
  overflow-x: clip;
  /* ページ内リンクの着地とフォーカスの送りを固定ヘッダーの下にする。Lenis もこの値を読むので、移動の側で差し引かない */
  scroll-padding-top: var(--header-h);
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

img, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ---------- 本文 ---------- */
body {
  overflow-x: clip;
  background: var(--mt-paper);
  color: var(--mt-ink);
  font-family: var(--mt-font-gothic);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.04em;
  line-break: strict;
  /* 日本語は、index.html に入れた文節の切れ目の <wbr>（tools/ja-phrase.py・BudouX）と、空白・句読点のあと・文節のまとまり（.mt-nb）の
     あいだでだけ折り返す。iPhone（WebKit）は word-break: auto-phrase に対応せず「パーソナ／ルトレーニング」のように折れていた（2026-10-22）。
     Chrome と iPhone が同じ位置で折り返すので、Chrome での監査がそのまま iPhone の確認になる */
  word-break: keep-all;
  overflow-wrap: normal;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 500; }

/* 段落の最終行が1〜2文字で孤立するのを避ける（対応ブラウザのみ。非対応でも崩れない） */
p, li, dd, figcaption { text-wrap: pretty; }

/* 背面から満ちてくる紙の温色。合成レイヤーの opacity だけを動かす */
.mt-warmth {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--mt-warm);
  opacity: calc(var(--mt-p) * 0.9);
  pointer-events: none;
}

/* ---------- レイアウト ---------- */
.mt-wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* ---------- 明朝と縦書き ---------- */
.mt-serif {
  font-family: var(--mt-font-mincho);
  font-weight: 500;
}

.mt-tate {
  font-family: var(--mt-font-mincho);
  font-weight: 500;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  font-feature-settings: normal; /* 縦組みの字形はブラウザが自動で当てる。palt は使わない */
  letter-spacing: 0.14em;
  line-height: 1.8;
}

.mt-col { display: block; }
.mt-col + .mt-col { margin-top: 2em; } /* 2列目の字下げ。縦書きでも物理プロパティで書く */

.mt-ch { display: inline-block; }

/* 縦中横は2字まで */
.mt-tcy {
  -webkit-text-combine: horizontal;
  text-combine-upright: all;
  letter-spacing: 0;
}

/* 縦持ちの狭い画面は縦書きを保つ。横組みは十分な幅のある横向き画面だけ。 */
@media (min-width: 560px) and (orientation: landscape) and (max-height: 600px) {
  .mt-tate {
    writing-mode: horizontal-tb;
    white-space: normal;
    letter-spacing: 0.08em;
    line-height: 1.6;
  }
  .mt-col + .mt-col { margin-top: 0; }
  .mt-tcy { -webkit-text-combine: none; text-combine-upright: none; }
}

/* 横組みの明朝の h2 */
.mt-h2 {
  font-size: var(--fs-h2-yoko);
  line-height: 1.6;
  letter-spacing: 0.08em;
  font-feature-settings: "palt" 1;
}

/* 文節の内部で折り返さない（日本語の改行品質） */
.mt-nb { display: inline-block; }
/* D18：「完全無料」だけを金の文字と細い金の下線で示す（太さ・大きさは変えない。ゆんの指定 2026-10-20） */
.mt-em { font-weight: inherit; color: var(--mt-gold-text); text-decoration-line: underline; text-decoration-thickness: 1px; text-decoration-color: var(--mt-gold); text-underline-offset: 0.32em; }

/* ---------- 共通部品 ---------- */
.mt-rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--mt-rule-strong);
  transform-origin: left center;
}

.mt-tri {
  display: inline-block;
  width: 0.72em;
  height: 0.62em;
  margin-right: 0.6em;
  background: var(--mt-gold);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.mt-note {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--mt-ink-sub);
}

/* ボタン。ホバーは「濃い金が左から入る」の1変化だけ */
.mt-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 28px;
  border-radius: 2px;
  overflow: hidden;
  font-size: 0.9375rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-align: center;
  white-space: nowrap; /* ボタンの文言を途中で折り返さない（768px で「せ」だけ落ちていた） */
}

.mt-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-ui) var(--ease-ui);
}

.mt-btn--primary { background: var(--mt-gold-deep); color: var(--mt-white); }
.mt-btn--primary::before { background: var(--mt-gold-deeper); }

.mt-btn--ghost {
  background: rgba(251, 249, 244, 0.88);
  color: var(--mt-ink);
  box-shadow: inset 0 0 0 1px var(--mt-rule-strong);
}
.mt-btn--ghost::before { background: var(--mt-hover); }

.mt-btn--lg { min-height: 56px; padding-inline: 40px; font-size: 1rem; }
/* 長い文言（「LINE公式アカウントでお問い合わせ」）は、入らない幅だけ文節（.mt-nb）の切れ目で2行にする */
.mt-btn__label { white-space: normal; }

@media (hover: hover) {
  .mt-btn:hover::before { transform: scaleX(1); }
}
.mt-btn:focus-visible::before { transform: scaleX(1); }

@media (max-width: 767.98px) {
  .mt-btn { padding-inline: 18px; }
  .mt-btn--lg { padding-inline: 20px; }
}

/* ---------- a11y ---------- */
.mt-skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--mt-gold-deep);
  color: var(--mt-white);
  transform: translateY(-220%);
}
.mt-skip:focus { transform: translateY(0); }

.mt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--mt-gold-text);
  outline-offset: 3px;
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
