/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ── Live follower surfaces (projector / musician) ──────────────────────────
   Projector = "Classic" look: true black, bold sans-serif, maximum contrast for
   any projector in any lighting. The fit Stimulus controller sizes .projector-lyrics
   to fill the stage; CSS only sets face, weight, colour and layout. */
.follower-body { margin: 0; background: #000; }

.projector-root {
  position: fixed; inset: 0;
  background: #000; color: #fff;
  display: flex; flex-direction: column;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.musician-root { min-height: 100vh; padding: 2rem; box-sizing: border-box; }

/* The live frame is the flex stage: lyrics centered, copyright pinned to the foot. */
#live-frame {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6vh 6vw; text-align: center;
}
.projector-section { display: flex; flex-direction: column; align-items: center; width: 100%; }

.projector-lyrics { width: 100%; }
.projector-line {
  font-weight: 700; line-height: 1.15; letter-spacing: -0.01em;
  text-wrap: balance;
}
.projector-line + .projector-line { margin-top: 0.35em; }

/* Operator preview: a bounded dark mini-stage showing the live projector frame in place, so the
   operator sees exactly what's on the screen. Overrides the full-viewport projector stage sizing. */
.projector-preview { background: #000; color: #fff; aspect-ratio: 16 / 9; position: relative; }
.projector-preview #live-frame { position: static; inset: auto; height: 100%; padding: 4% 5%; }
.projector-preview .projector-line { font-size: clamp(1rem, 3.5vw, 2rem); }
.projector-preview .projector-title-name { font-size: clamp(1.25rem, 4vw, 2.5rem); }
/* The blank overlay is position:fixed for the real full-screen projector; inside the operator
   preview it must stay WITHIN the preview box, not cover the whole page. */
.projector-preview .projector-blank { position: absolute; }

.projector-copyright {
  margin-top: 4vh; font-size: clamp(0.8rem, 1.4vw, 1.1rem);
  color: #9aa0a6; letter-spacing: 0.02em; text-align: center; font-weight: 400;
}

/* Title slide: the song name large and centered, with any licensing/credit lines muted below. */
.projector-title { justify-content: center; }
.projector-title-content { width: 100%; text-align: center; }
.projector-title-name { font-weight: 800; line-height: 1.1; }
.projector-title-credits { margin-top: 5vh; color: #9aa0a6; font-weight: 400; }
.projector-title-credit-line { font-size: clamp(0.9rem, 1.8vw, 1.4rem); letter-spacing: 0.02em; }
.projector-title-credit-line + .projector-title-credit-line { margin-top: 0.4em; }

/* Blank: a true-black fill that hides everything (operator pressed Blank). */
.projector-root.is-blanked, .projector-blank { background: #000; }
.projector-blank { position: fixed; inset: 0; }

.projector-slide { width: 100%; }
.projector-slide-body { text-align: center; font-weight: 600; }

.live-ended { text-align: center; font-size: 1.5rem; color: #9aa0a6; }

/* ── Musician view — a LIGHT, high-readability lead sheet (not the dark stage) ──
   The projector/congregation surfaces stay true-black; the musician reads from a
   bright paper-like chart. The whole set is shown in order; a sticky header tracks
   the live "Now" and peeks at "Next". */

/* Override the shared black follower background for the musician page only. */
.follower-body:has(.musician-root) { background: #f6f7f9; }

.musician-root {
  min-height: 100vh;
  padding: 0 0 4rem;
  box-sizing: border-box;
  background: #f6f7f9;
  color: #16181d;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Chord/lyric layout: chord floats above its syllable so a wide chord never injects a space.
   Shared by the live "Now" frame and the full chart. Monospace keeps columns honest. */
.musician-line,
.musician-chart-line {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; padding-top: 1.35em;
  font-size: 1.15rem; line-height: 1.5;
}
.musician-seg { position: relative; display: inline-block; white-space: pre; vertical-align: bottom; }
.musician-chord {
  position: absolute; bottom: 100%; left: 0; font-weight: 700; line-height: 1;
  white-space: pre; padding-right: 0.5rem; color: #1a56db; /* chords in a strong blue */
}

/* Top bar: set name + key/capo chooser, sticky so controls are always reachable. */
.musician-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: #ffffff; border-bottom: 1px solid #e3e6ea;
}
.musician-setname { font-weight: 700; font-size: 1.05rem; }
.musician-key-chooser { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; color: #4a5059; }
.musician-key-chooser label { display: inline-flex; align-items: center; gap: 0.4rem; }
.musician-field {
  border: 1px solid #c9ced6; border-radius: 0.5rem; padding: 0.3rem 0.5rem; width: 4rem;
  background: #fff; color: #16181d; font-size: 0.95rem;
}
.musician-field-sm { width: 3.25rem; }

/* Above the fold: the sticky Now/Next header that follows the projector. */
.musician-nowbar {
  position: sticky; top: 3.25rem; z-index: 20;
  margin: 0 0 1.25rem; padding: 1rem 1.25rem 1.1rem;
  background: #fffdf4; border-bottom: 2px solid #e8d98f; /* a warm "live" band */
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.musician-cue {
  display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.1rem 0.5rem; border-radius: 0.4rem; margin-bottom: 0.4rem;
}
.musician-cue-now { background: #b45309; color: #fff; }
.musician-cue-next { background: #e5e7eb; color: #4a5059; }
.musician-now #live-frame {
  display: block; padding: 0; text-align: left; align-items: stretch; /* undo stage centering */
}
.musician-now .musician-chart-section,
.musician-now .musician-section { margin: 0; }
/* The Now frame's chords stay blue and bold; its key badge is a light pill. */
.musician-now [data-role=key-badge] {
  display: inline-block; background: #eef2ff; color: #1a56db; border: 1px solid #c7d2fe;
  font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 0.4rem; margin-bottom: 0.5rem;
}
.musician-next { margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px dashed #e8d98f; }
.musician-next-body { color: #4a5059; font-size: 0.95rem; }
.musician-peek-label { font-weight: 700; color: #16181d; margin-right: 0.4rem; }
.musician-peek-title { font-weight: 700; }
.musician-peek-lyric { color: #6b7280; }

/* The whole-set chart. */
.musician-setlist { padding: 0 1.25rem; max-width: 56rem; margin: 0 auto; }
.musician-row {
  padding: 0.9rem 1.1rem; margin-bottom: 0.85rem;
  background: #ffffff; border: 1px solid #e3e6ea; border-radius: 0.75rem;
  scroll-margin-top: 8rem; /* clear the sticky Now/Next header when scrolled to */
}
.musician-row.is-current { border-color: #b45309; box-shadow: 0 0 0 2px rgba(180,83,9,0.25); }

.musician-chart-title h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.musician-chart-key {
  display: inline-block; background: #eef2ff; color: #1a56db; border: 1px solid #c7d2fe;
  font-size: 0.8rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 0.4rem; margin-top: 0.4rem;
}
.musician-chart-credits { margin-top: 0.5rem; color: #6b7280; font-size: 0.9rem; }

.musician-chart-label,
.musician-section-label {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: #b45309; margin-bottom: 0.1rem;
}
.musician-chart-tag {
  margin-left: 0.5rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em;
  color: #6b7280; background: #f1f3f5; border: 1px solid #e3e6ea;
  padding: 0.05rem 0.4rem; border-radius: 0.4rem; text-transform: lowercase;
}
.musician-chart-section { margin: 0.5rem 0 0.75rem; }
.musician-chart-section.is-replay { opacity: 0.92; }
.musician-chart-annotation,
.musician-annotation { font-style: italic; color: #6b7280; }
.musician-empty { color: #6b7280; padding: 2rem 1.25rem; text-align: center; }

/* The live frame still carries dark-stage classes on the projector; keep the shared chord
   float technique working there. The musician's live frame is recolored above. */
.musician-section-label { color: #b45309; }

@media (prefers-reduced-motion: reduce) {
  .musician-row { scroll-behavior: auto; }
}

/* ── Song sheet auto-scroll dock ─────────────────────────────────────────────
   A floating teleprompter control on the song view (a light admin page, so it uses
   semantic theme tokens). Fixed bottom-center, above the sheet; never printed. */
.autoscroll-dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 1.25rem; z-index: 40;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.9rem 0.5rem 0.5rem;
  background: var(--color-base-100, #fff);
  border: 1px solid var(--color-base-300, #d4d8de);
  border-radius: 9999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.autoscroll-speed { display: flex; align-items: center; gap: 0.5rem; }
.autoscroll-speed .range { width: 7rem; }
.autoscroll-speed-label {
  font-size: 0.8rem; font-weight: 700; min-width: 2rem; text-align: right;
  color: var(--color-base-content, #16181d);
}
@media print { .autoscroll-dock { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  /* The control still works on demand; we simply don't imply motion is free. */
  .autoscroll-dock { opacity: 0.95; }
}

/* ── Set preview page (one-page read-through inside the admin shell) ──────────
   Reuses the musician chart styling on a light surface. The preview's own top bar
   should not be sticky (the shell already has a sticky navbar), and the header +
   app chrome drop away when printing so the sheet prints clean. */
.musician-preview-page .musician-topbar { position: static; border-radius: 0.75rem; margin-bottom: 1rem; }
.musician-preview-page .musician-setlist { padding: 0; }
@media print {
  .no-print { display: none !important; }
  /* Print just the set: strip the app shell chrome around the preview. */
  [data-role=set-preview] { margin: 0 !important; max-width: none !important; }
  .musician-preview-page .musician-row { break-inside: avoid; box-shadow: none; border-color: #ccc; }
}