@charset "UTF-8";
@import url("https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css");

/* ==============================================================================
   Vimdoc-Ja Bulma モダンカスタムスタイルシート
   ============================================================================== */

:root {
  --vim-green: #019833;
  --vim-dark-green: #007f30;
  --vim-bg: #f8fafc;
  --vim-text: #1e293b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #334155;
  background-color: #f1f5f9;
  margin: 0;
  padding: 20px;
  line-height: 1.6;
}

/* ヘッダー */
header {
  max-width: 1020px;
  margin: 0 auto 20px auto;
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

header h1 {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 8px 0 !important;
  display: inline-block;
}

header a {
  color: #019833;
  font-weight: 500;
  text-decoration: none;
}

header a:hover {
  text-decoration: underline;
  color: #007f30;
}

/* 検索フォーム */
.EnglishJapaneseLink {
  float: right;
  margin-top: 4px;
}

#rtd-search-form {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

#rtd-search-form input[type="text"] {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px 0 0 4px;
  font-size: 13px;
  outline: none;
  width: 180px;
  height: 34px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#rtd-search-form input[type="text"]:focus {
  border-color: #019833;
  box-shadow: 0 0 0 2px rgba(1, 152, 51, 0.2);
}

#rtd-search-form input[type="submit"], #rtd-search-form .submit {
  height: 34px;
  padding: 0 14px;
  background-color: #019833;
  color: #ffffff;
  border: 1px solid #019833;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.2s;
}

#rtd-search-form input[type="submit"]:hover, #rtd-search-form .submit:hover {
  background-color: #007f30;
}

/* 2カラム レイアウトコンテナ */
.vimdoc-container {
  display: flex;
  gap: 18px;
  max-width: 1020px;
  margin: 0 auto 20px auto;
  align-items: flex-start;
}

/* 左サイドバー (TOC 目次) */
nav {
  width: 240px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: sticky;
  top: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

nav dl {
  margin: 0;
  padding: 0;
}

nav dt {
  font-weight: 700;
  font-size: 13px;
  color: #1e293b;
  margin: 12px 0 6px 0;
  padding: 3px 8px;
  background: #f1f5f9;
  border-left: 3px solid #019833;
  border-radius: 0 4px 4px 0;
}

nav dt:first-child {
  margin-top: 0;
}

nav dd {
  margin: 0;
  padding: 0;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
}

nav li {
  margin: 2px 0;
}

nav li a {
  display: block;
  font-size: 13px;
  color: #475569;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s;
}

nav li a:hover {
  background-color: #f0fdf4;
  color: #019833;
  text-decoration: none;
}

nav li a.CurrentPage {
  background-color: #019833;
  color: #ffffff;
  font-weight: 600;
}

/* メインコンテンツ (article.Vimdoc) */
article.Vimdoc {
  flex: 1;
  max-width: 760px;
  min-width: 0;
  background: #ffffff;
  border-radius: 8px;
  padding: 20px 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  color: #1e293b;
  white-space: nowrap;
}

/* シンタックスハイライト */
.Constant {
  color: #2563eb !important;
  font-weight: 600;
}

.Identifier {
  color: #059669 !important;
}

.PreProc, .Statement {
  color: #7c3aed !important;
  font-weight: 600;
}

.Special, .Type {
  color: #db2777 !important;
}

.Comment {
  color: #64748b !important;
  font-style: italic;
}

.helpExample {
  color: #dc2626 !important;
}

.Todo {
  background-color: #fef08a !important;
  color: #854d0e !important;
  padding: 2px 5px !important;
  border-radius: 3px !important;
  font-weight: bold !important;
}

article.Vimdoc a {
  color: #019833;
  text-decoration: none;
  transition: background-color 0.15s;
}

article.Vimdoc a:hover {
  text-decoration: underline;
  background-color: #f0fdf4;
}

article.Vimdoc a.Constant {
  color: #2563eb !important;
}

article.Vimdoc a.Constant:hover {
  background-color: #eff6ff;
  color: #1d4ed8 !important;
}

/* 関連キーワード */
.page_key_word {
  border: 1px solid #cbd5e1 !important;
  background-color: #f8fafc !important;
  border-radius: 8px !important;
  padding: 16px 20px !important;
  margin: 24px 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  white-space: normal !important;
}

.page_key_word legend {
  font-weight: 700 !important;
  font-size: 15px !important;
  color: #000000 !important;
  padding: 0 10px !important;
}

.page_key_word legend strong {
  color: #000000 !important;
  font-weight: 700 !important;
}

/* 関連キーワード */
.keyword-link {
  display: inline-block !important;
  text-decoration: none !important;
  margin: 3px 2px !important;
  transition: transform 0.15s ease !important;
}

.keyword-link:hover {
  text-decoration: none !important;
  transform: translateY(-1px);
}

.keyword-link .tag {
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.keyword-link:hover .tag {
  filter: brightness(0.95);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* フッター */
footer {
  max-width: 1020px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 8px;
  padding: 16px 24px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #64748b;
  clear: both;
}

footer a {
  color: #019833;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* レスポンシブ (タブレット・モバイル - 左右余白極小化) */
@media (max-width: 900px) {
  body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
  }

  header {
    margin: 0 0 8px 0 !important;
    padding: 10px 8px !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }

  header h1 {
    font-size: 1.3rem !important;
  }

  .vimdoc-container {
    flex-direction: column;
    margin: 0 0 8px 0 !important;
    gap: 8px !important;
    max-width: 100% !important;
  }

  nav {
    width: 100% !important;
    max-height: 220px;
    position: static;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
  }

  article.Vimdoc {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 10px !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #vimCodeElement {
    white-space: nowrap !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page_key_word {
    padding: 10px 8px !important;
    margin: 12px 0 !important;
  }

  .EnglishJapaneseLink {
    float: none;
    margin-top: 10px;
    display: block;
  }

  #rtd-search-form {
    width: 100%;
    margin-top: 8px;
    display: flex;
  }

  #rtd-search-form input[type="text"] {
    flex: 1;
    width: auto;
  }

  footer {
    margin: 0 !important;
    padding: 10px 8px !important;
    border-radius: 0 !important;
  }

  .keyword-link {
    padding: 3px 8px !important;
    font-size: 12px !important;
    margin: 3px 2px !important;
  }
}
