/* tunepages.css — TunePages chord chart stylesheet */



/* colors */

:root
{
 --color-page-bg:       oklch(97% 0.003 80);

 /* text in shades of grey */
 --color-text:          oklch(17% 0 0);
 --color-title:         oklch(10% 0 0);
 --color-artist:        oklch(38% 0 0);
 --color-key:           oklch(50% 0 0);
 --color-label:         oklch(44% 0 0);
 --color-rule:          oklch(80% 0 0);

 --color-chord:         oklch(45% 0.13 255);

 /* chorus has background and border-left accent */
 --color-chorus-bg:     oklch(96% 0.012 250);
 --color-chorus-accent: oklch(60% 0.07 250);

 /* layout */
 --toolbar-height: 2.75rem;
 --songlist-width: 220px;
 --font-size-adjust: 0px;

 --print-cols: 2;
 --print-font-size: 10.5pt;
}



@media screen
{
 body.dark
 {
  --color-page-bg:       oklch(15% 0.003 250);

  --color-text:          oklch(88% 0 0);
  --color-title:         oklch(93% 0 0);
  --color-artist:        oklch(70% 0 0);
  --color-key:           oklch(65% 0 0);
  --color-label:         oklch(65% 0 0);
  --color-rule:          oklch(35% 0 0);

  --color-chord:         oklch(70% 0.13 32);
  --color-chorus-bg:     oklch(22% 0.012 250);
  --color-chorus-accent: oklch(50% 0.07 250);
 }
}



/* single-page app with no scrolling */
html,
body
{
 height: 100%;
 overflow: hidden;
}



body
{
 font-family: "Georgia";
 font-size: 20px;
 line-height: 1.4;
 background: var(--color-page-bg);
 color: var(--color-text);
 margin: 0;
 padding: 0;
}



/* toolbar */

#toolbar
{
 position: fixed;
 top: 0;
 left: 0;
 right: 0;
 height: var(--toolbar-height);
 z-index: 100;
 display: flex;
 align-items: center;
 gap: 0.5rem;
 padding: 0 0.4rem;
 background: oklch(35% 0.12 255);
 color: oklch(95% 0 0);
 font-family: "Helvetica", sans-serif;
}

#toolbar button
{
 background: none;
 border: 1px solid oklch(60% 0 0 / 40%);
 border-radius: 3px;
 color: inherit;
 height: 1.8rem;
 padding: 0 0.3em;
 cursor: pointer;
 font-size: 0.95em;
 font-family: inherit;
 display: flex;
 align-items: center;
 justify-content: center;
}

#toolbar button svg
{
 height: 1em;
 width: auto;
 pointer-events: none;
}

#toolbar button:hover
{
 background: oklch(100% 0 0 / 10%);
}

#font_controls
{
 display: flex;
 align-items: center;
 gap: 0.25rem;
 margin-left: 0.4rem;
}

#nav_controls
{
 display: flex;
 gap: 0.25rem;
 margin-left: auto;
}

#transpose_controls
{
 display: flex;
 align-items: center;
 gap: 0.25rem;
 margin-left: 0.4rem;
 position: relative;
}


#btn_transpose_display
{
 min-width: 4.5em;
 text-align: center;
 font-size: 0.85em;
 font-family: "Helvetica", sans-serif;
}



/* overflow menu */

#menu_wrapper
{
 position: relative;
 margin-left: 0.4rem;
}

#menu_panel
{
 position: absolute;
 top: 100%;
 right: 0;
 z-index: 200;
 background: oklch(22% 0.01 250);
 border: 1px solid oklch(50% 0 0 / 40%);
 border-top: none;
 border-radius: 0 0 4px 4px;
 padding: 0.5rem;
 box-shadow: 0 4px 12px oklch(0% 0 0 / 30%);
 min-width: 12rem;
 text-wrap-mode: nowrap;
}

#menu_panel.hidden
{
 display: none;
}



.menu_item
{
 display: block;
 width: 100%;
 text-align: left;
 background: none;
 border: none;
 border-radius: 3px;
 color: oklch(88% 0 0);
 padding: 0.4em 0.6em;
 cursor: pointer;
 font-size: 0.9em;
 font-family: "Helvetica", sans-serif;
}

#menu_panel .menu_item
{
 justify-content: flex-start;
}

.menu_separator
{
 border: none;

 /*
    To add horizontal separator line:

    border-top: 1px solid oklch(50% 0 0 / 40%);
*/

 margin: 0.5rem;
}

.menu_item:hover
{
 background: oklch(100% 0 0 / 10%);
}

.menu_item::before
{
 /* Unicode Check Mark and NBSP -- always present to reserve space */
 content: "\2713\a0";
 visibility: hidden;
}

.menu_item.active::before
{
 visibility: visible;
}



/* print panel */

#print_panel
{
 position: absolute;
 top: 100%;
 right: 0;
 z-index: 200;
 background: oklch(22% 0.01 250);
 border: 1px solid oklch(50% 0 0 / 40%);
 border-top: none;
 border-radius: 0 0 4px 4px;
 padding: 0.5rem;
 box-shadow: 0 4px 12px oklch(0% 0 0 / 30%);
 min-width: 14rem;
 text-wrap-mode: nowrap;
}

#print_panel.hidden
{
 display: none;
}

#print_panel .menu_item
{
 justify-content: flex-start;
}

.menu_back
{
 display: block;
 width: 100%;
 text-align: left;
 background: none;
 border: none;
 border-radius: 3px;
 color: oklch(88% 0 0);
 padding: 0.4em 0.6em;
 cursor: pointer;
 font-size: 0.9em;
 font-family: "Helvetica", sans-serif;
 font-weight: bold;
}

.menu_back:hover
{
 background: oklch(100% 0 0 / 10%);
}

.print_control_row
{
 display: flex;
 align-items: center;
 gap: 0.4rem;
 padding: 0.3em 0.6em;
 color: oklch(88% 0 0);
 font-family: "Helvetica", sans-serif;
}

.print_control_label
{
 color: oklch(65% 0 0);
 font-size: 0.85em;
 min-width: 4.5em;
}

#print_font_display
{
 font-size: 0.85em;
 min-width: 3.5em;
 text-align: center;
}

.print_col_btn
{
 background: none;
 border: 1px solid oklch(60% 0 0 / 40%);
 border-radius: 3px;
 color: oklch(88% 0 0);
 padding: 0.2em 0.5em;
 cursor: pointer;
 font-size: 0.85em;
 font-family: "Helvetica", sans-serif;
 min-width: 2em;
 text-align: center;
}

.print_col_btn:hover
{
 background: oklch(100% 0 0 / 10%);
}

#print_panel .print_col_btn.active
{
 background: oklch(45% 0.13 255);
 border-color: oklch(65% 0.13 255);
}



/* key picker */

#key_picker
{
 position: absolute;
 top: 100%;
 left: 50%;
 transform: translateX(-50%);
 z-index: 200;
 background: oklch(22% 0.01 250);
 border: 1px solid oklch(50% 0 0 / 40%);
 border-top: none;
 border-radius: 0 0 4px 4px;
 padding: 0.5rem;
 box-shadow: 0 4px 12px oklch(0% 0 0 / 30%);
}

#key_picker.hidden
{
 display: none;
}

#key_picker_grid
{
 display: grid;
 grid-template-columns: repeat(4, minmax(2.8em, 1fr));
 gap: 0.3rem;
}

.key_btn
{
 background: none;
 border: 1px solid oklch(60% 0 0 / 40%);
 border-radius: 3px;
 color: oklch(95% 0 0);
 padding: 0.3em 0.6em;
 cursor: pointer;
 font-size: 0.9em;
 font-family: "Helvetica", sans-serif;
 font-weight: bold;
 min-width: 2.8em;
 text-align: center;
}

.key_btn:hover
{
 background: oklch(100% 0 0 / 10%);
}

.key_btn.active
{
 background: oklch(45% 0.13 255);
 border-color: oklch(65% 0.13 255);
}

.key_btn.reset
{
 grid-column: 1 / -1;
 font-weight: normal;
 font-size: 0.8em;
 margin-top: 0.2rem;
}



/* two-pane layout */

#layout
{
 display: flex;
 flex-direction: row;
 height: calc(100vh - var(--toolbar-height));
 margin-top: var(--toolbar-height);
}

#songlist_pane
{
 width: var(--songlist-width);
 flex-shrink: 0;
 overflow-y: auto;
 border-right: 1px solid var(--color-rule);
 padding: 0.5rem 0;
 font-size: calc(1em + var(--font-size-adjust));
}

#songlist_pane.hidden
{
 display: none;
}

#song_area
{
 flex: 1;
 overflow-y: auto;
 padding: 1em 2em;
 min-width: 0;
 font-size: calc(1em + var(--font-size-adjust));
}



/* song list items */

#songlist
{
 list-style: none;
 margin: 0;
 padding: 0;
}

.song_item_btn
{
 display: block;
 width: 100%;
 text-align: left;
 background: none;
 border: none;
 padding: 0.4em 0.75em;
 cursor: pointer;
 font-family: inherit;
 font-size: 0.85em;
 color: var(--color-text);

 /* hanging indent */
 padding-left: 1.75em;
 text-indent: -1em;
}

body.dark .song_item_btn:hover
{
 background: oklch(50% 0.008 250);
}

.song_item_btn.active
{
 background: oklch(88% 0.015 250);
 font-weight: bold;
 color: oklch(35% 0.12 255);
}

.song_item_btn:hover
{
 background: oklch(75% 0.008 250);
}



/* song header */

.song-header
{
 margin-bottom: 1.5em;
 border-bottom: 2px solid var(--color-rule);
 padding-bottom: 0.5em;
 column-span: all;
}


.song-title
{
 display: block;
 font-size: 1.6em;
 font-weight: bold;
 color: var(--color-title);
}

.song-artist
{
 display: block;
 font-size: 1em;
 color: var(--color-artist);
 margin-top: 0.2em;
}

.song-key
{
 display: block;
 font-size: 0.9em;
 color: var(--color-key);
 margin-top: 0.2em;
 font-family: "Helvetica", sans-serif;
 font-weight: bold;
}

.song
{
 column-width: 380px;
 column-gap: 2em;
}



/* sections */

.section
{
 break-inside: avoid;
 margin-bottom: 1.5em;
}

.section-label
{
 font-variant: small-caps;
 font-weight: bold;
 color: var(--color-label);
 font-size: 0.85em;
 margin-bottom: 0.3em;
 letter-spacing: 0.05em;
}

.section.chorus .section-body
{
 background: var(--color-chorus-bg);
 border-left: 3px solid var(--color-chorus-accent);
 padding: 0.5em 0.75em;
 border-radius: 2px;
}



/* lines and pairs */

.line
{
 display: block;
 margin-bottom: 0.25em;
 padding-left: 1.5em;
 text-indent: -1.5em;
}

.line.empty
{
 height: 0.75em;
}

.pair
{
 display: inline-flex;
 flex-direction: column;
 vertical-align: bottom;
 text-indent: 0;
}



/* chords */

.chord
{
 color: var(--color-chord);
 font-family: "Helvetica";
 font-size: 0.9em;
 font-weight: bold;
 min-width: 1em;
 white-space: pre;
 line-height: 1.0;
}



/* lyrics */

.lyric
{
 white-space: pre;
 line-height: 1.4;
}



/* inline text formatting */

.tp-bold
{
 font-weight: bold;
}

.tp-italic
{
 font-style: italic;
}



/* text sections */

.section.text .section-body
{
 font-family: "Helvetica", sans-serif;
 font-style: regular;
 color: var(--color-artist);
 border-left: 2px solid var(--color-rule);
 padding-left: 0.75em;
}

.text-line
{
 white-space: normal;
 line-height: 1.5;
 margin-bottom: 0.2em;
}

.text-line.empty
{
 height: 0.6em;
}



/* hide-chords mode */

body.hide-chords .chord
{
 display: none;
}

body.hide-chords .line.chord-only
{
 display: none;
}



/* chord-only lines */

.line.chord-only .lyric
{
 display: none;
}


/* ?? maybe chord-only lines don't need anything special ?? */
.line.chord-only .chord
{
 font-size: 0.9em;
}



/* chord spacing */

.chord-space
{
 display: inline-block;
 width: var(--chord-space-width, 1ch);
}



/* responsive layout */

@media (max-width: 767px)
{
 #layout
 {
  flex-direction: column;
 }

 #songlist_pane
 {
  width: 100%;
  max-height: 40vh;
  border-right: none;
  border-bottom: 1px solid var(--color-rule);
 }
}


@media (max-width: 900px)
{
 body
 {
  font-size: 18px;
 }

 #song_area
 {
  padding: 0.75em 1.5em;
 }
}


@media (max-width: 600px)
{
 body
 {
  font-size: 16px;
 }

 #song_area
 {
  padding: 0.5em 0.75em;
 }

 .section.chorus .section-body
 {
  padding: 0.4em 0.5em;
 }
}



#print_all_area
{
 display: none;
}



/* printing and PDF export */

@media print
{
 @page
 {
  size: Letter portrait;
  
  /* effective page margins for printing */
  margin: 0.5in 0.8in;
 }

 :root
 {
  --color-chord: black;
  --color-chorus-bg: oklch(99% 0 250);
 }

 #toolbar,
 #songlist_pane
 {
  display: none;
 }

 html,
 body
 {
  height: auto;
  overflow: visible;
 }

 #layout
 {
  display: block;
  height: auto;
  margin-top: 0;
 }

 #songlist
 {
  display: none;
 }

 #song_area
 {
  overflow: visible;
  height: auto;
  
  padding: 0;
 }

 body
 {
  font-size: var(--print-font-size);
  background: white;
 }

 .song
 {
  column-count: var(--print-cols);
  column-width: auto;
  column-gap: 2.5em;
 }

 #print_panel
 {
  display: none;
 }

 #print_all_area
 {
  display: none;
 }

 body.printing-all #song_area
 {
  display: none;
 }

 body.printing-all #print_all_area
 {
  display: block;
 }

 .print_song_entry
 {
  break-before: page;
 }

 .print_song_entry:first-child
 {
  break-before: auto;
 }

 *
 {
  print-color-adjust: exact;
 }
}


