/* 使い方（/guide/）のページの枠。本文の見た目は guide-content.css（Olive の HTML 書き出しと同じシート
   に、アプリのダークの配色を足したもの。scripts/build-guide-site.mjs が組む）が持ち、ここは売り場
   （style.css）の枠と本文の間を取り持つだけにする。

   読み込み順は guide-content.css → style.css → guide.css。--bg・--muted は両方のシートが定義して
   いて、後の style.css が勝つ（地と枠の色は売り場にそろえ、本文の文字色 --fg は Olive のまま）。 */

/* 書き出しは配布物をライトに固定している（受け手の環境で見た目を変えないため）。サイトは売り場と
   同じく OS の明暗に従う */
:root { color-scheme: light dark; }
html, body.guide { background: var(--bg); }

.guide-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 24px 0 48px;
  font-size: 0.9rem;
}
.guide-toc summary { display: none; }
.guide-toc h2 {
  margin: 22px 0 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.guide-toc ul { list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin: 0; line-height: 1.35; }
.guide-toc a {
  display: inline-block;
  padding: 4px 0;
  color: var(--text);
  text-decoration: none;
}
.guide-toc a[aria-current='page'] { color: var(--olive); font-weight: 600; }
.guide-toc code { font-size: 0.85em; padding: 0 0.25em; }
.guide-note { color: var(--muted); font-size: 0.85em; }
.guide-home { font-weight: 600; }

.nav nav a[aria-current] { color: var(--text); }

/* 本文の列。Olive の本文の幅（--text-width）に合わせ、余白（--content-padding-x）は枠の gap が持つ */
.guide-page.olive-content {
  max-width: var(--text-width);
  margin: 0;
  padding: 8px 0 96px;
}
/* 書き出しの h1 は文書の題として中央に大きな余白で置かれる。サイドバーと並ぶページでは左に寄せ、
   上の余白を詰める */
.guide-page.olive-content h1 {
  text-align: left;
  margin-top: 24px;
  margin-bottom: calc(var(--_block-gap) * 1.5);
}
.guide-page.olive-content img { max-width: 100%; height: auto; border-radius: 8px; }

@media (hover: hover) {
  .guide-toc a:hover { color: var(--olive-strong); }
}

@media (max-width: 860px) {
  .guide-layout { display: block; padding: 0 16px; }
  .guide-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 4px 0 0;
    border-bottom: 1px solid var(--line);
  }
  .guide-toc summary {
    display: list-item;
    cursor: pointer;
    padding: 10px 0;
    font-weight: 600;
    color: var(--text);
  }
  .guide-toc[open] nav { padding-bottom: 16px; }
}
