/**
 * howto.css
 * 使い方ページのスタイル
 */

.howto-content {
  flex: 1;
  padding-bottom: 40px;
}

/* ── セクション（アコーディオン） ── */
.howto-section {
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

/* デフォルトの ▶ マーカーを消す */
.howto-section summary {
  list-style: none;
}
.howto-section summary::-webkit-details-marker {
  display: none;
}

.howto-section-title {
  font-size: 1.0rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* 閉じているときは少し薄く */
  opacity: 0.72;
  transition: opacity 0.15s, background 0.15s;
}

/* 開いているセクションのタイトルは全開 */
.howto-section[open] > .howto-section-title {
  opacity: 1;
  border-bottom: 1.5px solid var(--border);
}

.howto-section-title:hover,
.howto-section-title:focus-visible {
  opacity: 1;
  background: var(--accent-light);
  outline: none;
}

/* アクセントバー（左端） */
.howto-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
  /* 閉じているときはグレー */
  opacity: 0.4;
  transition: opacity 0.15s;
}

.howto-section[open] > .howto-section-title::before {
  opacity: 1;
}

/* シェブロン（右端） */
.howto-section-title::after {
  content: '›';
  margin-left: auto;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  transform: rotate(90deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.howto-section[open] > .howto-section-title::after {
  transform: rotate(270deg);
}

/* セクション本文の内側余白 */
.howto-section-body {
  padding: 14px 16px 16px;
}

.howto-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.howto-body p {
  margin-bottom: 8px;
}

.howto-body p:last-child {
  margin-bottom: 0;
}

/* ── ステップリスト ── */
.flow-list {
  list-style: none;
  counter-reset: flow-counter;
  padding: 0;
}

.flow-list li {
  counter-increment: flow-counter;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.flow-list li:last-child {
  border-bottom: none;
}

.flow-list li::before {
  content: counter(flow-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── 調の色パレット ── */
.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.color-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── ヒントボックス ── */
.hint-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.65;
  margin-top: 12px;
}

/* ── 機能テーブル ── */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feature-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-name {
  font-weight: 600;
  color: var(--text-primary);
}

.feature-desc {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── サブセクション見出し ── */
.howto-subsection-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
}

/* ── 異名同音テーブル ── */
.enharmonic-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
}

.enharmonic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.enharmonic-table th {
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.enharmonic-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.enharmonic-table tr:last-child td {
  border-bottom: none;
}

.enharmonic-table td.adopted {
  color: var(--accent);
  font-weight: 600;
}

.enharmonic-table td.partial {
  color: var(--text-muted);
  font-weight: 500;
}
