/**
 * Stijlen voor maten en akkoordsymbolen in een akkoordenschema.
 */

/* Zorgt voor een dikkere lijn aan het einde van een sectie (dubbele maatstreep). */
div.maat.ends_double_bar {
    border-right: 3px solid #555;
}

/* Herstelt de normale rand als een dubbele maatstreep wordt gevolgd door een herhalingsteken. */
div.chordsheet_line>div.maat.ends_double_bar:has(+ span.repeat_end) {
    border-right: 1px solid #667;
}

/* Stijl voor de output container. */
.chordsheet-container {
    background-color: #fff;
    border-radius: 13px;
    padding: 11px;
    border: 1px solid #d3d3d3;
}

.chordsheet-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 100000;
    overflow-y: auto;
    padding: 20px;
}

.fullscreen-btn {
    padding: 5px 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    cursor: pointer;
}

/* Flexbox container voor een regel met maten. */
.chordsheet_line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 0.5em;
}

/* Stijl voor de toonsoort aanduiding. */
.toonsoort {
    display: inline-flex;
    align-items: baseline;
    font-weight: bold;
    padding: 0.1em 0.5em;
    margin: 0;
    vertical-align: baseline;
    background-color: #007bff;
    border-radius: 3px;
    flex-grow: 0;
    color: #fff;
    font-size: 0.75em;
}

.toonsoort-root {
    font-weight: bold;
    font-size: inherit;
}

.toonsoort-accidental sup {
    font-size: 0.8em;
    line-height: 1;
    margin-left: 0.05em;
}

.toonsoort-mode {
    font-size: 0.9em;
}

/* Gestapelde maatsoort (bijv. 4/4). */
.maatsoort.stacked {
    display: inline-grid;
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: center;
    vertical-align: middle;
    line-height: 1;
    padding: 0 0.3em;
    margin: 0;
    font-weight: bold;
    border-radius: 3px;
    min-width: 1.5em;
    font-size: 0.7em;
    margin-bottom: 0.75em;
}

.maatsoort-teller,
.maatsoort-noemer {
    grid-column: 1;
    font-size: 1.1em;
    line-height: 1;
    padding: 0;
    text-align: center;
}

/* Niet-gestapelde maatsoort. */
.maatsoort:not(.stacked) {
    display: inline-block;
    font-weight: bold;
    margin-right: 1em;
    padding: 0.2em 0.5em;
    background-color: #f0f0f0;
    border-radius: 3px;
}

/* Stijl voor een individuele maat. */
.maat {
    display: inline-flex;
    align-items: baseline;
    padding: 0.1em 0.6em;
    margin-right: 2px;
    min-height: 1.5em;
    gap: 0.5em;
    flex: 1;
    justify-content: space-between;
    margin-bottom: 0.7em;
}

span.maatsoort.stacked+div.maat {
    border-left: none;
}

.chordsheet_line>div.maat {
    border-left: 1px solid #667;
    border-right: 1px solid #667;
}

.chordsheet_line .repeat_start+div.maat {
    border-left: none;
}

.chordsheet_line>div.maat~div.maat {
    border-left: 0px;
    border-right: 1px solid #667;
}

.chordsheet_line>div.maat:has(+ span.repeat_end) {
    border: 0px;
}

/* Stijlen voor akkoordsymbolen. */
.chord_symbol {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.chord_root,
.bass_root {
    font-weight: bold;
    font-size: 1.0em;
}

.chord_accidental sup,
.bass_accidental sup,
.voorteken sup {
    font-size: 0.85em;
    line-height: 1;
    margin-left: 0.05em;
}

.chord_quality {
    font-size: 0.95em;
    margin-left: 0.05em;
}

.chord_extension sup {
    font-size: 0.8em;
    vertical-align: baseline;
    position: relative;
    top: -0.2em;
    margin-left: 0.05em;
}

.chord_alterations sup {
    font-size: 0.65em;
    vertical-align: baseline;
    position: relative;
    top: -0.5em;
    margin-left: 0.05em;
}

.chord_slash {
    margin: 0 0.1em;
    align-self: center;
}

.rhythm_slash {
    /* BELANGRIJK: Zorg ervoor dat het 'montserrat' lettertype is geladen. 'sans-serif' wordt als alternatief gebruikt. */
    font-family: montserrat, sans-serif;
    color: #c5c5c5;
    align-self: center;
    font-size: 0.6em;
    font-weight: bold;
    padding-right: 2px;
}

/* Wrapper voor vormaanduidingen om layout te beheren. */
.rehearsal-mark-wrapper {
    flex-basis: 100%;
    margin-top: 16px;
    margin-bottom: 8px;
}

/**
 * Stijlen voor Vormaanduidingen (Verse, Chorus, etc.)
 */
.rehearsal-mark {
    background-color: #34495e;
    color: #ffffff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Stijlen voor herhalingstekens. */
.repeat_start,
.repeat_end {
    font-weight: normal;
    font-size: 2.5em;
    color: #555;
    align-self: center;
    line-height: 0.7em;
    margin-bottom: 0.15em;
}

/*
 * Voorkom dat maten in de laatste regel van een sectie uitrekken.
 * De ':has()' selector wordt hier gebruikt en werkt in moderne browsers.
 */
.chordsheet_line:has(+ .rehearsal-mark-wrapper),
.chordsheet_line:last-child {
    justify-content: flex-start;
}