/* A song's page (templates/song_detail_new.html), laid out as a jam's page
   is: its name and what to know at a glance; a bar of its parts that stays
   under the site's header (detail-pages.css .page-tabs); the chords with the
   band; its lessons and videos beside where it's played; About; more songs.
   Built on detail-pages.css and song-detail.css. No capitals forced, no
   kickers over headings. */
.song-page.detail-page { max-width: 1160px; }
.song-page .song-breadcrumb { margin-bottom: 22px; }

/* ---- the top: the song's demo, its name and what to know ---- */
.song-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.song-head-video { position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; border-radius: 6px;
  background: #1d2f2c; }
.song-head-video img { display: block; width: 100%; height: 100%; object-fit: cover; }
.song-head-play { position: absolute; inset: 0; width: 56px; height: 56px; margin: auto; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.song-head-play::after { content: ""; position: absolute; left: 22px; top: 17px; border-left: 17px solid #fff; border-top: 11px solid transparent;
  border-bottom: 11px solid transparent; }
.song-head-video:hover .song-head-play { background: var(--color-forest-main); }
/* The demo's picture beside the name. For a song with no chart it's also
   where the page's videos play (static/js/video-reel.js), brought into
   sight clear of the site's header; otherwise they play in the player. */
.song-viewer { min-width: 0; scroll-margin-top: calc(var(--page-tabs-top, 64px) + 16px); }
.song-viewer iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; background: #000; }
/* The video playing in it, marked where it was picked. */
.song-page .video-reel-item[aria-current] .video-reel-thumb::after,
.song-page .song-tyler-video[aria-current]::after,
.song-page .song-head-video[aria-current]::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--color-forest-main);
  border-radius: inherit; pointer-events: none; }
.song-head-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.song-page .song-title-row { margin: 0; }
.song-page .song-detail-title { margin: 0; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.02; letter-spacing: -.02em; }
.song-head-facts { margin: 0; color: var(--color-text-muted); font-size: .98rem; }
.song-head-facts a { color: var(--color-forest-main); font-weight: 650; text-decoration: none; }
.song-head-facts a:hover { text-decoration: underline; }
.song-head-by { margin: 0; color: var(--color-text-secondary); font-size: .95rem; }
.song-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.song-head-actions .grass-save-song-slot { margin: 0; }
.song-head-share { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--detail-rule);
  border-radius: 6px; background: #fff; color: var(--color-forest-main); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.song-head-share .material-icons { font-size: 18px; }
.song-head-share:hover { border-color: var(--color-forest-main); }
.song-head-chords { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.song-head-chords-label { color: var(--color-text-muted); font-size: .88rem; font-weight: 650; }
.song-page .song-hero-chord-grid { margin-top: 0; }

/* The sign-up box (web-auth.js): one quiet line under the top, not a
   banner. Its words and button are the experiment's; only its look is the
   page's. */
.song-page .grass-signup-footer.song-signup { margin: 22px 0 0; padding: 12px 16px; border: 1px solid var(--detail-rule); border-radius: 6px;
  background: var(--detail-wash, #f7f3ea); box-shadow: none; }
.song-page .grass-signup-top .grass-signup-footer-copy { color: var(--detail-ink); font-size: 1rem; font-weight: 700; }
.song-page .grass-signup-top .grass-signup-save-description { color: var(--color-text-secondary); font-size: .9rem; }
.song-page .grass-signup-top .grass-signup-footer-submit { border-radius: 6px; background: var(--color-forest-main); }
.song-page .grass-signup-top .grass-signup-footer-submit:hover { background: var(--color-forest-deep); }
html.grass-signed-in .song-page .song-signup { display: none; }

/* ---- the parts ---- */
.song-page .page-tabs { margin-top: 26px; }
.song-part { min-width: 0; scroll-margin-top: calc(var(--page-tabs-top, 64px) + 64px); }
.song-part > h2, .song-page .where-played h2 { margin: 0 0 12px; color: var(--detail-ink); font-size: 1.45rem; }
.song-part-chords { margin-top: 22px; }

/* ---- the video player (templates/song_detail_new.html .song-player),
   shown while a video picked anywhere on the page plays in it
   (static/js/video-reel.js): beside the chart and lyrics on a computer and
   above them on a phone. ---- */
.song-player { display: none; margin: 0 0 14px; overflow: hidden; border-radius: 6px; background: #000; }
.song-player.is-playing { display: block; }
.song-player-bar { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 4px 0 12px; background: var(--detail-ink); color: #fff; }
.song-player-title { flex: 1; min-width: 0; overflow: hidden; font-size: .84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.song-player-close { display: grid; flex: none; place-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: #fff; cursor: pointer; }
.song-player-close svg { width: 16px; height: 16px; }
.song-player-close:hover { background: rgba(255, 255, 255, .16); }
.song-player-close:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.song-player-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* ---- the backing track, as the bottom edge of the chart and lyrics
   (.song-sheet): at the window's bottom while they scroll past it, resting
   under them at their end. Its controls are drawn by
   static/js/backing-track.js, whose markup the home and practice pages
   share: one row of the dock's own parts, which wraps where it's narrow,
   with the player's own round play button and named instruments, and the
   tempo set by its buttons alone (no slider). ---- */
.song-sheet { min-width: 0; }
.song-page .song-sheet .song-chords-lyrics-row { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.song-page .song-sheet .song-practice-dock { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: -1px 0 0; padding: 6px 8px 6px 12px; overflow: visible; border: 1px solid var(--detail-rule); border-radius: 0 0 6px 6px;
  background: #fff; box-shadow: none; }
.song-sheet .song-practice-dock-body, .song-sheet #backingTrackMount, .song-sheet .playback-controls, .song-sheet .tempo-control { display: contents; }
.song-page .song-sheet .song-practice-dock-header { width: auto; min-height: 0; margin-right: 2px; padding: 0; background: transparent;
  color: var(--detail-ink); font-size: .84rem; font-weight: 700; white-space: nowrap; }
.song-sheet .song-practice-dock-title .material-icons { display: none; }
.song-sheet .backing-track-btn { order: 1; }
.song-sheet .tempo-btns { display: flex; gap: 2px; }
.song-sheet .tempo-btns:first-of-type { order: 2; }
.song-sheet .tempo-value { order: 3; }
.song-sheet .tempo-label { order: 4; }
.song-sheet .tempo-btns:last-of-type { order: 5; }
.song-sheet .tempo-slider { display: none; }
.song-sheet .volume-control { order: 7; gap: 3px; margin-left: auto; }
.song-sheet .instrument-toggles { order: 8; display: flex; flex-wrap: wrap; gap: 4px; width: auto; margin: 0; padding: 0; border: 0; }
.song-sheet .tempo-btn { min-width: 24px; height: 26px; padding: 0 4px; border-radius: 4px; font-size: 11px; }
/* The tempo as the player's one readout. */
.song-sheet .tempo-value { box-sizing: border-box; display: grid; place-content: center; min-width: 38px; height: 26px; padding: 0 6px; border: 0; border-radius: 4px;
  background: var(--detail-ink); color: #fff; font-size: .95rem; font-variant-numeric: tabular-nums; }
.song-sheet .tempo-label { color: var(--color-text-muted); font-size: .76rem; font-weight: 650; }
.song-sheet .volume-icon { font-size: 18px; }
.song-sheet .volume-slider { width: 60px; height: 4px; }
.song-sheet .volume-slider::-webkit-slider-thumb { width: 12px; height: 12px; }
.song-sheet .volume-slider::-moz-range-thumb { width: 12px; height: 12px; }
/* A phone: play, the tempo and the volume on one line (without the
   title), then the instruments two by two. */
@media (max-width: 760px) {
  .song-page .song-sheet .song-practice-dock { gap: 4px; }
  .song-page .song-sheet .song-practice-dock-header { display: none; }
  .song-sheet .volume-slider { width: 48px; }
  .song-sheet .instrument-toggles { display: grid; flex: 1 1 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.song-page .song-chords-lyrics-row { border-radius: 6px; }

/* Lessons and videos beside where it's played. */
.song-learn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 40px; }
.song-videos { display: flex; flex-direction: column; gap: 18px; }
.song-videos > h2 { margin-bottom: 0; }
.song-tyler { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.song-tyler li { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.song-tyler b { color: var(--detail-ink); font-size: .95rem; font-weight: 650; }
.song-tyler span:not([class]) { color: var(--color-text-muted); font-size: .84rem; }
.song-tyler-video { position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; border-radius: 6px;
  background: #1d2f2c; }
.song-tyler-video img { display: block; width: 100%; height: 100%; object-fit: cover; }
.song-tyler-video .video-reel-tag { left: 8px; top: 8px; font-size: .76rem; }
.song-tyler-play { position: absolute; inset: 0; width: 46px; height: 46px; margin: auto; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.song-tyler-play::after { content: ""; position: absolute; left: 18px; top: 14px; border-left: 15px solid #fff; border-top: 9px solid transparent;
  border-bottom: 9px solid transparent; }
.song-tyler-video:hover .song-tyler-play { background: var(--color-forest-main); }
.song-tyler-video:focus-visible { outline: 2px solid var(--color-forest-main); outline-offset: 2px; }
.song-page .where-played { margin-top: 0; }
/* Performances: a row of their own, under the lessons and the jams. */
.song-performances { margin-top: 40px; }
.song-performances .video-reel-title { color: var(--detail-ink); font-family: var(--font-serif); font-size: 1.45rem; }

/* About, at a reading width, and the collections it's in. */
.song-page .song-about-section { max-width: 760px; margin-top: 44px; }
.song-collections { margin: 16px 0 0; color: var(--color-text-secondary); font-size: .95rem; }
.song-collections a { color: var(--color-forest-main); font-weight: 650; text-decoration: none; }
.song-collections a:hover { text-decoration: underline; }
.song-page .song-explore { margin-top: 48px; }

/* ---- a computer: the demo beside the name; videos beside the jams ---- */
@media (min-width: 761px) {
  .song-head { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 34px; }
  .song-head.song-head-plain { grid-template-columns: minmax(0, 1fr); }
  .song-head.song-head-plain:has(.song-viewer.is-playing) { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .song-learn { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 44px; }
  .song-learn-one { grid-template-columns: minmax(0, 1fr); }
  /* A song with no lyrics: its chart is the whole row, not half of one. */
  .song-page .song-chords-lyrics-row--chords-only { grid-template-columns: minmax(0, 1fr); }
  .song-learn-one .song-jams { max-width: 640px; }
  /* A video playing: the player beside the chart and lyrics, staying in
     view under the bar of parts while they scroll; the chart over the
     lyrics until there's room for them side by side. */
  .song-part-chords:has(.song-player.is-playing) { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
  .song-part-chords:has(.song-player.is-playing) .song-player { position: sticky; top: calc(var(--page-tabs-top, 64px) + 56px); margin: 0; }
  .song-part-chords:has(.song-player.is-playing) .song-chords-lyrics-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .song-part-chords:has(.song-player.is-playing) .song-chords-section { border-right: 0; border-bottom: 1px solid var(--detail-rule); }
}

/* A wide window: with a video playing, the chords part runs wider than the
   page (up to 1440px), so the player, the chart and the lyrics sit side by
   side. */
@media (min-width: 1240px) {
  .song-part-chords:has(.song-player.is-playing) { width: min(1440px, calc(100vw - 48px)); margin-left: calc(50% - min(720px, 50vw - 24px)); }
  .song-part-chords:has(.song-player.is-playing) .song-chords-lyrics-row:not(.song-chords-lyrics-row--chords-only) {
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); }
  .song-part-chords:has(.song-player.is-playing) .song-chords-section { border-right: 1px solid var(--detail-rule); border-bottom: 0; }
}

/* ---- a phone: the name, the sign-up line, then the chart (under the
   video while one plays), the lyrics and the backing track; where it's
   played comes before the videos ---- */
@media (max-width: 760px) {
  /* No demo picture by the name on a phone, but a song with no chart shows
     its viewer there once a video plays in it. */
  .song-viewer:not(.is-playing), .song-head-chords { display: none; }
  /* (The old layout ordered the title after other things on a phone.) */
  .song-page .song-title-row { order: 0; }
  .song-page .song-detail-title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .song-part-chords .song-chords-lyrics-row { display: contents; }
  .song-part-chords .song-lyrics-section { margin-top: 14px; }
  .song-page .song-sheet .song-chords-lyrics-row > :last-child { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .song-learn { margin-top: 32px; }
  .song-learn .song-jams { order: -1; }
}
