/* ================================================================
   MELODY MONKEY — song page styles
   Loaded AFTER lesson.css on every /songs/**.html page.
   Reuses lesson.css tokens (--bg, --card, --border, --accent-*, --grad).
   Only adds what a song page needs on top of the lesson system.
   ================================================================ */

/* ---------- hero: art + answer, side by side ---------- */
.song-hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
  margin: 22px 0 30px;
}
.song-art {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.song-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* fallback art — generated, always copyright-clean */
.song-art-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: var(--grad);
  text-align: center; padding: 18px;
}
.song-art-fallback .fa-key {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 54px; font-weight: 900; color: #fff; line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.song-art-fallback .fa-sub {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.85);
}

/* ---------- the answer block (featured-snippet bait) ---------- */
.song-answer {
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 18px;
}
.song-answer strong { color: var(--text); font-weight: 700; }

.song-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 700;
  color: #10b981;
  margin: -6px 0 20px;
}

.song-source {
  font-size: .74rem;
  color: var(--muted);
  margin: 4px 0;
}
.song-source a { color: var(--muted); text-decoration: underline; }
.song-source a:hover { color: var(--text-2); }

/* ---------- facts grid ----------
   Fixed 3 columns, never auto-fit. Two rows of three squares up against the
   240px art instead of orphaning a ragged last row. Every cell is the same
   height regardless of how long its value is. */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: start;
}
.fact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 115px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  transition: background .25s ease, border-color .25s ease;
}
.fact:hover { background: var(--card-hover); }
.fact-label {
  font-size: .66rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.fact-value {
  font-family: 'Nunito', system-ui, sans-serif;
  /* shrinks itself rather than blowing out the cell on "D major or B minor" */
  font-size: clamp(1rem, 1.5vw + .45rem, 1.45rem);
  font-weight: 900; color: var(--text); line-height: 1.2;
  overflow-wrap: anywhere; hyphens: auto;
}
/* long values (key candidates) step down instead of wrapping to three lines */
.fact-value.is-long { font-size: clamp(.86rem, .9vw + .42rem, 1.02rem); line-height: 1.3; }
.fact-note {
  font-size: .72rem; color: var(--muted); line-height: 1.3;
  overflow-wrap: anywhere;
}

/* the gap: an unknown fact is a conversion opportunity, not an error */
.fact.is-gap {
  border-style: dashed;
  border-color: var(--accent-2);
  background: rgba(139, 92, 246, 0.06);
}
.fact.is-gap .fact-value {
  font-size: 1rem; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fact.is-gap a { text-decoration: none; }
.fact.is-gap:hover { background: rgba(139, 92, 246, 0.12); }

/* ---------- difficulty rating (community vote, Website/JS/song-rating-widget.js) ----------
   Its own centered block below the art + fact grid, not one of the facts. */
.song-rating-block {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; margin: 4px 0 28px;
}
.song-rating-label {
  font-size: .72rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.song-rating-stars { display: flex; gap: 4px; margin: 2px 0; }
.song-star {
  background: none; border: none; cursor: pointer; padding: 0;
  line-height: 1; font-size: 1.6rem; color: var(--muted);
  transition: transform .15s ease, color .15s ease;
}
.song-star:hover { color: var(--accent-1); transform: scale(1.15); }
.song-star.filled { color: var(--accent-1); }
/* your own vote picks up the purple accent instead of gold, so "this is what
   I said" reads differently from "this is the crowd average". */
.song-rating-stars.mine .song-star.filled { color: var(--accent-2); }
.song-rating-meta { font-size: .78rem; color: var(--muted); }

/* ---------- honesty / ambiguity callout ---------- */
.song-gap-card {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-2);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 26px 0;
}
.song-gap-card h3 {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1.05rem; font-weight: 800; color: var(--text); margin-bottom: 8px;
}
.song-gap-card p { color: var(--text-2); line-height: 1.7; font-size: .95rem; margin-bottom: 12px; }
.song-gap-card p:last-child { margin-bottom: 0; }

/* ---------- metronome ---------- */
.metro {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px;
}
.metro-dot {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--card);
  flex-shrink: 0;
  transition: transform .08s ease, background .08s ease, border-color .08s ease;
}
.metro-dot.tick {
  background: var(--grad);
  border-color: transparent;
  transform: scale(1.14);
}
.metro-speeds { display: flex; gap: 8px; flex-wrap: wrap; }
.metro-speed {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 999px;
  padding: 6px 13px; font-size: .82rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all .2s ease;
}
.metro-speed:hover { background: var(--card-hover); color: var(--text); }
.metro-speed.active {
  background: var(--grad); border-color: transparent; color: #fff;
}

/* ---------- chord strip ---------- */
.chord-strip {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 4px 0 2px;
}
.chord-pill {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800; font-size: .95rem;
  background: var(--card); border: 1px solid var(--border-strong);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 8px 14px; cursor: pointer; font-family: inherit;
  transition: all .2s ease;
}
.chord-pill:hover { background: var(--card-hover); transform: translateY(-1px); }
.chord-pill.playing { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- related songs ---------- */
.song-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.song-related a {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px;
  text-decoration: none; transition: all .25s ease;
}
.song-related a:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.song-related .sr-artist {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.song-related .sr-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.song-related .sr-meta { font-size: .74rem; color: var(--accent-1); font-weight: 700; }

/* ---------- related section headings ---------- */
.rel-head {
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1rem; font-weight: 800; color: var(--text-2);
  margin: 22px 0 10px;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .song-hero { grid-template-columns: 190px 1fr; gap: 20px; }
  .song-art { width: 190px; height: 190px; }
  .fact { min-height: 90px; }
}
@media (max-width: 640px) {
  .song-hero { grid-template-columns: 1fr; gap: 18px; }
  .song-art { width: 100%; height: auto; aspect-ratio: 1 / 1; max-width: 300px; margin: 0 auto; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .fact { min-height: 84px; }
}

/* "See all →" link inside a related-section heading */
.rel-head .rel-all {
  font-size: .8rem; font-weight: 700; margin-left: 8px;
  text-decoration: none; color: var(--accent-1);
  opacity: .85; transition: opacity .2s ease;
}
.rel-head .rel-all:hover { opacity: 1; text-decoration: underline; }
