/* =====================================================================
   鉄腕PDF 公開ページ（法務文書・文書の一覧）のスタイル
   ヘッダー・フッターの形と文書の型は、ぺぺろん工房のサイト全体で共通の
   見た目（https://www.peperon-works.jp/assets/site.css、元は
   peperon-works-router の src/site-style.js）にそろえ、ここでは鉄腕PDFの
   色（紺と赤）と、表・引用・コードなど文書の細かい部分だけを決める。
   影・グラデーション・マウスを重ねたときの浮き上がりは使わない。
   ===================================================================== */

:root {
  --navy-950: #08132b;
  --navy-900: #0e1c3a;
  --red-600:  #d6222e;
  --red-700:  #b51a25;
  --on-navy:  #ffffff;
  --on-navy-muted: #d5dcea;

  --paper: #ffffff;
  --paper-alt: #f3f4f7;
  --ink: #111111;
  --text: #16191f;
  --text-muted: #4a5263;
  --line: #111111;
  --line-soft: #c9ced8;
  --accent-ink: var(--red-700);

  /* Windows 10（2018年10月の更新）以降に入っている BIZ UDPゴシックを使い、無ければ OS の書体にする */
  --font: "BIZ UDPGothic", "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;

  --rule: 4px;
  --rule-thin: 2px;

  --content-max: 760px;
  --container-max: 1120px;
}
:root:lang(en) {
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy-900: #13254a;
    --paper: #0b1222;
    --paper-alt: #111a30;
    --ink: #eef1f7;
    --text: #e6eaf2;
    --text-muted: #a7b0c4;
    --line: #dfe4ee;
    --line-soft: #2e3a58;
    --accent-ink: #ff7d85;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
/* 日本語は、言葉の途中で折り返さない（Chrome・Edge が対応）。1つの言葉が行に収まらないときだけ、途中で折り返す */
:lang(ja) body { word-break: auto-phrase; overflow-wrap: break-word; }
p, li, dd { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--red-600); outline-offset: 2px; }

/* ---------- ヘッダーとフッター（形は site.css、色は鉄腕PDF） ---------- */
:root {
  --pw-font: var(--font);
  --pw-accent: var(--red-600);
  --pw-bar-bg: var(--navy-900);
  --pw-bar-fg: var(--on-navy);
  --pw-bar-line: rgb(255 255 255 / .16);
  --pw-foot-bg: var(--navy-950);
}
.pw-header { position: sticky; top: 0; z-index: 10; }
.pw-footer { margin-top: 80px; }

/* ---------- 本文 ---------- */
.content {
  width: min(var(--content-max), 100% - 32px);
  margin-inline: auto;
  padding: 64px 0 32px;
}

.content h1, .content h2, .content h3, .content h4 {
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  word-break: auto-phrase;
  text-wrap: balance;
}
.content h1 {
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
  margin: 0 0 28px;
}
/* 見出しの下の赤い帯（販売ページの商品名の下と同じ印） */
.content h1::after {
  content: "";
  display: block;
  width: 72px; height: 6px;
  margin-top: 20px;
  background: var(--red-600);
}
.content h2 {
  font-size: 1.3rem;
  margin: 56px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}
.content h3 {
  font-size: 1.08rem;
  margin: 32px 0 10px;
}
.content h4 {
  font-size: 1rem;
  margin: 22px 0 8px;
}
.content p { margin: 0 0 16px; }
.content a { color: var(--accent-ink); text-underline-offset: 3px; }
.content a:hover { text-decoration-thickness: 2px; }

.content ul, .content ol { padding-left: 1.6em; margin: 0 0 16px; }
.content li { margin: 6px 0; }
.content ul > li::marker { color: var(--red-600); }

.content strong { font-weight: 700; color: var(--ink); }

.content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border: var(--rule-thin) solid var(--line);
  border-left: 8px solid var(--red-600);
  background: var(--paper-alt);
}
.content blockquote p:last-child { margin-bottom: 0; }

.content code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--paper-alt);
  border: 1px solid var(--line-soft);
  padding: 1px 5px;
}
.content pre {
  background: var(--paper-alt);
  border: var(--rule-thin) solid var(--line);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 18px 0;
}
.content pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.55;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: .95rem;
  border: 1px solid var(--line-soft);
}
.content th, .content td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.content tr:last-child th,
.content tr:last-child td { border-bottom: 0; }
.content th { font-weight: 700; color: var(--ink); background: var(--paper-alt); }
.content thead th {
  background: var(--ink); color: var(--paper);
  border-bottom: 0;
}
.content tbody th { width: 30%; }
/* 長い英数字（パッケージ名・版番号）も必要なときだけ折り返せるようにする。
   折り返せない文字列が列の幅を占め、ほかの列（ライセンスの名前など）が何行にも折り返すのを防ぐ */
.content th, .content td { overflow-wrap: anywhere; }

.content hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 40px 0;
}
/* 次の見出しに線があるときは、区切り線を重ねない */
.content hr:has(+ h2) { display: none; }

/* ---------- 文書の一覧（docs.html） ---------- */
.content ul.toc {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  border: var(--rule-thin) solid var(--line);
}
.content ul.toc li {
  margin: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: baseline; gap: 12px;
}
.content ul.toc li:first-child { border-top: 0; }
.content ul.toc li::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--red-600);
  flex: none;
}
.content ul.toc li a { font-weight: 700; flex-shrink: 0; }
.content ul.toc .src {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ---------- 法務文書の見出しの上の札 ---------- */
.section-legal .content h1::before {
  content: "法務文書";
  display: table;
  margin-bottom: 18px;
  padding: 2px 10px;
  border: 1.5px solid currentColor;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
}

/* ---------- 狭い画面 ---------- */
@media (max-width: 640px) {
  .content { padding-top: 36px; }
  .content h2 { font-size: 1.2rem; margin-top: 44px; }
  .content table { font-size: .88rem; }
  /* 版番号などの長い英数字も折り返し、表が画面の幅からはみ出さないようにする */
  .content th, .content td { padding: 9px 10px; overflow-wrap: anywhere; }
  .content tbody th { width: auto; }
  /* 1列目の項目名が1〜2文字ずつで折り返さないようにする */
  .content td:first-child { min-width: 6.5em; }
}
