/* ==========================================================================
   Bandoora User Guide - shared stylesheet
   --------------------------------------------------------------------------
   Every page under web/guide/ loads exactly this file. The palette is the
   same one the single-page guide used (near-black paper, turquoise body,
   red accents), so the split does not read as a different document.

   The second block of tokens mirrors lib/design_tokens.dart. Those colours
   are quoted verbatim in the figures and in the inline chips, so a reader
   comparing the guide with the app sees the same green for "Ready" and the
   same blue for song navigation. If a token changes in the app, change it
   here too - these are the only two places it lives.
   ========================================================================== */

:root {
  /* -- Document palette ---------------------------------------------- */
  --bg:               #08090A;
  --box:              #19191C;
  --box-alt:          #131315;
  --rule:             #1F1F23;
  --red:              #E8323D;
  --red-dim:          #6B1F26;
  --red-deep:         #B4232D;
  --turquoise:        #00ADB5;
  --turquoise-bright: #33C8D1;
  --turquoise-dim:    #0E7A80;
  --paper:            #F2F2F0;

  /* -- App tokens (lib/design_tokens.dart) --------------------------- */
  --app-status-ready:      #4CAF50;
  --app-status-rehearsing: #FF9800;
  --app-status-idea:       #9E9E9E;
  --app-pro:               #FFC107;
  --app-demo:              #42A5F5;
  --app-lyrics:            #7EB8A0;
  --app-tab:               #D4A85A;
  --app-sheet:             #7AAEC8;
  --app-note-common:       #7AAEC8;
  --app-note-personal:     #7EB8A0;

  /* -- Live mode control colours (lib/live_mode_screen.dart) --------- */
  --live-surface:    #171B1B;   /* _controlSurface, dark mode           */
  --live-song-nav:   #1E88E5;   /* _songNavColor    - prev / next song  */
  --live-paging:     #E53935;   /* _pagingColor     - page up / down    */
  --live-autoscroll: #43A047;   /* _autoScrollColor - play / pause      */
  --live-automated:  #7B1FA2;   /* automated playback                   */
  --live-toggle:     #FFB300;   /* kLiveModeToggleColor - view switch   */
  --live-chord:      #9F77FF;   /* chord / key / BPM text, dark mode    */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--turquoise);
  background: var(--bg);
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* -- Site header ------------------------------------------------------ */

.site-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.site-head .logo-dot {
  width: 12px;
  height: 12px;
  background: var(--turquoise-bright);
  border-radius: 50%;
  flex: none;
}

.site-head a.wordmark {
  color: var(--turquoise-bright);
  font-weight: 700;
  letter-spacing: -0.3px;
  text-decoration: none;
  font-size: 16px;
}

.site-head .crumb {
  color: var(--turquoise-dim);
  font-size: 13px;
}

/* -- Language switcher ------------------------------------------------
   Pushed to the far end of the header row by the auto margin, so it keeps
   its place whether or not the page has a breadcrumb. The header is
   flex-wrap, so on a narrow phone the switcher drops to its own line
   instead of squeezing the wordmark.

   Codes rather than language names, because four names do not fit next to
   a breadcrumb on a 360px screen; the language's own name for itself is
   carried as the accessible name and the tooltip. See buildLangSwitch()
   in guide.js.
   --------------------------------------------------------------------- */

.site-head .lang-switch {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.site-head .lang-switch a {
  color: var(--turquoise-dim);
  text-decoration: none;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.site-head .lang-switch a:hover,
.site-head .lang-switch a:focus-visible {
  color: var(--turquoise-bright);
  border-color: var(--turquoise-dim);
}

/* The language you are already reading: same size and position as the
   links, but clearly not a control. */
.site-head .lang-switch .lang-current {
  color: var(--paper);
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--turquoise-dim);
  background: var(--box);
}

/* -- "Not translated yet" banner --------------------------------------
   Shown on a language page that still carries the English source text
   (body[data-guide-untranslated]). Amber rather than red: this is a
   caveat about the page, not an error in it.
   --------------------------------------------------------------------- */

.untranslated {
  border: 1px solid var(--app-pro);
  border-left: 3px solid var(--app-pro);
  background: var(--box-alt);
  color: var(--paper);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
}

/* -- Page title ------------------------------------------------------- */

header.page {
  border-bottom: 3px solid var(--red);
  padding-bottom: 22px;
  margin-bottom: 30px;
}

h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--turquoise-bright);
  line-height: 1.25;
}

/* The one-sentence "what this is for" line that opens every page. */
.lede {
  color: var(--paper);
  font-size: 16px;
  margin-top: 10px;
  line-height: 1.6;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  margin: 38px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--red-dim);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--turquoise-bright);
  margin: 24px 0 8px;
}

p { margin-bottom: 12px; }

a { color: var(--turquoise-bright); }

ul, ol { margin: 0 0 14px 22px; }
li { margin-bottom: 6px; }

strong { color: var(--turquoise-bright); font-weight: 600; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--box-alt);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--paper);
}

/* -- "The three things you need to know" ------------------------------ */

.essentials {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  counter-reset: essential;
}

.essentials > li {
  position: relative;
  padding: 14px 18px 14px 52px;
  background: var(--box);
  border-radius: 10px;
  margin-bottom: 10px;
  counter-increment: essential;
}

.essentials > li::before {
  content: counter(essential);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red-deep);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.essentials > li b {
  color: var(--turquoise-bright);
  display: block;
  margin-bottom: 2px;
}

/* -- Numbered walkthrough steps --------------------------------------- */

ol.steps { list-style: none; margin-left: 0; counter-reset: step; }

ol.steps > li {
  position: relative;
  padding-left: 38px;
  margin-bottom: 12px;
  counter-increment: step;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red-deep);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -- Definition-style tables ------------------------------------------ */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
}

th {
  color: var(--turquoise-bright);
  font-weight: 600;
  white-space: nowrap;
}

td:first-child {
  color: var(--turquoise-bright);
  font-weight: 600;
  white-space: nowrap;
}

/* Tables can carry control glyphs and long labels; never let the page
   itself scroll sideways on a phone. */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* -- Callouts --------------------------------------------------------- */

.tip, .note {
  background: var(--box);
  border-left: 3px solid var(--turquoise-dim);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
  font-size: 14px;
}

.note { border-left-color: var(--red-dim); }

.tip b, .note b { color: var(--turquoise-bright); }

/* -- Badges ----------------------------------------------------------- */

.pro-badge {
  display: inline-block;
  background: var(--app-pro);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 1px 6px;
  border-radius: 4px;
  vertical-align: 2px;
  margin-left: 6px;
  text-decoration: none;
}

.beta-badge {
  display: inline-block;
  background: var(--box-alt);
  border: 1px solid var(--turquoise-dim);
  color: var(--turquoise-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 0 5px;
  border-radius: 4px;
  vertical-align: 2px;
  margin-left: 4px;
}

/* An inline swatch that names one of the app's control colours, so the
   prose can say "the blue buttons" and show which blue it means. */
.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: 0;
}

/* -- Advanced sections, collapsed by default -------------------------- */

details.advanced {
  background: var(--box-alt);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin: 18px 0;
  padding: 0 18px;
}

details.advanced > summary {
  cursor: pointer;
  padding: 14px 0;
  color: var(--turquoise-bright);
  font-weight: 600;
  list-style: none;
}

details.advanced > summary::-webkit-details-marker { display: none; }

details.advanced > summary::before {
  content: "\25B8";
  display: inline-block;
  width: 18px;
  color: var(--red);
}

details.advanced[open] > summary::before { content: "\25BE"; }

details.advanced[open] > summary { border-bottom: 1px solid var(--rule); }

details.advanced > *:not(summary) { margin-bottom: 12px; }
details.advanced > *:first-of-type { margin-top: 14px; }
details.advanced > *:last-child { margin-bottom: 18px; }

/* -- Figures ---------------------------------------------------------- */

figure {
  margin: 20px 0;
  background: var(--box-alt);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
}

/* The diagrams carry labels at a fixed type size. Shrinking one to a 340 px
   phone would make its text illegible, so below a floor width the figure
   scrolls sideways inside its own box instead - the page body itself never
   scrolls horizontally. .wide is for the two-phones-side-by-side figure,
   which needs more room than the single-bar ones. */
figure .fig-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

figure svg, figure img {
  display: block;
  width: 100%;
  height: auto;
  min-width: 520px;
}

figure.wide svg { min-width: 700px; }

figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--turquoise-dim);
  line-height: 1.55;
}

figcaption b { color: var(--turquoise-bright); }

/* -- Card grid (used by index.html) ----------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 18px 0 8px;
}

a.card {
  display: block;
  background: var(--box);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--turquoise);
}

a.card:hover { border-color: var(--turquoise-dim); }

a.card b {
  display: block;
  color: var(--turquoise-bright);
  font-size: 16px;
  margin-bottom: 4px;
}

a.card span { font-size: 13px; color: var(--turquoise-dim); line-height: 1.5; }

/* -- "Next step" ------------------------------------------------------ */

.next-step {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.next-step b { color: var(--turquoise-dim); font-weight: 600; }

.next-step a { font-weight: 600; }

/* -- Footer (written by guide.js) ------------------------------------- */

footer.site-foot {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--turquoise-dim);
  line-height: 1.8;
}

footer.site-foot a { color: var(--turquoise-dim); }

/* -- Narrow screens --------------------------------------------------- */

@media (max-width: 560px) {
  body { padding: 20px 16px 60px; font-size: 15px; }
  h1 { font-size: 23px; }
  h2 { font-size: 18px; }
  .cards { grid-template-columns: 1fr; }
}
