/* Default songbook stylesheet. The look and proportions are tuned to
 * match the legacy SSG output (v1_legacy in style_comparisons/), with
 * additional rules for the table of contents and a few elements the
 * legacy CSS didn't cover.
 *
 * Reference numbers from the legacy computed styles:
 *   - body:           16px Times New Roman, 1% padding
 *   - h1 title:       32px (2em) Trebuchet MS bold
 *   - .sg_comment:    16px Calibri bold, margin 0 0 15px 20px
 *   - .ch:            16px Calibri italic
 *   - .ly:            17.6px Calibri (110% of body)
 *   - chord+lyric:    ~45px tall when rendered together
 *   - chorus:         cream #fefedd, 1px gray border,
 *                     padding 16px 0 16px 32px, margin 0 32px
 *   - .sg_toc:        cream #fefedd, 1px gray border,
 *                     padding 16px 48px 48px, margin 0 0 32px
 */

body {
    background: white;
    color: black;
    font-family: "Times New Roman", Times, serif;
    padding: 1%;
    margin: 0 0 0 8px;
    font-size: 16px;
}

/* --- songbook header (full and split-index pages) ----------------- */

.songbook-header {
    text-align: center;
    margin: 0 0 1.7em;
}

.songbook-header h1 {
    font-family: "Trebuchet MS", Verdana, Chicago, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 2em;
    margin: 0;
}

/* --- table of contents -------------------------------------------- */

.toc {
    background: #fefedd;
    border: 1px solid #888;
    padding: 32px 48px 48px;
    margin: 0 0 32px;
    font-family: Calibri, Verdana, Times, sans-serif;
    font-size: 1em;
}

.toc-heading {
    font-family: "Trebuchet MS", Verdana, Chicago, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 2em;
    margin: 0 0 0.5em;
}

.toc ol {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc li {
    margin: 0;
    line-height: normal;
}

.toc a:link,
.toc a:visited {
    color: #009900;
    text-decoration: underline;
}

.toc a:hover {
    color: #006600;
    background: transparent;
}

.toc-subtitle {
    color: #555;
    font-style: italic;
    font-size: 0.9em;
}

/* --- song body ---------------------------------------------------- */

.song-title {
    font-family: "Trebuchet MS", Verdana, Chicago, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 2em;
    line-height: normal;
    margin: 0 0 0.67em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.song-title a {
    color: black;
    text-decoration: none;
}

.song-title .subtitle {
    font-style: italic;
    font-weight: normal;
    font-size: 0.45em;
    color: #555;
}

.transpose-buttons {
    display: inline-flex;
    gap: 0.2em;
    vertical-align: middle;
}

.transpose-buttons img {
    cursor: pointer;
    vertical-align: middle;
}

.comment {
    font-family: Calibri, Verdana, Times, sans-serif;
    font-weight: bold;
    font-size: 1em;
    color: black;
    margin: 0 0 15px 20px;
    padding: 0;
}

.lyric-line {
    white-space: nowrap;
    margin: 0;
    padding: 0;
    line-height: normal;
}

/* Empty source lines (and `{c:}` empty comments) become stanza
 * breaks. Use margins on an empty element so collapsing kicks in
 * and consecutive blank-lines don't stack. */
.blank-line {
    margin: 1.1em 0;
}

.chunk {
    display: inline-block;
    vertical-align: top;
}

.chunk .ch {
    display: block;
    font-family: Calibri, Verdana, Times, sans-serif;
    font-style: italic;
    font-weight: normal;
    color: black;
    font-size: 1em;
    line-height: 1.4;
    white-space: pre;
    padding-right: 0.4em;
    min-height: 1.4em;
}

.chunk .ly {
    display: block;
    font-family: Calibri, Verdana, Times, sans-serif;
    font-size: 1.1em;
    line-height: 1.3;
    white-space: pre;
}

/* "Chord sits before the next word, not above it" — push the lyric
 * right by the chord's own rendered width using the data-chord
 * attribute as an invisible spacer. */
.chunk.offset .ly::before {
    content: attr(data-chord);
    visibility: hidden;
    font-family: Calibri, Verdana, Times, sans-serif;
    font-style: italic;
    font-size: 0.91em;
    padding-right: 0.4em;
}

/* Chord-only lines (including chord-progression lines with arrows)
 * flow inline so the inter-chord text isn't buried under a wide
 * chord name. */
.lyric-line.chord-only {
    line-height: 1.4;
}

.lyric-line.chord-only .chunk,
.lyric-line.chord-only .chunk .ch,
.lyric-line.chord-only .chunk .ly {
    display: inline;
    min-height: 0;
}

.lyric-line.chord-only .chunk .ch {
    padding-right: 0.4em;
}

.lyric-line.chord-only .chunk.offset .ly {
    padding-left: 0;
}

.lyric-line.chord-only .chunk.offset .ly::before {
    content: none;
}

.chorus {
    background: #fefedd;
    border: 1px solid #888;
    margin: 0 2em;
    padding: 1em 0 1em 2em;
}

.tab {
    font-family: "Courier New", Courier, monospace;
    font-size: 8pt;
    margin: 0.5em 0;
    white-space: pre;
}

/* --- floating scroll toolbar + guitar-challenge modal ------------- */

.scrollControlsDiv {
    visibility: hidden;
    position: fixed;
    width: 200px;
    height: 30px;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    z-index: 99;
}

.scrollButton {
    position: absolute;
    top: 0;
    cursor: pointer;
    width: 25px;
}

.challengeDisplay {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 10px;
    max-width: 600px;
    width: 90%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.challengeContent {
    position: relative;
    font-family: "Trebuchet MS", Verdana, sans-serif;
}

.challengeClose {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    line-height: 1;
}

@media only screen and (max-width: 800px) {
    body { padding: 6px; margin: 0; }
    .toc { padding: 12px 16px 16px; }
    .challengeDisplay {
        bottom: 100px;
        max-width: 90%;
        padding: 15px;
    }
}
