/* =========================================================
   極真会館 群馬西支部 — base.css
   トークン・リセット・タイポ・レイアウト・共通部品・土台UI
   ========================================================= */

:root {
  /* 墨 */
  --sumi: #0F0E0D;
  --sumi-2: #1B1917;
  --sumi-3: #26231F;
  --on-sumi: #F2EEE6;
  --on-sumi-2: #B9B1A4;
  --line-sumi: rgba(242, 238, 230, .16);
  /* 和紙 */
  --washi: #F2EEE6;
  --washi-2: #E7DFD1;
  --ink: #22201D;
  --ink-2: #5E574E;
  --line: rgba(34, 32, 29, .18);
  /* 合図 */
  --shu: #C8102E;
  --shu-deep: #A30C25;
  --gold: #B08D57;
  --line-green: #06C755;
  /* 帯（帯レールと節の印だけに使う。面には使わない） */
  --belt-white:#F4F1EA; --belt-orange:#E8762B; --belt-blue:#2F5DA8; --belt-yellow:#E9C21C; --belt-green:#2E8B57; --belt-brown:#6B4226; --belt-black:#111111;

  --font-mincho: "Shippori Mincho B1", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --font-gothic: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;

  --fs-display: clamp(2.1rem, 7.2vw, 4.6rem);
  --fs-h2: clamp(1.65rem, 4.6vw, 2.75rem);
  --fs-h3: clamp(1.2rem, 2.4vw, 1.45rem);
  --fs-lead: clamp(1.02rem, 1.6vw, 1.15rem);
  --fs-body: 1rem;
  --fs-small: .875rem;

  --gutter: max(20px, env(safe-area-inset-left));
  --container: 1160px;
  --section-y: clamp(84px, 12vw, 168px);
  --header-h: 64px;
  --cta-bar-h: 64px;
  --radius-s: 3px;
  --radius: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --washi-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .13 0 0 0 0 .12 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (min-width: 1100px) {
  :root { --header-h: 80px; --cta-bar-h: 0px; }
}
/* スマホは縦の間隔を詰める（PCは変えない） */
@media (max-width: 767px) {
  :root { --section-y: clamp(64px, 16vw, 88px); }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--check-h, 0px) + 12px);
}
body {
  margin: 0;
  background: var(--washi);
  color: var(--ink);
  font-family: var(--font-gothic);
  font-size: var(--fs-body);
  line-height: 1.9;
  letter-spacing: .04em;
  font-feature-settings: "palt" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--cta-bar-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .25em; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
.section--sumi :focus-visible { outline-color: var(--on-sumi); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--shu); color: #fff; padding: 10px 16px; border-radius: var(--radius-s);
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- タイポグラフィ ---------- */
.display, .section-title, h1, h2, h3 {
  font-family: var(--font-mincho);
  font-weight: 700;
  letter-spacing: .06em;
  font-feature-settings: "palt" 1;
}
.display { font-size: var(--fs-display); font-weight: 800; line-height: 1.38; }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.6; }
.section-lead { font-size: var(--fs-lead); line-height: 2; color: var(--ink-2); max-width: 36em; }
.section--sumi .section-lead { color: var(--on-sumi-2); }
.note { font-size: var(--fs-small); line-height: 1.8; color: var(--ink-2); }
.section--sumi .note { color: var(--on-sumi-2); }
.num { font-family: var(--font-mincho); font-feature-settings: "tnum" 1, "palt" 1; }
strong { font-weight: 700; }

/* 和紙2（#E7DFD1）の上では朱を一段深く（--shu は 4.45:1 で AA に届かないため） */
.section--washi-2 { --accent: var(--shu-deep); }

/* ---------- 節の見出し（ヒーロー以外の全節で共通の一つの型） ----------
   <header class="section-head">
     <p class="section-head__kicker">小見出し</p>                       … 朱の四角＋小さな文字
     <h2 class="section-title"><span class="belt-mark"></span>見出し</h2> … 帯の印は必ず h2 の頭
     <p class="section-lead">リード文</p>
   </header>
   見出しの大きさは --fs-h2 の一つだけ。例外は最終CTA（.section-title--display）のみ。
   レイアウトの一部として置く見出し（右に凡例・縦書きなどを添える）は .section-head--flush で下余白を外す。 */
.section-head { display: grid; gap: 16px; align-content: start; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head--flush { margin-bottom: 0; }
@media (max-width: 767px) {
  .section-head { margin-bottom: clamp(28px, 8vw, 40px); }
  .section-head--flush { margin-bottom: 0; }
}
.section-head__kicker {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: var(--fs-small); font-weight: 700; letter-spacing: .14em; line-height: 1.6;
  color: var(--accent, var(--shu));
}
.section-head__kicker::before { content: ""; flex: none; width: .55em; height: .55em; background: currentColor; }
.section--sumi .section-head__kicker { color: #E0435B; }
.section-title { font-size: var(--fs-h2); font-weight: 700; line-height: 1.5; }
/* 最終CTAだけは「言い切り」の大きな文字（意図的な例外） */
.section-title--display { font-size: clamp(2.2rem, 7.4vw, 4rem); font-weight: 800; line-height: 1.34; letter-spacing: .08em; }

/* 縦書き：短いアクセントのみ */
.tategaki {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mincho);
  letter-spacing: .3em;
  line-height: 1.6;
}

/* ---------- レイアウト ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(820px + var(--gutter) * 2); }

.section { position: relative; padding-block: var(--section-y); }
.section--sumi { background: var(--sumi); color: var(--on-sumi); }
.section--washi { background-color: var(--washi); background-image: var(--washi-grain); color: var(--ink); }
.section--washi-2 { background-color: var(--washi-2); background-image: var(--washi-grain); color: var(--ink); }


/* ---------- ボタン ---------- */
.btn {
  --btn-bg: transparent; --btn-fg: currentColor; --btn-bd: currentColor;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.6em;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd); border-radius: var(--radius-s);
  font-family: var(--font-gothic); font-weight: 700; font-size: 1rem; letter-spacing: .1em; line-height: 1.3;
  text-decoration: none; white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn .icon { width: 1.25em; height: 1.25em; flex: none; }
.btn--primary { --btn-bg: var(--shu); --btn-fg: #fff; --btn-bd: var(--shu); }
.btn--primary:hover { --btn-bg: var(--shu-deep); --btn-bd: var(--shu-deep); }
/* LINE：公式の緑はそのまま、文字とアイコンは墨（白だと 2.26:1。墨なら 8:1 以上） */
.btn--line { --btn-bg: var(--line-green); --btn-fg: var(--sumi); --btn-bd: var(--line-green); }
.btn--line:hover { --btn-bg: #05B04B; --btn-bd: #05B04B; }
.btn--ghost { --btn-bg: transparent; --btn-fg: currentColor; --btn-bd: currentColor; }
.btn--ghost:hover { --btn-bg: rgba(127, 120, 110, .12); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 44px; padding: 0 1.2em; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* テキストリンク（矢印アイコン） */
.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.link-arrow .icon { width: 1.1em; height: 1.1em; transition: transform .25s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- 部品 ---------- */
.icon { width: 1.25em; height: 1.25em; flex: none; }

.card {
  background: var(--washi);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
}
.section--washi .card { background: rgba(255, 255, 255, .45); }
.section--washi-2 .card { background: var(--washi); }
.section--sumi .card { background: var(--sumi-2); border-color: var(--line-sumi); }

.tag {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .15em .7em; border: 1px solid currentColor; border-radius: var(--radius-s);
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; line-height: 1.7; white-space: nowrap;
}
.tag--shu { color: var(--shu); }
.tag--solid { background: var(--ink); color: var(--washi); border-color: var(--ink); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.section--sumi .rule { border-top-color: var(--line-sumi); }

/* 写真フレーム */
.photo { position: relative; overflow: hidden; border-radius: var(--radius-s); background: var(--sumi-3); }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* 定義リスト（料金・道場情報など） */
.dl-rows { display: grid; }
.dl-rows > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.dl-rows > div:last-child { border-bottom: 1px solid var(--line); }
.dl-rows dt { font-weight: 700; color: var(--ink-2); font-size: var(--fs-small); padding-top: .15em; }
.section--sumi .dl-rows > div { border-color: var(--line-sumi); }
.section--sumi .dl-rows dt { color: var(--on-sumi-2); }

/* アコーディオン（<details class="accordion">） */
.accordion { border-top: 1px solid var(--line); }
.accordion:last-of-type { border-bottom: 1px solid var(--line); }
.accordion > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px; cursor: pointer; list-style: none; font-weight: 700; line-height: 1.7;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary .icon { transition: transform .3s var(--ease); color: var(--shu); }
.accordion[open] > summary .icon { transform: rotate(45deg); }
.accordion__body { padding: 0 4px 24px; color: var(--ink-2); }
.section--sumi .accordion { border-color: var(--line-sumi); }
/* 入会時に用意するもの（#first・#price で共通） */
.needs-intro { font-size: var(--fs-small); color: var(--ink-2); margin-bottom: 4px; }
.needs-list { display: grid; }
.needs-list li { padding: 12px 0; border-top: 1px solid var(--line); line-height: 1.7; font-weight: 700; }
.needs-list small { display: block; font-weight: 400; font-size: .9rem; color: var(--ink-2); }
.section--sumi .accordion__body { color: var(--on-sumi-2); }

/* タブ（[data-tabs]） */
.tabs__list { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__tab {
  flex: 1 0 auto; min-height: 52px; padding: 0 1.2em;
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: var(--font-mincho); font-weight: 700; font-size: 1.05rem; letter-spacing: .12em; color: var(--ink-2);
  transition: color .2s, border-color .2s;
}
.tabs__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--shu); }
.tabs__panel { padding-top: 28px; }
.tabs__panel[hidden] { display: none; }
.tabs__panel.is-entering { animation: panel-in .45s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* フォーム */
.field { display: grid; gap: 8px; }
.field label, .field .field__label { font-weight: 700; font-size: .95rem; }
.field .req { color: var(--shu); font-size: .8rem; margin-left: .4em; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  background: #FBF9F5; border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 16px; line-height: 1.6;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(200, 16, 46, .18); }

/* ---------- reveal（控えめに：見出しブロック・写真だけ） ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }
.reveal[data-delay="6"] { transition-delay: .48s; }
/* 写真用：墨が拭き取られるように現れる。
   監視するのはラッパー（.reveal-wipe）、クリップするのは中身。
   ラッパー自体をクリップすると IntersectionObserver が交差を検知できないため。 */
.reveal-wipe { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal-wipe.is-in { opacity: 1; transform: none; }
.reveal-wipe > img { transform: scale(1.04); transition: transform 1.6s var(--ease); }
.reveal-wipe.is-in > img { transform: none; }
.reveal-wipe[data-delay="1"] { transition-delay: .06s; }
.reveal-wipe[data-delay="2"] { transition-delay: .12s; }
/* 写真の枠は塗らない（拭き取り中に暗い四角が見えるのを防ぐ）。読み込み中の下地は写真自身に、ごく淡く */
html .reveal-wipe { background: none; }
.reveal-wipe > img { background: rgba(15, 14, 13, .06); }
.section--sumi .reveal-wipe > img { background: rgba(242, 238, 230, .05); }
.no-js .reveal, .no-js .reveal-wipe, .no-js .reveal-wipe > * { opacity: 1; transform: none; clip-path: none; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; top: var(--check-h, 0px); z-index: 50; height: var(--header-h);
  color: var(--on-sumi);
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { background: rgba(15, 14, 13, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom-color: var(--line-sumi); }
.site-header__inner {
  height: 100%; display: flex; align-items: center; gap: 24px;
  max-width: calc(1320px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter);
}
.wordmark { display: grid; align-content: center; min-height: 44px; text-decoration: none; line-height: 1.25; margin-right: auto; }
.wordmark__org { font-size: .66rem; letter-spacing: .16em; color: var(--on-sumi-2); }
.wordmark__name { font-family: var(--font-mincho); font-weight: 800; font-size: 1.3rem; letter-spacing: .2em; }
.gnav { display: none; }
.gnav ul { display: flex; gap: clamp(16px, 2vw, 30px); }
.gnav a { text-decoration: none; font-size: .92rem; font-weight: 500; letter-spacing: .12em; padding-block: 6px; border-bottom: 1px solid transparent; transition: border-color .2s; }
.gnav a:hover { border-bottom-color: currentColor; }
/* スクロールスパイ：表示中のセクション */
.gnav a[aria-current] { border-bottom-color: var(--shu); box-shadow: 0 1px 0 var(--shu); }
.site-header__cta { display: none; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px;
  background: none; border: 0; color: inherit; font-size: .85rem; letter-spacing: .14em;
}
.menu-toggle .icon { width: 26px; height: 26px; }
@media (min-width: 1100px) {
  .gnav, .site-header__cta { display: block; }
  .site-header__cta { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* 全画面メニュー */
.menu {
  position: fixed; inset: 0; z-index: 45; overflow-y: auto;
  background: var(--sumi); color: var(--on-sumi);
  padding: calc(var(--header-h) + 24px) var(--gutter) calc(32px + env(safe-area-inset-bottom));
  display: grid; align-content: start; gap: 36px;
  opacity: 0; transition: opacity .35s var(--ease);
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }
.menu__nav a {
  display: block; padding: 12px 0; border-bottom: 1px solid var(--line-sumi);
  font-family: var(--font-mincho); font-weight: 700; font-size: 1.35rem; letter-spacing: .12em; text-decoration: none;
}
.menu__nav a[aria-current] { display: flex; align-items: center; gap: .6em; }
.menu__nav a[aria-current]::after { content: ""; width: .4em; height: .4em; background: var(--shu); }
.menu__actions { display: grid; gap: 12px; }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { background: var(--sumi); }

/* ---------- 固定ボトムCTAバー（スマホ・タブレット） ---------- */
.cta-bar {
  position: fixed; inset: auto 0 0; z-index: 40;
  display: grid; grid-template-columns: 1fr 1fr 1.6fr;
  height: calc(var(--cta-bar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--sumi); border-top: 1px solid var(--line-sumi);
  transform: translateY(100%); transition: transform .45s var(--ease);
}
.cta-bar.is-visible { transform: none; }
.cta-bar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; border-right: 1px solid var(--line-sumi);
  color: var(--on-sumi); text-decoration: none; font-size: .78rem; font-weight: 700; letter-spacing: .08em;
}
.cta-bar__item .icon { width: 24px; height: 24px; }
.cta-bar__item--line { color: #3BE07F; }
/* 「LINE」の下に小さく「準備中」（64px のバーに収める） */
.cta-bar__item--line > span { display: grid; justify-items: center; line-height: 1.25; }
.cta-bar__sub { font-size: .62rem; font-weight: 500; letter-spacing: .12em; line-height: 1.2; color: var(--on-sumi-2); }
.cta-bar__item--primary { flex-direction: row; gap: 8px; background: var(--shu); border-right: 0; font-size: .95rem; color: #fff; }
@media (min-width: 1100px) { .cta-bar { display: none; } }

/* ---------- 電話シート ---------- */
.phone-sheet {
  width: min(520px, 100%); max-width: 100%; max-height: 90vh; margin: auto auto 0;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom));
  border: 0; border-radius: 12px 12px 0 0;
  background: var(--washi); color: var(--ink);
}
@media (min-width: 768px) { .phone-sheet { margin: auto; border-radius: var(--radius); } }
.phone-sheet[open] { animation: sheet-in .4s var(--ease); }
.phone-sheet::backdrop { background: rgba(15, 14, 13, .6); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.phone-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 8px; }
.phone-sheet__title { font-family: var(--font-mincho); font-weight: 700; font-size: 1.15rem; }
.phone-sheet__close { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; }
.phone-sheet__list li + li { border-top: 1px solid var(--line); }
.phone-sheet__list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; text-decoration: none; min-height: 64px; }
.phone-sheet__list a:hover { background: var(--washi-2); }
.phone-sheet__dojo { display: grid; font-weight: 700; }
.phone-sheet__dojo small { font-weight: 400; font-size: .78rem; color: var(--ink-2); }
.phone-sheet__num { font-family: var(--font-mincho); font-weight: 700; font-size: 1.15rem; color: var(--shu); letter-spacing: .06em; }
.phone-sheet__note { padding: 12px 20px 0; font-size: .8rem; color: var(--ink-2); line-height: 1.8; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal, .reveal-wipe, .reveal-wipe > * { opacity: 1; transform: none; clip-path: none; }
}

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; z-index: 60;
  bottom: calc(var(--cta-bar-h) + 20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 40px);
  padding: 14px 20px; border-radius: var(--radius);
  background: var(--washi); color: var(--ink); border: 1px solid var(--ink);
  font-size: .9rem; font-weight: 700; line-height: 1.6; text-align: center;
  animation: sheet-in .3s var(--ease);
}

/* ---------- 日本語の改行 ---------- */
p, li, dd, figcaption, summary { text-wrap: pretty; }
h1, h2, h3, .display, .section-title, .h3 { word-break: auto-phrase; text-wrap: balance; }
