/* Music: SoundCloud の一覧の組み方（左にジャケット、右に再生ボタンと題、その下に波形）を、サイトの白黒に合わせたもの */
.music .shelf-about { max-width: 44rem; }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }

.track {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-areas: "cover head" "cover wave" "cover text";
  grid-template-rows: auto auto 1fr; column-gap: 28px; padding: 28px 0; border-bottom: 1px solid #D6D6D6;
}
.track-cover { grid-area: cover; width: 168px; aspect-ratio: 1; object-fit: cover; background: var(--hush); }

.track-head { grid-area: head; display: flex; align-items: center; gap: 16px; min-width: 0; }
.track-play {
  position: relative; flex: none; display: grid; place-items: center; width: 52px; height: 52px; padding: 0;
  border: 0; border-radius: 50%; background: var(--ink); color: var(--wall); cursor: pointer; transition: background .15s;
}
.track-play:hover { background: #333; }
.track-play:active { transform: translateY(1px); }
.track-play svg { width: 24px; height: 24px; fill: currentColor; }
.track-play .i-pause, .track.is-playing .track-play .i-play { display: none; }
.track.is-playing .track-play .i-pause { display: block; }
.track.is-loading .track-play::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--ink); animation: track-spin .8s linear infinite;
}
@keyframes track-spin { to { transform: rotate(1turn); } }

.track-titles { min-width: 0; }
.track-title a { text-decoration: none; }
.track-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.track-artist { margin: 0; color: var(--label); font-size: 14px; }
.track-title { margin: 0; font-weight: 800; font-size: 24px; line-height: 1.2; }
.track-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; align-self: flex-start; }
.track-side time { color: var(--label); font-size: 14px; white-space: nowrap; }
.track-tags { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.track-tags li { background: var(--hush); padding: 2px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; }

/* 波形: 上 7 割が本体、下 3 割が映り込み。色は canvas が読む */
.wave {
  --wave-idle: #C4C4C4; --wave-played: var(--ink); --wave-hover: #7A7A7A;
  grid-area: wave; position: relative; height: 88px; margin-top: 18px; cursor: pointer; touch-action: pan-y; user-select: none;
}
.wave canvas { display: block; width: 100%; height: 100%; }
.wave:has(.wave-seek:focus-visible) { outline: 2px solid var(--ink); outline-offset: 6px; }
.wave-time {
  position: absolute; top: calc(70% - 20px); padding: 1px 5px; background: var(--ink); color: var(--wall);
  font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.wave-cur { left: 0; opacity: 0; }
.track.is-active .wave-cur { opacity: 1; }
.wave-dur { right: 0; background: var(--wall); color: var(--ink); }
.wave-tip {
  position: absolute; top: -4px; transform: translateX(-50%); padding: 1px 5px; background: var(--ink); color: var(--wall);
  font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap;
}
.wave-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }

.track audio { grid-area: wave; width: 100%; margin-top: 18px; }
.track-text { grid-area: text; padding-top: 16px; }
.track-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.track-facts { margin: 0; color: var(--label); font-size: 14px; font-variant-numeric: tabular-nums; }

/* 共有: SoundCloud の Share と同じく行の下に置き、押すと小さなメニューが開く */
.share { position: relative; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--ink); background: var(--wall);
  font-weight: 800; font-size: 14px; line-height: 1.2; cursor: pointer; transition: background .15s, color .15s;
}
.share-btn:hover, .share-btn[aria-expanded="true"] { background: var(--ink); color: var(--wall); }
.share-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 190px; padding: 4px 0; background: var(--wall); border: 1px solid var(--ink); display: grid; }
.share-menu a, .share-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none;
  font-size: 15px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.share-menu a:hover, .share-menu button:hover { background: var(--hush); }
.share-menu i { font-size: 18px; }
.music .more { margin: 24px 0 0; }
.music .more a { text-decoration: none; font-weight: 800; }
.music .more a:hover { text-decoration: underline; }
.track-error { margin: 10px 0 0; font-size: 14px; font-weight: 800; }
.track-error span { margin-left: .35em; }

@media (max-width: 760px) {
  .track { grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "cover head" "wave wave" "text text"; grid-template-rows: auto; column-gap: 14px; padding: 20px 0; }
  .track-cover { width: 88px; }
  .track-head { flex-wrap: wrap; gap: 8px 12px; }
  .track-play { width: 44px; height: 44px; }
  .track-play svg { width: 20px; height: 20px; }
  .track-titles { flex: 1 1 0; }
  .track-title { font-size: 19px; }
  .track-side { margin-left: 0; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .wave { height: 72px; margin-top: 16px; }
  .track-text { padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .track.is-loading .track-play::after { animation: none; border-color: #C4C4C4; border-top-color: var(--ink); }
}
