/* wiki.morifuku.net テーマ: ネイビーのヘッダ/フッタ、他は白 */
@import url("basic.css");

:root {
  --navy: #0a507a;
  --navy-dark: #083f61;
  --link: #0a507a;
  --link-visited: #5b3b8c;
  --text: #222;
  --border: #d0d7de;
  --header-h: 92px;
  --sidebar-w: 300px;
}

html { scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--link); }
a:visited { color: var(--link-visited); }

/* ---- ヘッダ ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  box-sizing: border-box;
  background: var(--navy);
  color: #fff;
}
.site-header a, .site-header a:visited { color: #fff; text-decoration: none; }
.site-title { height: 56px; display: flex; align-items: center; padding: 0 24px; }
.site-title a { display: flex; align-items: center; gap: 12px; font-size: 1.6em; font-weight: 600; }
.site-title img.logo { height: 36px; width: auto; }
.breadcrumbs {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--navy-dark);
  font-size: 0.95em;
  white-space: nowrap;
  overflow-x: auto;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { opacity: 0.7; }

/* ---- 本体 2 ペイン ---- */
.page {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h) - 28px);
  /* 左ペインの境界線をページの高さいっぱいに引く */
  background: linear-gradient(var(--navy), var(--navy)) no-repeat calc(var(--sidebar-w) - 1px) 0 / 1px 100%;
}

/* 左ペイン: 検索 + ナビゲーション */
div.sphinxsidebar, aside.sphinxsidebar {
  float: none;
  width: auto;
  margin: 0;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 20px 40px;
  font-size: 0.95em;
}
#searchbox { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--navy); }
#searchbox h3 { display: none; }
#searchbox form.search, main.body form { display: flex; max-width: 480px; }
#searchbox input[type="text"], main.body form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 1em;
  border: 1px solid var(--navy);
  border-radius: 4px 0 0 4px;
}
#searchbox input[type="submit"], main.body form input[type="submit"] {
  padding: 6px 14px;
  font-size: 1em;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}
.globaltoc ul { list-style: none; margin: 0; padding: 0; }
.globaltoc ul ul { padding-left: 1.1em; }
.globaltoc li { margin: 0.15em 0; }
.globaltoc a { text-decoration: none; }
.globaltoc a:hover { text-decoration: underline; }
.globaltoc li.current > a { font-weight: 600; }
.globaltoc a.current { color: var(--text); }

/* 本文 */
.content { min-width: 0; max-width: 900px; padding: 24px 48px 48px; }
div.body, main.body {
  min-width: 0;
  max-width: none;
  padding: 0;
  background: #fff;
}
div.body h1, div.body h2, div.body h3, main.body h1, main.body h2, main.body h3 {
  line-height: 1.35;
  font-weight: 600;
}
main.body h1 { font-size: 1.9em; margin: 0.2em 0 0.8em; }
main.body h2 { font-size: 1.5em; margin-top: 1.6em; padding-bottom: 0.2em; border-bottom: 1px solid var(--border); }
main.body h3 { font-size: 1.2em; margin-top: 1.4em; }
main.body img { max-width: 100%; height: auto; }
main.body pre {
  padding: 12px 14px;
  overflow-x: auto;
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1.45;
}
main.body code.literal { padding: 0.1em 0.3em; background: #f0f2f4; border-radius: 4px; font-size: 0.9em; }
main.body table.docutils { border-collapse: collapse; }
main.body table.docutils th, main.body table.docutils td { padding: 6px 10px; border: 1px solid var(--border); }
main.body blockquote { margin-left: 0; padding-left: 1em; border-left: 4px solid var(--border); color: #555; }
a.headerlink { visibility: hidden; margin-left: 0.3em; text-decoration: none; color: #aaa; }
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, h4:hover > a.headerlink { visibility: visible; }

/* 前後のページ */
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.prev-next a { display: flex; flex-direction: column; max-width: 48%; text-decoration: none; }
.prev-next a.next { margin-left: auto; text-align: right; }
.prev-next .label { font-size: 0.85em; color: #666; }
.prev-next a:hover .title { text-decoration: underline; }

/* ---- フッタ (細く 1 行) ---- */
.site-footer {
  padding: 4px 24px;
  background: var(--navy);
  color: #fff;
  font-size: 0.85em;
  line-height: 20px;
}

/* ---- スマホ: 1 カラム (左ペインを本文の上に) ---- */
@media (max-width: 800px) {
  :root { --header-h: 84px; }
  .site-title { height: 48px; padding: 0 14px; }
  .site-title a { font-size: 1.3em; }
  .site-title img.logo { height: 30px; }
  .breadcrumbs { padding: 0 14px; }
  .page { grid-template-columns: 1fr; background: none; }
  aside.sphinxsidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--navy);
    padding: 14px;
  }
  .content { padding: 16px 14px 32px; }
}
main.body form #search-progress { align-self: center; white-space: nowrap; }
