@charset "UTF-8";

/* ------------------------------------------------------------
   分析機器のしくみ（/lab/）
   色・文字・ヘッダー・フッターは styles.css と同じ。
   ここでは「目次（サイドバー）と本文の並び」と、lab の部品だけを決める。
   ------------------------------------------------------------ */
.lab-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-block: 48px 120px;
}
.lab-side { position: sticky; top: calc(var(--header) + 32px); }

/* 目次 */
.lab-toc > summary { display: none; }
.lab-toc ul, .lab-toc ol { list-style: none; padding: 0; margin: 0; }
.lab-toc-home { display: block; margin-bottom: 20px; color: var(--ink); font-weight: 600; }
.lab-toc-inst { color: var(--ink); font-weight: 600; }
.lab-toc-inst a { color: inherit; }
.lab-toc-inst a[aria-current="page"] { color: var(--accent); }
.lab-toc-inst span { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
.lab-toc ol { counter-reset: page; margin: 6px 0 20px; border-left: 1px solid var(--line); }
.lab-toc ol a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  font-size: 15px;
  line-height: 1.6;
}
.lab-toc ol a::before { counter-increment: page; content: counter(page); display: inline-block; width: 1.4em; color: var(--muted); font-variant-numeric: tabular-nums; }
.lab-toc a:hover { color: var(--accent); }
.lab-toc a[aria-current="page"] { border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.lab-toc-home[aria-current="page"] { color: var(--accent); }

/* たたんだ目次（スマホと、シミュレーターのページ） */
.toc-folded .lab-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 20px; }
.toc-folded .lab-side { position: static; margin-bottom: 28px; }
.toc-folded .lab-toc > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: 1px solid var(--line-input);
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.toc-folded .lab-toc > summary::-webkit-details-marker { display: none; }
.toc-folded .lab-toc > summary::after { content: ""; width: 7px; height: 7px; margin-top: -4px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); }
.toc-folded .lab-toc[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
.toc-folded .lab-toc-body { max-width: 420px; margin-top: 12px; padding: 20px 24px 4px; border-radius: var(--radius); background: var(--soft); }

/* 本文 */
.lab-head { margin-bottom: 32px; }
.lab-kicker { margin-bottom: 4px; color: var(--accent); font-size: 14px; font-weight: 600; }
.lab-main h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.35; }
.lab-lead { max-width: 40em; margin-top: 12px; }

/* 一覧のカード */
.lab-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.lab-card { display: block; overflow: hidden; border-radius: 20px; background: var(--soft); }
.lab-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; background: var(--thumb); }
.lab-card-name { display: block; padding: 16px 22px 0; color: var(--ink); font-size: 22px; font-weight: 600; }
.lab-card-name small { margin-left: 10px; color: var(--muted); font-size: 14px; font-weight: 400; }
.lab-card-pages { display: block; padding: 2px 22px 20px; color: var(--muted); font-size: 14px; }
.lab-card:hover .lab-card-name { color: var(--accent); }

/* 装置の入口：ページを読む順に */
.lab-pages { list-style: none; padding: 0; display: grid; gap: 12px; max-width: 760px; }
.lab-pages a { display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: 2px 8px; align-items: baseline; padding: 18px 24px; border-radius: var(--radius); background: var(--soft); color: var(--ink); }
.lab-page-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.lab-page-title { font-size: 19px; font-weight: 600; }
.lab-page-summary { grid-column: 2; color: var(--muted); font-size: 15px; }
.lab-pages a:hover .lab-page-title { color: var(--accent); }

@media (max-width: 640px) {
  .lab-layout { padding-bottom: 64px; }
  .lab-head { margin-bottom: 24px; }
  .lab-pages a { padding: 16px 18px; }
}
