/* =====================================================================
   legal.css — 法務ページ・料金ページ
   ---------------------------------------------------------------------
   読み込み順: style.css → theme.css → legal.css
   色は theme.css の変数だけを使う。ここで色を直書きしない
   （直書きするとダークテーマで文字が読めなくなる）。

   【この種のページの決めごと】
   - 読ませることが目的なので、行間を広く、1行を短く。
   - 重要な条件は「太字」だけで示す。色を足すと、印刷とダークテーマで消える。
   - 表は狭い画面で横スクロールさせず、縦に積み替える。
     横スクロールする表は、スマホでは実質「読めない」。
   ===================================================================== */

/* =====================================================================
   1. 文書の枠
   ===================================================================== */
.lg-doc {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 24px 20px 80px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 2.0;
  /* ★日本語の禁則。緩めると句読点が行頭に来る */
  line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ---- パンくず ---------------------------------------------------------- */
.lg-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 20px; padding: 0; list-style: none;
  font-size: 12px; color: var(--text-tertiary);
}
.lg-crumbs li { display: flex; align-items: center; gap: 6px; }
.lg-crumbs li + li::before { content: '/'; color: var(--text-tertiary); }
.lg-crumbs a { color: var(--text-secondary); text-decoration: none; }
.lg-crumbs a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* ---- 見出し ------------------------------------------------------------ */
.lg-doc__head { margin: 0 0 28px; }
.lg-doc__title {
  margin: 0 0 10px;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800; line-height: 1.45; letter-spacing: -.01em;
}
.lg-doc__lead {
  margin: 0 0 8px;
  font-size: 14px; line-height: 2.0; color: var(--text-secondary);
}
.lg-doc__meta {
  display: block;
  font-size: 12px; color: var(--text-tertiary);
}

.lg-doc h2 {
  margin: 44px 0 12px; padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 18px; font-weight: 800; line-height: 1.55;
  /* リンク先アンカーで飛んだときに見出しが隠れないようにする */
  scroll-margin-top: 76px;
}
.lg-doc h3 {
  margin: 26px 0 8px;
  font-size: 15px; font-weight: 800; line-height: 1.6;
  scroll-margin-top: 76px;
}
.lg-doc p { margin: 0 0 14px; }
.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 1.4em; }
.lg-doc li { margin-bottom: 8px; }
.lg-doc a { color: var(--primary-dark); text-underline-offset: 3px; }
.lg-doc a:hover { color: var(--primary); }
.lg-doc strong { font-weight: 800; }
.lg-doc small { font-size: 12px; line-height: 1.9; }

.lg-muted { color: var(--text-secondary); }
.lg-muted small { color: var(--text-tertiary); }

/* ---- 条項番号 ---------------------------------------------------------- */
.lg-clause { margin: 0 0 18px; }
.lg-clause > ol { counter-reset: none; }
.lg-num {
  display: inline-block; min-width: 2.2em;
  font-weight: 800; color: var(--text-secondary);
}

/* =====================================================================
   2. 目次
   ===================================================================== */
.lg-toc {
  margin: 0 0 32px; padding: 16px 18px;
  border: 1px solid var(--border-color); border-radius: 14px;
  background: var(--bg-secondary);
}
.lg-toc__title {
  margin: 0 0 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--text-tertiary);
}
.lg-toc ol, .lg-toc ul {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 4px;
}
@media (min-width: 620px) { .lg-toc ol, .lg-toc ul { grid-template-columns: 1fr 1fr; } }
.lg-toc li { margin: 0; }
.lg-toc a {
  display: block; padding: 4px 0;
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
}
.lg-toc a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   3. 注記・注意書き
   ===================================================================== */
.lg-callout {
  margin: 0 0 20px; padding: 16px 18px;
  border: 1px solid var(--border-color); border-left: 3px solid var(--primary);
  border-radius: 12px;
  background: var(--bg-secondary);
}
.lg-callout__title {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 800;
}
.lg-callout p:last-child, .lg-callout ul:last-child { margin-bottom: 0; }

.lg-notice {
  margin: 0 0 20px; padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--warning) 40%, var(--border-color));
  border-left: 3px solid var(--warning);
  border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 7%, var(--bg-primary));
}
.lg-notice p:last-child { margin-bottom: 0; }

/* ★未記入の印。目立たせて、公開前に必ず気づけるようにする。
   （埋め終わったら <span class="lg-todo"> ごと消す） */
.lg-todo {
  display: inline-block;
  padding: 1px 8px; margin: 0 2px;
  border: 1px dashed var(--danger); border-radius: 6px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
  font-size: 12px; font-weight: 700; line-height: 1.7;
}

/* =====================================================================
   4. 表
   ---------------------------------------------------------------------
   ★狭い画面では行ごとに縦へ積み替える。
     横スクロールする表は、スマホでは読まれない。
   ===================================================================== */
.lg-table {
  width: 100%;
  margin: 0 0 22px;
  border-collapse: collapse;
  border: 1px solid var(--border-color); border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}
.lg-table caption {
  padding: 0 0 8px;
  font-size: 13px; font-weight: 800; text-align: left; color: var(--text-secondary);
}
.lg-table th, .lg-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  text-align: left; vertical-align: top; line-height: 1.9;
}
.lg-table thead th {
  background: var(--bg-secondary);
  font-size: 12px; font-weight: 800; color: var(--text-secondary);
  letter-spacing: .02em;
}
.lg-table th[scope="row"] {
  width: 34%;
  background: var(--bg-secondary);
  font-weight: 700; color: var(--text-secondary);
}
.lg-table tr:last-child th, .lg-table tr:last-child td { border-bottom: 0; }

@media (max-width: 640px) {
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table th, .lg-table td { display: block; width: auto; }
  .lg-table thead { display: none; }
  .lg-table tr {
    border-bottom: 1px solid var(--border-color);
    padding: 4px 0;
  }
  .lg-table tr:last-child { border-bottom: 0; }
  .lg-table th[scope="row"] {
    width: auto; padding: 10px 14px 2px;
    background: transparent; border-bottom: 0;
    font-size: 12px; color: var(--text-tertiary);
  }
  .lg-table td { padding: 0 14px 12px; border-bottom: 0; }
}

/* 比較表だけは横スクロールを許す（列が多く、積み替えると意味が壊れるため） */
.lg-compare-wrap {
  margin: 0 0 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color); border-radius: 12px;
}
.lg-compare { min-width: 560px; margin: 0; border: 0; border-radius: 0; }
.lg-compare th, .lg-compare td { white-space: nowrap; }
.lg-compare th[scope="row"] { white-space: normal; }
@media (max-width: 640px) {
  .lg-compare, .lg-compare tbody, .lg-compare tr, .lg-compare th, .lg-compare td { display: revert; }
  .lg-compare thead { display: revert; }
}

/* できる／できない */
.lg-yes, .lg-no { font-weight: 800; }
.lg-yes { color: var(--success); }
.lg-no  { color: var(--text-tertiary); }
/* ★色だけに頼らない。記号でも区別できるようにする */
.lg-yes::before { content: '○ '; }
.lg-no::before  { content: '− '; }

/* =====================================================================
   5. よくある質問
   ===================================================================== */
.lg-faq { display: grid; gap: 8px; margin: 0 0 24px; }
.lg-faq > details {
  border: 1px solid var(--border-color); border-radius: 12px;
  background: var(--bg-primary);
  overflow: hidden;
}
.lg-faq > details > summary {
  position: relative;
  padding: 14px 44px 14px 16px;
  font-size: 14px; font-weight: 800; line-height: 1.75;
  cursor: pointer; list-style: none;
}
.lg-faq > details > summary::-webkit-details-marker { display: none; }
.lg-faq > details > summary::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  width: 10px; height: 10px; margin-top: -6px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  rotate: 45deg;
  transition: rotate .2s ease;
}
.lg-faq > details[open] > summary::after { rotate: -135deg; margin-top: -2px; }
.lg-faq__body {
  padding: 0 16px 14px;
  font-size: 14px; line-height: 2.0; color: var(--text-secondary);
}
.lg-faq__body p:last-child { margin-bottom: 0; }

/* =====================================================================
   6. 料金ページ
   ===================================================================== */
.lg-pricing { width: min(100%, 1080px); margin: 0 auto; padding: 24px 20px 80px; }

.lg-hero {
  margin: 0 0 36px;
  text-align: center;
}
.lg-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 6vw, 36px); font-weight: 800; letter-spacing: -.015em;
}
.lg-hero p {
  margin: 0 auto; max-width: 42em;
  font-size: 15px; line-height: 2.0; color: var(--text-secondary);
}

.lg-plans {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-items: stretch;
  margin: 0 0 40px;
  padding-top: 14px;   /* 「おすすめ」帯のはみ出しぶん */
}
@media (min-width: 600px) and (max-width: 959px) {
  .lg-plans { grid-template-columns: 1fr 1fr; }
}

.lg-plan {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px 20px;
  border: 1px solid var(--border-color); border-radius: 18px;
  background: var(--bg-primary);
}
.lg-plan--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-md);
}
.lg-plan__tag {
  position: absolute; left: 50%; top: -12px; translate: -50% 0;
  padding: 4px 12px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; white-space: nowrap;
}
.lg-plan__name { margin: 0; font-size: 15px; font-weight: 800; }
.lg-plan__price { display: flex; align-items: baseline; gap: 2px; margin: 0; }
.lg-plan__amount {
  font-size: 30px; font-weight: 800; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.lg-plan__unit { font-size: 12px; color: var(--text-tertiary); }
.lg-plan__yearly { margin: 0; font-size: 12px; color: var(--text-tertiary); }
.lg-plan__for {
  margin: 0; padding: 8px 10px;
  border-radius: 10px; background: var(--bg-secondary);
  font-size: 12px; line-height: 1.8; color: var(--text-secondary);
}
.lg-plan__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 7px; flex: 1 1 auto;
}
.lg-plan__list li {
  position: relative; padding-left: 18px;
  font-size: 13px; line-height: 1.85; color: var(--text-secondary);
}
.lg-plan__list li::before {
  content: ''; position: absolute; left: 2px; top: 9px;
  width: 8px; height: 5px;
  border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
  rotate: -45deg;
}

/* ---- ポイントパック ------------------------------------------------------ */
.lg-packs {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0 0 32px;
}
.lg-pack {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 12px;
  border: 1px solid var(--border-color); border-radius: 14px;
  background: var(--bg-primary);
}
.lg-pack__n { font-size: 18px; font-weight: 800; }
.lg-pack__p { font-size: 15px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.lg-pack__u { font-size: 11px; color: var(--text-tertiary); }

/* ---- ポイントの使い道 ---------------------------------------------------- */
.lg-credits {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 0 0 32px;
}
.lg-credit {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border-color); border-radius: 12px;
  background: var(--bg-secondary);
}
.lg-credit__t { font-size: 13px; font-weight: 700; }
.lg-credit__c {
  font-size: 18px; font-weight: 800; color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   7. ボタン・関連ページ
   ===================================================================== */
.lg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border: 1px solid var(--border-color); border-radius: 999px;
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 14px; font-weight: 800; text-decoration: none;
  transition: background .14s ease, box-shadow .2s ease;
}
.lg-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.lg-btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent; box-shadow: var(--shadow-md);
}
.lg-btn--primary:hover { color: #fff; box-shadow: var(--shadow-lg); }

.lg-docnav {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  margin-top: 44px; padding-top: 20px;
  border-top: 1px solid var(--border-color);
}
.lg-docnav a { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.lg-docnav a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   8. 印刷
   ---------------------------------------------------------------------
   ★規約は印刷して保存されることがある。読める形で出す。
   ===================================================================== */
@media print {
  .header, .footer, .lg-crumbs, .lg-docnav, .theme-toggle { display: none; }
  .lg-doc { width: auto; max-width: none; padding: 0; font-size: 11pt; line-height: 1.8; }
  .lg-doc h2 { page-break-after: avoid; }
  .lg-table { page-break-inside: avoid; }
  .lg-faq > details { page-break-inside: avoid; }
  .lg-faq > details > summary::after { display: none; }
  /* 折りたたみの中身も必ず出す */
  .lg-faq > details > .lg-faq__body { display: block !important; }
  .lg-todo { border-color: #000; color: #000; background: transparent; }
  a[href^="/"]::after { content: ' (https://link-card.online' attr(href) ')'; font-size: 9pt; }
}

/* =====================================================================
   9. 動きを減らす設定
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .lg-faq > details > summary::after { transition: none; }
  .lg-btn { transition: none; }
}
