/* ============================================================
   XenoX マニュアル専用スタイル（一覧 /manuals と 各マニュアル /manuals/:slug）
   - plugins-xm.css（共通の土台）→ blog-xm.css（記事の本文・目次）の後に読む
   - 各マニュアルの本文はブログ記事と同じ見た目（.xm-post__body）。ここではマニュアル固有の部分だけ
   - 色は plugins-xm.css / blog-xm.css の .xm で定義した変数だけを使う
   ============================================================ */

/* ---------- 一覧：ブロック表示 ---------- */
.xm-mn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 18px; }
@media (max-width: 960px) { .xm-mn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .xm-mn-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

.xm-mn-card {
  display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 20px;
  text-decoration: none; color: var(--ink);
  background: var(--white); border: var(--bd); border-radius: 18px; box-shadow: var(--sh-sm);
  transition: transform .15s, box-shadow .15s;
}
.xm-mn-card:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--ink); }
.xm-mn-card[hidden] { display: none; }
.xm-mn-card__icon { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--paper); border: 2px solid var(--ink); overflow: hidden; }
.xm-mn-card__icon img { width: 48px; height: 48px; object-fit: contain; }
.xm-mn-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.xm-mn-card__name { font-size: 17px; line-height: 1.5; font-weight: 900; word-break: auto-phrase; }
.xm-mn-card__desc { font-size: 13.5px; line-height: 1.75; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.xm-mn-card__date { font-family: var(--en); font-size: 12.5px; font-weight: 700; color: var(--text-5); }
.xm-mn-card__go { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 2px dashed var(--ink-20); font-size: 14px; font-weight: 900; }
.xm-mn-card__go .xm-arw { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font-size: 13px; }

/* ---------- 一覧：リスト表示 ---------- */
.xm-mn-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 0; background: var(--white); border: var(--bd); border-radius: 18px; box-shadow: var(--sh-sm); overflow: hidden; }
.xm-mn-grid.is-list .xm-mn-card {
  flex-direction: row; align-items: center; gap: 16px; padding: 14px 20px;
  border: 0; border-bottom: 1.5px solid var(--rule); border-radius: 0; box-shadow: none;
}
.xm-mn-grid.is-list .xm-mn-card:last-child { border-bottom: 0; }
.xm-mn-grid.is-list .xm-mn-card:hover { transform: none; box-shadow: none; background: var(--yellow-2); }
.xm-mn-grid.is-list .xm-mn-card__icon { width: 44px; height: 44px; border-radius: 12px; }
.xm-mn-grid.is-list .xm-mn-card__icon img { width: 34px; height: 34px; }
.xm-mn-grid.is-list .xm-mn-card__body { flex-direction: row; align-items: baseline; gap: 16px; }
.xm-mn-grid.is-list .xm-mn-card__name { flex: none; min-width: 12em; font-size: 16px; }
.xm-mn-grid.is-list .xm-mn-card__desc { flex: 1; -webkit-line-clamp: 1; }
.xm-mn-grid.is-list .xm-mn-card__date { flex: none; }
.xm-mn-grid.is-list .xm-mn-card__go { padding: 0; border: 0; flex: none; font-size: 0; }
.xm-mn-grid.is-list .xm-mn-card__go .xm-arw { font-size: 13px; }
@media (max-width: 720px) {
  .xm-mn-grid.is-list .xm-mn-card { padding: 12px 14px; gap: 12px; }
  .xm-mn-grid.is-list .xm-mn-card__body { flex-direction: column; gap: 2px; }
  .xm-mn-grid.is-list .xm-mn-card__name { min-width: 0; font-size: 15px; }
}

.xm-mn-empty { margin-top: 32px; }
.xm-mn-empty[hidden] { display: none; }

/* ---------- 各マニュアル：頭 ---------- */
.xm-mn-head { display: flex; align-items: center; gap: 16px; margin: 18px 0 14px; }
.xm-mn-head__icon { width: 64px; height: 64px; flex: none; padding: 6px; object-fit: contain; background: var(--white); border: var(--bd); border-radius: 16px; box-shadow: var(--sh-sm); }
.xm-mn-head h1 { margin: 0; }
.xm-mn-head h1 small { display: inline-block; font-size: .6em; font-weight: 900; color: var(--text-3); }
@media (max-width: 600px) {
  .xm-mn-head { gap: 12px; }
  .xm-mn-head__icon { width: 48px; height: 48px; border-radius: 12px; }
}

/* マニュアルは最初の段落をリード扱いにしない（ブログの記事と違い、手順の説明から始まることが多い） */
.xm .xm-mn__body > p:first-of-type { font-size: inherit; line-height: inherit; font-weight: inherit; color: inherit; padding: 0; margin-bottom: 1.6em; border-bottom: 0; }
.xm .xm-mn__body > p:first-of-type + h2 { margin-top: 3em; }

/* 見出しへのジャンプで、固定ヘッダーの下に隠れないように */
.xm .xm-mn__body h2, .xm .xm-mn__body h3 { scroll-margin-top: 90px; }

/* ---------- 目次：小見出し（h3） ---------- */
.xm-toc .xm-toc__sub { counter-reset: none; max-height: none; overflow: visible; padding: 0 0 4px 34px; }
.xm-toc .xm-toc__sub li { counter-increment: none; }
.xm-toc .xm-toc__sub a { grid-template-columns: 10px minmax(0, 1fr); padding: 4px 8px; font-size: 12.5px; font-weight: 500; }
.xm-toc .xm-toc__sub a::before { content: "–"; font-family: inherit; }
