/* スワイプ型LP 共通スタイル
   色やサイズは各LPの config.json の theme から CSS 変数として渡されます。 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--page-bg, #111);
  overscroll-behavior: none;
}

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--header-text, #fff);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ===== 外枠（PCではスマホ幅で中央表示） ===== */
.lp {
  --header-h: 48px;
  --footer-h: 36px;
  position: relative;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--slide-bg, #000);
  overflow: hidden;
}

/* ===== ヘッダー（セクションのタブ） ===== */
.lp-header {
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg, #000);
  z-index: 10;
}

.lp-logo {
  flex: 0 0 auto;
  height: 28px;
  margin-left: 12px;
  display: block;
}

/* タブが増えても右端のページ番号と重ならないよう右側を空ける。
   収まらないときは横スクロール（中央寄せは先頭/末尾の auto マージンで行う） */
.lp-tabs {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-start;
  gap: 2px;
  height: 100%;
  margin-right: 48px;
  padding-left: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.lp-tabs::-webkit-scrollbar {
  display: none;
}

.lp-tab:first-child {
  margin-left: auto;
}

.lp-tab:last-child {
  margin-right: auto;
}

.lp-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--header-text, #fff);
  opacity: 0.6;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.lp-tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 9px;
  height: 2px;
  background: var(--accent, #fff);
  transform: scaleX(0);
  transition: transform 0.25s;
}

.lp-tab.is-active {
  opacity: 1;
}

/* タブが6つ以上のときは少し詰めて、スマホ幅に収める */
.lp-tabs:has(.lp-tab:nth-child(6)) .lp-tab {
  padding: 0 6px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.lp-tabs:has(.lp-tab:nth-child(6)) .lp-tab::after {
  left: 6px;
  right: 6px;
}

/* 7つ以上はさらに詰める */
.lp-tabs:has(.lp-tab:nth-child(7)) .lp-tab {
  padding: 0 5px;
  font-size: 11.5px;
  letter-spacing: 0;
}

.lp-tabs:has(.lp-tab:nth-child(7)) .lp-tab::after {
  left: 5px;
  right: 5px;
}

.lp-tab.is-active::after {
  transform: scaleX(1);
}

.lp-tab:focus-visible {
  outline: 2px solid var(--accent, #fff);
  outline-offset: -4px;
}

/* ===== スライド領域 ===== */
.lp-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

/* 全セクションのスライドを1本の縦の流れに並べる。
   縦スワイプだけで最初から最後まで進み、タブは各セクションの先頭へのジャンプ */
.lp-sections {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  container-type: size; /* スライドの高さ（100cqh）の基準 */
}

.lp-sections::-webkit-scrollbar {
  display: none;
}

/* セクションはまとまりを示すだけの入れ物 */
.lp-section {
  display: block;
}

.lp-slide {
  position: relative;
  height: 100cqh; /* スクロール領域ちょうど1画面分 */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--slide-bg, #000);
}

.lp-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--fit, contain);
  user-select: none;
  -webkit-user-drag: none;
}

/* ===== ページ番号 ===== */
/* ヘッダーの右端に置き、画像には重ねない */
.lp-header {
  position: relative;
}

.lp-counter {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 5;
  transform: translateY(-50%);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--header-text, #fff);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  pointer-events: none;
}

/* ===== 「次へ」ヒント ===== */
.lp-next {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 5;
  width: 44px;
  height: 32px;
  margin-left: -22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--hint, #fff);
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  animation: lp-bounce 1.6s ease-in-out infinite;
  transition: opacity 0.5s;
}

.lp-next svg {
  width: 100%;
  height: 100%;
}

/* 矢印はスライドが切り替わった直後だけ表示し、数秒で消える（画像の文字を隠さないため） */
.lp-next[hidden],
.lp-next.is-faded {
  display: block;
  opacity: 0;
  pointer-events: none;
}

@keyframes lp-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* ===== CTA ===== */
.lp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--cta-bg, #e2b04a);
  color: var(--cta-text, #fff);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.lp-cta:active {
  transform: translateY(1px);
}

/* 固定CTAはスライドの下に独立した帯として置く（画像の上に重ならない） */
.lp-cta-bar {
  flex: 0 0 auto;
  padding: 10px 16px;
  background: var(--cta-bar-bg, #000);
  z-index: 6;
}

.lp-cta-fixed {
  min-height: 52px;
  box-shadow: none;
  transition: opacity 0.25s;
}

.lp-cta-fixed.is-hidden {
  opacity: 0.25;
  pointer-events: none;
}

.lp-slide-cta {
  position: absolute;
  left: 16px;
  right: 16px;
  z-index: 4;
}

.lp-slide-cta.pos-bottom {
  bottom: 14px;
}

.lp-slide-cta.pos-middle {
  top: 50%;
  transform: translateY(-50%);
}

/* スライド画像全体をリンクにする場合 */
.lp-slide-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== フッター（法務リンク） ===== */
.lp-footer {
  flex: 0 0 var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 8px;
  background: var(--footer-bg, #111);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.lp-footer::-webkit-scrollbar {
  display: none;
}

.lp-footer a {
  color: var(--footer-text, #ccc);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

/* ===== 動きを減らす設定の人向け ===== */
@media (prefers-reduced-motion: reduce) {
  .lp-next {
    animation: none;
  }
  .lp-tab::after,
  .lp-cta-fixed,
  .lp-next {
    transition: none;
  }
}

/* ===== 法務ページ ===== */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  background: #fff;
  color: #222;
  min-height: 100%;
  line-height: 1.8;
  font-size: 15px;
}

.legal h1 {
  font-size: 20px;
  margin: 8px 0 24px;
}

.legal h2 {
  font-size: 16px;
  margin: 28px 0 8px;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.legal th,
.legal td {
  word-break: auto-phrase; /* 表の短い項目は文節で折り返す（対応ブラウザのみ） */
}

.legal td {
  overflow-wrap: anywhere; /* 長いメールアドレスやURLを枠内で折り返す */
}

.legal th,
.legal td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e5e5;
  text-align: left;
  vertical-align: top;
}

.legal th {
  width: 8em;
  color: #555;
  font-weight: 600;
}

/* 途中で改行させたくない語句は <span class="nb"> で囲む */
.legal .nb {
  display: inline-block;
}

.legal .legal-item {
  margin: 0 0 12px;
}

.legal .legal-item:last-child {
  margin-bottom: 0;
}

.legal .legal-indent {
  display: inline-block;
  padding-left: 1em;
  color: #555;
}

.legal .legal-date {
  margin-top: 32px;
  color: #555;
  font-size: 14px;
  text-align: right;
}

.legal p {
  margin: 0 0 10px;
}

.legal-back {
  display: inline-block;
  margin-bottom: 8px;
  color: #555;
  font-size: 14px;
}

body.legal-page {
  background: #f4f4f4;
}
