/* THE STRIKE SONG (ADR-060, doc/03): a street poster, loud and hand-made, on
   the site's own tones and faces. Every pair below was measured in both
   modes: the coral bands, ink on coral, 7.3:1 in both; verses, ink on page,
   6.9:1 light and 12.1:1 dark; translations and credits, secondary on page,
   5.9:1 and 10.0:1; links, accent on page, 8.6:1 and 10.6:1; chords, accent
   on paper, 9.6:1 and 9.2:1; the rest of the chords panel, text on paper,
   7.8:1 and 10.5:1. The chord diagrams keep the white of the PDF in both. */

/* The opening and the closing band reach the edges of the window, so the
   column stops pushing the first one down, and the body cuts the width a
   classic scrollbar adds to 100vw. clip, not hidden: no scroll container. */
body:has(.block-song) { overflow-x: clip; }
.page:has(> .block-song) { padding-top: 0; }

.block-song {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  /* main.css keeps the block hidden until this sheet has arrived. */
  visibility: visible;
  animation: none;
}

/* The opening: the crowd growing, on coral from edge to edge. */
.song-opening {
  container-type: inline-size;
  margin-inline: calc(50% - 50vw);
  padding: var(--space-5) var(--space-4) var(--space-6);
  background: var(--accent-warm);
  color: var(--accent-warm-ink);
}

.song-shout {
  margin: 0;
  font-family: var(--font-slide-caption);
  line-height: 0.86;
  /* A stamp lands from larger than its final size, so for the first second
     MIL covers the buttons below it and would swallow the tap on «Cantar». */
  pointer-events: none;
}

.song-shout__call {
  display: block;
  font-size: 20cqw;
}

/* A phone stacks the words, each much larger than the last, and «MIL !»
   takes the whole width. The sizes are measured on these three words of
   Londrina, the last with its closing mark and a space (Juan, 6 November
   2026); the opening clips if an editor writes much longer ones, and a
   word never breaks in two, so the mark stays on MIL's line. */
.song-shout__counts {
  display: flex;
  flex-direction: column;
}

.song-shout__count {
  display: block;
  width: fit-content;
  white-space: nowrap;
  transform: rotate(-1.5deg);
  transform-origin: left center;
}

.song-shout__count:nth-child(1) { font-size: 24cqw; }
.song-shout__count:nth-child(2) { font-size: 38cqw; transform: rotate(1deg); }
.song-shout__count:nth-child(3) { font-size: 60cqw; transform: none; }

/* From a tablet up the stack would be taller than the screen, so the words
   grow along one line that fills the width instead. */
@media (min-width: 768px) {
  .song-opening { padding-inline: var(--space-6); }
  .song-shout__call { font-size: 11cqw; }

  .song-shout__counts {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .song-shout__count:nth-child(1) { font-size: 12cqw; }
  .song-shout__count:nth-child(2) { font-size: 20cqw; }
  .song-shout__count:nth-child(3) { font-size: 27cqw; }
}

/* Each word lands once, like a stamp; with reduced motion they are already
   there, since the rule is not even declared. */
@media (prefers-reduced-motion: no-preference) {
  .song-shout__call,
  .song-shout__count {
    animation: song-stamp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  }

  .song-shout__count:nth-child(1) { animation-delay: 0.25s; }
  .song-shout__count:nth-child(2) { animation-delay: 0.55s; }
  .song-shout__count:nth-child(3) { animation-delay: 0.9s; }
}

@keyframes song-stamp {
  from {
    opacity: 0;
    transform: scale(1.9) rotate(-6deg);
  }
}

/* body:not(.admin) outweighs main.css's rule for headings, which would
   otherwise give it the title face's tracking. */
body:not(.admin) .song-title {
  margin: var(--space-4) 0 var(--space-4);
  font-family: var(--font-slide-caption);
  font-size: clamp(1.75rem, 7cqw, 4rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.song-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The focus ring takes the ink: the ring's token is light in dark mode,
   which on the coral would fall to 2:1. */
.song-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: 2px solid var(--accent-warm-ink);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-warm-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.song-button:focus-visible { outline-color: var(--accent-warm-ink); }

/* Without JavaScript the buttons that need it are not there. */
.song-button--needs-js { display: none; }
.has-song-js .song-button--needs-js { display: inline-flex; }

.song-button:hover,
.song-button--solid {
  background: var(--accent-warm-ink);
  color: var(--accent-warm);
}

.song-button--solid {
  font-family: var(--font-slide-caption);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

/* The Assembly's own recording (ADR-066): the browser's player, as wide as
   the phone and no wider than a verse's translation on a desktop, so it
   never runs past the column of the lyrics. The note is secondary on page,
   5.9:1 and 10.0:1, and its link the accent on page, 8.6:1 and 10.6:1, both
   as measured at the top of this file. */
.song-audio { max-width: 38rem; }

.song-audio h3 {
  margin-bottom: var(--space-2);
  font-size: 1.35rem;
}

/* block, since an inline <audio> leaves the gap of a text line under it.
   The height stays the browser's own: each one draws its controls at a
   different one, and a height of ours would squash some of them. */
.song-audio audio {
  display: block;
  width: 100%;
}

.song-audio__note {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* The lyrics, as a leaflet: room around each verse and the chorus as a coral
   sticker between them. */
.song-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  container-type: inline-size;
}

.song-line { display: block; }

.song-verse { align-self: flex-start; }

/* From a tablet up the verses take turns left and right, as if pasted up by
   hand; the text itself stays left-aligned, to be read. */
@media (min-width: 768px) {
  .song-verse:nth-of-type(even) {
    align-self: flex-end;
    margin-inline-end: 12%;
  }
}

/* A song whose verses follow one another without the chorus between them
   keeps them all on the left: taking turns, they zigzag (ADR-065). The
   rule is outside the media query above and after it, so it wins there. */
.song-sheet--straight .song-verse:nth-of-type(even) {
  align-self: flex-start;
  margin-inline-end: 0;
}

.song-verse__lyrics {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.2rem, 1rem + 1.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
}

.song-verse__translation {
  max-width: 38rem;
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* A direction inside the lyrics («Instrumental o coros», ADR-065), in the
   same face and colour as the closing one. */
.song-verse__note {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 1.35rem;
}

.song-verse__lyrics + .song-verse__note,
.song-verse__translation + .song-verse__note { margin-top: var(--space-3); }

.song-chorus {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--accent-warm);
  color: var(--accent-warm-ink);
  font-family: var(--font-slide-caption);
  font-size: clamp(1.2rem, 0.85rem + 1.9vw, 1.85rem);
  line-height: 1.15;
  text-wrap: balance;
  rotate: -0.8deg;
}

.song-chorus:nth-of-type(even) { rotate: 0.6deg; }

/* Six short lines read as two columns of three on a wide band, which keeps
   nine repeats of it from filling the page. */
@container (min-width: 56rem) {
  .song-chorus {
    columns: 2;
    column-gap: var(--space-6);
  }

  .song-chorus .song-line { break-inside: avoid; }
}

/* A refrain sung in parts: each part after the first starts a little
   lower, so the parts read apart (ADR-065). */
.song-line--stanza { margin-top: 0.6em; }

.song-ending {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 1.35rem;
  text-align: center;
}

.song-credits {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* The chords, on paper, for whoever plays. */
.song-chords {
  padding: var(--space-4) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--paper-bg);
  color: var(--text-primary);
}

.song-chords > summary {
  min-height: 1.5rem;
  font-family: var(--font-title);
  font-size: 1.35rem;
  cursor: pointer;
}

.song-chords__intro {
  margin: var(--space-4) 0;
  font-weight: 600;
  white-space: pre-wrap;
}

.song-chords__charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-5);
}

/* The longest line has 36 characters: this size keeps it, and the syllable
   each chord sits on, in one piece at 320 px. */
.song-chart__line {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 var(--space-2);
  font-size: clamp(0.875rem, 4.4vw, 1rem);
}

/* A segment is a box with its chord on top, so the chord stays over the first
   letter of its text in any face. break-spaces keeps the space before the
   next box, which pre-wrap would let hang outside the width. */
.song-chart__segment {
  display: inline-flex;
  flex-direction: column;
}

.song-chart__chord {
  min-height: 1.3em;
  color: var(--accent-blue);
  font-weight: 700;
  line-height: 1.3;
}

.song-chart__text { white-space: break-spaces; }

.song-chords__note {
  margin: 0;
  color: var(--text-secondary);
}

.song-chords__instrument {
  margin: var(--space-5) 0 var(--space-2);
  font-size: 1.25rem;
}

.song-diagrams {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.song-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
}

/* One height for the six, the size the smallest stays legible at: the guitar
   Mi7 is 70 px tall in the PDF. Three fit across 320 px at this size. */
.song-diagram img {
  width: auto;
  height: clamp(5.25rem, 24vw, 7.5rem);
  border-radius: var(--radius-sm);
}

.song-listen h3 {
  margin-bottom: var(--space-2);
  font-size: 1.35rem;
}

.song-listen p { margin: 0; }

.song-listen__note {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* The way back, first line of the coral opening: ink on coral, 7.3:1. */
.song-back { margin: 0 0 var(--space-3); }

.song-back a {
  color: inherit;
  font-weight: 600;
}

.song-back a:focus-visible { outline-color: var(--accent-warm-ink); }

/* Sing along: the whole screen. Verses on the page's own colours and the
   chorus on coral, so whoever is reading it from afar knows when to shout. */
.song-sing {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  /* The whole stage is what gets tapped, so the phone's default highlight
     would flash a blue veil over the entire screen at every verse. It is
     inherited, and the buttons keep their focus ring for the keyboard. */
  -webkit-tap-highlight-color: transparent;
}

.song-sing[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.song-sing[data-kind='chorus'],
.song-sing[data-kind='end'] {
  background: var(--accent-warm);
  color: var(--accent-warm-ink);
}

.song-sing__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.song-sing__control {
  min-height: 2.75rem;
  padding: var(--space-1) var(--space-2);
  border: 2px solid currentColor;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.song-sing__control:focus-visible { outline-color: currentColor; }

.song-sing__counter {
  margin-inline-start: auto;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.song-sing__stage {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
}

.song-sing__slide {
  width: 100%;
  padding-inline: var(--space-3);
  font-family: var(--font-slide-caption);
  line-height: 1.08;
  text-align: center;
}

/* main.css's reduced-motion guard sets a tiny transition-duration on every
   element, which makes every property transition. song.js measures the slide
   right after setting its size, and would read the size before. */
.song-sing__slide,
.song-sing__slide * {
  transition-property: none;
}

/* A big letter breaks a verse's lines in two, so room between them keeps
   showing where each one ends. */
.song-sing__slide .song-line { margin-block-end: 0.22em; }

.song-sing .song-ending {
  color: inherit;
  font-family: inherit;
  font-size: 1em;
}

/* The sheet to hand out: one A4 with the lyrics, the chorus once at the top
   and the credits. Ink on no background in both modes, since a dark-mode
   violet page would print its aquamarine text on white. */
@media print {
  @page {
    size: A4;
    margin: 9mm 14mm;
  }

  body:has(.block-song) {
    min-height: 0;
    background: none;
    color: var(--accent-warm-ink);
  }

  body:has(.block-song) :is(#site-header, #site-footer, .skip-link),
  .song-shout,
  .song-actions,
  .song-audio,
  .song-chords,
  .song-listen,
  .song-back,
  .song-sing,
  .song-chorus ~ .song-chorus {
    display: none;
  }

  .page:has(> .block-song) {
    display: block;
    max-width: none;
    padding: 0;
  }

  .block-song {
    display: block;
    color: var(--accent-warm-ink);
  }

  .song-opening {
    margin: 0;
    padding: 0;
    background: none;
    color: inherit;
    container-type: normal;
  }

  body:not(.admin) .song-title {
    margin: 0 0 4mm;
    font-size: 22pt;
    text-align: center;
  }

  /* One column on one A4 (Juan, 6-11-2026): the chorus once at the top, then
     every verse under the previous one at full width, nothing side by side
     and no cues between verses. The sizes below are what makes the nine
     verses fit the page; a tenth would not. */
  .song-sheet {
    display: flex;
    flex-direction: column;
    gap: 3.2mm;
    container-type: normal;
  }

  .song-chorus {
    order: -1;
    columns: 2;
    column-gap: 8mm;
    margin: 0 0 1mm;
    padding: 2mm 4mm;
    border: 1.5pt solid var(--accent-warm-ink);
    background: none;
    color: inherit;
    font-size: 14pt;
    line-height: 1.15;
    rotate: none;
  }

  .song-verse,
  .song-verse:nth-of-type(even) {
    align-self: stretch;
    margin: 0;
    break-inside: avoid;
  }

  .song-verse__lyrics,
  .song-verse__translation,
  .song-ending,
  .song-credits {
    color: inherit;
  }

  .song-verse__lyrics {
    font-size: 12pt;
    line-height: 1.2;
  }

  .song-verse__translation {
    margin-top: 0.5mm;
    font-size: 7pt;
    line-height: 1.2;
  }

  .song-ending {
    margin: 0;
    font-size: 11pt;
  }

  .song-credits {
    margin-top: 3mm;
    font-size: 8pt;
    line-height: 1.25;
    text-align: center;
  }
}

/* THE SONGBOOK'S FIRST SCREEN (ADR-065): one large coral button per song,
   in the face of the chorus stickers, on the muted coral of the song's
   poster (--poster-bg, ink on it 7.8:1 in both modes; 7.3:1 on the bright
   coral of the hover); the intro is secondary on page, 5.9:1 and
   10.0:1, like the credits. */
/* Under a song, the strips of the other songs (Juan, 9 November 2026:
   «quiero esas tiras en la página del qr tb»): the song's own gap comes
   from its flex column, so the next block brings its own, and a wide one
   so the strips read as another thing and not as one more verse. The
   sibling is not the adjacent one: the block's own <link> sits between. */
.block-song ~ .block-songs { margin-top: var(--space-8); }

.block-songs {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  /* main.css keeps the block hidden until this sheet has arrived. */
  visibility: visible;
  animation: none;
}

body:not(.admin) .songs-title {
  margin: 0;
  font-family: var(--font-slide-caption);
  font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
}

.songs-intro {
  margin: 0;
  color: var(--text-secondary);
}

.songs-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.songs-choice {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  min-height: 7rem;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  /* The poster's muted coral, not the strike coral: three wide strips of
     the bright one hurt the eye (Juan, 10 November 2026: «demasiado
     naranja, quiero el pastel»). The bright one is the hover. */
  background: var(--poster-bg);
  color: var(--accent-warm-ink);
  text-decoration: none;
  rotate: -0.6deg;
}

.songs-list li:nth-child(even) .songs-choice { rotate: 0.5deg; }

.songs-choice:hover { background: var(--accent-warm); }
.songs-choice:focus-visible { outline: 3px solid var(--accent-warm-ink); outline-offset: -6px; }

.songs-choice__title {
  font-family: var(--font-slide-caption);
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  line-height: 1.05;
}

.songs-choice__line {
  font-weight: 600;
  font-size: 1rem;
}

/* The printed sheet of a song is the song alone. Here at the end and not
   with the song's own print rules above: .block-songs is declared after
   them, and its display would win. */
@media print {
  .block-songs { display: none; }
}
