/* The ink and type of a printed chart: ONE set of rules, used by the Print or PDF document (.pd) and by the
   Cmd+P / browser print of the chart itself (.chart-print-root, built by chart_print.js). Paper is white, ink is
   black, chords are bold ink above their syllable, a long line wraps between words with a hanging indent. */

:is(.pd, .chart-print-root.chart-print-root) {
  --pd-ink: var(--print-ink);
  --pd-quiet: var(--print-hairline);
  --pd-rule: var(--print-rule);
  --pd-wash: var(--print-wash);
  color: var(--pd-ink);
  font-family: var(--font-ui);
  line-height: 1.25;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Chords: black and bold on paper, drawn above their syllable by chart_units.css. */
.pd,
.chart-print-root.chart-print-root {
  --chart-chord-color: var(--print-ink);
  --chart-chord-size: 0.92em;
  --chart-chord-weight: 700;
}


/* Title block (the chart's own heading when printed from the song view). */
.pd-title,
.chart-print-root.chart-print-root .pd-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--pd-ink);
  overflow-wrap: anywhere;
}

.pd-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 0; font-size: 15px; color: var(--print-muted); }
.pd-meta__key { font-weight: 700; color: var(--pd-ink); }


.pd-label,
.chart-print-root.chart-print-root .chart-line--section {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin: 0 0 0.65em;
  font-family: var(--font-ui);
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pd-quiet);
  break-after: avoid;
}

.pd-label::after,
.chart-print-root.chart-print-root .chart-line--section::after { content: ""; flex: 1; height: 1px; background: var(--pd-rule); }

/* A long line wraps between words only, with a hanging indent so the second line reads as a continuation.
   (The word boxes come from chart_units.css; each resets the indent.) */
:is(.pd, .chart-print-root.chart-print-root) .chart-line--units {
  margin: 0 0 0.5em;
  padding-left: 1.5em;
  text-indent: -1.5em;
  line-height: 1.25;
}

:is(.pd, .chart-print-root.chart-print-root) .chart-word { text-indent: 0; }

/* Chords are ink, never the screen's teal, whatever page the chart was printed from. */
:is(.pd, .chart-print-root.chart-print-root) .chart-unit__chord {
  color: var(--print-ink);
  font-size: 0.92em;
  font-weight: 700;
}

:is(.pd, .chart-print-root.chart-print-root) .chart-line--has-chords:not(.chart-line--units-chords) .chart-word--chorded { padding-top: 1.4em; }
:is(.pd, .chart-print-root.chart-print-root) .chart-line--units-chords { min-height: 0; }
:is(.pd, .chart-print-root.chart-print-root) .chart-line--units-chords .chart-unit { min-width: 0; margin-right: 0.75em; }
:is(.pd, .chart-print-root.chart-print-root) .chart-line--units-chords .chart-unit--spaced { margin-left: 0; }


.pd-lyric {
  margin: 0 0 0.5em;
  padding-left: 1.5em;
  text-indent: -1.5em;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.pd-note,
.chart-print-root.chart-print-root .chart-note {
  margin: 0.2em 0 0.6em;
  padding: 0.4em 0.7em;
  border-left: 3px solid var(--pd-ink);
  background: var(--pd-wash);
  font-size: 0.82em;
  font-style: italic;
  line-height: 1.35;
  break-inside: avoid;
}

.pd-note b,
.chart-print-root.chart-print-root .chart-note__label {
  margin-right: 0.5em;
  font-size: 0.8em;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pd-tab,
.chart-print-root.chart-print-root .chart-tab-block {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  margin: 0.2em 0 0.6em;
  padding: 0.5em 0.7em;
  border: 0.5pt solid var(--pd-rule);
  border-radius: 2pt;
  background: var(--print-panel);
  color: var(--pd-ink);
  font-family: var(--font-editor);
  font-size: 0.7em;
  line-height: 1.25;
  overflow: hidden;
  break-inside: avoid-page;
}

/* The strings of a tab sit one against the next inside the panel: no box, margin or gap of their own. */
.chart-print-root.chart-print-root .chart-tab-block .chart-line--tab {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  line-height: 1.25;
  overflow: visible;
}

/* The strings are separate rows; markup whitespace between them must not show. The line itself keeps its spaces. */
.chart-print-root.chart-print-root .chart-tab-block .chart-line--tab { white-space: pre; }

/* A chart's own chord shapes print as bare diagrams, with no panel. */
.chart-print-root.chart-print-root .chart-tab-block[data-shapes-drawn] {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5em 1.1em;
  white-space: normal;
  padding: 0;
  border: 0;
  background: none;
}

/* Ink on paper: the name and the dots of a chart-defined shape are black, never teal. */
.chart-print-root.chart-print-root .chart-shape {
  --accent: var(--pd-ink);
  --chart-chord-color: var(--pd-ink);
}
.chart-print-root.chart-print-root .chart-shape__name { color: var(--pd-ink); }
