/* 読む・書く・伝える：研究の実践ガイド 用スタイル調整 */

/* 明朝とゴシックの混在を防ぎ、全体でゴシック体に統一 */
:root {
  --bs-body-font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif !important;
  --bs-headings-font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif !important;
}

html, body,
#quarto-content, #quarto-document-content,
.quarto-title, .chapter-title,
.sidebar, .sidebar-title, .sidebar-item-container, .sidebar-item-text,
#TOC, #TOC .nav-link,
.quarto-secondary-nav, .breadcrumb,
h1, h2, h3, h4, h5, h6,
p, li, td, th, span, div {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif !important;
}

/* コード・等幅は別フォントを維持 */
pre, code, kbd {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace !important;
}

/* アイコンフォント（Bootstrap Icons）はそのまま */
.bi, [class^="bi-"] {
  font-family: "bootstrap-icons" !important;
}

/* 本文: 日本語の可読性向上 - 両端揃えをやめ左揃えでリバーを防ぐ */
#quarto-document-content {
  text-align: left !important;
}

/* 段落の余白と行間 */
#quarto-document-content p {
  line-height: 1.65;
  margin-bottom: 1em;
  text-align: left;
}

/* 見出しの余白とタイポグラフィ */
#quarto-document-content h1 {
  margin-top: 0;
  margin-bottom: 1em;
  font-weight: 600;
}

#quarto-document-content h2,
#quarto-document-content h3 {
  margin-top: 1.75em;
  margin-bottom: 0.6em;
  font-weight: 600;
}

/* サイドバー: アクティブ項目のハイライトを落ち着いた色に */
.sidebar-item-container .active {
  background-color: #eef2f7 !important;
  color: #1a365d !important;
  border-radius: 6px;
  font-weight: 500;
}

/* 章内目次 TOC: アクティブ項目 */
#TOC .nav-link.active {
  background-color: #eef2f7 !important;
  color: #1a365d !important;
  border-radius: 6px;
}

/* サイドバー全体の余白 */
.sidebar-item-container {
  font-size: 0.9rem;
  line-height: 1.5;
}

#TOC .nav-link {
  font-size: 0.875rem;
}

/* 表の見やすさ */
#quarto-document-content table {
  font-size: 0.9375rem;
  margin: 1.5em 0;
  border-collapse: collapse;
  width: 100%;
}

#quarto-document-content table th,
#quarto-document-content table td {
  vertical-align: top;
  padding: 0.55em 0.7em;
  border: 1px solid #e2e8f0;
}

#quarto-document-content table thead th,
#quarto-document-content table tr:first-child th {
  background-color: #f6f8fb;
  font-weight: 600;
}

#quarto-document-content table tbody tr:nth-child(even) {
  background-color: #fbfcfe;
}

/* リンクの色を控えめに */
#quarto-document-content a {
  color: #2b6cb0;
}

#quarto-document-content a:hover {
  color: #1a365d;
}

/* 本文エリアの最大幅（広めに設定） */
.column-body {
  max-width: 65em;
}

/* 折りたたみセクション（参考文献・ツール一覧に使用） */
details {
  margin: 1em 0;
  padding: 0.5em 1em;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background-color: #fafbfc;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: #2b6cb0;
  padding: 0.3em 0;
}

details summary:hover {
  color: #1a365d;
}

details[open] summary {
  margin-bottom: 0.5em;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5em;
}

/* コールアウトの日本語調整 */
.callout {
  margin: 1.5em 0;
}

.callout .callout-body {
  font-size: 0.95rem;
}

/* マージンノート */
.column-margin {
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.5;
}

/* タブセットの見やすさ */
.panel-tabset .nav-tabs .nav-link {
  font-size: 0.9rem;
}

/* パート区切り（部の見出し） */
.part-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a365d;
  border-bottom: 3px solid #2b6cb0;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

/* 参考文献: ぶら下がり（hanging indent）、文献間の区切り、リンク有効化
   2026-09-08: セレクタを `.references` から `.references` に直した。
   Quarto は `::: {.references}` を **<div class="references">** で出すため、
   `section.` 付きでは6つの規則すべてが当たっておらず、
   ぶら下がりインデントも文献間の余白も初版から一度も効いていなかった。
   要素を問わない形にしておけば、Quarto が div でも section でも出しても効く。 */
.references ul {
  list-style: none;
  padding-left: 0;
}

.references ul li {
  margin-bottom: 0.85em;
  padding-left: 2em;
  text-indent: -2em;
  line-height: 1.65;
}

.references a {
  color: #2b6cb0;
}

.references a:hover {
  color: #1a365d;
  text-decoration: underline;
}

.references p,
.references li {
  line-height: 1.65;
}
