/* 学習ページ（/learn/・tools/build_web.py が書き出す）。
   色と書体は style.css の変数だけを使う（アプリの Paper under Glass の写し）。 */

/* 🚨 本文の欄は無地にする。五線罫が文字を横切ると、ダークでは小さい文字
   （キャプション・注）が線に埋もれて読めなかった（2026-09-19・user）。
   罫は左右の余白にだけ残る。LP は読む量が少ないので罫の上のまま。 */
main.learn {
  padding-top: 24px;
  background: var(--ivory);
}

@media (min-width: 721px) {
  main.learn {
    border-radius: 18px;
  }
}

.crumbs {
  font-size: 12.5px;
  color: var(--slate);
  margin-bottom: 28px;
}

.crumbs a {
  color: var(--slate);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--brass);
}

main.learn h1 {
  font-size: 28px;
  margin: 4px 0 24px;
}

.lead {
  color: var(--slate);
  margin-bottom: 32px;
}

/* ── 本文 ─────────────────────────────── */
.lesson > * + * {
  margin-top: 18px;
}

.lesson strong {
  color: var(--ink);
  background: linear-gradient(transparent 62%, rgba(156, 122, 51, 0.22) 62%);
  font-weight: 600;
}

.note {
  border-left: 2px solid var(--brass);
  padding: 4px 0 4px 16px;
  font-size: 15px;
}

.aside {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  font-size: 15px;
}

.aside h4,
.steps h4 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 15px;
  margin-bottom: 6px;
}

.steps {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px 18px 22px;
}

.steps ol {
  padding-left: 1.3em;
}

.steps li + li {
  margin-top: 10px;
}

.steps li::marker {
  color: var(--brass);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

figure.example {
  text-align: center;
}

figure.example figcaption {
  color: var(--slate);
  font-size: 13.5px;
  margin-top: 8px;
  text-align: left;
}

/* 楽譜は紙の上に描く。🚨 ダークでも紙は明るいまま——Verovio の音符は黒で、
   反転させると真鍮の印（設問が指す音）の色まで狂う。 */
.sheet {
  background: #f5efe2;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  overflow-x: auto;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

/* パート名（Piano）は出さない。アプリのテンプレートと同じ指定 */
.sheet .label,
.sheet .labelAbbr {
  display: none !important;
}

.sheet svg {
  max-width: 100%;
  height: auto;
  display: inline-block;
  vertical-align: top;
}

/* 鍵盤 */
svg.keyboard {
  width: 100%;
  max-width: 320px;
  height: auto;
}

svg.keyboard .key-w {
  fill: #fbf8f1;
  stroke: #8a8578;
  stroke-width: 1;
}

svg.keyboard .key-b {
  fill: #202b3b;
}

svg.keyboard .on {
  fill: #9c7a33;
}

svg.keyboard .key-w.on {
  fill: #d9c08a;
}

svg.keyboard text {
  font-size: 12px;
  fill: var(--ink);
}

/* 図（lesson_figures.dart の写し） */
.fig-series {
  position: relative;
  height: 92px;
}

.fig-series svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fig-series line {
  stroke: var(--line);
  stroke-width: 1.2;
}

.fig-series .node {
  position: absolute;
  transform: translateX(-50%);
}

.node {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 13px;
  white-space: nowrap;
}

.node.em {
  border-color: var(--brass);
}

.node b {
  color: var(--brass);
  font-weight: 400;
  margin: 0 2px;
}

.fig-axis {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--slate);
  margin-top: 6px;
}

.fig-axis i {
  flex: 1;
  border-top: 1px solid var(--line);
}

.fig-inversion .row {
  display: flex;
  justify-content: space-between;
}

.fig-inversion .row + .row {
  margin-top: 4px;
}

.fig-inversion .node {
  padding: 1px 4px;
  font-size: 12px;
}

.fig-inversion .arrows {
  justify-content: space-around;
  color: var(--brass);
  font-size: 14px;
  line-height: 1.2;
}

.fig-inversion .pairs {
  justify-content: space-evenly;
  margin-top: 10px;
}

/* ── 問題 ─────────────────────────────── */
.drill {
  margin-top: 64px;
}

.practice {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.quiz {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 20px 18px;
}

.drill .quiz {
  margin-top: 18px;
}

.quiz .q {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 600;
  margin-bottom: 12px;
}

.quiz .opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.opt {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
}

.opt:hover:not(:disabled) {
  border-color: var(--brass);
}

.opt:disabled {
  cursor: default;
}

.opt.right {
  border-color: var(--brass);
  background: rgba(156, 122, 51, 0.18);
  font-weight: 600;
}

.opt.wrong {
  border-color: var(--vermilion);
  color: var(--vermilion);
}

.opt.dim {
  opacity: 0.55;
}

.result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.result p + p {
  margin-top: 6px;
}

.result .verdict {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 600;
  font-size: 17px;
}

.result .verdict.ok {
  color: var(--brass);
}

.result .verdict.ng {
  color: var(--vermilion);
}

.result .pick {
  color: var(--slate);
}

.result .pick:empty {
  display: none;
}

.result .answer {
  font-weight: 600;
}

.tally {
  margin-top: 24px;
  text-align: center;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 18px;
}

/* ── 目次・送り・誘い ─────────────────── */
ol.toc {
  list-style: none;
  padding: 0;
}

ol.toc li + li {
  border-top: 1px solid var(--line);
}

ol.toc a {
  display: flex;
  gap: 16px;
  padding: 16px 4px;
  color: var(--ink);
  text-decoration: none;
}

ol.toc a:hover b {
  color: var(--brass);
}

ol.toc .n {
  color: var(--brass);
  font-family: Georgia, serif;
  min-width: 1.2em;
}

ol.toc b {
  display: block;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 600;
}

ol.toc small {
  display: block;
  color: var(--slate);
  font-size: 13px;
  line-height: 1.7;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  font-size: 14px;
}

.pager a {
  text-decoration: none;
}

.pager .next {
  margin-left: auto;
  text-align: right;
}

.cta {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid var(--brass);
  border-radius: 14px;
  text-align: center;
}

.cta .stores {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.cta .stores img {
  height: 40px;
  width: auto;
  display: block;
}

@media (max-width: 480px) {
  main {
    padding: 0 16px 80px;
  }

  header.site {
    padding: 24px 16px;
  }

  main.learn h1 {
    font-size: 24px;
  }

  .quiz {
    padding: 16px 14px;
  }

  .aside,
  .steps {
    padding: 16px;
  }
}
