/* =========================================================
   八木橋正覚 公式プロフィール（百科事典風）スタイルシート
   ========================================================= */

:root {
  --bg: #f6f6f6;
  --page: #ffffff;
  --text: #202122;
  --muted: #54595d;
  --link: #3366cc;
  --link-visited: #6b4ba1;
  --border: #a2a9b1;
  --border-light: #c8ccd1;
  --box: #f8f9fa;
  --infobox-head: #cedff2;
  --win: #d4f5d4;
  --loss: #fcd9d9;
  --serif: "Linux Libertine", "Georgia", "Times", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
          "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }

/* ---------- ヘッダー ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: var(--page);
  border-bottom: 1px solid var(--border-light);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.site-logo:visited { color: var(--text); }
.site-logo:hover { text-decoration: none; }
.site-logo .mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--text);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: bold;
  font-size: 18px;
}
.site-logo .name { font-family: var(--serif); font-size: 18px; line-height: 1.2; }
.site-logo .name small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.site-header nav a { margin-left: 16px; font-size: 14px; }

/* ---------- レイアウト ---------- */
.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  max-width: 1280px;
  margin: 0 auto;
}

.sidebar {
  padding: 24px 16px;
  font-size: 13px;
}
.sidebar h2 {
  font-size: 12px;
  color: var(--muted);
  font-weight: normal;
  border-bottom: 1px solid var(--border-light);
  margin: 20px 0 6px;
  padding-bottom: 2px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 3px 0; }
.sidebar .toc-side li.sub { padding-left: 12px; }

.content {
  background: var(--page);
  border: 1px solid var(--border-light);
  border-top: none;
  padding: 20px 32px 40px;
  min-height: 100vh;
}

/* ---------- 記事ヘッダー ---------- */
.article-title {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 1.9rem;
  line-height: 1.3;
  margin: 0 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.tagline {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 16px;
}

/* ---------- 本文 ---------- */
.body-text { font-size: 15px; }
.body-text p { margin: 0.5em 0 1em; }

.body-text h2 {
  font-family: var(--serif);
  font-weight: normal;
  font-size: 1.5rem;
  margin: 1.4em 0 0.3em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border);
  clear: both;
}
.body-text h3 {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 1.2em 0 0.3em;
}

sup.ref { font-size: 0.72em; line-height: 0; white-space: nowrap; }
sup.ref a { padding: 0 1px; }

/* ---------- インフォボックス ---------- */
.infobox {
  float: right;
  clear: right;
  width: 300px;
  margin: 0 0 16px 20px;
  background: var(--box);
  border: 1px solid var(--border);
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}
.infobox caption {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: bold;
  padding: 6px 4px 2px;
}
.infobox .photo td {
  text-align: center;
  padding: 8px;
}
.infobox .photo .placeholder {
  display: grid;
  place-items: center;
  height: 200px;
  background: #eaecf0;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--border);
}
.infobox .photo img { max-width: 100%; height: auto; }
.infobox .photo figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.infobox .section-head th {
  background: var(--infobox-head);
  text-align: center;
  padding: 4px;
}
.infobox th[scope="row"] {
  text-align: left;
  vertical-align: top;
  width: 34%;
  padding: 4px 6px;
  font-weight: bold;
}
.infobox td { padding: 4px 6px; vertical-align: top; }
.infobox tr + tr th, .infobox tr + tr td { border-top: 1px solid #eaecf0; }

/* ---------- 目次 ---------- */
.toc {
  display: inline-block;
  background: var(--box);
  border: 1px solid var(--border);
  padding: 8px 16px 10px;
  font-size: 13px;
  margin: 8px 0 16px;
}
.toc-title { text-align: center; font-weight: bold; margin-bottom: 4px; }
.toc ol { margin: 0; padding-left: 0; list-style: none; counter-reset: item; }
.toc li { counter-increment: item; }
.toc li::before { content: counters(item, ".") " "; color: var(--text); margin-right: 4px; }
.toc ol ol { padding-left: 1.5em; }

/* ---------- 汎用テーブル ---------- */
.wikitable {
  border-collapse: collapse;
  background: var(--box);
  border: 1px solid var(--border);
  margin: 0.8em 0 1.2em;
  font-size: 14px;
}
.wikitable th, .wikitable td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  vertical-align: top;
}
.wikitable th { background: #eaecf0; text-align: center; }
.wikitable td.center { text-align: center; }
.wikitable tr.win td:first-child { background: var(--win); }
.wikitable tr.loss td:first-child { background: var(--loss); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.record-summary th, .record-summary td { text-align: center; min-width: 56px; }

/* ---------- リスト・脚注 ---------- */
.body-text ul { padding-left: 1.6em; }
.body-text li { margin: 0.2em 0; }

.references { font-size: 13px; padding-left: 2em; }
.references li { margin: 0.3em 0; }
.references li:target { background: #eaf3ff; }
.references .backlink { font-weight: bold; margin-right: 4px; }

/* ---------- カテゴリ・フッター ---------- */
.catlinks {
  clear: both;
  margin-top: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--box);
  font-size: 13px;
}
.catlinks ul { display: inline; margin: 0; padding: 0; }
.catlinks li { display: inline; }
.catlinks li + li::before { content: " | "; color: var(--muted); }

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 32px 232px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .content { padding: 16px; border-left: none; border-right: none; }
  .site-footer { padding: 16px; }
}

@media (max-width: 720px) {
  .site-header { padding: 8px 16px; }
  .site-header nav { display: none; }
  .article-title { font-size: 1.6rem; }
  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 16px;
    table-layout: fixed;
  }
  .infobox th, .infobox td { overflow-wrap: anywhere; }
  .toc { display: block; }
}

@media print {
  .site-header, .sidebar, .site-footer { display: none; }
  .layout { display: block; }
  .content { border: none; }
}
