/*
 * スタイルガイド（/brand/）専用のスタイル。
 *
 * このページはサイト本体と同じ /css/tokens.css と /css/site.css を読み込み、
 * 値は JavaScript で CSS カスタムプロパティから読み出して描画する。
 * ガイド側に値を書き写さないことで、実装とドキュメントがずれない。
 *
 * ここに置くのはガイド固有の見せ方（見本の並べ方、コード表示など）だけで、
 * サイト本体で使うコンポーネントは site.css 側にある。
 */

/* ---- スケール見本 ---------------------------------------------------- */
.swatch-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.swatch .chip {
  height: 72px;
  border-radius: 8px;
  border: 1px solid rgb(var(--c-brand-800) / 0.08);
}

.swatch .meta {
  font-family: var(--font-brand);
  font-size: 10px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.swatch .meta .step { display: block; color: rgb(var(--c-brand-800)); font-weight: 600; }
.swatch .meta .hex  { display: block; color: rgb(var(--c-brand-600)); }
.swatch .meta .cr   { display: block; }
.swatch .meta .cr.pass { color: rgb(var(--c-accent-700)); font-weight: 600; }
/* 「文字に使えない段」を示す控えめな表示だが、この文字自体はAAを満たす必要がある */
.swatch .meta .cr.fail { color: rgb(var(--c-brand-600)); }

@media (max-width: 720px) {
  .swatch-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .swatch .chip { height: 56px; }
}

/* ---- コード表示 ------------------------------------------------------- */
.code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  background: rgb(var(--c-brand-100));
  color: rgb(var(--c-brand-800));
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

pre.code-block {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.8;
  background: rgb(var(--c-brand-900));
  color: rgb(var(--c-brand-200));
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 0;
}

/* ---- ロゴ見本 --------------------------------------------------------- */
.logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgb(var(--c-brand-200));
}

.logo-cell.on-dark { background: rgb(var(--c-brand-900)); border-color: transparent; }

/* 使用禁止例。斜線を重ねて「やってはいけない」ことを示す */
.dont {
  position: relative;
  overflow: hidden;
}

.dont::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top left,
    transparent calc(50% - 1px),
    rgb(var(--c-accent-600) / 0.5) calc(50% - 1px),
    rgb(var(--c-accent-600) / 0.5) calc(50% + 1px),
    transparent calc(50% + 1px));
}

/* クリアスペースの図。マークの周囲に1層分の余白を示す */
.clearance {
  position: relative;
  display: inline-block;
  padding: var(--clearance-pad);
  outline: 1px dashed rgb(var(--c-accent-600) / 0.5);
  outline-offset: -1px;
}

/* ---- モーション実演 ---------------------------------------------------- */
.motion-demo {
  height: 8px;
  border-radius: 99px;
  background: rgb(var(--c-accent-500));
  width: 12%;
  transition-property: width;
  transition-timing-function: var(--ease-out-expo);
}

.motion-track {
  background: rgb(var(--c-brand-200));
  border-radius: 99px;
  padding: 0;
  cursor: pointer;
}

.motion-track.run .motion-demo { width: 100%; }

/* ---- 目次 ------------------------------------------------------------- */
.toc a {
  display: block;
  padding: 7px 0;
  border-bottom: 1px solid rgb(var(--c-brand-200));
  color: rgb(var(--c-brand-600));
  transition: color var(--dur-fast) var(--ease-out-expo);
}

.toc a:hover { color: rgb(var(--c-accent-600)); }

@media (prefers-reduced-motion: reduce) {
  .motion-demo { transition: none; }
}
