/* =========================================================
   ぬりおた — 解説ページ・配色ページの共通スタイル
   /guide/<slug> と /palette/<slug> の静的HTMLが読み込む。
   色・書体・寸法は variables.css のトークンだけを使い、
   サイト本体（style.css）と同じ見た目に揃える。
   ========================================================= */

/* ---- 記事の器 ---------------------------------------------------- */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 72px;
}

/* パンくず。1行に収め、狭い画面でははみ出しを隠さず折り返す */
.article__crumbs {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--paper-text-dim);
  margin: 20px 0 0;
  line-height: 1.8;
}
/* 要素名を足して「.article a」と同点になったときの後勝ちを防ぐ（0-2-1） */
.article nav.article__crumbs a { color: var(--paper-text-dim); }
.article nav.article__crumbs a:hover,
.article nav.article__crumbs a:focus { color: var(--tape); }

/* ⚠️ 部品の色・字送りは「.article p」「.article a」（詳細度 0-1-1）に負けるため、
   要素名を付けて 0-2-1 にしてある。ここを .article__label 単独に戻すと、
   本文の色が勝ってラベルが黄色地に白文字（1.3:1＝読めない）になる。 */
.article p.article__label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--mat-deep);
  background: var(--tape);
  padding: 3px 9px;
  border-radius: 3px;
  margin: 24px 0 0;
  line-height: 1.7;
}

.article__title {
  font-family: var(--font-heading);
  font-size: clamp(23px, 5vw, 33px);
  line-height: 1.45;
  color: #fff;
  margin: 12px 0 14px;
  font-weight: 700;
}

/* 記事の要点。読み手が「自分の悩みか」を3秒で判断するための箱 */
.article p.article__lead {
  color: var(--paper-text);
  line-height: 2;
  font-size: 15.5px;
  margin: 0 0 8px;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
}

.article p.article__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper-text-dim);
  margin: 12px 0 30px;
}

/* ---- 本文 -------------------------------------------------------- */
.article h2 {
  font-family: var(--font-heading);
  font-size: clamp(18px, 3.6vw, 22px);
  color: #fff;
  margin: 44px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  line-height: 1.5;
}
.article h3 {
  font-family: var(--font-heading);
  font-size: 16.5px;
  color: var(--tape);
  margin: 30px 0 10px;
  line-height: 1.6;
}
.article p {
  color: var(--paper-text);
  line-height: 2.05;
  margin: 0 0 18px;
  font-size: 15.5px;
}
.article a { color: var(--accent); }
.article a:hover,
.article a:focus { color: var(--tape); }
.article strong { color: #fff; font-weight: 700; }

.article ul,
.article ol {
  color: var(--paper-text);
  line-height: 2;
  margin: 0 0 20px;
  padding-left: 1.4em;
  font-size: 15.5px;
}
.article li { margin-bottom: 8px; }

/* 手順の箱。番号を大きく出して「今どこか」を見失わせない */
.article ol.steps {
  list-style: none;
  counter-reset: gstep;
  padding: 0;
  margin: 0 0 24px;
}
.steps > li {
  counter-increment: gstep;
  position: relative;
  padding: 2px 0 2px 44px;
  margin-bottom: 16px;
}
.steps > li::before {
  content: counter(gstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 補足・注意の箱 */
.note {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  margin: 0 0 22px;
}
.note p:last-child { margin-bottom: 0; }
.note--warn { border-color: rgba(242, 209, 107, 0.5); }

/* ---- 表 ---------------------------------------------------------- */
/* 狭い画面では表だけを横スクロールさせる（本文は折り返す） */
.tablewrap {
  overflow-x: auto;
  margin: 0 0 24px;
  -webkit-overflow-scrolling: touch;
}
.article table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
  font-size: 14px;
  color: var(--paper-text);
}
.article th,
.article td {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 9px 11px;
  text-align: left;
  line-height: 1.75;
  vertical-align: top;
}
.article thead th {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.article tbody th {
  background: rgba(0, 0, 0, 0.14);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- 色見本つきのリンク（配色ページ・記事内の実例） ---------------- */
.swatches {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.swatches__item { margin: 0; }
.article a.swatches__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--paper-text);
  font-size: 13.5px;
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid var(--panel-edge);
}
.article a.swatches__link:hover,
.article a.swatches__link:focus {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  outline: none;
}
.swatches__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.swatches__chip {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-s);
  flex: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 1px 3px rgba(0, 0, 0, 0.4);
}
.swatches__body { flex: 1 1 auto; min-width: 0; }
.swatches__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swatches__sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--paper-text-dim);
  margin-top: 2px;
}
.swatches__code { color: var(--tape); }

/* 配色の帯（題材ごとの色をまとめて眺めるための横並び） */
.band {
  display: flex;
  border-radius: var(--radius-m);
  overflow: hidden;
  margin: 0 0 20px;
  box-shadow: var(--shadow-chip);
  min-height: 68px;
}
.band__cell {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  padding: 7px 8px;
}
/* ⚠️ 塗料の色の上に直接文字を置くと、色によってコントラストが足りなくなる
   （実測で明灰白色や工廠グレイの上が 4.0〜4.4:1 まで落ちた）。
   色ごとに文字色を選ぶ運用は、色を差し替えたときに黙って壊れる。
   そこで濃い下敷きを必ず1枚挟み、どの色の上でも 8:1 以上を確保する。 */
.band__tag {
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.35;
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 100%;
  word-break: break-all;
}

/* ---- 行動へつなぐ箱（記事の結論＝サイトの機能） -------------------- */
.cta {
  background: linear-gradient(180deg, rgba(255, 107, 53, 0.16), rgba(255, 107, 53, 0.06));
  border: 1px solid rgba(255, 107, 53, 0.45);
  border-radius: var(--radius-l);
  padding: 20px 20px 18px;
  margin: 34px 0;
}
.cta h2 {
  margin: 0 0 10px;
  padding: 0;
  border: none;
  font-size: 18px;
}
.cta p { margin-bottom: 14px; }
/* ⚠️ 要素名を付けて「.article a」に勝たせている。
   .cta__btn 単独だと本文リンクの色（＝オレンジ）が勝ち、
   オレンジ地にオレンジ文字＝文字が消える（ホバーで初めて読める状態になる）。 */
.article a.cta__btn {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-chip);
}
.article a.cta__btn:hover,
.article a.cta__btn:focus { background: #ffa07d; color: var(--on-accent); }

/* ---- 関連ページ -------------------------------------------------- */
.related {
  margin: 44px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.related h2 {
  margin: 0 0 12px;
  padding: 0;
  border: none;
  font-size: 17px;
}
.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.related li { margin: 0; }
.related a {
  display: block;
  padding: 11px 13px;
  border-radius: var(--radius-s);
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--panel-edge);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
}
.related a:hover,
.related a:focus { background: rgba(255, 255, 255, 0.08); }

/* ---- 一覧ハブ（/guide） ------------------------------------------ */
.hub { max-width: 900px; margin: 0 auto; padding: 0 16px 72px; }
.hub__lead {
  color: var(--paper-text-dim);
  line-height: 2;
  max-width: 44em;
  margin: 0 0 34px;
}
.hub__section { margin: 0 0 40px; }
.hub__heading {
  font-family: var(--font-heading);
  font-size: 18px;
  color: #fff;
  margin: 0 0 6px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.hub__note { color: var(--paper-text-dim); font-size: 13.5px; margin: 10px 0 16px; line-height: 1.9; }
.hub__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.hub__card {
  display: block;
  padding: 15px 16px;
  border-radius: var(--radius-m);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-edge);
  text-decoration: none;
  height: 100%;
}
.hub__card:hover,
.hub__card:focus { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 107, 53, 0.5); }
.hub__card-title {
  display: block;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 6px;
}
.hub__card-desc {
  display: block;
  color: var(--paper-text-dim);
  font-size: 13px;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .article__title { margin-top: 14px; }
}
