/* css/style.css */

/* 基本設定とダークテーマ */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
    /* ★ body の height: 100% と overflow: hidden は削除 */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #ffffff;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

a {
    color: #61dafb;
    text-decoration: none;
}

a:hover {
    color: #8cffff;
    text-decoration: underline;
}

header {
    background-color: #2c2c2c;
    padding: 15px 30px;
    border-bottom: 1px solid #444;
    height: 70px;
    /* ヘッダー高さを固定 */
    box-sizing: border-box;
    position: sticky;
    /* ★ヘッダーを画面上部に固定 */
    top: 0;
    z-index: 100;
}

header h1 {
    margin: 0;
    font-size: 1.5em;
    line-height: 40px;
    color: #ffffff;
}

/* コンテナとレイアウト */
.container {
    display: flex;
    /* ★ container の height 指定を削除 (コンテンツに合わせる) */
}

/* ナビゲーション */
#main-nav {
    width: 250px;
    flex-shrink: 0;
    background-color: #252525;
    padding: 20px;
    height: calc(100vh - 70px);
    /* ★ビューポート高さからヘッダー高さを引く */
    overflow-y: auto;
    /* ★コンテンツがこの高さを超えた場合のみスクロール */
    border-right: 1px solid #444;
    position: sticky;
    /* ★ナビゲーションをヘッダー下に固定 */
    top: 70px;
    /* ヘッダーの高さ分下げる */
    box-sizing: border-box;
}

#main-nav h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#main-nav li a {
    display: block;
    padding: 8px 10px;
    color: #cccccc;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#main-nav li a:hover,
#main-nav li a.active {
    background-color: #3a3a3a;
    color: #ffffff;
}

/* コンテンツエリア */
#content-area {
    flex-grow: 1;
    height: calc(100vh - 70px);
    /* ★ビューポート高さからヘッダー高さを引く */
    /* overflow: auto; */
    /* iframe内部でスクロールするため不要 */
}

#content-area iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* --- ツールチップ用スタイル --- */
.tooltip-popup {
    position: absolute;
    background-color: rgba(51, 51, 51, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.tooltip-popup.visible {
    opacity: 1;
}

.abbr-tooltip {
    border-bottom: 1px dotted #888;
    cursor: help;
    position: relative;
}

/* コンテンツ内のスタイル (iframe内のHTMLに適用される想定) */
.content-section {
  /* iframe内のbodyやdivにこのクラスを付与 */
  padding: 30px;
  box-sizing: border-box;
  /* パディングを幅・高さに含める */
}

.content-section h1 {
  font-size: 2em;
  border-bottom: 2px solid #61dafb;
  /* リンク色に合わせる */
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.content-section h2 {
  font-size: 1.6em;
  border-bottom: 1px solid #555;
  padding-bottom: 8px;
}

.content-section h3 {
  font-size: 1.3em;
  color: #8cffff;
  /* リンクホバー色に合わせる */
}

.content-section p {
  margin-bottom: 1em;
}

.content-section ul,
.content-section ol {
  margin-bottom: 1em;
  padding-left: 25px;
}

.content-section li {
  margin-bottom: 0.5em;
}

.content-section code {
  background-color: #333;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
  color: #f0f0f0;
}

.content-section pre {
  background-color: #282c34;
  /* コードブロックの背景色 */
  color: #abb2bf;
  /* コードブロックの文字色 */
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  /* 横スクロール */
  font-family: monospace;
  margin-bottom: 1em;
}

.content-section figure {
  margin: 20px 0;
  text-align: center;
}

.content-section figcaption {
  margin-top: 5px;
  font-style: italic;
  color: #aaa;
  text-align: center;
}

.content-section img {
  max-width: 100%;
  height: auto;
  background-color: #ddd;
  /* 図の背景（仮） */
  border: 1px solid #555;
  border-radius: 4px;
}

.content-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
}

.content-section th,
.content-section td {
  border: 1px solid #555;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  /* テーブルセル内の縦位置を上揃えに */
}

.content-section th {
  background-color: #3a3a3a;
  color: #ffffff;
}

.content-section tr:nth-child(even) {
  background-color: #2a2a2a;
}

.highlight {
  /* 重要事項のハイライト用 */
  background-color: #444;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: bold;
  color: #e0e0e0;
}
/* --- フッタースタイル --- */
footer {
  margin-top: 40px;
  /* 上のコンテンツとの間隔 */
  padding: 20px 0;
  /* 上下のパディング */
  border-top: 1px solid #444;
  /* 上境界線 */
  text-align: center;
  /* テキスト中央揃え */
  font-size: 0.9em;
  /* 少し小さめのフォントサイズ */
  color: #aaa;
  /* やや薄めの文字色 */
}

footer .container {
  /* フッター内のコンテナ - 必要に応じて幅制限などを追加 */
  /* 例:
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
    */
  /* 今回はシンプルにpadding等なし */
}

footer p {
  margin: 0;
  /* デフォルトのマージンをリセット */
}

footer a {
  color: #8cffff;
  /* リンク色 (ホバー時の色に合わせる例) */
  text-decoration: none;
  /* 下線なし */
}

footer a:hover {
  color: #fff;
  /* ホバー時、少し明るく */
  text-decoration: underline;
  /* ホバー時に下線 */
}