/*
  規約ページ（/privacy・/terms）・問い合わせページ・単語リスト出典ページ（/wordlist）の共有スタイル。
  設計・経緯: docs/superpowers/specs/ ではなく issue #173（docs/release-readiness.md 項目 2）。

  ここは SPA（React + LIFF）に相乗りさせない。/app と同じ理由:
  ブラウザで開いただけで LIFF ブートが走ると無意味に重く、失敗すると真っ白になる。
  プライバシーポリシー URL は App Store Connect の必須入力であり、Apple のレビュアーも
  URL 検証も「ただ GET するだけ」なので、依存ゼロで即表示できる実ファイルにしてある。
  public/ の実ファイルは CF Pages が SPA ルーティングより優先配信する。

  /app（web/public/app/index.html）はスタイルをインラインで複製しているが、あちらは
  「1枚で完結」が目的。こちらは 2 枚あるので 1 ファイルに切り出して共有している。
  そのため theme.css は読み込めず（バンドルがハッシュ付きで出力される）、必要なトークンだけ
  下に複製している。意図的な重複 — theme.css を変えたらここも見ること。
*/

:root {
  --app-bg: #f3f5ff;
  --ink: #2a2d55;
  --muted: #5a64a7;
  --hairline: #dde2f8;
  --blue: #3d7bff;
}

/* 項（1.）と号（（1））で marker を変える。号は decimal では親と見分けが付かない。
   @counter-style 非対応ブラウザは直前の decimal にフォールバックする。 */
@counter-style kc-paren {
  system: extends decimal;
  prefix: "（";
  suffix: "）";
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fbfcff;
  color: var(--ink);
  /* /app と同じ順。iPhone は Hiragino が当たる（Zen Maru Gothic は Android 用） */
  font-family: -apple-system, "Hiragino Maru Gothic ProN", "BIZ UDPGothic", sans-serif;
  font-size: 15px;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

/* ── 共通ヘッダー ── */

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 4px 2px 14px;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.legal-brand img {
  flex: 0 0 auto;
  margin-right: 9px;
  border-radius: 9px;
}

.legal-brand-en {
  font-family: ui-rounded, "Arial Rounded MT Bold", -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.legal-brand-ja {
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.legal-home {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.legal-brand:hover .legal-brand-en,
.legal-home:hover { color: var(--blue); }

/* ── 本体カード ── */

.legal-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px 22px 32px;
}

.legal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0 58%, #e5385f 58% 82%, #ffd85a 82%);
}

.doc h1 {
  font-size: 22px;
  line-height: 1.5;
  margin: 0 0 4px;
}

.doc .subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 22px;
}

.doc h2 {
  font-size: 17px;
  line-height: 1.6;
  margin: 34px 0 12px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}

/* 前文の直後の最初の見出しは、区切り線が二重に見えるので上罫を出さない */
.doc .lead + h2 { border-top: none; padding-top: 0; margin-top: 26px; }

.doc p { margin: 12px 0; }

.doc a { color: var(--blue); }

.doc strong { font-weight: 700; }

/* ── 問い合わせ ── */

.contact-card { max-width: 600px; margin: 0 auto; }

.contact-card h1,
.sent-card h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.5;
}

.contact-eyebrow {
  margin: 0 0 2px;
  color: #b9284a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.contact-lead { margin: 10px 0 20px; color: var(--muted); }

.contact-note {
  margin: 0 0 24px;
  padding: 14px 16px;
  background: #fff8d9;
  border-left: 4px solid #ffd85a;
  border-radius: 4px 14px 14px 4px;
  font-size: 13.5px;
  line-height: 1.7;
}

.contact-note p { margin: 3px 0 0; }

.contact-form { display: grid; gap: 20px; }

.form-field { display: grid; gap: 7px; }

.form-field label { font-size: 14px; font-weight: 700; }

.required-mark,
.optional-mark {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.7;
  vertical-align: 1px;
}

.required-mark { background: #ffe8ef; color: #b9284a; }
.optional-mark { background: var(--app-bg); color: var(--muted); }

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid #bfc7eb;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
}

.form-field input,
.form-field select { min-height: 48px; padding: 9px 12px; }
.form-field textarea { min-height: 180px; padding: 11px 12px; resize: vertical; }

.form-hint,
.form-error,
.form-status { margin: 0; font-size: 12px; line-height: 1.6; }

.form-hint { color: var(--muted); }
.form-error { color: #b9284a; font-weight: 700; }
.form-status { min-height: 1.6em; color: var(--ink); }

.contact-submit {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.contact-submit:disabled { opacity: 0.45; cursor: not-allowed; }

.honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.sent-card {
  max-width: 520px;
  margin: 56px auto 0;
  text-align: center;
}

.sent-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  background: #fff8d9;
  color: #b9284a;
  font-size: 28px;
  font-weight: 800;
}

.sent-home { margin-top: 24px; padding: 13px 18px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ── リスト ── */

.doc ol, .doc ul { margin: 12px 0; padding-left: 1.6em; }
.doc li { margin: 6px 0; }
.doc li > ol, .doc li > ul { margin: 6px 0; }

/* 号（第2階層の ol）。decimal を先に置いて非対応ブラウザのフォールバックにする */
.doc li > ol {
  list-style-type: decimal;
  list-style-type: kc-paren;
}

.doc li::marker { color: var(--muted); font-weight: 700; }

/* ── 要点（プライバシーポリシー冒頭） ── */

.summary {
  background: var(--app-bg);
  border-radius: 16px;
  padding: 18px 18px 20px;
  margin: 22px 0 8px;
}

.summary h2 {
  border-top: none;
  padding-top: 0;
  margin: 0 0 10px;
  font-size: 15px;
}

.summary p { margin: 10px 0; font-size: 14px; }
.summary ul { margin: 12px 0; padding-left: 1.3em; }
.summary li { font-size: 14px; }

/* ── 表 ── */

/* 表は横に長くなりうるので、この中だけをスクロールさせる（body は横スクロールさせない） */
.table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--hairline);
  border-radius: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 380px;
  font-size: 13.5px;
  line-height: 1.7;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}

thead th {
  background: var(--app-bg);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

/* 事業者情報のような 2 列の定義表は min-width を外して折り返させる。
   横スクロールは列が多い表のためのもので、ここに効かせると
   「住所を読むのに横スクロールが要る」という一番まずい形になる（375px で実際にそうなった）。 */
.table-wrap.kv table { min-width: 0; }
.table-wrap.kv th { white-space: nowrap; }

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: none; }

/* ── 奥付 ── */

.colophon {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 13px;
}

.colophon p { margin: 4px 0; }

/* ── ページ間の導線 ── */

.site-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--blue); }
.site-foot span { color: var(--hairline); padding: 0 8px; }

/* ── 印刷 ── */

@media print {
  body { background: #fff; font-size: 11pt; }
  .legal-header, .site-foot { display: none; }
  .legal-card { border: none; border-radius: 0; padding: 0; }
  .legal-card::before { display: none; }
  .table-wrap { overflow: visible; }
}

@media (max-width: 520px) {
  .page { padding-top: 12px; }
  .legal-header { gap: 8px; }
  .legal-brand { flex: 1 1 auto; }
  .legal-brand img { margin-right: 6px; }
  .legal-brand-en { font-size: 18px; }
  .legal-brand-ja {
    min-width: 0;
    margin-left: 5px;
    font-size: 10px;
    line-height: 1.25;
    white-space: normal;
  }
  .legal-home { font-size: 12px; }
  .legal-card { padding: 26px 18px 28px; }
  .sent-card { margin-top: 28px; }
}

@media (max-width: 340px) {
  .page { padding-right: 10px; padding-left: 10px; }
  .legal-header { gap: 6px; }
  .legal-brand img { width: 28px; height: 28px; margin-right: 5px; }
  .legal-brand-en { font-size: 17px; }
  .legal-brand-ja { margin-left: 4px; font-size: 9px; }
  .legal-home { font-size: 11px; }
}
