/* geo_webview docs — 共有スタイル(全ページ共通)
   kasugai_canvas ドキュメントサイト(style.css)に合わせた配色・雰囲気 */
:root {
  --accent: #667eea; --accent2: #764ba2; --deep: #4a3d8f;
  --ink: #333; --muted: #555; --line: #e0e0e0; --bg-soft: #f8f9fa;
  --green: #28a745;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP',
    'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  color: var(--ink); min-height: 100vh; font-size: 15px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%) fixed;
  padding: 20px 20px 20px 288px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- サイドバー ---------- */
nav.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
  width: 268px; padding: 22px 14px 40px;
  background: #fff; border-right: 1px solid var(--line);
  overflow-y: auto; font-size: .92em;
  box-shadow: 2px 0 12px rgba(0, 0, 0, .06);
}
nav.sidebar .site {
  font-weight: 700; font-size: 15px; margin: 0 8px 14px;
  padding-bottom: 12px; border-bottom: 2px solid var(--line);
  color: var(--accent); letter-spacing: .02em;
}
nav.sidebar .site a {
  display: inline; padding: 0; font-size: inherit; color: inherit;
  border-radius: 0;
}
nav.sidebar .site a:hover { background: none; text-decoration: underline; }
nav.sidebar a {
  display: block; padding: 6px 10px; border-radius: 6px;
  color: #33424d; text-decoration: none; font-size: 13.5px;
}
nav.sidebar a:hover { background: #e8ecff; color: var(--accent); }
nav.sidebar a.active { background: var(--accent); color: #fff; font-weight: 600; }
nav.sidebar a.sub {
  padding: 4px 8px 4px 26px; font-size: 12.5px; color: #4d5f6b;
  border-left: 2px solid var(--line); margin-left: 12px;
  border-radius: 0 6px 6px 0;
}
nav.sidebar a.sub:hover { border-left-color: var(--accent); }
nav.sidebar a.ext { color: #6b7a85; }
nav.sidebar a.ext::after { content: " ↗"; font-size: 11px; }

/* ---------- 本文 ---------- */
main {
  display: block; max-width: 960px; margin: 0 auto;
  padding: 40px 40px 72px; line-height: 1.7;
  background: #fff; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
h1 { font-size: 1.6em; margin-top: 0; line-height: 1.4; }
main > h1 {
  font-size: 1.3em; padding: 10px 14px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
h2 {
  font-size: 1.35em; color: #333; margin: 36px 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
h3 { font-size: 1.2em; color: #444; margin: 28px 0 10px; }
h4 { font-size: 1.05em; color: #555; margin: 20px 0 8px; }
h1[id], h2[id], h3[id], h4[id] { scroll-margin-top: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: #222; }
code {
  background: #f4f4f4; padding: 2px 6px; border-radius: 4px; font-size: .9em;
  font-family: 'Fira Code', Consolas, 'Lucida Console', monospace;
}
pre {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 16px; overflow-x: auto; line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; }
table {
  border-collapse: collapse; width: 100%; font-size: .92em; margin: 14px 0;
  border: 1px solid var(--line); display: block; overflow-x: auto;
}
th, td {
  border: 1px solid var(--line); padding: 8px 12px; text-align: left;
  vertical-align: top;
}
th { background: #f4f4f4; color: #333; font-weight: 600; white-space: nowrap; }
table.matrix th:not(:first-child),
table.matrix td:not(:first-child) { text-align: center; }
blockquote {
  margin: 14px 0; padding: 10px 18px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); color: #555; border-radius: 0 8px 8px 0;
}
img { max-width: 100%; height: auto; }
figure.shot { margin: 24px 0; text-align: center; }
figure.shot img, figure.shot video {
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
figure.shot video { display: inline-block; max-width: 100%; max-height: 75vh; }
figure.shot figcaption { margin-top: 8px; font-size: .82em; color: var(--muted); }
.mermaid { text-align: center; margin: 18px 0; }
.lead { color: var(--muted); font-size: .95em; }
.ver-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .72em; font-weight: 600; vertical-align: middle;
  background: var(--green); color: #fff;
  white-space: nowrap;
}
nav.sidebar .ver-badge { margin-left: 6px; font-size: 11px; padding: 1px 8px; }

/* ---------- index: ヒーロー + 3本柱 ---------- */
.hero {
  padding: 32px 30px; border-radius: 12px; color: #fff; margin-bottom: 26px;
  background: linear-gradient(135deg, var(--deep) 0%, var(--accent) 55%, var(--accent2) 100%);
  text-align: center;
}
.hero h1 { border: 0; margin: 0 0 10px; color: #fff; }
.hero p { margin: 0; opacity: .95; font-size: .97em; }
.hero code { background: rgba(255, 255, 255, .18); color: #fff; }
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin: 22px 0 30px;
}
.pillars a {
  display: block; padding: 20px; background: var(--bg-soft);
  border-left: 4px solid var(--accent); border-radius: 8px;
  text-decoration: none; color: var(--ink);
  transition: box-shadow .2s, transform .2s;
}
.pillars a:hover {
  box-shadow: 0 8px 20px rgba(102, 126, 234, .15); transform: translateY(-2px);
}
.pillars b { display: block; color: var(--accent); margin-bottom: 10px; font-size: 1.04em; }
.pillars span { font-size: .9em; color: var(--muted); line-height: 1.6; }

/* ---------- ページャー ---------- */
.pager {
  display: flex; justify-content: space-between; margin-top: 44px;
  border-top: 1px solid var(--line); padding-top: 14px; font-size: .92em;
}
.pager a {
  text-decoration: none; padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 8px;
}
.pager a:hover { background: var(--bg-soft); }
.pager .next { margin-left: auto; }

/* ---------- レスポンシブ / 印刷 ---------- */
@media (max-width: 860px) {
  body { padding: 12px; }
  nav.sidebar {
    position: static; width: auto; height: auto; border-right: 0;
    border-radius: 12px; margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  }
  .pillars { grid-template-columns: 1fr; }
  main { padding: 24px 18px 56px; }
  .hero { padding: 26px 20px; }
}
@media print {
  body { padding: 0; background: #fff; }
  nav.sidebar, .pager { display: none; }
  main { max-width: none; padding: 0; border-radius: 0; box-shadow: none; }
}
